Commit Graph

1714 Commits

Author SHA1 Message Date
Cole Robinson ae8a4f3db3 engine: Fix first run startup error (bz 1674040)
unitpath can be used uninitialized

https://bugzilla.redhat.com/show_bug.cgi?id=1674040
2019-02-08 15:50:15 -05:00
Cole Robinson 10973c7932 guest: Add find_device to Guest
It operates on a Guest object, so it makes sense
2019-02-07 17:36:10 -05:00
Marc Hartmayer 12e8456da2 domain: Move set boot order responsibility to guest
Move set boot order responsibility to guest XML builder.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer c5f8f3e640 guest: Add get_boot_order method
Add 'get_boot_order' method. This method has an optional parameter for
getting the legacy boot order defined in the OS node of the domain
definition.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer 853237aebc domain: Move get boot order methods to guest
Move get boot order methods to guest XML builder. For this we must
replace self.get_bootable_devices() with
self.get_bootable_devices(exclude_redirdev=True) in the
_get_device_boot_order and set_device_boot_order to have no
functionality change.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer d0c2750da5 domain: Move use_device_boot_order to guest
Move use_device_boot_order to guest XML builder and rename it into
'set_device_boot_order'.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:50 -05:00
Marc Hartmayer f06a16bffd domain: Try to untangle __use_device_boot_order
Operate only on @boot_order and @guest and not on @self. This allows
us to refactor this functionality in the next patch. Additionally,
simplify the used algorithm without functionality change.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer e6c14e2e79 domain: Try to avoid self access since we're operating on guest
Try to avoid self access since this function operates on the guest
definition only. This is needed for later refactoring as it will
reduce side-effects.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer 735d8b75c9 domain/guest: Add get_bootable_devices() method
Add a method to the Guest XMLBuilder for getting all bootable devices
of the guest definition with the option to exclude the redirdevs in
the returned list.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Marc Hartmayer 3365838b1b Move (find|compare)_device to guest.py
Move (find_compare)_device functions to guest.py as it will be used
there in an upcoming patch.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-02-07 17:15:49 -05:00
Cole Robinson bc98c21758 installer: Remove need_scratchdir
create.py doesn't really need to know about it. It just needs to know
what paths the install process is going to be accessing.
2019-02-07 13:58:55 -05:00
Pino Toscano 1018ab4484 inspection: handle failures in application listing
The Python binding of libguestfs errors out in case any of the details
(e.g. summary, description) of an application are not proper UTF-8.
This seems a rare situation, which nevertheless causes the failure of
the inspection of a guest, making the rest of the metadata not used.

While these encoding issues are tackled, and fixed in python-libguestfs
(or libguestfs itself), gracefully handle the failure of
inspect_list_applications(), so at least the rest of the details of a
guest are used/shown.
2019-02-07 09:59:28 -05:00
Cole Robinson c6dd050147 netlist: Assume type=network if source/@network present (bz 1669265)
When a VM is using interface type=network with a forward mode=bridge
network, on qemu domain startup the runtime XML will be changed to
type=bridge and both source/@bridge and source/@network will be filled
in, which breaks some assumptions virt-manager had internally.
Unfortunately this isn't easy to test with the unittest driver either.

https://bugzilla.redhat.com/show_bug.cgi?id=1669265
2019-02-04 17:43:42 -05:00
Cole Robinson f7508d024d addhardware: Fix setting optimal default net model
We were unconditionally reseting it to the first list entry
2019-02-03 19:47:54 -05:00
Cole Robinson 21465e2af7 create: Differentiate detection between cdrom and location
Behind the scenes there is a difference, like windows media won't
validate as a 'location' because it doesn't have a direct bootable
kernel/initrd.
2019-02-03 16:15:54 -05:00
Cole Robinson a391613b9f engine: More logging for --test-first-run 2019-02-03 15:46:32 -05:00
Cole Robinson 314ceab878 connectauth: Convert dialog to glade format 2019-02-03 15:23:05 -05:00
Cole Robinson 4b5cfe3cbb createvol: Fix showing backing store UI on first run (bz 1670266)
Whether we check for a vol-format value shouldn't be dependent
on whether the UI is on screen (is_visible), but whether the UI
is requested to be shown (get_visible)

https://bugzilla.redhat.com/show_bug.cgi?id=1670266
2019-02-03 12:37:41 -05:00
Cole Robinson 9e4287321f urlfetcher: Drop explicit prepare/cleanup calls
We can do this automatically easily enough. The downsides of
not cleaning up are pretty minor these days anyways without
the 'mount' handling
2019-02-03 12:05:18 -05:00
Pino Toscano bce4cc4ef8 inspection: fix check of null icon
Recently the Python binding of libguestfs was adapted to properly use
bytes in APIs that return data, instead of (ab)using strings [1].
This change was done only when built for Python 3, which has this
distinct bytes and strings.

Because of that, now the 'icon == ""' (empty string) checks fail, using
whatever inspect_get_icon() returns, including empty arrays of bytes.
Hence, change the checks to use the length of the data as condition, as
also the libguestfs Python API documentation says.  Leave also the
checks for None, in the remote case the API will return None in the
future for no data.

