Commit Graph

524 Commits

Author SHA1 Message Date
Cole Robinson
e4e924ea50 tests: Add libosinfo iso detection test
With another fake iso, based on stripped down centos 6.5 boot iso.
Reason we do centos 6.5 is that everything newer also compares
on volume size, and we don't want to store a huge iso in git.
2018-10-12 17:15:58 -04:00
Cole Robinson
b90b8e3c07 distroinstaller: Remove --cdrom $URL boot.iso fetching
And instead treat any URL passed to --cdrom as a file to
access directly over http. Rationale for dropping this is
laid out here:

https://www.redhat.com/archives/virt-tools-list/2018-May/msg00011.html
2018-10-12 15:54:36 -04:00
Cole Robinson
4f320c2b98 distroinstaller: Remove implied cdrom installs
This is an obscure feature that I'm skeptical anyone is relying on,
and has weirdly subtle semantics that are hard to test.
2018-10-12 15:33:05 -04:00
Cole Robinson
1cd9d0b524 tests: scsi reservation test shouldn't check host /dev/sda
Was failing in our CI
2018-10-11 17:02:45 -04:00
Lin Ma
eb1a67a595 cli: disk: Add options to support SCSI persistent reservation
Create the managed or the unmanaged PR object to enable SCSI persistent
reservation for LUN Passthrough

Signed-off-by: Lin Ma <lma@suse.com>
2018-10-11 16:00:28 -04:00
Cole Robinson
42a96cfd59 virt-install: add --destroy-on-exit
This makes the console window behave like a raw qemu command line:
when the user closes it, the VM is hard powered off.
2018-10-11 15:24:16 -04:00
Cole Robinson
3e55e89453 tests: Add better virt-install console testing 2018-10-11 12:19:48 -04:00
Yossi Ovadia
215d296b61 cli: add --boot rebootTimout
virt-install -n blah -r 1024 --vcpu=1 --disk=/root/vm/blah.qcow2,size=10\
 --network=bridge:br-public --pxe --boot=network,rebootTimeout=3

