Commit Graph

187 Commits

Author SHA1 Message Date
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
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
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
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
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
Cole Robinson
e30671b53d viewers: Only use openGraphics if supported 2016-05-07 19:12:33 -04:00
Cole Robinson
f4dfb6de9d Fix recent pylint/pep8 output 2016-04-18 16:42:12 -04:00
Mikhail Feoktistov
32cccaa170 virt-manager: Fix VNC connection on hypervisor without GraphicsFD
Function virDomainOpenGraphicsFD() from libvirt can return -1
But in this case libvirt-python will raise an exception.
We should handle this case and return -1 as invalid FD.
In commit 5c451b64 Viewer._open() there is a code to open
graphics console in case of invalid GraphicsFD.

(crobinso: also log the error message)
2016-04-07 16:31:38 -04:00
Marc-André Lureau
5c451b6401 virt-manager: connect with openGraphicsFD
This allows to connect to VM without any display listening socket, the
fd passing is done through libvirt connection.

Furthermore, since it uses unix socket, spice can use virgl locally
with texture sharing. This effectively enables spice-gtk to display
local virgl rendering.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-03-09 20:25:37 -05:00
Cole Robinson
e68efe8103 domain: Use setMemoryStatsPeriod for QEMU
Since that's what is required to get cooperative memory stats from
the guest balloon driver.
2015-11-18 21:20:36 -05:00
Cole Robinson
c3b5fb407a details: Fix editing filesystem devices 2015-11-18 21:12:35 -05:00
Cole Robinson
d32953d8c6 details: Remove UI for vcpu pinning
This UI exposed the old NUMA allocation policy detailed in the last commit.
It's very much sub-optimal, and should be removed.

Manual cpuset configuration is also quite uncommon and not really something
worth exposing in the UI. It can easily be done from the command line
with virt-xml.

If people complain, I'd consider adding a checkbox for vcpu placement=auto,
or an option to do that by default for new VMs.
2015-11-18 15:05:21 -05:00
Cole Robinson
f8744a34da domain: Fix filesystem device editing 2015-09-20 16:48:30 -04:00
Cole Robinson
dc61755e8b domain: Don't track xen Domain-0
It doesn't really fit our UI, so blacklist it
2015-09-17 16:06:14 -04:00
Cole Robinson
4b5e65fe8d details: Remove iotune UI
This is a little low level and rarely used IMO to have it in the UI.
If people want to edit this we should point them at virt-xml which
seems like the appropriate user friendlyness for this feature.
2015-09-13 15:54:47 -04:00
Cole Robinson
7a56c322ed domain: Drop is_management_domain
It's not consistently applied. If I had a setup to test against old xen
that still listed dom0, I'd make it so we never even show dom0 so we
can sidestep the problem entirely.
2015-09-05 17:32:03 -04:00
Cole Robinson
40d4c37868 domain: Use UpdateDevice for CDROM media change (bz 1229819)
This has been supported for a long time now, and is more tested these
days, so let's use it rather than the old style AttachDevice method

It also works around a libvirt issue described in bz 1229819
2015-08-10 18:47:12 -04:00
Pavel Hrdina
a2505def2c pep8 E731: do not assign a lambda expression, use a def
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-07-14 13:01:20 -04:00
Cole Robinson
776c1d97c6 domain: Fix changing USB device model
Broken before v1.2.0
2015-05-19 18:29:45 -04:00
Cole Robinson
2168f33799 details: Unify controller model handling with addhardware 2015-05-19 18:29:45 -04:00
Cole Robinson
32d998b216 domain: Properly prime stat lists at object creation
Fixes graph spikes when initially connecting to a running VM
2015-05-04 18:42:26 -04:00
Cole Robinson
cb0eaf23d8 conn/domain: Privatize stats list 2015-05-04 18:42:17 -04:00
Cole Robinson
fbf841151d conn/domain: Condense the internal stats APIs 2015-05-04 18:05:54 -04:00
Cole Robinson
848123e6c8 domain: Fix memory stats for shutoff VM (bz 1215453)
memory doesn't have a separate input/output stats, so we shouldn't use
the in_out_vector_helper. This resulted in shutoff VMs appearing to still
use memory in the manager window.
2015-05-04 15:50:01 -04:00
Cole Robinson
a8d3afbcd9 domain: Log initial XML for virtinst/customize object 2015-05-03 17:01:16 -04:00
Cole Robinson
18a6d8b444 migrate: Add 'temporary' option
This doesn't undefine the VM source, and leaves it temporary on the
destination. Basically the default migration action
2015-04-21 17:39:44 -04:00
Cole Robinson
fb26349546 domain: Make the tick() logic easier to follow 2015-04-21 17:15:58 -04:00
Cole Robinson
62ad0e91ee migrate: Big reworking of the dialog
It's largely the same, but now

