Commit Graph

7992 Commits

Author SHA1 Message Date
Cole Robinson 34543b3ecd ui: Remove use of deprecated GtkAlignment
Mostly this is replaced with widget padding, and GtkBox for generic
containers

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-20 09:53:17 -05:00
Cole Robinson 382391eadb Clean up gtk STOCK and various image usage
- Remove most use of deprecated stock icons. Without it the UI will
  be a lot more ugly in Fedora 36
- Remove deprecated ImageMenuItem usage, convert to regular MenuItem
- Remove most embedded button images

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 15:33:42 -05:00
Cole Robinson cfc438c024 storagepool: Fix backtrace in cleanup path
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 14:07:27 -05:00
Cole Robinson 9c0a132f2a fsdetails: Point users to Memory screen if shared memory not enabled
If the user selects virtiofs when editting or adding a new VM, and
we don't detect that they have shared memory enabled, show
a warning label in the UI pointing them to the Memory screen.

It would be nicer if we did this for them, but to get that totally
correct would require both duplicating libvirt's shared memory
detection logic, and some surgery to the addhw wizard. This is good
enough for now

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:44:29 -05:00
Cole Robinson a7682fc9eb fsdetails: Show virtio-9p vs virtiofs driver field
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson d65d31cea2 devices: filesystem: Fix default virtiofs accessmode
We shouldn't use accessmode=mapped here, libvirt rejects it.
Let libvirt fill in a working default

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson 72b7dcaceb fsdetails: Hide 'Type:' field for qemu driver
The qemu driver only accepts type=mount

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson fd079a6132 fsdetails: Drop 'Mode:' UI
We only ever show mapped vs squashed, and the difference is pretty
advanced, so if users need it they can use the XML editor. Upcoming
virtiofs support will also make handling this field more complicated

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson 3fd71ea72f tests: cli: A bunch of cleanup
- Move most xml suboption testing to many-devices test
- Clarify every specific bit we are testing in the singleton tests
- Consolidate/drop/reduce a lot of tests

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:41 -05:00
Cole Robinson fd181cecc3 virtManager: Split out tpmdetails.py and tweak it
Split out tpmdetails.py, following the pattern of fsdetails.py. This
adds more UI editing fields for an already attached TPM.

Move the model and version under an 'Advanced options' expander,
since we should be getting this correct by default.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 10:02:22 -05:00
Cole Robinson d70d4e6e7a devices: tpm: Rework defaults
The code previously was just encoding the same defaults as libvirt,
which doesn't really add anything.

Instead, let's prefer type='emulator' model='tpm-crb', which
gives the most modern virtualization friendly config. When we don't
know if that will work, we mostly leave things up to libvirt to fill
in.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 08:36:28 -05:00
Cole Robinson 39731b8bf7 tests: Add updated domcaps data for s390x and ppc64le
Pulled from libvirt's test suite

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-17 14:47:18 -05:00
Cole Robinson 46d6491eae domcapabilities: Organize methods a bit
Break out the CPU secure stuff from being inline in the class, most
of the logic there is not relevant to understanding what the
domcapabilities API provides

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-17 14:15:46 -05:00
Cole Robinson f7f390836a domcapabilities: Add has_value() helper and use it
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-17 14:00:22 -05:00
Cole Robinson db8305ad01 guest: Default to 16 pcie root ports for q35
Add extra PCIe root ports to enable q35 device hotplug to work out
of the box. A typical modern linux guest has 7-8 PCI devices added
by default, so this gives plenty of wiggle room.

The smart thing to do would be to count the attached PCI devices
and add 4-5 extra, but that takes more work and isn't trivial.

The number can be overridden on the cli with:

  --controller q35_pcie_root_ports=X