By default, in case of (first) pxe boot failure the VM will simply
stop trying.
By adding the above, VM will re-try pxe boot. ( useful when DHCP not
replys on first attempt.

Libvirt support it and VM XML will look as follow : ( 'bios rebootTimeout'
will be created under OS section. )

  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.5.0'>hvm</type>
    <boot dev='network'/>
    <bios rebootTimeout='3'/>
  </os>

(crobinso: fix it, add test case)
2018-10-11 11:24:07 -04:00
Cole Robinson
877cbade4a tests: Move OLD_OSINFO check to central place
Other tests may need it in the future
2018-10-04 19:29:41 -04:00
Cole Robinson
469fed08a0 guest: Default to cpu mode=host-model if libvirt is new enough
We check whether host-model is exposed in domcapabilities, which
indicates host-model is using the smarter new safer method in
cooperation with qemu
2018-10-04 14:43:41 -04:00
Cole Robinson
046a242bd4 guest: Use USB3 for x86 qemu if OS supports it
Using new annotations in osinfo-db
2018-10-03 19:02:07 -04:00
Marc-André Lureau
4ad74278ca cli: add memory backing access_mode & source_type
Allow to set some memory backing options, ex:
--memorybacking access_mode=shared,source_type=anonymous

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-10-02 11:12:13 -04:00
Cole Robinson
d389e93586 tests: Fix with latest libosinfo
And add some logic to skip these tests on older libosinfo as well
2018-10-01 11:34:51 -04:00
Cole Robinson
757910a1bb cli: Add --metadata os_name= and os_full_id=
Allows changing the libosinfo metadata for an existing vm via virt-xml
2018-09-30 20:55:32 -04:00
Cole Robinson
87d19ebf36 tests: Add rhel5 and win10 kvm XML tests 2018-09-14 14:37:12 -04:00
Cole Robinson
a741f595ea guest: Drop update_defaults
Fold its one purpose into the UEFI setting bits, fix it and test it
2018-09-13 15:59:27 -04:00
Cole Robinson
2d53f7223d clitest: Test comparison against --os-variant fedora-unknown
Which always maps to the latest Fedora. May help catch accidental
changes
2018-09-12 12:33:16 -04:00
Cole Robinson
5f22f41da4 guest: Absorb capabilities defaults setup
Rather than forcing API users to go through the capabilities APIs.
This lets us simplify things in virt-install quite a bit, and is
needed for smarter machine type defaults
2018-09-06 20:12:49 -04:00
Cole Robinson
256ca7f3fb virt-install: Simplify install method validation a bit
And drop the --pxe --nonetwork collision check, it's near pointless
2018-09-04 14:55:04 -04:00
Cole Robinson
347143982a devices: Add set_defaults for memballon, redirdev, rng, smartcard 2018-09-04 14:55:04 -04:00
Cole Robinson
c3515fa469 guest: Drop multifunction address magic
Seems sufficiently obscure that if someone is manually specifying
addresses we can require them to pass multifunction as well
2018-09-04 14:55:04 -04:00
Cole Robinson
6f301ba0aa tests: clitest: Fix failure when isoinfo not installed
https://ci.centos.org/job/virt-manager-master-check/systems=libvirt-fedora-rawhide/410/display/redirect

support usage cleanup broke self.skip_test
2018-09-04 10:01:20 -04:00
Cole Robinson
967ca4eeda virtinst: Drop direct 'support' usage
Except from connection. This requires some reorg in clitest and
some minor changes in a few other places
2018-08-31 18:31:17 -04:00
Cole Robinson
d8514e19c8 guest: Drop arm vexpress virtio-mmio support
This case will still work, but be a bit slower, which is fine. Nowadays
-M virt is much better for virt usage and nearly everyone is using that,
so save us the complication. This was really only useful when
bootstrapping arm virt support
2018-08-31 17:31:09 -04:00
Cole Robinson
8d45dba43d cli: Add --boot bootloader= 2018-08-22 07:38:34 -04:00
Cole Robinson
f9600ca31b virt-install: Remove smm validation and q35 default setting
The validation is already handled by libvirt, and setting q35 for
smm=on is overkill and just hardcoding some libvirt logic here.
I think the 'secboot' detection in Guest.py is the preferred
magic here, otherwise let users specify all the correct values.
2018-08-21 15:39:27 -04:00
Cole Robinson
eb0f4a612f virt-install: Support armv7l and i686 uefi 2018-08-08 15:14:21 -04:00
Cole Robinson
7a2abb5abf installer: Remove --location nfs support
Removal was discussed here:
https://www.redhat.com/archives/virt-tools-list/2018-May/msg00011.html

Basically I don't think many people use this, the feature is very
inflexible, it's hard to test, and users can essentially do it
themselves with a bit more effort.
2018-06-12 14:07:50 -04:00
Cole Robinson
8e150901f4 clitest: Streamline the string format dict
Remove a bunch of dead entries, open code a bunch of limited usage,
and only use the dict for commonly referenced data
2018-06-12 14:07:50 -04:00
Cole Robinson
d68305eaab tests: utils: Move all URI strings to URIs object
Non-functional change, just makes code org nicer
2018-06-12 14:07:50 -04:00
Cole Robinson
b6cd46b382 virt-install: Add --test-stub-command
Fills in basic install options to make the command succeed. Saves
devs having to type boiler plate options when testing new command
line bits
2018-06-12 14:07:50 -04:00
Marc-André Lureau
fa32aea416 tpm: add TPM emulator backend
An emulated backend doesn't require any path, since libvirt will take
care of finding the emulator and managing the storage. However, the
version to emulate can be specified.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-11 12:40:28 -04:00
Marc-André Lureau
67cb191e82 tpm: add CRB device model
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-11 12:40:28 -04:00
Anya Harter
846e2f711a cli: add --sound codec support
Add codec support to virt-install so that it can accommodate
multiple instances of codec configuration.

The commandline argument:

  --sound codec0.type=micro,codec1.type=duplex,codec2.type=output

maps to the sound XML below:

    <sound model="es1370">
      <codec type="micro"/>
      <codec type="duplex"/>
      <codec type="output"/>
    </sound>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-11 12:23:14 -04:00
Anya Harter
02635d3358 cli: Add --disk geometry attribute options
Attribute options are:
    - geometry.cyls=W
    - geometry.heads=X
    - geometry.secs=Y
    - geometry.trans=Z

This maps to disk XML like:

    <disk>
      <geometry cyls='W' heads='X' secs='Y' trans='Z'/>
    </disk>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-11 12:02:11 -04:00
Anya Harter
89c389e45a cli: Add --disk driver.copy_on_read=on option
This maps to disk XML like:

    <disk>
      <driver copy_on_read='on'/>
    </disk>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-11 12:00:56 -04:00
Cole Robinson
b85a2a9eb8 virt-install: Drop --import and --nodisks collision
It doesn't work with '--disk none' and it's not very useful anyways
2018-06-07 10:56:47 -04:00
Anya Harter
8bde479112 cli: Add --network mtu.size=X option
This maps to interface XML like:

    <interface>
      <mtu size='X'/>
    </interface>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-06 10:44:03 -04:00
Stefan Weil
633534c8b8 Fix some typos in comments and documentation (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-05 14:27:29 -04:00
Cole Robinson
39a7cbbad7 domain.numatune: Drop cpuset validation
This type of validation should really be done at the libvirt level,
particularly for a non-mandatory feature like cpuset. Otherwise
it's just more code for us to test which will rarely be hit by users
2018-06-05 14:27:29 -04:00
Cole Robinson
a33ac92040 cli: Fix --boot smbios_mode=sysinfo (bz 1570549)
Not sure how this was expected to work, just make it do the simple
thing and set the value in the XML. Add a test case for it
2018-04-24 12:32:18 -04:00
Daniel P. Berrangé
48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson
b17c7565e2 tests: clitest: test virt-xml --update on inactive VM 2018-04-03 12:43:14 -04:00
Cole Robinson
5aedc0aff7 urldetect: Drop GenericDistro, non-treeinfo redhat bits
non-treeinfo redhat only applies to pre RHEL5.4 and very old
Fedora. It's not worth it anymore to slow down all URL lookups
and maintain code complexity to handle such long out of date
distros.

GenericDistro doesn't actually apply to any public trees that I
can find, except for some with TreeInfo. So turn it into
GenericTreeinfoDistro. If random URL trees want to work with
virt-install, add a treeinfo file
2018-03-29 16:23:57 -04:00
Cole Robinson
3b88bfb1ee cli: Drop clear_attr property
It slightly complicates the generic machinery, and the one usage we
can handle directly
2018-03-21 11:17:36 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Radostin Stoyanov
1ae5c4ff75 pylint: Resolve logging-not-lazy
A new Python checker was added to warn about using a + operator inside
call of logging methods when one of the operands is a literal string.

https://pylint.readthedocs.io/en/latest/whatsnew/1.8.html

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:12 -05:00
Cole Robinson
8371a681b1 tests: Remove some redundant clitests
- Consolidate tests if they don't add coverage
- Remove some categories that aren't really required
2018-02-22 18:26:50 -05:00
Marc-André Lureau
0a62ae0b7a virtinst: add <vmcoreinfo/> feature
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-02-22 16:23:40 -05:00
Cole Robinson
6954c6774a tests: Fix running testsuite on older libvirt
If we try to run the testsuite on anything older than libvirt 3.1,
it immediately throws an exception before processing any tests,
due to choking on parsing drm bits from testdriver.xml. This global
failure is only due to sloppy coding though.

Turn all test cases that use testdriver.xml into skips in this case,
so we can at least get some test coverage otherwise.
2018-02-22 16:01:24 -05:00
Cole Robinson
62fecb09d3 tests: Create a smaller testsuite.xml
Right now, most test cases will create a libvirt test driver using
tests/testdriver.xml. This is problematic for 2 reasons:

1) testdriver.xml is 3500 lines of XML, and it's parsed hundreds of
   times. Opening it is responsible for about 25% of test suite time
2) Older libvirt chokes on testdriver.xml, meaning the test suite will
   be useless there. This is a recurring problem as new features are
   added to testdriver.xml

