Commit Graph

2097 Commits

Author SHA1 Message Date
Cole Robinson bfa37d0065 xmlutil: Take unindent_device_xml from details.py
We will use this in virt-xml soon

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-03 12:34:47 -04:00
Cole Robinson e7c936f16e vmwindow: Customize window should not be 'deletable'
This forces the user to use the 'Cancel' button, which gives a warning
about the install being aborted

Resolves: https://github.com/virt-manager/virt-manager/issues/416

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-01 09:44:48 -04:00
Cole Robinson 8079c421bd connection: De-duplicate ui and cli version logging
Remove the open coded version logging in cli.py and virt-manager
connection.py, and move it into virtinst connection open

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-08-01 06:04:48 -04:00
Cole Robinson d51541e155 Fix UI rename with firmware='efi'
Our code to duplicate nvram wasn't expecting the XML to be devoid
of an nvram path.

Resolves: https://github.com/virt-manager/virt-manager/issues/372

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-20 09:37:26 -04:00
Cole Robinson 64dfb6c595 details: Go back to old Channel naming format
The new format is too long and wordy IMO. It was added to handle
qemu-vdagent ambiguity, since without it we would print the same string
for spicevmc and qemu-vgagent channel. Let's just special case
qemu-vdagent to solve that problem

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-13 13:49:08 -04:00
Jonathon Jongsma caa99a6001 virt-manager: add support for qemu-vdagent channel
This provides the UI support for the qemu-vdagent channel which allows
 clipboard sharing with VNC graphics (see previous commit for more
 information).

 The channel name in the device list was changed slightly in order to
 avoid confusion. Due to the fact that both the spice-vdagent and the
 qemu-vdagent specify the same virtio name (com.redhat.spice.0), both of
 these channels were showing up in the device list as "Channel spice",
 which is a bit confusing.

 In order to disambiguate these, channels now show up in the device list
 as "Channel {type} ({name})" instead of "Channel {name}". So for
 example, a qemu-vdagent channel would show up as:
    Channel Qemu vdagent (spice)
Whereas a spice-vdagent channel would show up as:
    Channel Spice agent (spice)

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2022-06-13 13:49:08 -04:00
Cole Robinson ddead32287 virtmanager: Remove executable bit
rpmbuild complains about it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-04-13 08:36:05 -04:00
Cole Robinson 9db16377e8 viewers: Fix import error when spice is missing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-03-01 14:52:26 -05:00
Tudor Brindus 990b932c17 addhardware: add "none" video type
In some setups, it is useful to have Spice input, clipboard, audio, etc.,
but not video, for instance when doing GPU passthrough -- one can
interact inside the VM via Spice rather than USB passthrough, and use
a plugged-in monitor or alternate VM viewers like Looking Glass[1] for
video.

It is already possible to specify a "none" video device by manually
typing into the "Model" combobox and hitting "Apply". Yet, this is
unintuitive. Despite being documented everywhere GPU passthrough is
brought up, in the Looking Glass community we still get ~daily support
requests from users who couldn't figure out how to disable Spice video.

This patch makes "None" an explicit option in the video model combobox,
in the hopes that this is more straightforward for users to get right.

[1]: https://looking-glass.io/

Signed-off-by: Tudor Brindus <contact@tbrindus.ca>
2022-03-01 08:14:44 -05:00
Cole Robinson 3065b715d5 details: viewers: Fix variable override from outerscope
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-28 08:50:04 -05:00
Cole Robinson 1aaa28e26a tests: uitests: Add coverage for when spice is missing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-27 14:23:09 -05:00
Cole Robinson 365d1f5d56 diskbackend: Set relative path for media change
Via the virt-manager UI we aren't converting relative path to
absolute path, even though we do it internally when needed.

We were benefiting from this in the test suite in some ways, so we
need to adjust tests to strip out the dev dir on XML comparison

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-27 13:44:26 -05:00
Cole Robinson 708ec982a9 details: Only show channel state for qemu ga channel
This is the only one that we get notified when the XML changes,
so it's the only one we can be certain is up to date. Users have
gotten confused about out of date spice info here:

https://bugzilla.redhat.com/show_bug.cgi?id=2027867

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-24 14:54:08 -05:00
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 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 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 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 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 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
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
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 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 c3e9db5f3a createvm: Tweaks to new UEFI pref
* Make it clear in code and UI that this is x86 only. Other arches
  either require UEFI (aarch64) or don't support it
* Drop the internal 'bios' values since we don't handle them and may
  not want them anyways, since when win11 support lands we will need
  to explicitly throw an error if the user tries to force bios
* Add UI tests

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-31 14:18:42 -05:00
Charles Arnold 0a1dd8b822 virt-manager: Add firmware preferences for creating a new VM
Possible values are BIOS (default) and UEFI.
The firmware used is determined by libvirt unless a specific firmware is
selected from the Customize dialog.

See https://bugzilla.redhat.com/show_bug.cgi?id=1997882
2022-01-31 13:55:00 -05:00
Cole Robinson 87e0ed5de0 Revert "details: console: drop hardcoding background color as black"
This reverts commit aaabb44ac7.

I figured out how to trigger this: it's when scaling is enabled.
To maintain VM aspect ratio, we have to constrain the size of the
viewer widget. When the widget is smaller than the VM window, the
viewport widget is visible. This change made the viewport the default
theme color, rather than black.

Problem is, in the non-scaling case, we don't shrink the viewer
widget but let it expand to fill the whole area. This is necessary
to get the 'Autoresize VM with window' option to work, but is also
simpler in the cdoe. The viewport widget is not visible, and gtk-vnc
and spice-gtk paint the non VM owned areas as black. AFAICT that's not
configurable in any way.

So after this change we have differing behavior for scaled and
non-scaled cases, which is confusing and visually kinda comes off as
a bug.

So this reverts back to the old behavior and explains all this in
a comment.
2022-01-27 11:07:31 -05:00
Cole Robinson 5003f0432e details: Add os.firmware=efi in the firmware selector UI
Let users choose libvirt's os.firmware=efi setting in the UI, putting
it about the firmware path list, since it's the preferred default
these days.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-26 13:23:27 -05:00
Cole Robinson 3013889727 guest: Use os.firmware=efi for --boot uefi, if it is supported
<os firmware='efi'> is the libvirt official way to do what we
historically implement with `--boot uefi`, and UEFI setup in
virt-manager.

Let's prefer libvirt's official method if the support is advertised
in domcapabilities.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-26 11:59:51 -05:00
Cole Robinson 245e89ac38 guest: Rework set/get_uefi entry points
This replaces the pattern:

  Guest.set_uefi_path(Guest.get_uefi_path())

With a single entrypoint

  Guest.enable_uefi()

to immediately change the guest config to use UEFI, using our
default logic.

This will make it easier to change that logic in the future, like
using <os firmware='efi'> instead of hardcoded paths

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-26 11:59:42 -05:00
Cole Robinson 6c3b5def81 netlist: Revive portgroup UI
I removed Portgroup UI in 4c3c53f773 release 3.0.0, but there's been
a steady stream of requests to bring it back. It seems it's commonly
used with some certain openvswitch config.

Maint burden isn't too bad. Let's bring it back

Fixes: https://github.com/virt-manager/virt-manager/issues/169

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 16:01:17 -05:00
Cole Robinson c6bf106dd3 device: netlist: Rework source row data structure
Put non-UI bits into a class, rather that stuff them into gtk
columns. Simplifies adding bits here

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 15:35:55 -05:00
Cole Robinson 9c45f4a2e9 details: Strip back 'Enable shared memory' to only cover memfd
Strip back the logic to:

* Only try to toggle source_type=memfd and access_mode=shared
* Disable the field if guest has any <numa> config
* Disable the field if domcaps does not report virtiofs and memfd