[1] 0ee02e0117
2019-01-30 18:06:26 -05:00
Pavel Hrdina 943b2a400e details: allow to remove video device if it's not the last one
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1659354

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-28 17:55:38 +01:00
Lin Ma eadb5b6193 vsockdetails: Show CID for active VM if the attribute auto is set to yes
Signed-off-by: Lin Ma <lma@suse.com>
2019-01-21 13:49:56 +01:00
Slavomir Kaslev 63db4de0b5 Remove Author lines from files
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-15 13:55:53 -05:00
Pavel Hrdina ad77f4fe83 createnet: fix typo introduced by commit dae8642bb
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-15 15:55:44 +01:00
Povilas Kanapickas 23c489e220 console: Extract fullscreen exit code to separate class
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2019-01-07 18:12:29 -05:00
Marc Hartmayer 50633d3329 domain: add docstring for _convert_old_boot_order
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer bf62001cfd domain: use else/elif since the conditions are mutually exclusive
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer a5f5072b01 domain: remove indirection
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer 29bfe2c682 domain: convert _change_boot_order to a instance method
This avoids the access of non-local variables of the closure.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Marc Hartmayer c9d63546a3 netlist: use NamedTuple for storing a network device
This has the advantage that we can access the attributes by name and
it's immutable by design.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00
Slavomir Kaslev 021d2938af virt-manager: Add support for vsock devices to Add Hardware UI
This patch adds support for adding vsock devices to a VM.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:27:17 -05:00
Slavomir Kaslev a9092b6abe virt-manager: Add support for vsock device to Hardware Details UI
Add support for vsock devices to Hardware Details UI so that vsock devices can
be configured or removed.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:27:17 -05:00
Slavomir Kaslev 2afa06c128 virt-manager: Add vsock sockets details UI
Add vsock details UI which will be shared between Hardware Details and Add
Hardware UIs.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:27:17 -05:00
Slavomir Kaslev 0889c7c7e4 virt-manager: Fix misspelling caught by codespell
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2018-12-10 10:43:55 +08:00
kalebskeithley c30b3bc611 Update create.py
100 is a bit too short for managing/creating vms over the corporate VPN. About half the time it times out and I have to exit the virtmgr app and restart it to see the new vm.
2018-11-15 12:05:36 -05:00
Cole Robinson 535e34481d libvirtobject: Add is_X object type helpers 2018-10-13 17:23:18 -04:00
Cole Robinson d39b7d1079 details: Fix launching wrong window for duplicate VM name (bz 1630220)
https://bugzilla.redhat.com/show_bug.cgi?id=1630220
2018-10-13 17:16:21 -04:00
Cole Robinson e212ce84e6 installer: extraargs -> extra_args
Better matches what's on the command line
2018-10-13 16:29:32 -04:00
Cole Robinson cec5fdeabe addhardware: Fix some pylint 2018-10-13 15:34:09 -04:00
Cole Robinson a00152d72a manager: fix some --test-leak-debug issues 2018-10-13 14:27:10 -04:00
Cole Robinson 452f5286cd addhardware: Don't show pci-bridge devices
These aren't assignable
2018-10-13 12:38:06 -04:00
Cole Robinson c23a0d4c96 nodedev: add is_linux_root_hub helper
Move the check out of connection.py, and simplify the addhardware
code
2018-10-13 12:18:50 -04:00
Cole Robinson 2482e57a15 create: Fix customize boot page
Installer reworks dropped the guest.autostart flag, need to add
it back. Add Uitest for it
2018-10-13 09:46:06 -04:00
Cole Robinson 11d1cbdf06 installer: DistroInstaller -> InstallerTreeMedia
Now we have only one Installer class, and callers don't need to
worry about choosing a particular class type depending on their
needs, just pass cdrom vs. location to the installer init and
we figure out everything behind the scenes.

Besides simplifying the callers this makes the control flow a
lot easier to follow whether looking at InstallerTreeMedia or
Installer classes
2018-10-13 09:42:11 -04:00
Cole Robinson 286dbf6d51 installer: Fold PXEInstaller into base Installer class
PXEInstaller is really just 'boot off bootdev=network' which is
easy enough to model without a separate class
2018-10-12 15:15:20 -04:00
Cole Robinson 4096800f71 Remove interface UI
Discussed here: https://www.redhat.com/archives/virt-tools-list/2018-October/msg00032.html
2018-10-12 14:38:05 -04:00
Cole Robinson 425f599c84 device: disk: Move all path search handling to diskbackend
Simplify it slightly by combining return output and removing
an entry point. Add some additional test cases for it
2018-10-11 19:11:16 -04:00
Lin Ma 3c44ea8810 addhardware: Add SCSI persistent reservation support for LUN Passthrough
Signed-off-by: Lin Ma <lma@suse.com>
2018-10-11 16:00:28 -04:00
Lin Ma 280b78c96a details: Add SCSI persistent reservation support for LUN Passthrough
It's a common requirement for VMs to send SCSI PR commands in VM cluster
environment. This patch adds the managed mode support of scsi persistent
reservation in details page.