Most test cases don't actually need all the test state in testdriver.xml
though. So this creates a smaller testsuite.xml which has a lower
libvirt requirement and is much quicker to parse. New XML bits should
continue to go into testdriver.xml so we can keep testsuite.xml as
the more stripped down option.
2018-02-22 15:44:06 -05:00
Cole Robinson
8917305a6e Don't use count() for substring checking
Use the idiomatic 'X in Y'
2018-02-14 11:08:09 -05:00
Cole Robinson
3086c7fda9 Drop python3 compat imports
We are going completely python3
2018-02-06 18:56:15 -05:00
Radostin Stoyanov
81d68e6100 Use StringIO instad of BytesIO in Py 3
The print function in Python will convert printed arguments to text
strings [1] and thus print() cannot be used with binary mode file
objects.

In Python 2 the write() method of BytesIO() takes as input *bytes* object
which refers to *str* in Python 3. [2] The write() method of StringIO()
takes *unicode* object. [3] Therefore, StringIO() object cannot be used with
the print() function.

In Python 3 the write() method of BytesIO() takes a *bytes* object (not
*str*). [4] Therefore, the BytesIO() obj cannot be used with print().
However, the write() method of StringIO() in Python 3 takes a *str* as
input.[5]

Example of the issue:

    from __future__ import print_function
    import io

    a = io.BytesIO()
    b = io.StringIO()

    print("test", file=a)  <- Fails for Python 3
    print("test", file=b)  <- Fails for Python 2

    a.write('%s\n' % "test")  <- Fails for Python 3
    b.write('%s\n' % "test")  <- Fails for Python 2

[1] https://docs.python.org/3.5/library/functions.html#print
[2] https://docs.python.org/2/library/io.html#io.BufferedWriter.write
[3] https://docs.python.org/2/library/io.html#io.TextIOBase.write
[4] https://docs.python.org/3/library/io.html#io.BufferedWriter.write
[5] https://docs.python.org/3/library/io.html#io.TextIOBase.write
2018-02-06 18:49:17 -05:00
Wim ten Have
708516c39e virtinst: add vcpupin support
Add vcpupin support to virt-install so that it can create guest
domains with statically allocated vcpu pinning towards a given cpuset.

Syntax: to pin vcpu=0 to cpuset="1,3" and vcpu=1 to cpuset=2

  --cputune vcpupin0.vcpu=0,vcpupin0.cpuset=1,3,vcpupin1.vcpu=1,vcpupin1.cpuset=2

generates below XML description for the guest domain.

  <cputune>
    <vcpupin vcpu="0" cpuset="1,3"/>
    <vcpupin vcpu="1" cpuset="2"/>
  </cputune>

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
2018-02-06 10:21:56 -05:00
Menno Lageman
ae5239358a virtinst: Add NUMA distance support
Now that libvirt has support for administration of distances between NUMA cells
it would be nice to be able to set those with virt-install directly instead of
having to 'virsh edit' the domain XML manually after installation.

For example

--cpu cell0.memory=1234,cell0.cpus=0-3,cell1.memory=5678,cell1.cpus=4-7,\
      cell0.distances.sibling0.id=0,cell0.distances.sibling0.value=10,\
      cell0.distances.sibling1.id=1,cell0.distances.sibling1.value=21,\
      cell1.distances.sibling0.id=0,cell1.distances.sibling0.value=21,\
      cell1.distances.sibling1.id=1,cell1.distances.sibling1.value=10

would generate the following XML:

     <cpu>
       <numa>
         <cell cpus="0-3" memory="1234">
           <distances>
             <sibling id="0" value="10"/>
             <sibling id="1" value="21"/>
           </distances>
         </cell>
         <cell cpus="4-7" memory="5678">
           <distances>
             <sibling id="0" value="21"/>
             <sibling id="1" value="10"/>
           </distances>
         </cell>
       </numa>
     </cpu>

Signed-off-by: Menno Lageman <menno.lageman@oracle.com>

(crobinso: rework cli format, drop some validation, drop man changes)
2018-01-30 11:19:54 -05:00
Cole Robinson
044d93d471 tests: Rework how we pass command line objects down to test data 2018-01-08 17:05:55 -05:00
Cole Robinson
0198db6d3f tests: cli: Skip iso test if isoinfo isn't installed 2018-01-06 15:08:23 -05:00
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
Cole Robinson
19b4cf026e cli: Support --cpu cellX.id (and cpus, and memory)
This allows configuring <cpu><numa><cell> bits via the command line.
This uses the optional numbering scheme described in the previous
commit.
2016-06-14 19:07:55 -04:00
Cole Robinson
b785f3f594 cli: Support --disk seclabelX.model (and relabel, and label)
This adds support for setting VirtualDisk <seclabel> XML. This
invents a new command line scheme for cases like this where there
are possibly multiple child elements that we want to specify
on the command line. So if you just want to specify one <seclabel>
block, you can do the expected

  --disk ...,seclabel.model=dac,relabel=no

