Commit Graph

1174 Commits

Author SHA1 Message Date
Cole Robinson
07f1a4e168 ui: Use 'Shut Down' vs 'shutdown' consistently 2017-03-06 22:05:35 -05:00
Cole Robinson
1ac02d2ade ui: clone: Delay error if default storage doesn't have enough space
Just ignore the error populating the initial paths, otherwise we can't
even open the dialog
2017-03-06 22:05:34 -05:00
Cole Robinson
b6630c2a63 clone: Don't error if disk doesn't have a backing volume 2017-03-06 22:05:34 -05:00
Pavel Hrdina
8225cac648 virtManager.delete: don't allow deleting SCSI disks
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina
31e923dbdf virtManager.clone: don't generate default clone_path for some storage pools
Libvirt doesn't support creating volumes for some storage pools,
don't generate default clone_path for these storage pools.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina
79baf8e30c virtManager.clone: don't generate clone path if we don't default to clone
If we don't default to clone the disk in question don't try to generate
and assign default clone_path, this will force user to select the path
explicitly and avoid some unnecessary errors in debug log.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina
d93203022a virtManager.clone: set new manual path before we populate storage list
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Cole Robinson
0910c8dcfc domain: Use libvirt.VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH (bug 1379581)
It's what virt-viewer uses, and apparently it's needed for VNC
listen type=none

https://bugzilla.redhat.com/show_bug.cgi?id=1379581
2017-03-02 15:08:32 -05:00
Marc-André Lureau
b484d15258 virtManager/ui: add 3d acceleration checkbox to virtio video
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:58:30 -05:00
Marc-André Lureau
53d09bc28c virtManager/ui: add rendernode selection
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:57:57 -05:00
Marc-André Lureau
326dc03c23 virtManager/ui: add listen type option
Similarly to virt-install --listen=none, add a combobox to select
the listen type: "address" or "none" for now, as suggested by Pavel
Hrdina.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:56:52 -05:00
Marc-André Lureau
88942028b3 virtManager/ui: add opengl graphics option
Add an OpenGL checkbox to the Spice graphics options (only available if
SUPPORT_CONN_SPICE_GL).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-01 17:54:19 -05:00
Pino Toscano
ecd66a7df2 inspection: try harder to show a pkg summary
If a package has no summary, try to use the description (if available):
- if it is just one line (mostly because the package manager only has
  a single line as description of a package), then use it fully
- if it contains more lines, then take the first only, adding suspension
  dots to indicate it is longer than that
2017-03-01 16:32:57 -05:00
Pino Toscano
409ae0bcf4 inspection: add a way to refresh the inspection info
Introduce a 'Refresh' button in the 'Information' page of a VM, and
wire it up so a refresh of the inspection data for it is triggered.
2017-03-01 16:25:47 -05:00
Pino Toscano
436d4c544c details: refresh Information page on inspection data change
Refresh the 'Information' page when there are new inspection data
available, so they can be seen even without switching to a different
page and back.  This could be seen when starting virt-manager, and
opening quickly the 'Information' page of an uninspected guest.
2017-03-01 16:25:47 -05:00
Pino Toscano
45d0be9805 inspection: add vmmInspection.vm_refresh helper
Add a simple helper to force a new inspection of a VM.
2017-03-01 16:25:47 -05:00
Pino Toscano
67ed3e86df inspection: filter libguestfs VMs earlier
No need to do any job for them, so skip processing them altogether when
a new one is added.
2017-03-01 16:25:47 -05:00
Pino Toscano
d2ca54fce4 inspection: remove queue draining
Now we act for each item in the queue, so there is no more need to drain
it fully before doing anything.  Thus, turn _run into a simple
get+process+done loop.
2017-03-01 16:25:47 -05:00
Pino Toscano
7a696c8db8 inspection: handle duplicated conn-added signals
We might get 'conn-added' signals for the same connections more than
once, so make sure to skip a new connection notification when the
connection is already known.
2017-03-01 16:25:47 -05:00
Pino Toscano
ea5a6a3014 inspection: simplify VMs visit
Currently, the handling of the 'vm_added' element in the queue (added as
consequence of the 'vm-added' signal) is to act as trigger to rescan
every VM in every local connection; this operation is "fast" because
every VM except the newly added is already marked as visited. Still, it
is an not really efficient way to visit new VMs.

Instead, just push in the queue all the data we get in vm_added, so when
processing the queue we can process each VM straight away.  Because of
this, make sure to gracefully handle VMs that were removed while the
'vm_added' item for them was sitting in the queue (which is something
the old code did not handle properly).
2017-03-01 16:25:47 -05:00
Pino Toscano
0c019fb8e3 inspection: rename vmmInspection._process to _inspect_vm
It fits more the actual job of the function.
2017-03-01 16:25:47 -05:00
Pino Toscano
ad47e80ec2 inspection: extract vmmInspection._process_vm
Move the code that does the inspection handling of a VM to an own
function, so it can be used as-is later on.

