Commit Graph

1143 Commits

Author SHA1 Message Date
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
Cole Robinson
6a740ff91c conn: Build default pool before registering events
Otherwise this triggers some event calls and results in double
polling during connection startup. Doesn't cause any issues, just
spams the logs and needless libvirt calls
2016-06-20 17:03:12 -04:00
Jovanka Gulicoska
b904d62e47 Use storage pool lifecycle events
API will be available in upcoming libvirt 2.0.0
2016-06-18 11:08:14 -04:00
Cole Robinson
20c2d5b6ff delete: Don't offer to delete floppy media by default
Even if it's not marked readonly or shareable, floppy media is
very likely to be a shared resource and not something that belongs
to the VM that the user will want to delete by default.
2016-06-17 13:06:35 -04:00
Cole Robinson
9f297eda5b virtinst: guest: drop 'continue_install' concept
continue_install is intended to facilitate windows XP style 3 stage
installs:

  stage 1: initial dos style disk setup, reboot
  stage 2: actual full installer, reboot
  stage 3: OS is functional, virt-install is done

The code assumed that we needed to keep the cdrom as the primary
boot device for the second stage, so virt-install/virt-manager needed
to hang around through the second stage run, wait until the VM shutdown,
then encode the final XML to boot of the disk.

Windows is and always has been smart enough to handle that case though...
after the initial boot, if we set the hd as the primary boot device
for stage 2, the disk bits that windows already installed will make
use of the cdrom as necessary. So the entire premise of continue_install
is irrelevant. Maybe back when it was added, when xen didn't even have
working ACPI support, this served a purpose, but I'm pretty sure we
can safely drop it nowadays.
2016-06-17 07:52:42 -04:00
Cole Robinson
5cd1b57852 create: customize: Fix inadvertent disk removal on install fail
If the first install attempt fails, then the second attempt succeeds,
we were still removing the disk images we created as though the
install never succeeded. We need to clear out the cached failed_guest
value via the customize dialog callback

https://bugzilla.redhat.com/show_bug.cgi?id=1342043
2016-06-16 19:47:49 -04:00
Pavel Hrdina
0acdea1dad virtManager.details: show firmware options also for XEN guests 2016-06-16 12:16:53 +02:00
Pavel Hrdina
5ecc2b440a virtManager.create: don't clear recommended machine if none is selected
This improves loading domcapabilities to get domcapabilities for recommended
machine, not for default machine.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-16 12:00:10 +02:00
Jovanka Gulicoska
053672764f storagelist: code cleanup
Remove cb() function calling pool.refresh, instead use pool.refresh
in vmmAsyncJob
2016-06-14 19:17:06 -04:00
Pavel Hrdina
2f0b40ac00 virtManager.config: fix pylint warning
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-10 18:05:39 +02:00
Pavel Hrdina
09cc6f3832 console: add support to forget password
If password for console is saved currently there is no way how to tell
virt-manager to forget that password.  This patch improves the authentication
page in order to provide a way how to forget password simply by unchecking the
"Save this password in your keyring".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 20:03:27 +02:00
Pavel Hrdina
7e1bd1d762 console: fix checkbox to save password if it was loaded from keyring
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1302175

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 20:02:45 +02:00
Pavel Hrdina
7280dcf7df create: report an error if storage doesn't exists for import installation
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1305210

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 19:48:24 +02:00
Pavel Hrdina
b327191a20 maint: fix pylint warnings wrong-import-order
standard import "import logging" comes before "from gi.repository import GLib"

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 17:37:06 +02:00
Pavel Hrdina
efd1d2dd07 cpu: config: replace host-cpu-model by host-model-only
Commit f5c32063 replaced host-cpu-model by host-model-only but forget those two
places.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 09:06:13 +02:00
Pavel Hrdina
2d554aca7b ui: remove "Restore Saved Machine..." from File menu of Connection Details
Commit 839ce682 removed deprecated support of save/restore which was replaced by
managedsave feature.  This is a leftover that wasn't removed together with that
commit.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-31 13:09:48 +02:00
Pavel Hrdina
4506d49ff5 addhardware: don't remove QXL if VNC graphics are configured
Commit 1a6e803a introduced a fix for bogus behavior of QXL+VNC where
there was no cursor visible by disabling this configuration in
virt-manager.  We should enable it again because this is a supported
configuration and the bug was actually in QEMU.