However if you want to specify 2 <seclabel> blocks you need to do:

  --disk ...,seclabel0.model=dac,seclabel0.relabel=no,seclabel1.model=selinux,seclabel1.relabel=no
2016-06-14 19:05:30 -04:00
Cole Robinson
7ec97400a5 cli: Only instantiate VirtCLIArguments at parse time
We register the VirtCLIArgument classes with the static parse
instructions, but instantiate it with the actual key=val pair
from the command line. This fixes some layering violations, and
gives callers access to the actual command line key that we
are parsing, if that's interesting.
2016-06-14 16:26:56 -04:00
Cole Robinson
14fd99255b cli: add --graphics listen=socket support
This is the new style socket support, where we request libvirt to
allocate a socket path for us. Plus this is the only way to enable
socket support for type=spice
2016-06-11 16:56:41 -04:00
Cole Robinson
4c0b761cfb virtinst: graphics: Add listen=none support
Not strictly needed for spice, but now available for vnc if
people want it
2016-06-11 16:48:34 -04:00
Cole Robinson
2b34831b26 cli: Add device address.type/address.bus/... options
This exposes every device <address> option, for each device
cli option. So --disk, --network, --video, etc.

Fill out a few more address XML bits as well
2016-06-11 16:10:31 -04:00
Cole Robinson
927990ad9d tests: clitest: Allow --only matching on output filename
So you can do "python setup.py --only many-devices' to only run the
clitest compare tests that output their results to files with
"many-devices" in the name
2016-06-11 15:58:48 -04:00
Pavel Hrdina
df1c3e74aa virt-install: add a new guest feature GIC for ARM guests
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1334857

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-11 18:41:31 +02: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
Chen Hanxiao
70299a32c5 test: Fix tests with latest libvirt
libvirt commit
b33c14b342e5c2abeeee91c852ef2032327cb355
introduce this.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>

(crobinso: add proper compare_check annotations to clitest to skip
 changed tests on older libvirt)
2016-06-07 10:31:04 -04:00
Cole Robinson
443b64b64d tests: Add some spice gl related virt-xml tests 2016-05-20 14:51:31 -04:00
Marc-André Lureau
8aead7619c virtinst: add listen=none graphics option
Add a special listen value to disable any extra display server listening
socket. This is necessary now that qemu prevents starting a spice+virgl
VM with listening sockets (until spice allows remoting with virgl).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-05-20 14:51:31 -04:00
Cole Robinson
4a076232b6 cli: Expose --video heads, ram, vram, vgamem, accel3d 2016-05-20 11:44:18 -04:00
Cole Robinson
694d5bb9ce support: Drop some explicit checks only used in clitest.py
Since we have support for using libvirt version numbers directly, there
isn't much use in tracking symbolic names in support.py anymore
2016-04-09 09:24:08 -04:00
Cole Robinson
e669e67b40 tests: Adapt for new video primary= output in libvirt 1.3.3 2016-04-09 09:17:01 -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
Marc-André Lureau
f912f28e97 virtinst: add --graphics gl option
Add a --graphics option to enable accelarated rendering using
OpenGl. This is used only by Spice (and for local only guests atm).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-09 20:25:37 -05:00
Cole Robinson
7f3ddf3818 Fix some pep8 warnings 2016-02-15 12:55:45 -05:00
Cole Robinson
2c0157ca9e clitest: Skip updated tests on older libvirt 2016-01-29 15:32:31 -05:00
Cole Robinson
67dcfb9534 tests: Allow skipping tests based on libvirt version
Rather than requiring a new SUPPORT value to be added. Use this to fix
a test failure on f21:

https://ci.centos.org/view/libvirt-project/job/virt-manager-test/systems=libvirt-fedora-21/871/console
2016-01-26 20:08:31 -05:00
Cole Robinson
7f7ff0c344 cli: add --network rom_bar and --network rom_file 2016-01-20 10:53:23 -05:00
Cole Robinson
75dbf5699e tests: Make many-devices dependent on newer libvirt
Libvirt started to put type='raw' by default for rbd volumes, which
changes our generated XML. Limit the test to only libvirt that supports
that check.
2016-01-15 11:44:28 -05:00
Cole Robinson
6d3b5e2838 cli: Have '--input tablet' default to bus=usb (bz 1232087)
Make the default a little smarter in other ways too
2015-11-21 20:26:50 -05:00
Cole Robinson
0d095e22f7 cli: Have --vcpu cpuset=auto use placement=auto
For many years virt-install has supported a bit of logic that maps
--cpuset=auto to a CPU pinning based on host NUMA topology; we look
for a NUMA node who's current free memory is closest to the requested
memory allocation. This isn't very useful though, since it's a one time
allocation, the conditions at VM creation time likely aren't the
conditions of the machine in the future.

Libvirt has supported a smarter option in vcpu placement=auto for a long
while, which will perform a similar operation but at every VM startup.