- The code is better organized
- The UI is much more streamlined, only showing relevant fields when
  required.
- We warn about the hostname/URI cases that we know libvirt will error on
- Drop some of the attempts at being smart, and just mimic what libvirt
  will do.
2015-04-21 17:15:58 -04:00
Cole Robinson
692604e0a3 domain: migrate: Use UNDEFINE_SOURCE
Leaving a VM defined on the source is dangerous: if they are sharing
storage, and aren't using virtlockd, then they might be inadvertently
started in two places at once and trash a disk image.

Some people might still need the option to turn this off, so maybe we
will revive it. Not sure though
2015-04-21 16:33:41 -04:00
Cole Robinson
26c729887d domain: migrate: use PERSIST_DEST flag
Don't do it manually, it's been supported by libvirt for 5 years
2015-04-21 16:33:41 -04:00
Cole Robinson
be86785fdd migrate: Drop unused 'live' parameter. We always pass LIVE 2015-04-21 16:33:41 -04:00
Cole Robinson
2b877cf337 migrate: Remove 'max downtime' support
This is only needed when people have very specific downtime constraints
on public facing services. I don't think that covers many virt-manager
users. So suggest they just use the command line for this.
2015-04-21 16:33:41 -04:00
Cole Robinson
39dc0c7b94 migrate: Drop 'bandwidth' UI
A bit too enterprisy for my tastes. If people need this they should use
the command line.
2015-04-21 16:33:41 -04:00
Cole Robinson
e4e4c8c6f7 domain: Some 'customize before install' fixes after XML rework 2015-04-13 17:25:40 -04:00
Cole Robinson
c3fc4ee5a2 console: Drop timeout retry logic
This was needed in the days of old xen + libvirt, but I don't think
it's required nowadays, and if it is it's busted with our XML caching
I think.
2015-04-12 10:24:35 -04:00
Cole Robinson
839ce682b1 Drop support for non-managed save/restore
All major drivers either support it, or don't support save at all,
so I think we can safely drop it. If people still need it they can
get by with virsh.
2015-04-11 13:52:48 -04:00
Cole Robinson
20cd7f86ca domain: Remove manual_reboot
qemu has provided this feature for a long time, and every other driver
we care about provides a reboot implementation as well, so drop our
handling of it.
2015-04-11 11:13:05 -04:00
Cole Robinson
42648f45f0 libvirtobject: Clean up XML invalidation
Make sure we aren't invalidating things when we are using events. Don't
overload APIs so much.
2015-04-10 17:50:06 -04:00
Cole Robinson
a7a19b2abc libvirtobject: Drop redefine_cached
There's no external callers anymore, and the prospect of keeping this
stuff cached but potentially having a thread invalidate it makes me nervous,
so simplify things by making callers explicitly request the object they
want to redefine.
2015-04-10 17:23:11 -04:00
Cole Robinson
1552cb257e domain: Make device XML editing similar to guest XML editing 2015-04-10 17:15:07 -04:00
Cole Robinson
d0ffd954cd connection: Unify initial object refresh handling
Have libvirtobjects advertise a routine specifically for initial setup,
and emit a signal when it's complete. Then dispatch the associated conn
signal on demand as the objects are initialized. This should avoid a
whole class of ordering issues, and is easier to follow IMO.
2015-04-10 15:00:42 -04:00
Cole Robinson
838baf6946 connection: tick: Operate on combined object lists
Makes the flow a bit simpler, and allows us to break out polling without
having to pass around a ton of lists.
2015-04-10 15:00:34 -04:00
Cole Robinson
2d25c920ea connection: Use consistent nodedev function names 2015-04-10 15:00:34 -04:00
Cole Robinson
cb5d075f50 libvirtobject: Unify a few APIs and conn tick handling 2015-04-10 15:00:34 -04:00
Cole Robinson
4933cf7600 libvirtobject: Clarify force_update_status 2015-04-10 15:00:34 -04:00
Cole Robinson
c9b882619e libvirtobject: Add decorator for lifecycle events
That does the appropriate event loop updating, if needed.
2015-04-10 15:00:34 -04:00
Cole Robinson
a3f8d73a9c libvirtobject: Unify internal status APIs and signals
Drop config-changes vs. status-changed and just use one signal, since they
are largely the same code paths for all users.
2015-04-10 15:00:34 -04:00
Cole Robinson
01bf07ba11 libvirtobject: Unify status signals
Dispatch them all from the actual object and not proxied through
the connection. Use the same signal name for all objects with the same
signature.
2015-04-10 15:00:33 -04:00
Cole Robinson
1d98af2c47 create: Move mac address editing to customize dialog
People should rarely need to edit the mac address, so remove it from
the create wizard. However we only allow editing the mac address in
the 'customize' dialog: regular network details disables editing, since
that should be a rare and potentially dangerous operation.
2015-04-07 18:52:35 -04:00