Commit Graph

266 Commits

Author SHA1 Message Date
Cole Robinson
23c9dd3ee7 tests: clitest: Add an actual stub iso for --location testing
And add an explicit nfs URL test
2018-01-06 14:01:44 -05:00
Radostin Stoyanov
75210ed37c Replace StringIO with io.(StringIO or BytesIO)
StringIO and cStringIO modules no longer exists in Python 3. [1]
Use either io.StringIO [2] for text or io.BytesIO [3] for bytes.

[1] http://docs.python.org/3.0/whatsnew/3.0.html
[2] https://docs.python.org/3/library/io.html#text-i-o
[3] https://docs.python.org/3/library/io.html#binary-i-o
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
63fce081ed pycodestyle: Use isinstance() for type checking
This is E721 in pycodestyle [1]:
   "do not compare types, use ‘isinstance()’"

The main differece between "type() is" and "isinstance()" is that
isinstance() supports inheritance. [1]

This can be seen in the example below:
    >>> type(True) is int
    False
    >>> isinstance(True, int)
    True

As we can see in python 'bool' a subclass of 'int'.

[1] https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
[2] https://docs.python.org/2/library/functions.html#isinstance
2017-10-20 11:49:13 -04:00
Lin Ma
40f70d4fe5 virt-install: add param cache.mode and cache.level for option '--cpu'
libvirt supports guest CPU cache by commit df13c0b, So add this feature
to virt-install to configure cpu L3 cache mode.

Currently, The valid values are 'passthrough', 'emulate' or 'disable'.
say:
  --cpu host-passthrough,cache.mode=passthrough
or
  --cpu $CPU,cache.mode=emulate,cache.level=3
or
  --cpu $CPU,cache.mode=disable

Signed-off-by: Lin Ma <lma@suse.com>
2017-09-14 18:54:01 -04:00
Pavel Hrdina
af91d51fc8 cli: introduce snapshot_policy parameter for disk device
This allows to configure snapshot behavior for each disk.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-12 08:58:31 +02:00
Pavel Hrdina
d718f1a516 graphics: introduce listens.socket parameter
Add support to configure socket path for socket listen type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:11:42 +02:00
Pavel Hrdina
fe6c5067c0 graphics: introduce listens.{type|address|network} parameters
Using "listens.*" allows better configuration of listen elements for
graphics devices.  Currently the only way how to configure a listen
type is to abuse "listen" parameter and there is no way how to configure
exact "network".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:11:42 +02:00
Pavel Hrdina
9f191da5c5 devicepanic: add all models supported by libvirt
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:09:46 +02:00
Pavel Hrdina
36230c9a18 devicepanic: use model instead of address.type
There are multiple models of the panic device, the address type is only
one and is valid only for "isa" model.

To not break the virt-install/virt-xml the command line parser needs to
be updated.  Before this patch there was only one parameter that
configured the "iobase".  Now the first parameter configures a model
but to keep it backward compatible it follows these rules:

1. there is only one parameter and it matches known model:

  --panic isa

  <panic model='isa'>
    <address iobase='0x505' type='isa'/>
  </panic>

2. there is only one parameter and it doesn't match any model:

  --panic 0x505

  <panic model='isa'>
    <address iobase='0x505' type='isa'/>
  </panic>

3. there are two parameters:

  --panic isa,iobase=0x505

  <panic model='isa'>
    <address iobase='0x505' type='isa'/>
  </panic>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:09:46 +02:00