Convert cpuset=auto to use this functionality instead.
2015-11-18 15:00:54 -05:00
Cole Robinson
492c9c4f28 cli: Add --vcpu placement=static|auto option 2015-11-18 15:00:42 -05:00
Cole Robinson
e9d5347395 cli: Support --network link_state=up|down 2015-11-18 13:59:15 -05:00
Kevin Zhao
07e22c926a Add a watchdog model diag288, listed in the watchdog model list.
Since the qemu 2.4 has supported the watchdog device diag288
for s390x,so add it in the optional model list. Also modefied
the clitest xml to cover this change.
2015-11-10 16:14:17 -05:00
Kevin Zhao
79d02e356b Add a capatilities-xml for s390x, and add a clitest for it.
Add a capatilities xml file for s390x ,the capatility for IBM
Distro called KVMIBM,mainly focus on a KVM hypervious on S390x.
Also add a clitest by using virt-install.
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
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
65aba92797 virt-install: Add --feature pmu=on|off 2015-09-28 17:12:42 -04:00
Cole Robinson
7c10d8a27f devicedisk: Tweak driver defaults for xen
Following some discussion here:

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

jfehlig suggested better defaults for modern xen. End result is:

- Drop the blktap check, since it's deprecated (yaay)
- If xen + block device, use driver_name=phy
- Otherwise if on modern enough libvirt + libxl, do the same thing we
  do for qemu.
2015-09-23 17:26:48 -04:00
Cole Robinson
29745a9f75 clitest: Do a basic xen-pv install test 2015-09-22 12:41:57 -04:00
Cole Robinson
85307b9bd2 devicefilesystem: Default to accessmode=mapped for qemu
libvirt qemu default's to accessmode=passthrough, which really only
works correctly when qemu is run as root, which isn't common for libvirt
nowadays. So use accessmode=mapped which has a better chance of working
2015-09-20 20:33:46 -04:00
Cole Robinson
6a9f0089b9 devicefilesystem: Rename mode->accessmode
To reflect the name in the XML
2015-09-20 20:16:21 -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
7786c4b35b xmlbuilder: Make clear() work for child objects
So we can call clear() on a Guest owned VirtualDisk, and it actually
does the correct thing. This allows us to enable clearxml= cli option
for most devices.
2015-09-05 13:16:35 -04:00
Daniel P. Berrange
d6ea493d1b virtinst: support virtual port parameters for non-802.1Qbg NICs
Previous commit added support for virtual port profiles
on NICs, but only defined the attributes needed by the
802.1Qbg NIC type.

  commit 34e2ca8389
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Fri Jan 31 16:51:02 2014 -0500

    cli: --network: Wire up virtualport options

This commit adds the profileid and interfaceid parameters
needed by 801.Qbh, openvswitch and midonet

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-08-28 12:40:18 +01:00
Cole Robinson
6279c3a3d8 tests: Add clitest for USB duplicate checking 2015-08-10 15:01:03 -04:00
Cole Robinson
82ea5bfc62 tests: Add qemu:///session unit tests 2015-08-10 12:46:47 -04:00
Pavel Hrdina
aebebbf879 virt-install: report an error for pxe install without network
Fix a regression where we used to report an error message if user
specified pxe installation without any network (--nonetworks or
--network none).

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-08-06 14:56:30 +02: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
b82b739d5a tests: Fix output to work the same with libvirt <console> change
See this thread for the original patches:

https://www.redhat.com/archives/virt-tools-list/2015-June/msg00091.html

