Commit Graph

143 Commits

Author SHA1 Message Date
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
Pavel Hrdina
1590490fa3 capabilities: detect ACPI and APIC capabilites properly
Instead of hard-coding that ACPI and APIC are enabled by default, detect
their presence from libvirt capabilities and use it.

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

(crobinso: Adjust for recently added test case)

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-07-14 13:26:42 -04:00
Pavel Hrdina
3ff35898a4 refactor detection of guest type capabilities
Each guest type can have its own capabilities and we should always ask
only for those capabilities.

The old approach was to get capabilities from libvirt and then for
example cycle trough all guests and return True, if any guest type
supports kvm or pae, etc.

Now we check those capabilities only for the correct guest type
according to defaults and input from user.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-07-14 13:11:40 -04:00
Kevin Zhao
8dbe96fc01 virt-manager : add support for architecture type "s390x".
For architecture "s390x",the disk and the network device are base
on "virtio" bus.The cdrom is based on "scsi".So set the default
cdrom bus as "scsi",the default bus as "virtio".Also the default
machine type is set to "s390-ccw-virtio" as it is the only supported
in "s390x".Also add a test cast of virt-install by cdrom in s390x.

(crobinso: Tweak test suite and minor formatting stuff)
2015-07-14 12:45:32 -04:00
Cole Robinson
bfa5762d9e guest: Add install cdrom in set_defaults, not start_install (bz 1220180)
Fixes weirdness when using addhardware wizard for a customized VM,
and makes the code easier to follow anyways.
2015-06-06 17:02:20 -04:00
Cole Robinson
cdc0a8fe41 guest: Remove unused code
We don't support the transient install disks anymore
2015-06-06 14:59:48 -04:00
Giuseppe Scrivano
f8af2e6b10 create: verify HYPER-V support after customization
commit 938060ae53 moved default devices
setup to happen before UEFI is set invalidating what the commit
5acfccf6032abb9e8be89130d05b661e8b3f42c7 does.

Add another check to happen before installing the guest to disable
HYPER-V when not supported.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1185253

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-20 22:48:33 +02:00
Marc-André Lureau
ddfca74e54 virtinst: set vmport off by default when has_spice()
Spice is better off without vmport enabled, to be able to switch between
absolute and relative mouse mode easily.
Message-Id: <1428012248-5767-5-git-send-email-marcandre.lureau@gmail.com>
2015-05-04 12:40:13 -04:00
Marc-André Lureau
ede876e792 virtinst: set_graphics_defaults() first
Some later options may require Spice (or other) to be enabled,
so call set_graphics_defaults() earlier.
Message-Id: <1428012248-5767-4-git-send-email-marcandre.lureau@gmail.com>
2015-05-04 12:40:13 -04:00
Cole Robinson
33cfe883c6 guest: arm kvm should use host-passthrough, not model=host
Seems to work with libvirt, not sure if it was ever broken as the comment
suggested.
2015-04-23 10:14:58 -04:00
Cole Robinson
0f3d86ac9e guest: Disable PM for virt-install as well
We are just mirroring the behavior that virt-manager (and boxes) have
used for a while now.

In my experience the average user is confused by their VMs suspending,
so for our sake I'd rather make people opt into this feature.
2015-04-11 18:02:45 -04:00
Cole Robinson
a2c7d62ec4 guest: Disable spice image compression for local VMs
The image compression setting has a noticably detrimental effect on
spice graphics quality. It's meant to be used for spice VDI but the
vast majority of people don't use spice in a way that makes bandwidth
usage matter.

Boxes has already done this for a while as well:

https://mail.gnome.org/archives/commits-list/2013-March/msg14904.html

Turn it off by default if creating the VM on a local connection.
2015-04-11 17:53:17 -04:00
Cole Robinson
a5d03fdf6e guest: Don't unconditionally overwrite on_poweroff/on_crash 2015-04-07 19:53:15 -04:00
Cole Robinson
86f1133777 guest: Encode defaults into the XML at install time
Previously we made all the default encoding non-permanent by XML objects
before generating the XML, making changes to the copies, and restoring
to the old state after the XML is returned to the user.

This allows us to call start_install multiple times with the same Guest
object and not alter it's original config... but that feature isn't really
useful anymore, and this behavior makes the 'customize before install'
dialog difficult to handle.

So drop most of it, and fix some of the minor fallout.
2015-04-07 18:36:06 -04:00
Cole Robinson
a773a66a3f virtcli: Export config variables in a class object
Makes things easier to extend later
2015-04-06 15:54:35 -04:00
Cole Robinson
e29f216503 guest: Use sata by default for q35 cdrom, non-virtio (bz #1207834) 2015-04-06 13:43:18 -04:00
Cole Robinson
bd9ab2d5b5 osdict: Add toplevel OSDB as API entry point
Makes code more readable, and lazy loading simpler.
2015-04-04 12:06:41 -04:00
Cole Robinson
f644b0997d osdict: Have users call functions, rather than access properties
Gives us more future flexibility, and simplifies the flow quite a bit.
2015-04-04 11:24:18 -04:00