Signed-off-by: Lin Ma <lma@suse.com>
2018-10-11 16:00:28 -04:00
Cole Robinson c83e083dde statsmanager: Skip old CPU stats for offline VM
We will handle any info() calls for status syncinging in domain.tick()
2018-10-10 17:34:21 -04:00
Cole Robinson 3d11cff6e2 statsmanager: Drop self.config prop caching
gsettings/dconf is meant for this usecase, it's fine to hit it
multiple times, we are doing it already anyways with the stats
record checking
2018-10-10 17:25:47 -04:00
Cole Robinson 390adc4e58 module_trace: Support --trace_libvirt=all|mainloop
'all' means log even API calls that are invoked from threads
2018-10-10 17:20:25 -04:00
Cole Robinson 155ddcfc17 conn: Move allstats polling before VM polling
So new VMs already have their stats cached
2018-10-10 17:19:44 -04:00
Cole Robinson a9f9b1be24 statsmanager: Don't run allstats if UI disables all stats 2018-10-10 17:19:32 -04:00
Cole Robinson ac2652a1fa statsmanager: make timestamps more accurate
And reorg our cache of allstats output to be easier to deal
with and not keep virDomain references
2018-10-10 17:19:21 -04:00
Cole Robinson a88a28d0b8 statsmanager: Absorb more domain stats handling 2018-10-10 17:19:21 -04:00
Cole Robinson f553cb67c2 statsmanager: Move VM stats calls back to domain.tick
Otherwise if we hit an error in connect.tick, connection can be
automatically closed in the UI, plus other parts of the code
were implicitly depending on this ordering, like VM rename support
2018-10-10 08:11:25 -04:00
Cole Robinson 5f1acb0c1a statsmanager: clean up
* Absorb support checks from vmmDomain
* Move the allstats handling out of the old wrapper functions
* Misc formatting fixes
2018-10-10 07:35:41 -04:00
Cole Robinson c30c1b8f6d statsmanager: Fix it with LXC
LXC doesn't support allstats API, and there were a number of issues
in that case.
2018-10-10 07:35:41 -04:00
Simon Kobyda 68a5abe279 statsmanager: new class for VM/conn stats polling
Class will work above connection. Right know, it is possible to
provide stats for domains only, but could be expanded.
To retrieve stats, you can use get_vm_stats(vm).

This class uses new virConnectGetAllDomainStats call, which reduces
number of calls needed to poll stats.
Stats are refreshed with every connection tick.

Signed-off-by: Simon Kobyda <skobyda@redhat.com>

(crobinso: squash commits, move statsmanager to its own file,
           fix pylint)
2018-10-10 07:35:37 -04:00
Cole Robinson 88cacb0295 setup: Remove configure --openssh-askpass
For one, we don't offer to install it anymore because we dropped
packagekit stuff. But even having a single package here isn't
really the whole story because different desktops have their
own askpass providers, like Fedora has openssh-askpass for GNOME,
but ksshaskpass for KDE

So drop it all, make the error more generic, and point people
to setting up SSH keys too
2018-10-08 13:59:13 -04:00
Cole Robinson 211ddf3a85 connectauth: polish up the user/pass auth dialog 2018-10-08 13:47:16 -04:00
Cole Robinson efe4f14fc7 connection: Remove krb5 auth dbus check
kerberos+libvirt is sufficiently obscure that I don't expect this
is of much value. Plus I don't have a setup to test
2018-10-08 09:27:22 -04:00
Cole Robinson 368c202f9b systray: Add connection open/close options 2018-10-07 20:16:55 -04:00
Cole Robinson 8a23cda0fe systray: Revive libappindicator usage
In the future, the only option for systray icons is going to
be statusnotifier/libappindicator. statusicon doesn't work on
wayland and gtk4 is dropping the APIs. KDE however is keeping
statusnotifier's around, and ubuntu is maintaining a gnome-shell
plugin to make them work

Revive support, but add a dbus check to make it smarter about
only using libappindicator when there's a listener present.
Better architect the code to separate the differences between
statusicon and libappindicator. Clean up the menu building
2018-10-07 19:52:20 -04:00
Cole Robinson f1d169ad7b setup: Remove configure --{libvirt,kvm}-package-names
This was really only useful with packagekit integration, which
is now gone
2018-10-07 14:27:20 -04:00
Cole Robinson a1d1b4d5a0 engine: Drop PackageKit integration
On first run of the app we will check to see if libvirt and qemu
are installed, and if not, offer to install them. In theory anyways.
In practice this stuff breaks repeatedly and is a pain to test because
every desktop has their own API provider with subtly different behavior.

My last round of testing about 12 months ago: apper on KDE was completely
busted and apparently unmaintained (although that may have changed lately),
gnome-software is the latest packagekit provider on gnome and completely
changes the semantics of the API compared to old style gnome-packagekit
that break a lot of virt-manager assumptions.

So I'm tired of it and want it all gone. Still use systemd to try and
check if libvirtd is running, and provide error messages at startup
to guide people.
2018-10-07 14:24:05 -04:00
Cole Robinson e2352e8518 packageutils: Remove system-config-services dbus
The app is dead and not part of fedora anymore. systemd service
actually provides a polkit dialog nowadays so let's just use
that
2018-10-07 12:41:16 -04:00
Cole Robinson fc8f8d5d7e connect: Drop avahi support
Libvirtd can advertise itself over avahi. The feature is disabled by
default though and in practice I hear of no one actually using it
and frankly I don't think it's all that useful

The 'Open Connection' wizard has a disproportionate amount of code
devoted to this feature, but I don't think it's useful or worth
maintaining, so let's drop it
2018-10-06 20:55:31 -04:00
Cole Robinson 7eaf036acf virtinst: Remove stable_defaults concept
This switch says: if we detect a rhel host, use special version
checks that match rhel backports. This pattern sucks. The way
forward is to have libvirt advertise the bits that are supported,
through domcapabilities. Then virt-manager/virtinst can react
as appropriate.
2018-10-06 19:45:51 -04:00
Cole Robinson 0638e72f1f Remove 'Choose CD', rework details and create media change
The new UI is handled in mediacombo. It's a combobox+entry. The
combobox is prepopulated with host cdrom/floppy devices, and
previously used media paths from gsettings

