Commit Graph

160 Commits

Author SHA1 Message Date
Cole Robinson
a90d675394 Switch deprecating log.warn to log.warning
Same semantics, but the alias is deprecated
2017-05-05 14:53:28 -04:00
Cole Robinson
62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Pavel Hrdina
3ebbeef80e virtinst: introduce support for <maxMemory> element
This element controls hot(un)plugable memory for the guest in
addition to the initial memory configured by <memory> element.

One has to configure <maxMemory> and guest numa nodes using <numa>
element to enable hot(un)plug of memory modules.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-05 11:49:27 +02:00
Cole Robinson
8181e86098 guest: Only use define+start logic for vz
Handling this for qemu, which may need UNDEFINE_NVRAM flags to do
the cleanup, is a pain, so move this logic to only apply to vz
driver which doesn't support createXML

Mentioned on list: https://www.redhat.com/archives/virt-tools-list/2017-April/msg00037.html
2017-04-27 14:59:41 -04:00
Cole Robinson
4c4d31d67d tests: Fix after vmvga change 2017-04-19 14:08:04 -04:00
Cole Robinson
93085d2b9d guest: Don't repeatedly overwrite self.domain
Since clearing it is important, just set it at the end when things
have succeeded
2017-04-13 14:56:03 -04:00
Christophe Fergeau
2099a1946e Reset Guest.domain to None on domain creation error
When an error occurs when the VM creation wizard tries to start the VM,
it's then not possible to press again the "Finish" button to try again
to start it, as this errors out with:

Traceback (most recent call last):
  File "/home/teuf/redhat/virt/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/home/teuf/redhat/virt/virt-manager/virtManager/create.py", line 2341, in _do_async_install
    guest.start_install(meter=meter)
  File "/home/teuf/redhat/virt/virt-manager/virtinst/guest.py", line 457, in start_install
    raise RuntimeError(_("Domain has already been started!"))
RuntimeError: Domain has already been started!

This is caused by code introduced in commit fc6778 which does not reset
self.domain to None when an exception is caught.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2017-04-13 14:24:40 -04:00
Mikhail Feoktistov
c25ea6537b Tune default device list for Virtuozzo containers
Virtuozzo supports virtio NIC.
Also add default VNC graphics.
Privnet feature and emulator device have no sense for vz containers.
2017-03-17 13:36:15 -04:00
Cole Robinson
d62e975568 guest: Add default virtio-rng /dev/urandom (bz 1212082)
For guests that support it, per libosinfo, and new enough libvirt
to handle /dev/urandom. See the bug for discussion

https://bugzilla.redhat.com/show_bug.cgi?id=1212082
2017-03-08 17:26:19 -05:00
Cole Robinson
22b6becd5d guest: Add support for qemu cli passthrough
This is for xml like:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  ...
  </devices>
  <qemu:commandline>
    <qemu:arg value='-newarg'/>
    <qemu:env name='QEMU_ENV' value='VAL'/>
  </qemu:commandline>
</domain>

Requires some extensions to the xmlbuilder infrastructure
2017-03-06 22:15:46 -05:00
Cole Robinson
a2df53db21 guest: Reorder XML output to match libvirt output 2017-03-05 21:04:34 -05:00
Cole Robinson
8ebed65459 guest: Only add default usb redirdev for x86
Since we only attempt to add a default USB controller for x86, match
it by only trying to add redir devices on x86 as well. Fixes a uitests
failure for ppc testing, since the test:/// driver doesn't add an
implied USB controller, and libvirt now validates that one was provided.
2017-03-05 14:32:14 -05:00
Mikhail Feoktistov
f78ff6457b Do not use createXML for non transient domains
For these domains use defineXML

(crobinso: Add undefine on start() failure)
2017-03-01 15:27:37 -05:00
Cole Robinson
fc6778108b guest: Don't set any defaults for on_*
Currently we hardcode these defaults for installing VMs:

  <on_poweroff>destroy</on_poweroff>
  <on_reboot>destroy</on_reboot>
  <on_crash>destroy</on_crash>

And these for post-install config:

  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>

But this has some issues. on_crash=restart is problematic in that most
configs don't support it, and some like virtuozzo actively reject it.
Additionally this we should leave as much to libvirt defaults as we
can, which are more sensible in this case.

Drop everything except setting on_reboot=destroy for the install time
case (which is required for our config changes). Since on_poweroff
and on_crash already default to 'destroy', the install time config
is unchanged, and the post-install config now on_crash=destroy instead
of 'restart'.

