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>
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>
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>
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>
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>
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>
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>
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>
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.
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
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
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
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>
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>
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>
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.
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
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>
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
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)
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
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
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.
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
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.
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
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>
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
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
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
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
* 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
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>
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
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>
- 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
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>
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>
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>
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>
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>
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)
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>
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>
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
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
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