It is just code motion.
2017-03-01 16:25:47 -05:00
Pavel Hrdina
b8dccf6aca virtManager/viewers: fix connection to remote SPICE with password
When connecting to remote SPICE we use ssh tunnel if the SPICE is
listening only on "localhost".  Our ssh tunnel scheduler uses locks
to serialize the requests for FD in order to not spam user for ssh
password.

However when the main_channel is connected and emits AUTH_ERROR
we ask user for password and request for new FD.  Unfortunately
after the new request is handled we didn't unlock the scheduler
and all other request would remain waiting for the lock.

We need to unlock every FD request for the SPICE main channel not
only the first one when the channel itself is created.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-02-10 09:43:20 +01:00
Pino Toscano
46f4abbb50 inspection: try low quality icons as fallback
When there is no high quality icon for a guest, try getting the low
quality icon.  This should make virt-manager show icons for Ubuntu and
Windows guests.
2017-02-09 16:29:27 -05:00
Pino Toscano
3c95d20994 inspection: consider also epoch for pkg version
When composing the string of the version of packages, prepend also the
epoch, as it is an important part of the package version.
2017-02-09 16:29:27 -05:00
Pino Toscano
ebf4ade208 inspection: show OS type in Inspection page
Show also a pretty label for the OS of the guest, in addition to
hostname and product name.
2017-02-09 16:29:27 -05:00
Pino Toscano
f7a726dc70 inspection: rename variable for OS type
'type' is ambiguous as name, it might conflict with the Python builtin.
Instead, rename it to 'os_type' to get rid of the issue altogether.
2017-02-09 16:29:27 -05:00
Pavel Hrdina
2df8dc39e8 virtManager/interface: detect whether IP address comes from DHCP server
When the network interface is up the active XML contains only IP address
even in case that the inactive XML was configured to get the IP address
from DHCP server.  To propagate this information back to UI we need to
get both XMLs to figure out current IP addresses and the configuration.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-02-06 09:11:00 +01:00
Pavel Hrdina
798a2e5080 virtManager/addhardware: get supported disk bus types from libvirt
Libvirt provides domain capabilities where supported disk bus types are
listed.  Virt-manager should try to get those bus types.  The old code
remains as fallback if domain capabilities doesn't contain the disk
bus types.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-01-24 08:37:17 +01:00
Cole Robinson
88bfdf4926 console: Fix resize to VM on wayland (bug 1397598)
Yet another issue with not using window.get_size() and instead using
its size allocation directly, which differ on wayland due to client
side decorations.

https://bugzilla.redhat.com/show_bug.cgi?id=1397598
2016-12-13 13:34:09 -05:00
Cole Robinson
107aa2b134 manager: Fix window size tracking on wayland (bug 1375175)
The method we were using is a common implementation bug,
explained here: https://wiki.gnome.org/HowDoI/SaveWindowState

https://bugzilla.redhat.com/show_bug.cgi?id=1375175
2016-12-13 13:34:09 -05:00
Cole Robinson
435de2d40c pylint: Fix some issues with F25 version 2016-12-13 12:36:49 -05:00
Seeteena Thoufeek
5a11cf0782 virt-manager generates invalid guest XML
The virt-manager application generates invalid guest XML when a
 spapr-vio SCSI model controller is changed to a virtio-scsi model controller.

1. Create a guest
2. Add an spapr-vio controller to the guest via this gui path:
->Add Hardware
->Controller
->Type SCSI
->Model Hypervisor default
At this point, there will be a valid spapr-vio SCSI controller defined:
    <controller type='scsi' index='0'>
      <address type='spapr-vio' reg='0x2000'/>
    </controller>
3.Now modify the above SCSI controller using this gui path:
->Choose "Controller sPAPR SCSI" on left pane
->Choose "VirtIO SCSI" for the Model on the right pane
->Apply
At this point, there will be a SCSI controller definition which is invalid due to an incorrect address type:
~# virsh dumpxml dotg2|grep -A2 -i scsi
    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='spapr-vio' reg='0x2000'/>
    </controller>
Any attempt to start the guest will throw this error:
error: Failed to start domain dotg2
error: internal error: process exited while connecting to monitor: 2016-12-02T17:45:12.989165Z qemu-system-ppc64le: -device virtio-scsi-pci,id=scsi0,reg=0x2000: Property '.reg' not found

virt-manager fails to realize that the address type needs to be changed to a PCI address for a virtio-scsi controller.

If you change the model, you are supposed to leave the address field empty, so that libvirt sets it correctly. Or change the address field also appropriately.

Note that this bug can be reproduced entirely within virt-manager.  No manual editing of guest XML is being done here.  So, fix is to make virt-manager delete the address field when the SCSI controller model is changed, allowing libvirt to automatically assign a new address with the correct type.

Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
2016-12-12 21:12:09 -05:00
Chen Hanxiao
b7eb3e57ea We can't clone a VM in some scenarios,
such as a VM is active.