Cole Robinson
f0e36d52e7 tests: bypass cache hacking for test:///default
To allow us to test the standard code in some cases. Would have caught
the previous issue
2017-08-30 10:36:37 -04:00
Chen Hanxiao
b44aa0e3bb pycodestyle: fix all E131 warnings
Fix all E131:
     Continuation line unaligned for hanging indent

   Also remove ignore options of E131

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-26 20:03:21 +08:00
Chen Hanxiao
c92aade081 pycodestyle: fix all E203 warnings
Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-11 00:01:38 +08:00
Cole Robinson
c6fdfbf3c3 cli: disk: add driver_detect_zeroes= support 2017-07-15 13:39:04 -04:00
Cole Robinson
f41844f3f2 guest: Use usb3 qemu-xhci for machvirt
This is what libvirt will default to nowadays for those configs,
so let's match it.
2017-07-10 19:46:13 -04:00
Cole Robinson
5a1f2f7b66 tests: add aarch64 graphics test 2017-06-28 11:54:41 -04:00
Yuri Arabadji
4be3d030b5 cli: Add --disk logical/physical_block_size 2017-06-16 13:28:25 -04:00
Pavel Hrdina
4f8e795c6a virtinst: if required by UEFI enable SMM feature and set q35 machine type
If we detect that the UEFI image is build to require SMM feature we
should configure the guest to enable SMM feature and set q35 machine
type.  Without this user wouldn't be able to boot the guest.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Pavel Hrdina
24f9d05329 virt-install: add support for loader secure attribute
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Pavel Hrdina
f38c56c971 virt-install: add support for SMM feature
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Cole Robinson
f551d7e55d Replace file() usage with open()
Same semantics, but the latter is needed for python3
2017-05-05 14:53:12 -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
a2985f07e6 virtinst: add support for memory device
This is the actual memory device that is used to hot(un)plug memory
to(from) a guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-05 12:20:52 +02: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
7a4acfcd0c devicedisk: Raise proper error on invalid source_volume (bz 1445198)
https://bugzilla.redhat.com/show_bug.cgi?id=1445198
2017-04-27 15:44:46 -04: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
Venkat Datta N H
66435cb03d virt-install:support --features hyperv_synic=(on/off) 2017-03-30 14:19:06 -04:00
venkat
935c93812f virt-install: support --features hyperv_reset=(on/off) 2017-03-27 17:50:35 -04:00
Cole Robinson
191896d0dc cli: Add --qemu-commandline option 2017-03-06 22:15:46 -05:00
Cole Robinson
ed92e03f39 tests: make test-clone VMs offline by default
Simplifies test cases
2017-03-06 22:15:46 -05:00
Cole Robinson
84d8cd9896 tests: Rename clone test VMs to have a common "test-clone" prefix 2017-03-06 22:05:35 -05:00
Cole Robinson
1757e394bb virt-install: Support --video vram64= (bz 1377080) 2017-03-05 14:51:25 -05:00
Cole Robinson
d31e933f24 virt-install: support --network trustGuestRxFilters= (bz 1427600) 2017-03-05 14:43:31 -05:00
Mikhail Feoktistov
3870001fd2 virtinst: Add tests for Virtuozzo hypervisor 2017-03-01 15:45:24 -05:00
Marc-André Lureau
dffb2aaa2d virtinst/cli: add spice rendernode argument
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-02-23 18:31:43 -05:00
Cole Robinson
cd2ade9fd7 tests: Fix with latest osinfo-db output 2017-02-22 14:40:49 -05:00
Pavel Hrdina
b4239b7538 tests: fix virt-xml test
Broken by commit b1c0a1c2d9.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-01-17 17:47:46 +01:00
Charles Arnold
a3206f89c8 virtinst: Add the --sysinfo option
Allow passing SMBios information to the guest using the new sysinfo
option. Also update the appropriate files with test cases.
2016-09-08 11:36:59 -04:00
Chen Hanxiao
c859d39428 virt-install: introduce vhostuser interface
Add support to interface type 'vhostuser' by:

--network vhostuser,source_type=unix,source_path=/tmp/vhost1.sock,source_mode=server,model=virtio

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-09-02 18:58:47 -04:00
Kothapally Madhu Pavan
d107762880 Error out cleanly when autoclone or destination file is not specified
When virt-clone is used without autoclone or destination file, libvirt
errors with message "ERROR    missing source information for device vda".
This doesn't convey what is missing. This patch will indicate which
options to use.

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
2016-09-02 14:10:17 -04:00
Cole Robinson
c84c2cfd58 devicechar: Support source_master and source_slave
Needed for type=nvdm for *bsd

https://bugzilla.redhat.com/show_bug.cgi?id=1369803
2016-08-24 16:37:36 -04:00
Cole Robinson
322d212516 cli: Add --serial log.file= and log.append=
And for other character devices --console, --parallel, --channel
2016-07-18 15:04:40 -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
81231530e5 tests: Add virt-install --wait test, and tweak the logic a bit 2016-06-17 12:13:21 -04:00
Cole Robinson
0e8d4007cf tests: Add some virt-install autoconsole tests 2016-06-17 12:13:21 -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
5398282e12 storage: Detect backing_store format automatically
By attempting to manage/import the passed path. This makes it
work via both virt-install and virt-manager

https://bugzilla.redhat.com/show_bug.cgi?id=1235406
2016-06-16 20:36:30 -04:00
Cole Robinson
8d4e58c501 cli: Add --disk backing_format= option 2016-06-16 20:09:37 -04:00
Chen Hanxiao
6c82b9d184 tests: fix a testcase failure by --os-variant
Current libosinfo release on fedora23 and centos7
didn't know fedora23.
Change --os-variant fedora22 as a workaroud.

df1c3e74a introduce this issue.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-06-16 23:10:51 +08:00
Pavel Hrdina
86e11786b5 maint: update all libvirt checks for version from 1.3.6 to 2.0.0
There want be 1.3.6 version, libvirt switched to new release numbering, for more
information see <http://libvirt.org/downloads.html#numbering>.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-15 12:05:11 +02:00