This is now fixed in qemu-2.6.0 [1] so revert commits 1a6e803a and
67ca0a9f.

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

[1] http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg00507.html

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-20 18:10:24 +02:00
Pavel Hrdina
bf99c0ce82 virt-manager: fix --show-domain-creator to not depend on manager window
Commit a0c2fdf4 fixed a bug that there was no way how to close the app.

The original issue isn't present anymore but reverting that commit isn't
enough.  We need to increment/decrement window count while
showing/closing the create window in order to not exit right after
the create window is opened.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-20 12:02:03 -04:00
Cole Robinson
0891fc9ee1 manager: Clean up new conn/vm handling 2016-05-20 11:44:18 -04:00
Cole Robinson
c65e9d1e16 manager: fix --show-domain * manager conn populating
We need to register the conn internally before connecting
vm-added, otherwise the VMs don't end up in the UI
2016-05-20 11:44:18 -04:00
Cole Robinson
eea9b27696 console: Fix and simplify 'Resize to VM' action
We need to resize the window and not try to play crazy games with
the scroll window size. Wish I realized this years ago...
2016-05-20 11:44:18 -04:00
Cole Robinson
8c2adb83ae console: Error for more non-working graphical configs
- If connecting remotely but graphics has no listen address,
    like the spice GL case.
- Trying to connect to a TLS using VM over an ssh tunnel, it doesn't
    seem to work: https://bugzilla.redhat.com/show_bug.cgi?id=1320331
2016-05-18 16:57:38 -04:00
Cole Robinson
0f88ebbc0b console: Enforce text wrapping on 'unavailable' page 2016-05-18 16:32:07 -04:00
Cole Robinson
01d4203933 viewers: spice: fix password auth 2016-05-18 16:14:51 -04:00
Cole Robinson
ed666b21db sshtunnels: Drop 'ext' URI handling
Never really seen it used in practice, so drop this support. Would
probably take more work to make it actually work anyways
2016-05-18 16:06:04 -04:00
Cole Robinson
7b0f916886 baseclass: Undo workaround for old pygobject
Basically reverting this commit:

    commit 1c8bf88db7
    Author: Cole Robinson <crobinso@redhat.com>
    Date:   Tue Jun 18 08:46:24 2013 -0400

    baseclass: Add unregister wrappers for idle and timeout

    If an idle handler raises an exception, it isn't unregistered and loops
    forever. This is a regression from previous pygobject and pygtk:

    https://bugzilla.gnome.org/show_bug.cgi?id=702552

    Work around this for now with our own wrappers.
2016-05-17 17:49:56 -04:00
Cole Robinson
3aa941571a uiutil: Drop check for old pygobject row handling
Once upon a time it couldn't handle setting a row value to None,
but we've bumped the dep now
2016-05-17 17:49:56 -04:00
Cole Robinson
cb4909dffb console: Fix fullscreen keycombo menu placement
Some pygobject update must have fixed the callback signature,
so handle both versions
2016-05-17 17:49:55 -04:00
Cole Robinson
dc05600324 console: Convert from autodrawer to native Gtk widgets
Gtk 3.10 has a GtkOverlay and GtkRevealer widget which we can
use to more sustainably implement the autodrawer functionality.
2016-05-17 17:49:55 -04:00
Cole Robinson
3221b56ac3 viewers: Show spice error message in the UI on disconnect 2016-05-16 16:28:55 -04:00
Cole Robinson
0bd73da4bb sshtunnels: Remove duplicate error strings
spice can open multiple tunnels, and in certain cases we may get
multiple duplicate errors from each tunnel. Try to strip them out
2016-05-16 16:22:35 -04:00
Cole Robinson
adef60211f viewers: Pass SSH error output via gobject signal
Rather than have the console fetch it. Just streamlines things a bit
2016-05-16 16:16:13 -04:00