This patch will disable 'Clone' label in VMActionMenu
if we can't clone a VM,
as same as we did for 'Clone' button in clone ui page.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-10-06 23:12:59 +08:00
Jim Fehlig
561f5cd3e6 virt-manager: drop 'xenmigr' scheme from Xen migration URI
For Xen, virt-manager uses a 'xenmigr' URI scheme, which is not
supported by the libvirt libxl driver. Attempting migration
fails with

libvirtError: invalid argument: unable to parse URI: xenmigr://myhost

The old xend-based libvirt driver supports this scheme, but also
supports an empty scheme. It's not clear what the 'xenmigr' scheme
is used for. 'xenmigr' is not referenced by any files in the Xen
code-base, including old branches with xend.

Drop setting scheme to 'xenmigr' when creating the Xen migration URI.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-09-08 11:47:52 -04:00
Jim Fehlig
0425975f38 virt-manager: use virDomainMigrate3 API
libvirt has supported the migration V3 protocol for many years now.
A nice feature of the virDomainMigrate3 API is that it will detect
the protocol version supported by the underlying hypervisor,
including whether it supports the extensible parameters variant,
and call the hypervisor API with parameters fixed up as needed.

Change virt-manager to use the virDomainMigrate3 API, allowing
migration to work with hypervisors that only support the extensible
parameters variant of the migration V3 API.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-09-08 11:47:45 -04:00
Jovanka Gulicoska
44dd5ae0a6 Fix storage pool refresh event signal
When creating a storage volume, it wouldn't show up in the list
since the refresh signaling was busted.
Code was using VIR_STORAGE_POOL_EVENT_REFRESHED which was dropped
from lifecycle event type, refresh is introduced as top level
event.
2016-08-19 11:06:44 -04:00
Pavel Hrdina
da81d4c32c console: don't use _close_viewer directly
Function _close_viewer should be always called together with setting
unavailable page.  Call only _activate_unavailable_page which does both things.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-08-18 10:36:04 +02:00
Pavel Hrdina
354877b90e console: set unavailable page while closing details window
We need to set unavailable page in order to trigger _init_viewer() function.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-08-18 10:36:04 +02:00
Jovanka Gulicoska
bc42fac710 Use node device update event support
API will be available in upcoming libvirt 2.2.0
2016-08-17 09:03:10 -04:00
Jovanka Gulicoska
ead5fdffff Use node device lifecycle events
API will be available in upcoming libvirt 2.2.0
2016-08-11 10:14:30 -04:00
Tristan Helmich
27703ca379 storage: Enable creation of zfs storave volumes 2016-08-09 11:48:34 -04:00
Chen Hanxiao
911dac0dfa snapshot: start snapshot when double-click the item of snapshot list
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-08-02 13:20:15 -04:00
Pavel Hrdina
810c73864a translation: mark some strings to be translated
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-07-26 09:32:14 +02:00
Cole Robinson
9a67fc4d6e storagepool: Don't double invoke 'refresh' when events are present
We need to tweak refresh() handling to work similar to the shared
XML and status caching in libvirtobject.py: when the user manually
invokes the refresh() operation, and storage events are set up,
we just invoke the refresh() but let the event loop handle
refreshing the cache.

This fixes a backtrace when invoking a manual refresh via the
host details dialog
2016-06-23 15:38:31 -04:00
Cole Robinson
cdf5d32434 libvirtobject: Rename refresh_...->recache_from_event_loop
Since 'refresh' is kind of ambiguous now that we support pool
refresh events
2016-06-23 14:48:04 -04:00
Cole Robinson
61a4318f85 storagelist: Remove unused function 2016-06-21 19:15:43 -04:00
Cole Robinson
e69cc002b1 viewers: spice: Catch failure to setup usbdev manager
Since some distros like openbsd don't compile support for
usb redirection, which makes this fail

https://bugzilla.redhat.com/show_bug.cgi?id=1348479
2016-06-21 09:01:32 -04:00
Cole Robinson
6d587c40bb storagepool: Don't refresh newly arriving pools
If they show up while a connection is 'active', it means they were
just defined/created, and thus a pool refresh is likely redundant
2016-06-20 17:21:46 -04:00
Cole Robinson
53459cb0f6 conn: Don't process any pool REFRESHED events during conn startup
When new pool objects appear, we call refresh() on them, to ensure
we have the latest data (in case manual changes were made to the
storage pool directory behind libvirt's back, which is quite common).

However with the storage event support, this results in lots of
REFRESHED signals during initial connection startup, which kick
off redundant object polling.

Avoid storage REFRESHED events if they come in before the connection
is finished starting up to skip this redundant polling.
2016-06-20 17:07:26 -04:00