The s390 on_crash=preserve workaround is dropped, which was intended
to avoid a reboot loop caused by on_crash=reboot
2017-03-01 14:17:51 -05:00
Marc-André Lureau
ee6a60a9b9 virtinst: error out if spice+gl is not supported
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-11-14 09:55:43 +01:00
Charles Arnold
b31c0b442e virtinst: Add classes for defining SMBios information
This includes adding an smbios sub-element to the guest os element and a
sysinfo sub-element to the guest. The sysinfo sub-element contains the SMBios
specific data.
2016-09-08 11:36:59 -04:00
Cole Robinson
1d2cd30677 osdict: Fix incorrect usage of virtio input
Regression reported with latest libosinfo, when the OS reports
virtio-input support:

http://www.redhat.com/archives/virt-tools-list/2016-July/msg00109.html

Really our code presently only cares about the USB tablet, so adjust
our libosinfo lookup to explicitly check for it
2016-07-29 13:17:36 -04:00
Cole Robinson
40e0354631 guest: Fix multiple address.type=pci auto allocate requests
And test it for aarch64, which is the only place it's really
interesting at the moment
2016-06-17 17:17:49 -04:00
Richard W.M. Jones
246e3c9c59 virtinst: Add --transient flag.
If this flag is specified, --import|--boot will create a transient
libvirt domain, ie. one which goes away when the guest shuts down or
the host is rebooted.

(crobinso: some tweaks and tests)
2016-06-17 12:20:24 -04:00
Cole Robinson
116fabb37a virt-install: Access domain in place via guest.domain
And stop returning the domain object from Guest.start_install, it's
redundant
2016-06-17 12:13:21 -04:00
Cole Robinson
59edd87e9f guest: Rename noboot -> doboot
It's a bit easier to follow the logic IMO
2016-06-17 12:13:21 -04:00
Cole Robinson
b5d0b381ba guest: Rename start_xml -> install_xml
Make it more clear what the case is
2016-06-17 12:13:21 -04:00
Cole Robinson
837a9710a3 guest: Use newer named CreateXML API
CreateLinux is the very old style name. CreateXML has been around
since at least 2009, which covers our minimum libvirt-python version
2016-06-17 08:58:28 -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
302a84a97d virtinst: rename .seclabel->.seclabels
Since guest and disk can have multiple of these, make it clear
to callers
2016-06-12 11:09:15 -04:00
Shivaprasad G Bhat
94f610465f CD-ROMs should be on scsi bus for pSeries machines
Commit f6322c9e changed the default bus type for disks to virtio.
That changed it for both disks and cdroms. The CD-ROMs dont work
if on virtio on pSeries. So, change the cdrom bus type to scsi as
before.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>

Extend virt-install-ppc64-pseries-f20 test to cover this case.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 16:55:46 +02:00
Leno Hou
3bbf0aad85 virtinst: fix indent tab issue with virtinst/guest.py
Signed-off-by: Leno Hou <lenohou@gmail.com>
2016-05-13 12:38:55 +02:00
Leno Hou
1ba524db04 virtinst: set preserve when on_crash in s390x
When booting from empty disk image or none bootdev, its leads
system IPL enter into infinite loop with message on s390x.
This patch sets preserve when on_crash to avoid the loop

Signed-off-by: Leno Hou <lenohou@gmail.com>
2016-05-10 13:38:38 -04:00
Shivaprasad G Bhat
f6322c9ed8 virtinst: Use virtio bus type for disks on pSeries machines
pSeries doesn't support ide and so was changed to use the scsi. virtio works
better on pSeries with better performance outcomes. Change the default to
virtio for disks

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
2016-04-21 09:58:08 -04:00
Marc-André Lureau
ea1bd169c1 virtinst: use virtio if spice+gl
Use virtio+accel3d by default whenever spice+gl is chosen. This allows
to easily set up accelerated gpu VM.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-09 20:25:37 -05:00
Cole Robinson
33ca0fff7d Only use spice on x86
qemu isn't compiled with spice support for non-x86