The new VM wizard no longer has separate UI for cdrom device vs
ISO media. The choosecd dialog is gone all together, and media
is changed with the 'apply' button like all other details changes
2018-10-06 19:37:16 -04:00
Cole Robinson 977a8ced52 addhardware: Fix cdrom icon (bz 1608530) 2018-10-06 13:04:45 -04:00
Cole Robinson c9f0641700 cliconfig: Remove --preferred-distros
It's less relevant with our new search based OS list
2018-10-06 12:33:15 -04:00
Cole Robinson e6738d9827 cliconfig: Remove --default-qemu-user
Libvirt has given us this info in capabilities for a long time,
this shouldn't matter anymore
2018-10-06 12:30:59 -04:00
Cole Robinson 9edca3486a virt-manager: Wire up support for default mode=host-model
Simplify things a long the way
2018-10-04 14:43:44 -04:00
Cole Robinson b807cfa744 details: Handle qemu-xhci as USB3
And fix it in addhardware too
2018-10-04 09:53:36 -04:00
Cole Robinson 8326adb997 oslist: Hide dialog if search field is empty
Behavior here was kinda inconsistent
2018-10-02 10:26:04 -04:00
Cole Robinson f3045b6404 oslist: Expand popover to horizontal size of the search entry
Makes the window more usable by default
2018-10-02 10:26:04 -04:00
Christian Ehrhardt 92c610e782 connection: avoid failing on NoneType in _hostinfo
There is a potential race of a backend to be opened and being true on
self._backend.is_open but self._hostinfo not being set yet.

Avoid spurial bugs due to that by also checking against None before
accessing subelements ot self._hostinfo

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2018-10-01 13:58:52 -04:00
Cole Robinson ff3d6c65d8 Fix some pep8 warnings 2018-10-01 11:37:28 -04:00
Cole Robinson b19f94299b details: Add OS name view/edit, + oslist rework
This is just a big nasty commit.

Turn the OS inspection page into an always available page that
shows the libosinfo name from the domain metadata XML. Use oslist.py
and have it absorb more of the common behavior needed by create.py
and details.py. Add UI tests for it all
2018-09-30 20:55:32 -04:00
Cole Robinson 75c64151b1 engine: Exit app if if --show-X bits fail
We were missing some cases. Simplify the code while we are at it
and add some extra ui test cases
2018-09-30 20:55:18 -04:00
Cole Robinson 627bfabc32 pylint: Silence output on Fedora 29 2018-09-29 14:27:34 -04:00
Cole Robinson a741f595ea guest: Drop update_defaults
Fold its one purpose into the UEFI setting bits, fix it and test it
2018-09-13 15:59:27 -04:00
Cole Robinson 6063538750 guest: Replace os_variant with set_os_name
And have callers directly access osinfo.name if they need it
2018-09-12 17:24:28 -04:00
Cole Robinson d60229825f create: update caps state when machine type changes
And drop old dtb virtio stuff which we don't care about anymore
2018-09-12 15:35:49 -04:00
Cole Robinson bc248b3eb5 create: Drop arm kernel warning
This case should be uncommon, and is wrong with UEFI, so drop it
and let qemu error
2018-09-12 14:06:13 -04:00
Cole Robinson 4e30161f44 guest: Absorb UEFI default setup
Rather than force callers to deal with it
2018-09-12 14:02:23 -04:00
Cole Robinson ec69ae44b6 capabilities: Drop build_virtinst_guest
Same as lookup_virtinst_guest
2018-09-06 20:54:59 -04:00
Cole Robinson 5f22f41da4 guest: Absorb capabilities defaults setup
Rather than forcing API users to go through the capabilities APIs.
This lets us simplify things in virt-install quite a bit, and is
needed for smarter machine type defaults
2018-09-06 20:12:49 -04:00
Cole Robinson 12a7a18be0 cli: Fix traceback detection 2018-09-06 18:39:14 -04:00
Cole Robinson a754718889 devices: disk: Use uppercase naming for mode lists 2018-09-06 16:51:14 -04:00
Cole Robinson 63287c83fb addhardware: Move disk bus listing to virtinst
Drop the stable_default stuff as domcaps usage should make
it obsolete for any cases we care about
2018-09-06 16:40:49 -04:00
Cole Robinson a09a46289a addhardware: Move controller list logic to virtinst
And tweak the UI defaults a bit, preferring virtio-scsi and
usb3
2018-09-06 16:05:12 -04:00
Cole Robinson 7994dc90c8 addhardware: Move video model list to virtinst
And make it smart about the hypervisor
2018-09-06 14:45:05 -04:00
Cole Robinson 7baa296aed details: Update IP addr UI after refresh_ip call 2018-09-06 14:04:00 -04:00
Lin Ma 838822b242 Fix error while refreshing ip if the virtual nic only has ipv6
Signed-off-by: Lin Ma <lma@suse.com>
2018-09-06 13:49:12 -04:00
Lin Ma be8dfc25f7 Fix error while refreshing ip if the virtual nic doesn't have any ip
Signed-off-by: Lin Ma <lma@suse.com>
2018-09-06 13:48:58 -04:00
Lin Ma b99731397b addhardware: Add support for disk io mode option
Signed-off-by: Lin Ma <lma@suse.com>
2018-09-06 13:28:21 -04:00
Lin Ma f2679df719 addhardware: Use consistent combo init for disk io mode option
Signed-off-by: Lin Ma <lma@suse.com>
2018-09-06 13:28:21 -04:00
Cole Robinson b3865d7b0d addhardware: Drop tcp/udp/dev char support
I know openstack uses tcp consoles but for end users I've never
really heard about it. RHEL compiles out udp as well. I'm fine telling
users to go to the cli and use virt-xml for this use case.

