Commit Graph

67 Commits

Author SHA1 Message Date
Shalini Chellathurai Saroja
965480e8bc virt-install: add mediated device
Add support to install a virtual server with passed-through mediated
device. Mediated device can be created using vGPU attached to
vfio_pci driver or DASD attached to vfio_ccw driver or APQNs attached
to vfio_ap driver.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
2021-05-18 18:36:03 -04:00
Cole Robinson
12517e0a28 tests: Fix --sound audio.id test
libvirt validates this, but we don't support <audio> devices yet,
so find another way

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-04-06 17:06:41 -04:00
Jonathan Schwender
f9a0c3ccb2 cli: --cputune: add vcpusched[0-9]* config
This adds the following suboptions to configure <cputune>:

- vcpusched.vcpus
- vcpusched.scheduler
- vcpusched.priority

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2021-02-16 16:37:15 -05:00
Cole Robinson
d304a9b205 tests: More bhyve UEFI testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-02-15 13:39:16 -05:00
Roman Bogorodskiy
6c7080a39b virtinst: bhyve: properly configure loader
Bhyve requires explicit loader configuration. So query
domain capabilities, try to find the "official"
firmware and configure all the necessary loader options.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2021-02-15 13:27:48 -05:00
Roman Bogorodskiy
2d254f2815 tests: cli: start testing bhyve
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2021-02-15 13:27:48 -05:00
Cole Robinson
db44332791 tests: Fix virt-xml test case
This would have caught the bug Roman just fixed

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-02-10 10:27:35 -05:00
Cole Robinson
56cb813d42 cli: Add --tpm persistent_state=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:54:54 -05:00
Cole Robinson
2862f1be98 cli: Add --memballoon freePageReporting=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:49:55 -05:00
Cole Robinson
5c1ace02c9 cli: Add --sound audio.id=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:48:09 -05:00
Cole Robinson
d3517ded62 cli: Add --filesystem fmode, dmode
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:46:47 -05:00
Cole Robinson
41eda8a431 tests: Remove now redundant LANG overrides
We added a central one in the previous commit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-12-07 14:32:27 -05:00
Igor Ryzhov
ac9316cce1 virtinst: add support for controller target subelement
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-21 14:47:22 -05:00
Cole Robinson
4cfb3aeff1 cloner: more detailed error messages about supported network vols
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson
1a1e4580c0 cloner: Explicitly reject 'network' disks we don't know how to clone
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-03 13:03:03 -05:00
Cole Robinson
fa322588b4 tests: Drop most unittest usage from virtinst tests
Kill usage of the TestCase class, move more to pytest standard
style

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:46 -04:00
Cole Robinson
b79ee9565f tests: Rename test_xmlconfig.py to test_misc.py
That's what it is now, just a collection of misc virtinst tests

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:33 -04:00
Cole Robinson
0ac9ff3488 tests: Drop a bunch of redundant xmlparse/xmlconfig tests
For the few bits we are hitting specific code paths, break them
out or fold them into other test cases

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:08 -04:00
Cole Robinson
1b93c17564 cli: Add --controller vectors=X
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:45:07 -04:00
Pino Toscano
76593f8a08 virtinst: use fail_conflicting
Make use of the new helper for showing a standard error message for two
conflicting cli options. This also catches one untranslatable message.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-17 15:38:42 -04:00
Cole Robinson
9fdbccec2b Fix pylint raise-missing-from
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-15 12:36:27 -04:00
Cole Robinson
a242894182 cli: Add --os-variant require=on|off
If specified, this errors if no OS name was detected or manually set.
So --os-variant detect=on,require=on will error if no OS is detected.

name= can be used as a fallback, so test and document this case

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-14 20:36:12 -04:00
Cole Robinson
17f47a44c5 cli: --os-variant: add explicit suboptions
This adds the following --os-variant suboptions

* name=, short-id=
* id=
* detect=on|off

Functionally this does not change behavior, just adds explicit
sub options for behavior we already support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-14 20:15:20 -04:00
Cole Robinson
67703ec7a5 cli: Add --osinfo as alternate name for --os-variant
The --os-variant option naming is pretty crappy and mostly a historical
artifact. Ideally this would be named just `--os` but I'm afraid that
would cause confusion with libvirt's <os> XML

Add --osinfo as an alternate commandline naming. If we ever want to
transition documented use of --os-variant it will help to have the
alternative around for a few releases

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-14 18:12:41 -04:00
Cole Robinson
428948a690 cli: Add disk type=nvme source properties
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-13 09:58:39 -04:00
Cole Robinson
ffc48af4ee cli: Add --disk source.file, source.dir, source.dev
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-13 09:58:39 -04:00
Cole Robinson
8560138cf2 cli: Add --xml xpath option for virt-install and virt-xml
The --xml option allows users to request raw XML edits to virt-install
or virt-xml generated XML. This gives users a bit of a workaround
incase we don't have proper support for some XML property. The --xml
option can gain more features in the future if it makes sense, like
setting XML namespaces for example.