This is the simplest future proof case, though it will exclude some
legit guest configs and some libvirt+qemu back compat.

My feeling is the <numa> stuff in particular is pretty advanced, so if
users have it configured they can toggle shared memory via the XML
without too much trouble.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 12:43:32 -05:00
Cole Robinson 51de31499e details: Move 'shared mem' editing and tooltip logic to domain.py
We will eventually want to share this with the addhw wizard, so it
should live in a shared space.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 12:26:14 -05:00
Lin Ma b4189a925b details: Add new checkbox to control shared memory access
The virtiofs in domcapabilities is used as a proxy to tell us whether
libvirt is new enough to allow bare memory access mode=shared', So We
enable/disable this checkbox according to it.

When we configure shared memory access, If the 'memfd' is available in
domcaps, We configure VM to use it as memory backend because it doesn't
need addtional host setup for vhost-user devices, Otherwise use 'file'
as backend.

If all of numa nodes explicitly defined memAccess=shared, We mark this
checkbox as checked even if virtiofs isn't exposed in domcapabilities.
In this case:
- It doesn't matter what the value of access mode of memoryBacking is
  because access mode of memoryBacking will be overridden per numa node
  by memAccess attribute.
- Although the checkbox is disabled, the checked checkbox presents actual
  status about shared memory access to users.

Signed-off-by: Lin Ma <lma@suse.com>
2022-01-25 12:26:14 -05:00
Cole Robinson f13c8d87fb guest: Remove the hyperv + uefi workaround for win7 + win2k8r2
Both these windows versions are now longer supported, and UEFI isn't
the default, so I don't think this hack is much needed anymore

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 12:05:45 -05:00
Cole Robinson 6a83eae30f virtManager: nodedev: Handle failure to lookup drm parent
Apparently nodedev drm XML can link to a parent device that we can't
look up?

We shouldn't be trying to do the full address string compare anyways,
so just try the name lookup, which would improve the error here too

Fixes: #328

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 13:20:46 -05:00
Cole Robinson 28af0f02f6 console: Clarify some error labels and debug messages
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 11:03:23 -05:00
Cole Robinson bd4ca8a55e console: Add _cb suffix to viewer callback function names
And use _src for the first parameter name, which appeases pylint
but is more descriptive

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 11:03:23 -05:00
Cole Robinson 8bb64ad5af console: Don't block console reconnect for non-error
https://listman.redhat.com/archives/virt-tools-list/2022-January/msg00012.html

On xen, a guest reboot will trigger a non-error viewer-disconnected
signal, but we treat it like an error, which makes it difficult to
reconnect to the VM console.

If there's no error message raised, treat the disconnect like a
non-error cases.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 11:03:23 -05:00
Cole Robinson 2815b7406e gfxdetails: Fix switching from listen=none to listen=address
... with the 'hypervisor default' address. In this case, we need to
force set port=-1 in the XML, to make the changes actually stick

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-20 16:34:59 -05:00
Shalini Chellathurai Saroja ca8950f0ed virtManager: change MDEV display names
The MDEV devices listed in the "Add New Virtual Hardware" page, are a
concatenation of parent device name and MDEV device name, eg:
css_0_0_0014 mdev_b204c698_6731_4f25_b5f4_894614a05ec0_0_0_0014. The
parent name is duplicated in here, as the MDEV device name itself includes
a part of the parent name in libvirt version 7.8.0 and later. So, this patch
changes the MDEVs listed in "Add New Virtual Hardware" page to only display
the MDEV device
name(eg:mdev_b204c698_6731_4f25_b5f4_894614a05ec0_0_0_0014), when the
new naming convention is used.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
2022-01-19 14:24:14 -05:00
Cole Robinson acaca061be uitests: top off test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-17 17:11:18 -05:00
Cole Robinson 4f02ccd7b5 uitests: Mock virtBootstrap
It's historically flakey to keep it + skopeo + virt-sandbox
all working, let's just mock it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-17 15:13:12 -05:00