Use this opportunity to drop a lot of code that only simplified the
case when there are tons of char options we need to consider
2018-09-06 13:28:21 -04:00
Cole Robinson 954d2687d0 domain: Drop stable_defaults wrapper
Have callers invoke it directly on Guest
2018-09-06 13:28:21 -04:00
Cole Robinson cd07d6af34 sound: Track recommended models in virtinst
Change addhardware to show an editable model entry, like the
details wizard
2018-09-06 13:28:21 -04:00
Cole Robinson 84a68d56de addhardware: Don't disable filesystem on rhel
It might be compiled out, but just let qemu reporting fail. The
proper way to fix this expose it in domain capabilities or similar
2018-09-06 13:28:21 -04:00
Cole Robinson da00a52159 storagebrowser: Remove stable_defaults handling
It simply makes vmdk disk images not selectable. I don't even know
if that's relevant for RHEL7+ anymore, but if it is, maintaining
code for disabling this in the UI doesn't make the situation any
better IMO
2018-09-06 13:28:21 -04:00
Cole Robinson 2b7043cd85 createpool: Fix showing formats
But shrink the format list to 'auto' only, but also add a text entry
so users can type their own
2018-09-06 13:28:21 -04:00
Cole Robinson c5033c02d5 fsdetails: Use combo entry for format list
And stop listing all the crazy qemu formats
2018-09-06 13:28:21 -04:00
Cole Robinson f13d10590d createvol: Only show raw+qcow2 as file formats
And turn the combo into a text entry, so users can enter their
own if they want. raw and qcow2 covers the vast majority of usecases
2018-09-06 13:28:21 -04:00
Cole Robinson f499bc9638 details: Use browse mode for hw-list
Meaning a row can never be unselected. Drop some redundant code
afterwards
2018-09-05 19:37:55 -04:00
Cole Robinson a4d0d49d88 details: Centralize device row lookup 2018-09-05 19:20:23 -04:00
Cole Robinson b4b7c7b520 details: IP address fixes/improvements
* Tweak the UI
* Add accelerator for the refresh button
* Make the IP labels selectable
* Drop the IP prefix from the UI, it's not the important bit
* Call DHCPLeases on the network instead to support this for more
  drivers, like LXC
* Cache the IP results in the domain/network object wrappers
* Catch and log errors
* Poll for IP address when first visiting the interface page
2018-09-05 14:58:32 -04:00
Lin Ma 3bd582331e details: Show ipv4 and ipv6 address in details page of interface
If the interface's type is 'network', then code uses lease as one of
parameters of interface_addresses to get ipv4 and ipv6 address.
If the result is negative, then uses agent to try again, If the result
is still negative, uses arp for final try.

Signed-off-by: Lin Ma <lma@suse.com>
2018-09-05 12:33:11 -04:00
Lin Ma a500191b60 domain: Add function interface_addresses to return ipv4 and ipv6
It returns a dict that consisting of ipv4 and ipv6 which only match the
given mac, it returns None in exception.

Signed-off-by: Lin Ma <lma@suse.com>
2018-09-05 12:33:11 -04:00
Lin Ma e96e52bc28 addhardware: Add support for disk detect zeroes option
Complete this part of feature for commit e6c7e46a

Signed-off-by: Lin Ma <lma@suse.com>
2018-09-05 10:26:32 -04:00
Lin Ma a919a1ae4e addhardware: Add support for disk discard option
Complete this part of feature for commit d13b793b.