Use =0 to go back to the old behavior.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 14:09:33 -05:00
Cole Robinson ceeae705c2 guest: Use is_q35 helper in UEFI secboot check
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 14:06:13 -05:00
Cole Robinson 0c2cb36475 tests: uitests: Test linux2020 osinfo usage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 14:03:44 -05:00
Cole Robinson 8903b470f1 details: Have 'copy host CPU' mean 'host-passthrough'
Adjust the UI to leave the box checked for both host-model and
host-passthrough, but host-passthrough is now what it means when
the user selects it. host-model can still be selected via the
CPU model drop down list

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 14:03:44 -05:00
Cole Robinson 2c477f3302 domain: cpu: Use host-passthrough by default on x86
When libvirt and qemu are new enough, use host-passthrough for the
CPU default. Nowadays this is recommended over host-model for most
end user usage where migration isn't a critical feature.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 14:03:44 -05:00
Cole Robinson fc9a22afe0 oslist: fix window size in New VM wizard
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 14:03:44 -05:00
Cole Robinson e37e27bc35 guest: Rename _add_implied_controllers -> _add_virtioscsi_controller
Since that's all it does. And clean up the style a bit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 14:02:58 -05:00
Cole Robinson d488472837 tests: cli: Organize the qemu/kvm section a bit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 12:31:52 -05:00
Cole Robinson 8eeebce4bc tests: more capabilities data cleanup
* Merge kvm-x86_64-domcaps{-q35} variants
* Add -oldfirmware for explicitly testing secboot fallback setup
* Use consistent kvm-x86_64-domcaps-* prefix

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 12:31:52 -05:00
Cole Robinson 0cce75addc capabilities: Remove some XML parsing we don't use
These have been used in the past, but no current code touches them,
so drop the parsing infrastructure

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 12:31:52 -05:00
Cole Robinson 49f54a294b virtinst: cpu: drop host-copy support
host-copy was the old default, but it's fundamentally flawed. Since
we switched to host-model default a few years back, it's not advertised
in the docs or selectable via virt-manager any more.

Have it print a warning and invoke host-model-only

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 12:31:52 -05:00
Cole Robinson 26ecf8a5e3 virt-install: Make missing --osinfo fatal for most cases
This was previously discussed here:
https://listman.redhat.com/archives/virt-tools-list/2020-September/msg00017.html

For the x86 + hvm case, failure to specify an --osinfo/--os-variant
OS, and failure to detect an OS from install media, will now throw
a big error:

```
--os-variant/--osinfo OS name is required, but no value was
set or detected.

This is now a fatal error. Specifying an OS name is required
for modern, performant, and secure virtual machine defaults.

If you expected virt-install to detect an OS name from the
install media, you can set a fallback OS name with:

  --osinfo detect=on,name=OSNAME

You can see a full list of possible OS name values with:

   virt-install --osinfo list

If your Linux distro is not listed, try one of generic values
such as: linux2020, linux2018, linux2016

If you just need to get the old behavior back, you can use:

  --osinfo detect=on,require=off

Or export VIRTINSTALL_OSINFO_DISABLE_REQUIRE=1
```

The thread goes into more detail, but basically, for x86 VMs at least,
it's unlikely you will _ever_ want the default 'generic' behavior,
which gives gives no virtio, no PCIe, no usb3, IDE disks, slow
network devices, etc.

Many people use virt-install in scripts and CI, and this may now
cause breakage. The environment variable is there to help them
get things back to normal as quick as possible, but it will still
noisy up their logs with the warning to hopefully get them to make
a useful change to their virt-install invocations.

This is limited to x86, since that's where most of our defaults
historically differ, and where we can depend on libosinfo to give
the most accurate device info. This may be relevant to change for
other KVM architectures in the future.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 12:25:13 -05:00
Cole Robinson c57b0f7d46 tests: Add output test for --osinfo linux2020
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 12:56:00 -05:00
Cole Robinson 95cdbf9e8f osdict: Drop usb-tablet checking
Historically over time it's been more likely that an issue is reported
for osinfo-db missing the usb-tablet annotation. So for example we
always enable it for the default 'generic' case. We also want to
enable it for osinfo's 'unknown' case too.

