Commit Graph

2050 Commits

Author SHA1 Message Date
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
Cole Robinson 499badbdf4 object: nodedev: support isActive state
This was added to libvirt in the past few years, and we may want it
for mdev addhardware UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-17 14:37:06 -05:00
Cole Robinson cdd7061f8e pylint: Fix some deprecation warnings and minor bits
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-11 12:32:23 -05:00
Cole Robinson 79da19ad07 Fix some pylint, exclude some new warnings
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-10-04 16:04:33 -04:00
Cole Robinson be05135867 libvirtobject: rename autostart tweaks
* Silence some pylint
* set_autostart failure shouldn't reset the old name

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-31 19:21:09 -04:00
coreyberla b2835da3c8 libvirtobject: reapply autostart setting after rename
Fixes: #204
2021-07-31 19:20:51 -04:00
coreyberla f3127e0029 domain: Don't rename domain if newname isn't different 2021-07-31 16:36:39 -04:00
Cole Robinson aaabb44ac7 details: console: drop hardcoding background color as black
Submitted in https://github.com/virt-manager/virt-manager/pull/241

I couldn't get this code to change the output, tested with VNC and
spice-gtk on Fedora 34 gnome-shell x11 and XFCE. Maybe it's something
theme related. But either way this doesn't seem to be useful for the
default case anyways, so let's drop it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-31 16:27:15 -04:00
Hugues Fafard a24cdd1964 cli: --boot: Completed options for guest-based bootloader
Adds support for `bootmenu.timeout` suboption.
2021-07-29 11:44:57 -04:00
Cole Robinson 10515ea167 gfxdetails: Default to configured graphics type, not always spice
So if the user chooses a different value from Preferences, or
app is built with a different value, default to that in Add Hardware

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-01 11:24:43 -04:00
Cole Robinson eb6b79396b Remove shebangs from library paths
These don't really serve any purpose any longer

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-06-22 19:54:37 -04:00
Cole Robinson 078178f476 progress: Drop tqdm and revert back to local urlgrabber copy
I thought tqdm was available everywhere, but it does not seem like
it will be in RHEL9. Revert back to the old urlgrabber copy, now
stored in virtinst/_progresspriv.py. If we ever want to try tqdm
again, we can just revert this commit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-06-09 16:52:11 -04:00
Cole Robinson 18b017f148 domain: Force jobinfo values to be ints
We only want our meter abstraction to handle int values now

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-06-09 16:51:48 -04:00
Cole Robinson f2a04f1abc createvm: Fix text progress with virt-bootstrap
It looks awkward after the text tweaks. Drop the semblance of
progress reporting

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-06-09 16:51:46 -04:00
Shalini Chellathurai Saroja 0e15cd51df virt-manager: enable MDEV support
Enable virt-manager GUI to support add, edit, remove, hot-plug and
hot-unplug of mediated devices (like DASDs, APQNs and PCIs) in virtual
server.

It is not possible to edit MDEV when a virtual server is in
running state, as this is not supported by libvirt.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
2021-06-08 09:58:50 -04:00
Cole Robinson fe7f4db6e7 host: Use libvirtobject.run_status
Fixes uitest coverage when the host doesn't have any inactive
non-domain objects

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-22 16:17:02 -04:00
Cole Robinson 2024068be8 progress: convert to tqdm
tqdm is an external library that provides a progress bar
implementation. Switch to it and drop our internal copy of the
old urlgrabber progressbar

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-22 14:56:10 -04:00
Cole Robinson 6659889319 progress: Some internal API cleanup
* Simplify start() and end() function signature
* Drop use of 'basename' and standardize on 'text'
* Add vmmMeter.is_started()
* Add vmmMeter.set_text()
* Fix asyncjob UI to show text in the progress bar

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-22 14:56:10 -04:00
Cole Robinson 167d2f2f8e delete: Ensure storage_errors is always declared
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-22 14:56:10 -04:00
Cole Robinson a53f35e425 viewers: Absorb resizeguest support check
This let's us move the gtkvnc import back
to be solely in viewers.py

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-22 14:56:10 -04:00
Cole Robinson a8e978dd38 pylint: Another fix for gtk3 version detection
We need to place require_version calls earlier and before
any code that might import Gtk/Gdk

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-22 14:56:10 -04:00
Cole Robinson 61a4c00835 tests: uitests: Add mock test for VNC autoresize
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-19 16:46:30 -04:00
Daniel P. Berrangé 499739cee3 details: enable resizing of displays with new GtkVnc
The 1.2.0 release of GtkVnc introduces support for remote desktop
resize. This is also supported in QEMU >= 6.0.0 when using virtio-gpu.

This introduces support for resize without forcing a new min version of
GtkVnc by just checking for existance of the new API. We don't attempt
to check if the current QEMU instance supports resize, as we gracefully
degrade - the guest simply won't resize and will be rendered as before.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-19 16:30:00 -04:00
Cole Robinson ff0c8458e2 keyring: Coverage and style fixes
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-04-06 19:20:16 -04:00
WGH 9b00bf3e1c Support prompt in keyring CreateItem as well
I haven't seen the implementation that needs prompt confirmation here,
though, so I haven't really tested it. The code path is pretty much the
same as in Delete, though, which I did test.
2021-04-06 18:30:08 -04:00
WGH fae3fecc1e Improve Secret Service interoperability
The current implementation of Secret Service keyring client assumes that
the last component of an item path is integer, which is not true for some
Secret Service server implementations (e.g. KeePassXC). Besides,
the Secret Service API documents advises against recording object path
(not to mentioning parsing it in any way), recommending using lookup attributes
instead[1].