Signed-off-by: Lin Ma <lma@suse.com>
2018-09-05 10:26:12 -04:00
Cole Robinson 4394eff9fa xmlbuilder: Drop last usages of set_converter
Unfold most of them into manual property() wrappers. It's a bit
noisier but the logic is easier to follow.
2018-09-04 14:55:04 -04:00
Cole Robinson bd35f4711c devices: disk: Rename setup() to build_storage()
It's more explicit. Plus drop the supposedly generic setup()
entry point, storage is handled specially everywhere so it's
not a generic interface
2018-09-04 14:55:04 -04:00
Cole Robinson ebd6091cc8 devices: interface: Simplify is_conflict_net calls
We don't return a non-fatal error these days, so adjust all callers
to only handle failure
2018-09-04 14:55:04 -04:00
Cole Robinson c27cdc67de devices: interface: Convert setup() to validate()
That's all it's doing. Fold in mac validation while we are here
2018-09-04 14:55:04 -04:00
Cole Robinson 8aa01dab78 details: Remove UI display fields for egd RNG
In practice no one is using this, so it's not worth maintaining
specific UI to show its details
2018-09-04 14:55:04 -04:00
Cole Robinson 852d7b564d virtinst: Remove name field validate_cb usage
Either openly do this at callers, or wrap it in a validate() call.
Doing this at set time has always had issues, like the self.replace hack
2018-09-04 14:55:04 -04:00
Cole Robinson 2ac54ac001 guest: Drop self.installer and start_install wrapper
This changes all the callers to invoke start_install directly on the
Installer object. We still stash the installer instance inside the
guest object in create.py, just for simplicity
2018-09-04 14:55:04 -04:00
Cole Robinson c154bbacd4 guest: Fold add_default_devices into set_defaults
It doesn't have any need anymore to be separate
2018-09-04 14:55:04 -04:00
Cole Robinson f1bbc5f67a guest: move set_install_defaults to installer class
It's only called explicitly in one place, so update the caller
2018-09-04 14:55:04 -04:00
Cole Robinson 068c8aedd2 installer: Remove ContainerInstaller and ImportInstaller
Fold their non-logic into the base Installer class
2018-09-04 14:55:04 -04:00
Cole Robinson 1e76496fa8 storage: remove default_cb usage 2018-09-04 14:55:04 -04:00
Cole Robinson d5bff2c987 guest: Remove default_cb usage
This lets us simplify things in create.py a bit, since we don't
need to manually encode a UUID
2018-09-04 14:55:04 -04:00
Cole Robinson 6215f790f5 devices: filesystem: Add set_defaults
Requires a bit of rework in virt-manager handling, which had lots
of explicit "default" handling
2018-09-04 14:55:04 -04:00
Cole Robinson 0f918a4bd5 addhw: Move interface model list to virtinst
So we are keeping the default and model list logic closer together,
as its similar
2018-09-04 14:55:04 -04:00
Cole Robinson 347143982a devices: Add set_defaults for memballon, redirdev, rng, smartcard 2018-09-04 14:55:04 -04:00
Cole Robinson 698c72e60d devices: sound: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson 1b0f325813 devices: video: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson 7738b8f407 devices: panic: Add set_defaults
Move default handling out of Guest and default_cb callbacks, and
make implement it in a standard set_defaults function
2018-09-04 14:55:04 -04:00
Povilas Kanapickas 41daf1227c choosecd: Emit cdrom-chosen signal after the dialog has been closed
This fixes the testChooseCDHotplug UI test: the cdrom-chosen signal
opens an alert and it does not get focus because it's being opened
before the dialog is closed. As a result, the tests timeout waiting for
the alert to get focus. Emitting the signal after the closure of the
dialog fixes this issue.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2018-09-04 13:30:14 -04:00
Povilas Kanapickas e6c7e46a54 details: Add support for disk detect zeroes option 2018-09-04 11:39:50 -04:00
Povilas Kanapickas d13b793bfa details: Add support for disk discard option 2018-09-04 11:39:50 -04:00
Cole Robinson fb1bb26373 support: Drop lots more checks
- Remove anything for less than qemu 0.12 or libvirt 0.10, basically
  rhel6 vintage stuff
- Open code some simple checks
- Remove some that are only used for unnecessary error reporting
2018-08-31 22:21:15 -04:00
Cole Robinson 967ca4eeda virtinst: Drop direct 'support' usage
Except from connection. This requires some reorg in clitest and
some minor changes in a few other places
2018-08-31 18:31:17 -04:00
Cole Robinson ea413be214 xmlbuilder: Rename get_xml_config -> get_xml
The config part is redundant. Should have done this a long time ago
2018-08-31 16:52:02 -04:00
Cole Robinson 2b41e130d8 connection: rename fetch_all_guests->fetch_all_domains
The virtinst class is erroneously called Guest, but these
functions are dealing with libvirt <domain> XML, so rename them
2018-08-31 16:50:46 -04:00
Cole Robinson 348b7e092c sshtunnels: Fix bytes vs str in error reporting 2018-08-22 07:29:52 -04:00
Simon Kobyda ef4e0dbc4f details: ADD checkbox to plug/unplug network interface
Hardware Details -> NIC of every VM should now contain checkbox for
interface's link state. This checkbox edits domain's XML by changing
<link state='up/down'/>. If XML doesn't contain this tag, virt manager
assumes state "up".

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

Signed-off-by: Simon Kobyda <skobyda@redhat.com>
2018-08-17 10:49:26 +02:00
Cole Robinson cab540792f create: Support UEFI installs for armv7l
Will be supported with Fedora 29

https://fedoraproject.org/wiki/Changes/uEFIforARMv7

We should probably limit this by selected OS, but that's tricky
with the wizard as it is, so lets see if anyone cares
2018-08-08 15:14:21 -04:00
Lin Ma a55761c593 details: Use _disable_device_remove helper to set the remove tooltip
Signed-off-by: Lin Ma <lma@suse.com>
2018-08-08 10:25:41 -04:00
Lin Ma 0c1fff2494 details: Disallow removing virtio-serial controller if devices attach to it
Signed-off-by: Lin Ma <lma@suse.com>
2018-07-31 10:57:56 -04:00
Cole Robinson 6099ca674e details: Add _disable_device_remove helper 2018-07-31 10:49:42 -04:00
Cole Robinson 5212ab992e details: Reset Remove tooltip on hardware selection
Otherwise it can be out of date

Reported-by: Lin Ma <lma@suse.com>
2018-07-31 10:37:50 -04:00
Lin Ma cacf2abe6b details: Show attached disk info in sata, ide and floppy controller page
Reflect controllers <-> disks mapping relationship for not only scsi,
But other storage controllers.

As a bonus, These controllers are not allowed to be removed if there are
disks attached to them.

Signed-off-by: Lin Ma <lma@suse.com>
2018-07-31 10:16:45 -04:00
Lin Ma 4484f473cd char: Track/Show the state of virtio channels in channel details
crobinso: Add a test case