Rather than add another check for that, let's just drop the osinfo
checking entirely. Some very old OS don't support usb-tablet, but
specifying it for those cases doesn't cause issues AFAIK, and users
can override it with `--input none` if they want.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 12:51:05 -05:00
Cole Robinson e7249fa79f virt-install: Warn about performance for `--osinfo generic` too
Currently we skip the warning if the user explicitly requests
`--osinfo generic`. Upcoming changes to the defaults here will make
it tempting to specify `--osinfo generic` just to make things work,
and we want to dissuade that, so enable the warning for that case too.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 12:51:01 -05:00
Cole Robinson 9c54c116fa cli: Recommend --osinfo more over --os-variant
We are about to change the some defaults around os handling. Let's
start recommending the nicer named --osinfo more, since new error
messages are going to promote it a bit as well

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 11:53:09 -05:00
Cole Robinson c2fb5ad402 tests: Add grep= annotation for every invalid test
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 11:53:09 -05:00
Cole Robinson 3e794d2d96 virt-install: Turn --os-type into a no op and warning
I'm still seeing blog posts that recommend using

  --os-type linux --os-variant XXX

Which has been a no op for a long time but is mostly harmless.
Current git would make this an error condition, but that's too
disruptive IMO. Just print a warning

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 11:53:09 -05:00
Cole Robinson 1f8afc8668 virtManager: oslist: Push users towards linuxXXXX options
Have the UI push users more towards better defaults, by discouraging
the 'generic' entry and offering the 'linuxXXXX' entries when their
distro or OS version is not in the list.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 11:53:09 -05:00
Cole Robinson 95ba78f3e8 osdict: Simplify os list sorting
Previously we tried to use a combination of distro class and version
number to produce a correct ordering that was independent of the
osinfo short ID. The original intent was to have correct ordering
for Windows entries in the virt-manager UI, since the short ID
values are all over the place.

Nowadays that doesn't really matter, since we weed out old
unsupported entries by default. And in the mean time, our current
sort method gives some weird results like interspersing silverblue
entries with fedora entries.

Using a natural/human sort is simpler and handles things pretty well.

Change the UI to sort by the OS label too which preserves some of
the good behavior of original method

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 11:53:09 -05:00
Cole Robinson 96a40b1143 cli: Add `--os-variant list` option to print OS name values
The canonical tool for this is `osinfo-query os`, which we still
reference in the man pages and in the list output.

However, we are about to make missing --os-variant fatal for common
usage, and I don't want to force users to install an extra tool just
to figure out what an acceptable --os-variant value is.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 11:53:09 -05:00
Cole Robinson a39bd561b0 addhardware: tweak mdev inactive UI
- Move tooltip to the tree row instead of the finish button
- Some style cleanups
- Add a hack so we can hit it in the test suite

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-12 11:24:44 -05:00
Shalini Chellathurai Saroja a4c02b1aed virt-manager: prevent attach of inactive nodedevs
With virt-manager application, it is possible to add inactive node
devices(eg: mediated device) in host system to guest system. But it is
impossible to start a guest system with inactive node devices.  Also,
it is not yet possible to start a node device with virt-manager
application. So, the user cannot use the inactive node devices.

This patch disables the "finish" button and provides a tip, when
inactive node devices are selected. So, it is not possible to add
inactive node devices to the guest system.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2022-02-11 14:00:33 -05:00
Cole Robinson 9643955121 Revert "virt-manager: prevent attach of inactive nodedevs"
This reverts commit 216dc6e4e1.

This was not meant to be pushed, the patch is still under review
2022-02-11 13:59:06 -05:00
Cole Robinson d1e1bc0995 devices: graphics: tweak a few log messages
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-10 10:17:15 -05:00
Cole Robinson b4e35c0687 devices: graphics: Don't use spice default on xen
This matches what we have historically done, prior to the domcaps
change in 30382d57f. Xen will report spice in domcaps but we should
not let that change our historical default