But this fix is nicer since it will work before those libvirt changes as
well.
2015-06-08 17:41:16 -04:00
Cole Robinson
2d572e02bd tests: Fix tests on F22 libvirt 2015-05-20 14:00:15 -04:00
Marc-André Lureau
e2184ea2cf tests: add some vmport tests
Message-Id: <1428012248-5767-6-git-send-email-marcandre.lureau@gmail.com>
2015-05-04 12:40:14 -04:00
Cole Robinson
fa08d0ada5 clitest: Fix tests on F21 2015-05-02 16:41:21 -04:00
Cole Robinson
bbb048cbd0 clitest: Add KVM tests for aarch64, armv7, ppc64le 2015-04-22 20:28:47 -04:00
Cole Robinson
6fd3983f6d tests: Clean up capabilities test data
Make it clear which ones are used for the caps unit tests, and which
are for cli/UI testing and can be updated at will. And drop a bunch
of outdated stuff.
2015-04-22 19:05:06 -04:00
Cole Robinson
8a3e3391c8 clitest: Drop explicit fake.iso filename
Just use one of the other files we stub out
2015-04-22 18:00:00 -04:00
Cole Robinson
d4bf3b58a0 clitest: Drop prompttest infrastructure
Just fake it for the one remaining test
2015-04-22 18:00:00 -04:00
Cole Robinson
ccc0da3e51 tests: Add specific VM for virtxml tests
Decouple it from test-many-devices which is really about manual testing
of virt-manager UI. It's annoying that every time test-many-devices is
extended we need to regenerate all the virtxml tests.
2015-04-21 19:50:41 -04:00
Cole Robinson
93f826a8b2 cli: Replace add --check option (bz 1063471)
For fine grained enabling/disabling validation checks. Use this to
replace the heavy handed --force option.
2015-04-11 19:48:35 -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
20d37422fe virt-install: Fill in a bunch of --graphics spice options (bz 1110017) 2015-04-11 16:56:27 -04:00
Cole Robinson
9a789c19e2 virt-install: Support --hostdev scsi passthrough (bz 1054912)
Pass it a type=scsi nodedev name, and we will set things up correctly.
2015-04-11 15:55:09 -04:00
Cole Robinson
527c49dec2 virt-install: Add --input option
For configuring VM <input> devices
2015-04-09 13:22:40 -04:00
Cole Robinson
a5d03fdf6e guest: Don't unconditionally overwrite on_poweroff/on_crash 2015-04-07 19:53:15 -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
3a36d95da0 details: Explicitly label virtio scsi disks + controllers 2015-04-04 20:06:40 -04:00
Cole Robinson
3d6831ec8f virt-install: Deprecate --print-step, just use --print-xml
argparse lets us handle this in a back compat fashion, so let's simplify
the CLI.
2015-04-04 17:10:45 -04:00
Cole Robinson
d0c65b30a4 osdict: Simplify a bunch of the checks, drop some legacy stuff 2015-04-04 15:32:35 -04:00
Cole Robinson
cfe9e7dc7e virt-install: Make '--cpu none' work with aarch64 2015-03-23 17:46:09 -04:00
Cole Robinson
c7c772b200 virt-install: Default to --boot uefi
Try to use --boot uefi if the user hasn't already specified loader params,
or a kernel to boot. If we can't determine a UEFI setup, just print a
warning.
2015-02-22 10:25:51 -05:00
Cole Robinson
a04307cd70 virt-install: Add --boot uefi
Will enable UEFI if we know libvirt + hypervisor support it, and libvirt
is advertising a suitable UEFI binary.
2015-02-22 10:25:47 -05:00
Anatoly Belikov
e44b95149b devicedisk: fix source name attribute for gluster volumes
(crobinso: Small code tweak, and add test cases)
2015-01-29 11:31:43 -05:00
Giuseppe Scrivano
dc169c1406 tests: check that HYPER-V is not enabled on win7 guest with UEFI
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-27 20:52:06 +01:00
Cole Robinson
5018233f63 tests: Test --channel none 2015-01-09 10:52:59 -05:00
Chen Hanxiao
5d0c68cc0c clitest: replace DIR from current pwd to '/var'
Introduced by f16dc4dd34
This will cause test case failure on different machines.
Use '/var' to replace it.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-12-12 10:05:40 +08:00
Cole Robinson
9ae3dbe05b virt-install: Fix --disk pool=NETPOOL,size=... creation 2014-12-10 13:22:42 -05:00
Cole Robinson
e1ab165b1a cli: Don't try to create storage with source_pool + size 2014-12-10 13:22:42 -05:00
Cole Robinson
f16dc4dd34 tests: clitest: Lots of house cleaning
Drop redundant tests, organize things better, add more tests where we
can stick new cli device options and view the output, since that's the
most common extension.
2014-12-10 13:22:42 -05:00
Cole Robinson
464ebabc5a virt-install: Wire up --disk vol= for network volumes
This involves convering pool/vol XML to disk source bits
2014-12-09 18:23:22 -05:00
Cole Robinson
838d7f015c tests: Drop a bunch of redundant xmlconfig tests
These are mostly covered by clitests. Keep the important ones around
for code coverage.
2014-12-09 13:19:56 -05:00
Cole Robinson
9952764dda virt-install: Make --disk $URL 'just work'
If VirtualDisk.path is set to a URL, parse it and fill in all the
source_* values automagically.
2014-12-09 10:45:26 -05:00
Cole Robinson
81009caa54 tests: clitest: Drop explict readonly file testing
This was originally to hit certain code paths in virtinst that are long
gone, and was causing issues for running the test suite in certain
situations:

http://www.redhat.com/archives/virt-tools-list/2014-December/msg00010.html
2014-12-09 07:13:27 -05:00
Cole Robinson
cd305da3f8 virt-install: support network --disk's
Handle type=network in devicedisk.py, and wire up all the network fields
for virt-install --disk. Right now it requires manually spelling out
all the protocol, name, host/port etc fields.

The one 'magic' bit is that VirtualDisk.path will be a pretty URL when
all those network fields are specified. This is keeps things mostly
working in various parts of the code where we expect 'path' to be an
identifier for a VirtualDisk.
2014-12-06 21:00:51 -05:00
Cole Robinson
86682c8c54 virt-install: Support --disk source_pool,source_volume
For setting type=volume disks. This requires some reworking of
devicedisk bits
2014-12-06 17:14:16 -05:00
Cole Robinson
7b8e850bc0 clitest: Sanitize diff output some more 2014-12-06 16:32:10 -05:00
Cole Robinson
2acbf52ce3 cli: If creating storage, always build vol_install
This is the start of moving this logic out of devicedisk
2014-12-05 20:00:11 -05:00
Cole Robinson
0389ab23a7 diskbackend: Remove backing by pool object
It just muddles things up for a minor edge case. The autopoolify logic
should catch all practical cases we care about.
2014-12-04 19:45:00 -05:00
Cole Robinson
e992cc15b2 virt-xml: Disable clearxml= for devices
It doesn't work in the general case, and users can just --remove and
--add devices as needed for the same effect
2014-12-04 15:28:14 -05:00
Cole Robinson
899bff4c4d tests: Quiet things with non-latest libvirt 2014-12-04 13:04:02 -05:00
Cole Robinson
26828b52cc guest: Use virtio-scsi for arm machvirt CDROM
Since it's the only option we have to actually use the CDROM
2014-11-20 11:27:09 -05:00
Martin Kletzander
339ead9f70 tests: fix failure on 32-bit machines
clitest.py used the value 100000000000 (100 PB) for memory size, which
was parsed as 0 by older libvirt.  Latest release (1.2.10) has the
parsing fixed and properly reports an error on overflow.  Changing the
memory size to 4000000 (4 TB) is still an overcommit, at least most
development machines and it works properly.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-11-05 09:00:58 +01:00
Cole Robinson
c4162f6708 Use -M virt as default machine for arm/aarch64
Centralize the default machine logic in caps and use it consistently
2014-09-23 16:05:48 -04:00
Cole Robinson
92db9bd4dd tests: Add some more arm tests
Many are broken for now, but they will help validate we are setting
the correct defaults with subsequent patches.
2014-09-23 15:08:47 -04:00
Cole Robinson
4c4bdbb8b8 cli: Allow embedding comma in kernel_args
And fix can_comma for aliases
2014-09-23 14:14:21 -04:00
Cole Robinson
30db9ece22 osdict: Add qemu-ga for RHEL6 and RHEL7 guests (bz 1139109) 2014-09-22 17:33:55 -04:00
Cole Robinson
eda5eea549 virt-install: Switch --cpu host to use host-model, not copy (bz 1133155)
host-model offers us other protections now, like ensuring we don't try
to use a host cpu feature that qemu doesn't support.