Signed-off-by: Lin Ma <lma@suse.com>
2018-07-12 15:25:23 -04:00
Lin Ma 8f78b33d1c Output the qemu guest agent lifecycle events in debug mode
Signed-off-by: Lin Ma <lma@suse.com>
2018-07-12 15:19:34 -04:00
Lin Ma ef3bcff14a libvirtenummap: Map state vals of agent event to libvirt enum names
Signed-off-by: Lin Ma <lma@suse.com>
2018-07-12 15:19:34 -04:00
Lin Ma 099ec95ac8 connection: Add callback parameter for function _add_domain_xml_event
Further patches will pass in the callback instead of the default one.

Signed-off-by: Lin Ma <lma@suse.com>
2018-07-12 15:19:34 -04:00
Cole Robinson 139031793c serialcon: Remove direct PTY connection
Removal was discussed here:
https://www.redhat.com/archives/virt-tools-list/2018-May/msg00011.html

Libvirt stream APIs are pretty ubiquitous, have several advantages like
remote access, and avoid some pitfalls of direct access. So drop the
old code
2018-06-12 14:23:39 -04:00
Stefan Berger c58f8514ab tpm: allow hotplug operation so error is reported by libvirt
Perform a hotplug operation so that we get the error notification
about unsupported TPM hotplug operation and we can alert the user
that the change will only take effect upon domain shutdown.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-06-12 09:54:15 -04:00
Stefan Berger a557ed18f9 details: show TPM device model and allow updating it
Show the TPM device model and allow updating it. If a TPM 1.2 has been
chosen, we only allow the TIS interface to be selected. In case of a
TPM 2.0 we also enable the choice of the CRB interface.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-06-11 12:40:28 -04:00
Marc-André Lureau c802f2b3b8 details: show TPM version
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-11 12:40:28 -04:00
Marc-André Lureau 51919b9824 addhardware: learn to set emulated TPM version
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-11 12:40:28 -04:00
Marc-André Lureau c04733c10d addhardware: learn to choose a TPM model
There is only one for now, but we are adding CRB next (and SPAPR is
being added too in qemu/libvirt).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-11 12:40:28 -04:00
Cole Robinson 96414aa88a domain: Fix removing <console> compat (bz #1586333)
Typo referencing the Guest console list

https://bugzilla.redhat.com/show_bug.cgi?id=1586333
2018-06-07 10:56:47 -04:00
Stefan Weil 633534c8b8 Fix some typos in comments and documentation (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-05 14:27:29 -04:00
Cole Robinson ffab20782f connection: Handle more openauth cred types
Like ECHOPROMPT which is needed for libssh hosts file management.
Sync the two implementations a bit
2018-05-03 06:16:28 -04:00
Cole Robinson 1feb478557 connect: When Custom URI selected, prepopulate with URI label 2018-05-02 17:43:20 -04:00
Cole Robinson 04398945e1 connect: Drop non-ssh remote transport UI
These URIs take non-trivial external config to make work. Explicitly
putting them in the UI is a distraction now that we have the custom
URI option
2018-05-02 17:42:32 -04:00
Cole Robinson 54bfb3efff create: Fix container install
We hide the OS selection UI for container installs, the new code
wasn't taking this into account
2018-05-01 18:45:25 -04:00
Cole Robinson ad12a6273d create: Fix guest-name-from-os logic
Should be using the os name, not the 'distro' value
2018-05-01 18:45:25 -04:00
Cole Robinson 511d764b84 create: Import media isn't detectable
This bit has been in the code for a while but only surfaced causing
weirdness with the recent changes.
2018-05-01 18:45:25 -04:00
Cole Robinson 1fd238a2d0 oslist: Drop show() logging
it gets spammed in the logs
2018-05-01 18:45:25 -04:00
Cole Robinson e1f16e62b8 addhardware: Remove non-device RNG UI
This config is not common enough to warrant the large UI surface
2018-05-01 12:27:27 -04:00
Daniel P. Berrangé d52d9885c8 Redesign OS distro selection UI to be faster to use
The current OS distro selection UI is fairly cumbersome to use. First
you need to decide on a variant, then decide a distro and then look for
the version you want. The list is filtered by default so only a subset
of OS are displayed. So for less common distros you'll then need to
start again and tell it to show all OS to try to find the one you want.

The core problem is that we have an incredibly large list and want to
make it easy for the user to find a specific entry. The modern UI
paradigm for this problem is to provide interactive search with
live updated results. The current UI does provide an interactive search
facility on the OS version results, but you still have to first select a
variant to be able to use the search which is unhelpful.

This patch attempts to better apply the search UI design to the OS selection
problem. We get rid of the notion of variants, distros and version, and
provide a single text entry box in which the user can type a few letters
of the OS name. As they type, a popover displays the matching results
filtered on OS name. By default end of life OS will be hidden, so in
general there will only be a small handful of results left after just
typing a few characters. This makes it very quick to find and select the
desired OS, without needing to provide a mutli-step navigation hierarchy.

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

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

(crobinso: fix some pylint)
2018-05-01 11:31:39 -04:00
Cole Robinson 577a636c43 addhardware: Remove largely redundant validate() error handling
Just centralize it in one place. Clean up conn usage in some places
2018-04-25 08:04:50 -04:00
Cole Robinson 056305d29b addhardware: Make combo init/populating more consistent
* Use the _build_combo helper more
* Un-static methods that don't need it
* Use pretty labels more
2018-04-25 08:04:50 -04:00
Cole Robinson 52b20ef40f addhardware: Remove non-spicevmc USB redir config
This is very rarely used, if at all, so it doesn't need to be in
the UI
2018-04-24 14:16:41 -04:00
Daniel P. Berrangé 48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Daniel P. Berrangé 24a8b66b35 avoid referencing ConnectError if it is None
Currently it throws an exception at startup which is hidden unless you
run with --no-fork

  $ python3 ./virt-manager --no-fork
  Traceback (most recent call last):
    File "/home/berrange/src/virt/virt-manager/virtManager/baseclass.py", line 225, in wrap_func
      return func(*wrapargs)
    File "/home/berrange/src/virt/virt-manager/virtManager/engine.py", line 206, in conn_open_completed
      ConnectError.details)
  AttributeError: 'NoneType' object has no attribute 'details'

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson a6c776f1f8 baseclass: Catch another cursor failure instance 2018-04-03 16:12:18 -04:00
Cole Robinson 9a87a8d5ea baseclass: Catch cursor error if icon missing (bz 1516588)
Debian users who installed virt-manager on a bare system found
that a missing cursor icon theme caused addhardware wizard to fail

https://bugzilla.redhat.com/show_bug.cgi?id=1516588
2018-04-03 13:10:11 -04:00
Cole Robinson eee1caa946 domain: Drop most device list wrappers
There's lots of hacks stuffed into the domain device lists. Formalize
some of it, move some of the specific stuff to details.py, and drop
a lot of the needless API wrappers
2018-03-21 16:10:45 -04:00
Cole Robinson 5b111b3d9f guest: Move get_all_devices to devices.get_all 2018-03-21 12:59:46 -04:00
Cole Robinson f69b823fad devices: Switch to normal _XML_PROP_ORDER
Drop the register_device stuff, rename virtual_device_type
2018-03-21 11:17:36 -04:00
Cole Robinson 7b61c45d3b guest: Move all_devices to guest.devices.X
The way we enumerate devices doesn't conform with the way all
other XMLBuilder instances expose child objects. Move more towards
that direction.

This requires some virt-xml and cli.py hacks but we will remove those
in future patches
2018-03-21 11:17:36 -04:00
Cole Robinson fe9ed2340c virtinst: move <domain> XML files to virtinst/domain
And give the classes consistent naming
2018-03-21 11:17:36 -04:00
Cole Robinson b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson 1c911ce567 virtinst: Give device classes consistent DeviceX naming
Previous state was inconsistenty and needlessly wordy. Fix up
a few other class namings that have redundant Virtual in the name
2018-03-21 07:29:40 -04:00
Cole Robinson a55abc8e89 details: Again fix default page showing 2018-03-18 11:36:02 -04:00
Cole Robinson 4d4a07c65b tests: uitests: Add window cleanup tests
And fix some bugs I found as a result
2018-03-17 19:42:19 -04:00
Cole Robinson 259c70a090 error: Drop unused parent callback 2018-03-17 18:49:55 -04:00
Cole Robinson defdfd4b51 engine: Fix backtrace from manager->exit 2018-03-17 18:47:13 -04:00
Cole Robinson 97db1ac18a manager: Simplify row management a bit
Drop the self.rows dict, use more pygobject row[] convenience
helpers, add some helper properties for VM
2018-03-17 18:46:40 -04:00
Cole Robinson 7de9028221 manager: Fix some menu item sensitivity issues 2018-03-17 18:46:40 -04:00
Cole Robinson b5377f8f0f engine: Make a decorator function for showing startup errors 2018-03-17 18:46:40 -04:00
Cole Robinson 3c1e0a8a12 virtManager/*: Give pylint hints about singleton classes
It can't seem to figure out that what 'cls' is in this context,
so make it explicit.
2018-03-17 18:46:39 -04:00
Cole Robinson 7ad15769dc virt-manager: fix git startup on wayland
Apparently we need to do these env settings much earlier...
2018-03-17 13:14:04 -04:00
Cole Robinson 483a8de6c1 systray: Change window tracking a bit
We should only prevent app closing if the systray is actually embedded
2018-03-17 12:18:38 -04:00
Cole Robinson 9ec865e4c0 systray: Only create statusicon if showing
Since even if it's marked as not visible, it can cause some movement
on the gnome3 topbar with topicons extension
2018-03-17 11:42:12 -04:00
Cole Robinson dac860e8ce engine: Show modal startup errors if window open fails 2018-03-16 19:09:55 -04:00
Cole Robinson ee817c32ce s/connect_opt_out/connect_once/ for open-completed callback
Forgot about that helper function...
2018-03-16 18:05:52 -04:00
Cole Robinson ad632383c8 virt-manager: if new --connect fails, don't save the URI 2018-03-16 18:05:52 -04:00
Cole Robinson 2f0e730efc error: Don't double log summary
details is often composed of a summary + traceback, so if users copy
it into a bug report we get all the info. But when logging the contents
we don't want to double log the summary, so try to strip it out
2018-03-16 17:30:39 -04:00
Cole Robinson c9b2ec163f preferences: Add UI for disabling spice usb autoredir
We already have a gconf key and command line option for this.
Drop the CLI option and add UI for it, we should have just done
that to begin with
2018-03-16 14:38:22 -04:00
Cole Robinson dabbc8d5bd engine: Remove centralized conn.open handling
Move connection opening logic to each caller, since needs are
slightly different.
2018-03-15 21:24:48 -04:00