https://listman.redhat.com/archives/virt-tools-list/2022-February/msg00006.html

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-10 10:17:10 -05:00
Cole Robinson 9c6efdc1d5 man: virt-install: Use osuosl.org for debian URL example
https:// needs to link to the exact site, not the debian.org redirect,
otherwise we get browser cert warnings

Fixes: #360

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-09 11:11:29 -05:00
Jonathon Jongsma 17cd4477b8 man: fix default value for filesystem accessmode option
Commit 85307b9bd2 changed the default
value for 'accessmode' from 'passthrough' to 'mapped', but forgot to
update the documentation in the man page.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2022-02-09 11:05:01 -05:00
Michal Privoznik 34c47c1527 Update domain title/description on corresponding event
If a domain is edited outside of virt-manager (e.g. via virsh
edit) then this is reflected in the GUI (in the domain HW details
tab). However, if domain title or description is updated outside
of virt-manager (virsh desc) then this change is not reflected.
This is simply because the corresponding event emitted by libvirt
is not listened to.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-09 10:14:24 -05:00
Cole Robinson 6baa327d67 cli: Add --tpm active_pcr_banks support
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-03 16:33:08 -05:00
Shalini Chellathurai Saroja 216dc6e4e1 virt-manager: prevent attach of inactive nodedevs
With virt-manager application, it is possible to add inactive node
devices(eg: mediated device) in host system to guest system. But it is
impossible to start a guest system with inactive node devices.  Also,
it is not yet possible to start a node device with virt-manager
application. So, the user cannot use the inactive node devices.

This patch disables the "finish" button and provides a tip, when
inactive node devices are selected. So, it is not possible to add
inactive node devices to the guest system.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2022-02-03 15:29:26 -05:00
Cole Robinson d09e722a6f config: Disable libguestfs UI integration by default
If python3-libguestfs is installed, virt-manager will use it
automatically to fetch guest OS icons, installed application lists,
and some other details.

In practice though the libguestfs integration usually doesn't work,
because most virt-manager created VMs have disks image in a location
only accessible to root, and our libguestfs usage needs the disks
accessible by the app user.

When it does work, we don't cache the results across app runs, so
libguestfs spawns lots of inspecting VMs every app startup, with
lots of log chatter and CPU spiking.

Then there's the confusion that app behavior can noticeably change
through the install of another package and an app restart.

I think it's simpler from a maintenance perspective to disable this
by default. If we fix those two big issues then maybe we can change
it back in the future

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-03 15:28:24 -05:00
Cole Robinson 19efeaf7a6 Rename 'master' branch to 'main'
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-03 15:23:45 -05:00
Cole Robinson 8377b7f7b6 details: Remove 'detect zeroes' UI
After checking with qemu devs, this option is not really recommended
for common usage and doesn't get used much in practice. So I don't
think it is suitable for the UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-03 13:50:53 -05:00
Cole Robinson 381aa4050c devices: disk: Set discard=unmap by default for some cases
This recommendation came from an internal discussion. The cases are

* For block storage. This means guest requests are passed through
  to the host device, which seems a more reasonable default than
  ignoring them

* For sparse disk images we will create. discard=unmap helps preserve
  the sparseness of the disk image. If a user requests non-sparse, they
  are likely more concerned with performance than saving disk space,
  so we leave the default as is. We limit this to disk images we will
  create, since that's the easiest case to check, and it's less clear
  if we should change the behavior here for an arbitrary existing
  disk image.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-03 13:42:49 -05:00
Cole Robinson 1ab6dd50be devices: video: Use virtio default more often
This is from Gerd's suggestions here:
https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/

When the guest supports it, we should use virtio. qxl is on the way
out, and the benefits are marginal and add a security and maintenance
burden.

While here, check domcaps that qxl or virtio are actually available.
Modern qemu has device modules, so device support may not be installed.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-03 13:42:49 -05:00