http://bugzilla.redhat.com/show_bug.cgi?id=1133155
2014-09-20 20:44:13 -04:00
Cole Robinson
64106230bd virt-install: Add hidden option --test-media-detection
Can help with debugging and test cases
2014-09-20 20:32:19 -04:00
Cole Robinson
d7e1a40352 virt-install: Deprecate --nodisks in favor of --disk none 2014-09-20 19:16:13 -04:00
Cole Robinson
57ae284ad4 virt-install: Deprecate --nonetworks in favor of --network none
Follows the pattern used by the other cli options
2014-09-20 19:02:38 -04:00
Cole Robinson
6a8194ebc7 docs: Document virtio-scsi better, and add explicit test cases for it 2014-09-20 15:03:19 -04:00
Cole Robinson
5130d959e5 cli: Advertise the --host-device option as --hostdev
It annoys me that all the other CLI options map to the libvirt XML name,
except this one. Of course, keep the old option around for back compat,
just give precendence to the new option.
2014-09-20 14:29:34 -04:00
Cole Robinson
c88d085d03 virt-xml: Make --remove-device --host-device <str> work
Need to add some infrastructure for arbitrary lookup functions
2014-09-20 14:22:29 -04:00
Chen Hanxiao
30c3434916 test: update compare_check flags for auto-clone cases
auto-clone cases use SUPPORT_CONN_BARE_BACKINGSTORE,
which check libvirt 1.2.4.
Change it to SUPPORT_CONN_LOADER_ROM(1.2.9)
and drop SUPPORT_CONN_BARE_BACKINGSTORE.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-09-16 10:03:27 +08:00
Chen Hanxiao
4a83ea3a83 test: skip unit tests affected by loader extention before libvirt 1.2.9
libvirt commit for 1.2.9
68bf13dbef8342eaee0bf57c73cebb60b7de11e8
conf: Extend <loader/> and introduce <nvram/>

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-09-16 10:02:57 +08:00
Cole Robinson
5aafe008bc Remove virt-image, as scheduled
As promised with the last release, remove virt-image. In 6 months I didn't
hear a peep from any actual users that cared.
2014-09-06 18:05:43 -04:00
Cole Robinson
7d25dbe7a3 osdict: Always use vmvga for ubuntu
There's been a couple reports recently that virt-manager's default of video
model=qxl doesn't work well with latest ubuntu 14.04:

https://bugzilla.redhat.com/show_bug.cgi?id=1129803
https://lists.fedoraproject.org/pipermail/virt/2014-August/004105.html

However vmvga works, so let's use it for all ubuntu versions and not just a
couple of them. Marc Deslauriers confirmed it should be safe.
2014-09-06 13:45:15 -04:00
Chen Hanxiao
cff8e32c55 virt-install: support setting hugepages/page/[@size, @unit, @nodeset] for memorybacking
libvirt commit
136ad49740f017aabcac48d02d2df6ab7b0195e9
introduce ./hugepages/page/[@size, @unit, @nodeset]
for memory backing.
This patch will add support in virt-install.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-07-30 14:34:03 +08:00
Chen Hanxiao
d1b0fade1d virt-install: add --resource support
This patch will enable setting
resource partition configuration.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-04 10:08:05 +08:00
Cole Robinson
42fe235cbf virt-install: Add --network portgroup= option 2014-05-31 14:30:07 -04:00
Chen Hanxiao
3c45262526 virt-install: add --events support
This patch will enable setting event configuration:
on_poweroff, on_reboot and on_crash.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-05-29 09:46:24 +08:00
Cole Robinson
f397d96ca6 virt-install: Don't require install option with --print-xml (bz 1095789) 2014-05-11 19:19:00 -04:00
Cole Robinson
ea89dfb53f tests: Don't fail on non-latest libvirt 2014-05-11 19:11:45 -04:00
Cole Robinson
196ff823b3 Fix warnings with latest pep8 2014-05-02 10:20:59 -04:00
Jim Minter
764063dfe9 virt-install --disk discard= support
(crobinso: Remove default overriding, add test cases)
2014-04-29 10:38:30 -04:00
Cole Robinson
9050998028 cli: Rename --membacking to --memorybacking
More consistent with the existing --memory option, and the
XML block name.
2014-03-22 12:28:23 -04:00
Chen Hanxiao
7096c3708e virt-install: Add --membacking option
Add option --membacking for "Memory Backing".

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-22 12:16:24 -04:00
Chen Hanxiao
58a07d04fb remove memoryBacking parameters from --memory
Remove some "Memory Backing" parameters from --memory,
and keep 'hugepages' for backward compatibility.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-22 12:16:24 -04:00
Chen Hanxiao
008feeb09a Add more parameters for memoryBacking
Add support for parameters nosharepages and locked
if using option --memory.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-14 21:23:23 +08:00
Chen Hanxiao
40c1f5fdb8 clitest: put fake iso under /tmp dir
commit 797afb3b27
bring a dir depending issue when using
fake iso.
Test output will be undecided when virt-manager source
in different dirs.