Reported-by: Kevin Zhao <kevinzs@linux.vnet.ibm.com>
2015-12-24 11:33:47 -05:00
Cole Robinson
e13f81a7c5 guest: Add qemu-ga virtio channel for arm
Originally we didn't add this since arm vexpress virtio only had 4
virtio-mmio slots. But the now-common -M virt target has 32 slots,
so we aren't starved.
2015-11-24 19:39:19 -05:00
Cole Robinson
e18d2caa45 create: Don't go back to NewVM on error, if customize dialog launched
The code really isn't set up to handle exiting the customize dialog,
so just make the UI enforce it.
2015-11-21 19:55:48 -05:00
Cole Robinson
492c9c4f28 cli: Add --vcpu placement=static|auto option 2015-11-18 15:00:42 -05:00
Kevin Zhao
35792f7dd6 Add the console target "sclp" for s390x
Add console target "sclp" for s390x ,since the newest Distro guests has
supported the console target, solve some console issues in s390x.Also
modified the test xml cover this change.

crobinso: fix the test suite output
2015-11-16 19:54:15 -05:00
Cole Robinson
72f83b638d guest: Clarify archs that skip adding the qemu-ga channel 2015-11-10 17:55:55 -05:00
Kevin Zhao
2aca20141e Remove default channel for s390x.
The Qemu guest agent change for 390x,remove default channel device
for s390x and regenerate the test output.Modified the clitest xml.
2015-11-04 14:42:26 -05:00
Cole Robinson
b7e073a407 osdict: Disable x2apic for solaris10 (bz 1262093)
It breaks networking:
https://bugzilla.redhat.com/show_bug.cgi?id=1262093
https://bugs.launchpad.net/bugs/1395217
2015-11-03 16:00:52 -05:00
Pavel Hrdina
5c3758142d virt-install: always enable pae for xen hvm 64bit guest
According to xen documentation 64bit guest has to have pae enabled in
order to be able to run 64bit OS.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-03 16:37:17 +01:00
Abhijeet Kasurde
e5a0d1cbb8 Added support to on_lockfailure
Added cli option to specify on_lockfailure in events.
Also, added various testcases and related output XMLs.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

(crobinso: add clitest.py example)
2015-10-07 10:25:12 -04:00
Cole Robinson
f371ac0de3 virt-install: Don't add USB tablet if user disables USB controller 2015-09-28 19:01:44 -04:00
Cole Robinson
9dd0900b7d guest: Add default console device for xenpv
Libvirt already adds one so this is kinda redundant, but it makes
things clearer in the virt-manager 'customize' UI at least.
2015-09-22 12:41:57 -04:00
Cole Robinson
a538b69356 guest: Remove code for default virtio console
It's been disabled for a while and we don't plan on re-enabling it
2015-09-22 12:41:57 -04:00
Cole Robinson
60d6161efc create: Clean up default storage if VM fails (bz #799721)
Similar to the virt-install change, we only do this with default storage
if the installed failed in such a way that we never left the wizard.

It isn't going to cover all cases, but should handle the common issue
of stranded disk images

https://bugzilla.redhat.com/show_bug.cgi?id=799721
2015-09-06 15:10:17 -04:00
Cole Robinson
697164f2e5 virtinst: Centralize urlgrabber meter lookup
We will eventually want to drop this dep since it's basically dead
upstream, this is a small step in that direction
2015-09-06 15:09:44 -04:00
Cole Robinson
1237be9d1a virt-install: Clean up created disk images if VM creation fails
We are conservative here, only cleaning up disk images if libvirt
fails to even accept the XML. Otherwise the VM may already be
running or defined, and the user has to do some cleanup anyways.
2015-09-06 14:27:37 -04:00
Cole Robinson
68962f48f7 virtinst: Support multiple seclabels
libvirt has supported this for a while. Wire it all up through the
cli, and fix some bad assumptions along the way.
2015-09-05 13:49:36 -04:00
Cole Robinson
acfb988945 xmlbuilder: Make _add_child and _remove_child public
We have a lot of functions that are just wrappers around these, so
make it public for future use.
2015-09-04 15:47:43 -04:00
Cole Robinson
5e68b0fc3d guest: Don't try to set vmport on non-x86, it isn't supported (bz 1259998) 2015-09-04 12:14:22 -04:00
Pavel Hrdina
2d9587c114 support: enable hv_time since qemu-kvm 1.5.3 from RHEL
This feature is available in upstream Qemu since 2.0.0 but it was also
back-ported to downstream Qemu into qemu-kvm-1.5.3 released in RHEL-7.
Add a new check and enable hv_time also in RHEL systems if qemu new
enough.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-07-21 10:51:41 +02:00