This commit fixes the code to behave in more interoperable way.

- The item path (called "keyid" in code) is no longer parsed and stored anywhere.
- The secret item is looked up in the Secret Service using hvuri and machine
  uuid attributes.
- /console-password with (username, keyid) is removed from GSettings
  storage. Instead, only username is stored in /console-username.

[1] https://specifications.freedesktop.org/secret-service/latest/ch03.html

Resolves: #237
2021-04-06 18:30:08 -04:00
WGH d9b5090e06 Fix forgetting password from keyring
First, Item.Delete never accepted any arguments, so this code likely
never worked.

Second, Item.Delete might return a Prompt object, which client
is supposed to call if keyring wants to confirm deletion.
2021-04-06 18:30:08 -04:00
Cole Robinson 404507b3ad virt-manager: Require pygobject >= 3.31.3
This is the first version that universally treats a None value as
bool False. Most recent code changes have been developed against this
version of pygobject, and several backwards incompatible None usages
have slipped in, and I suspect there's more lurking.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-02-10 12:43:53 -05:00
Pavel Hrdina cf93e2dbff console: fix error with old pygobject
The code doesn't work as expected. From python documentation:

    x and y

is the same as

    x if not x or y

so in the code if for some reasone `dev` is None the value stored in
`sensitive` will be None as well.

No the code itself works with pygobject >= 3.31.3 where they allowed
None as a valid boolean value, but with older versions it will fail
with this error message:

    TypeError: Argument 1 does not allow None as a value

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2021-02-05 12:15:46 +01:00
Cole Robinson 5a152712d9 details: Log the active_edits list when warning about unapplied changes
This pops up randomly sometimes for reasons I can't determine yet.
logging this will help narrow it down when it does crop up

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-19 12:22:31 -05:00
Cole Robinson e7222b5058 addstorage: Don't pass None to widget.set_active()
Older pygobject can't handle it. Mentioned here:
https://github.com/virt-manager/virt-manager/issues/188

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-21 17:17:33 -05:00
Cole Robinson 7541065d09 systray: Appindicator tweaks
- Prefer ayatana if it's available, since that's the modern library
- Fix some pylint and code coverage issues

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-16 11:11:19 -05:00
Laurent Bigonville ac7e6a0966 Try to load AyatanaAppIndicator3 in addition of AppIndicator3
AyatanaAppIndicator3 is the successor or AppIndicator3 it uses the same API for the time being

Just try to load AyatanaAppIndicator3 in addition of AppIndicator3

Fixes: #181
2020-11-16 10:09:19 -05:00
Cole Robinson f81c07d2da details: Add simplified wrapper for change_config_helper
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-14 16:09:21 -05:00
Cole Robinson 488f153655 fsdetails: Rework XML building logic
Make it work more like gfxdetails. The problem with the current
approach is that it requires effectively rebuilding the whole device
to match the original device when we want to edit a single field,
which is error prone.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-14 16:09:21 -05:00
Cole Robinson fca338d2d1 fsdetails: Remove some dead code
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 17:05:00 -05:00
Cole Robinson 41023192ca fsdetails: Stop showing the 'driver' combo for qemu
The only valid value now is 'path' which is also the default,
so drop the UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 13:17:41 -05:00
Cole Robinson b7b75ab8fc fsdetails: Drop driver="handle" UI
It was removed in qemu 4.0.0

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 13:09:03 -05:00
Cole Robinson 2b864a9294 fsdetails: Remove the combo vs label dynamic
If something would normally be shown only in a label, just
hide the row entirely. This was interesting for viewer XML
properties before we had the XML editor, but now it doesn't
add much

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 12:53:10 -05:00
Cole Robinson 374ea52be0 fsdetails: Remove wrpolicy UI
This is an obscure setting. If users need it they can set
it manually in the XML editor

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 12:20:57 -05:00
Cole Robinson 3d07b28a36 device: disk: Rename path property to get/set_source_path
This makes it more clear that 'path' is really a special designation
with a bunch of complicated logic behind it. It's also easier to
grep for

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson 98ca65f183 connection: Unconditionally report connection leak
Leaked connection may mean the app keeps libvirtd socket activated
daemon running for longer than necessary, so it's useful to report
this

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-10 17:41:20 -05:00
Cole Robinson 2773bc35bf storagepool: cleanup() volumes on pool cleanup()
Fixes connection leaks

Resolves: #172

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-10 17:40:31 -05:00
Cole Robinson 2d4b85b5bf domain: use makedirs exist_ok=True
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-03 12:23:13 -05:00
Charles Arnold 9dc057e3e7 Add /usr/sbin to search path for non-root user
On a fresh install where no previous connection has been made a
non-root user starting virt-manager won't find the installed libvirtd
because the location is not in the user path.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Charles Arnold <carnold@suse.com>
2020-11-03 12:23:13 -05:00
Cole Robinson 129865aea0 mediacombo: Clear text entry when New VM is launched
We were leaving the ISO field populated with whatever the old value
was. This is likely useful in some cases but it's consistent with
how we handle fields in the rest of the wizard, and has some weird
interaction with OS detection

Fixes: #159

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-30 10:35:21 -04:00
Cole Robinson 9c13d2f878 Remove use of problematic terminology
Following kernel recommendation here:
https://lkml.org/lkml/2020/7/4/229

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-23 14:33:17 -04:00
Cole Robinson 12fe58cd91 uitests: Use drag() method again for window cleanup tests
delete and createvm tests launch a dialog which obstructs the
manager UI. The location can be kinda random, and it might obstruct
selecting the connection in the manager window. Go back to using
the drag() window pattern to make this more deterministic

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-22 11:28:21 -04:00