This patch will touch a fake iso under /tmp,
so test case will pass on most of the machines.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-07 09:06:27 +01:00
Cole Robinson
797afb3b27 virt-install: Fix --location iso again, and test it (bz 1071513) 2014-03-06 12:46:46 -05:00
Cole Robinson
a2ab8a2643 tests: 'skip' a test if compare check fails
And make latest tests dependent on libvirt.git version
2014-02-25 15:05:58 -05:00
Chen Hanxiao
a48f75078d virt-install: Add --memtune option
This patch provides the ability to
tune memroy tunable parameters for the domain.
Also add test cases for --memtune option
and update man page.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-24 21:02:31 -05:00
Cole Robinson
21fb072d4a virt-install: Default to qcow2 for new images
Following along with virt-manager's change. It has all the features and
good enough performace, and is easy enough to override for people that
care.
2014-02-10 18:47:58 -05:00
Cole Robinson
cdd9dbe7fc cli: Add simple mode --disk size=X
Works the same as pool=default, we generate a disk image path and
create it in the default pool.
2014-02-10 18:34:44 -05:00
Cole Robinson
82754ddc84 Expose hostdev rombar in UI and cli (bz 768857) 2014-02-10 14:25:23 -05:00
Cole Robinson
719f23a273 cli: Support per-device <boot order=> 2014-02-09 14:07:27 -05:00
Chen Hanxiao
fcac052cdc virt-install: add support for user namespace
This patch will enable configuring idmap.
It could be used as enable user namespace
for LXC containers.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-09 13:16:34 -05:00
Cole Robinson
98ea4cdad2 Reduce test suites clear_cache calls 2014-02-08 19:28:56 -05:00
Cole Robinson
c5f6c6852a VirtualDisk: Always use storage APIs for provisioning
This means if we are passed an unmanaged path, we try to create a
storage pool for the parent directory.

We skip directories like /dev where doing this might be problematic.

This makes things much friendlier to use for remote connections, and
means we can always rely on having libvirt's storage APIs to use
for format probing.
2014-02-08 19:24:14 -05:00
Cole Robinson
0b4a72fd77 virt-convert: Reimplement it
We totally break CLI compat here, but the previous tool wasn't sustainable.
Instead, repurpose the tool as strictly converting external formats
like ovf/vmx to native libvirt XML, and launch the guest.

So we drop vmx/virt-image output, and virt-image input, and a slew of
command line options. I don't think anyone was depending on this in a
scripted fashion, so in practice I don't think anyone will care.

Add much more comprehensive unit tests while we are at it.
2014-02-07 21:16:09 -05:00
Chen Hanxiao
5a097183a9 test: add more test cases for option --blkiotune
Add additional test cases for option --blkiotune.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-07 23:12:54 +08:00
Giuseppe Scrivano
499cb63f65 doc: remove reference to SDL from virt-install man page
Adjust some tests to not use --graphics sdl.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-02-06 16:20:12 +01:00
Chen Hanxiao
3be9dd3eb3 virt-install: Add --blkiotune option
This patch provides the ability to
tune Blkio cgroup tunable parameters for the domain.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-06 22:41:00 +08:00
Cole Robinson
dff14ea12b tests: Use consistent predictable URIs 2014-02-05 19:02:42 -05:00
Cole Robinson
f5c32063e4 wip 2014-02-05 14:09:05 -05:00
Cole Robinson
7a825d9a28 virt-install: Add usbredir channels by default if using spice
Can be disabled with --redirdev none
2014-02-05 13:07:01 -05:00
Cole Robinson
f635187bb8 virt-install: If using spice graphics, add <sound> by default
Can be disabled with --sound none
2014-02-05 12:51:27 -05:00
Cole Robinson
e70ab961f9 virt-install: Switch back to using --sound argument
Since argparse allows optional arguments, we can back compat handle the
original boolean --sound option. This is nicer than using an option
named --soundhw
2014-02-05 12:41:34 -05:00
Cole Robinson
4e4fb15a2f virt-*: Drop all --prompt handling
This stuff is not very helpful and a pain to maintain. Let's drop it once
and for all. We still accept the CLI options and log a warning so people
hopefully take the hint.
2014-02-04 17:01:27 -05:00
Cole Robinson
0654784643 virt-install: Add --pm option 2014-02-03 11:11:38 -05:00
Cole Robinson
4fbee9aa41 cli: Make --cpu host-model and --cpu host-passthrough work 2014-02-03 11:11:38 -05:00
Cole Robinson
66d9cdbe22 tests: Strip beginning lines from diff output to not conflict so much 2014-02-02 13:44:20 -05:00
Cole Robinson
bce8ee942d Fix some pylint 2014-02-01 19:47:31 -05:00
Cole Robinson
6638587077 clitest: Don't needlessly deviate default_bridge from test infra 2014-02-01 14:19:37 -05:00
Cole Robinson
184fe3fdb1 clitest: Make it easier to filter prompt tests 2014-02-01 14:17:03 -05:00
Cole Robinson
24c1c5a2bd cli: --network: Support driver_queues option 2014-02-01 07:48:04 -05:00
Cole Robinson
34e2ca8389 cli: --network: Wire up virtualport options 2014-01-31 16:51:02 -05:00