Basic usage is like: virt-install --xml ./@foo=bar ...

Which will change the generated <domain> XML to have

<domain foo='bar' ...

virt-xml works similarly. It can only be combined with --edit currently.
This only works with xpaths rooted against the entire document.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 15:04:37 -04:00
Cole Robinson
1b48772bc1 virt-install: Don't reboot VM is user manually stopped it
Similar to behavior we have in virt-manager, if the user destroys the
VM during the VM install process, don't invoke the post install
reboot.

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson
9c5c1f3e44 virt-install: Move more install process handling into separate functions
Try to save us having to pass around a ton of options, and make
things cleaner for upcoming changes

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson
ac51ff8684 cli: Fill in all --filesystem suboptions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson
d24b3ba1d1 cli: Add virtio driver packed= option
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson
65f93e5d60 cli: support --sysinfo type=fwcfg,entry...
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson
5473695fe1 installer: Upload unattended and cloudinit data to remote connections
* rename kernelupload.py to volumeupload.py and make the entrypoint
  more generic
* move all upload invocation to the Installer class
* use it with cloudinit and unattended ISO generation if required

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 19:24:21 -04:00
Cole Robinson
44033b43bb virt-xml: Handle removing <console> <serial> dup device
This is a quirk of libvirt that the first <device> is usually a
logical duplicate of the first <serial> device. Adjust virt-xml to
understand this quirk and remove both devices at the same time,
like we already do in virt-manager

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:55:09 -04:00
Cole Robinson
e2419869e7 tests: data: Move all cli/ bits to their own directories
Move the content to:

* cli/virtclone/
* cli/unattended/
* fakemedia/

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:48:40 -04:00
Cole Robinson
900ff8c3e1 tests: Move cli virt-xml input XML to a virtxml/ dir
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:39:38 -04:00
Cole Robinson
8856b781d0 cloner: Write preserve vs share vs clone into DiskInfo
This let's us move more of the preserve logic to virtclone.py
and prep more things to share with virt-manager

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson
f23a27639f cloner: Big API rework
* Centralize lots of disk building
* Open code virt-clone specific behavior at the source
* Drop a lot or properties
* Move most testing to test_cli.py
* Generally a ton of cleanup

virt-manager clone wizard has not been converted yet so is totally
broken after this commit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson
c0d1e76941 tests: Cover more of cloner.py from test_cli.py
Cover more cases via the virt-clone CLI testing, than just the
test_cloner.py unit style testing.

Change most of the virt-clone --print-xml testing to also attempt the
clone operation as well via a hidden cli option, to ensure we aren't
testing XML of any bogus operations

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson
f157aa1839 diskbackend: Simplify path a case of path joining
We are reimplementing os.path.join. Make sure the standard cli
test suite hits this case too

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson
f46e1a395c tests: cli: Drop most usage of virt-clone --clone-running
This is just a test suite hack from before we had other methods
of specifying cloneable guests. It will be removed soon

We need to tweak some test XML to fix code coverage after

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson
39e8d60bea tests: cli: drop some clone --original-xml arg redundancy
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson
b3fb88e345 cli: Add --cpu numa.cell.memAccess and discard
https://bugzilla.redhat.com/show_bug.cgi?id=1824373

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-31 13:53:26 -04:00
Cole Robinson
38405a477c tests: Add *DIR helper variables
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -04:00
Cole Robinson
44aa0b093e tests: cli: Clean up global module data a bit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:47:58 -04:00
Cole Robinson
61a947d667 tests: Rename clistate -> TESTCONFIG
Makes it more clear it's a constant class, and its purpose

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:38:40 -04:00
Cole Robinson
247170c066 tests: cli: Make test names easier to match with pytest
pytest doesn't like './' in the name

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 13:03:54 -04:00
Petr Benes
2862b68292 cli: Add --graphics websocket= support
Add a --graphics websocket option to configure VNC WebSocket port
as described in https://libvirt.org/formatdomain.html#elementsGraphics

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-07-16 14:52:03 -04:00
Menno Lageman
25419db9ca virtinst: add support for configuring the IOMMU
Add a --iommu option to configure IOMMU parameters as described in
https://libvirt.org/formatdomain.html#elementsIommu

E.g. 'virt-install --iommu model=intel,driver.aw_bits=48,driver.iotlb=on ...'
will generate the following domain XML:

  <devices>
    <iommu model="intel">
      <driver aw_bits="48" iotlb="on"/>
    </iommu>
  </devices>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
2020-07-12 09:15:52 -04:00
Cole Robinson
fec9f0b136 po: Fix message format warnings printed from xgettext
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-11 19:18:38 -04:00