Commit Graph

443 Commits

Author SHA1 Message Date
Erik Skultety
1a8728fc2d virtinst: guest: Fill in SEV platform specific data automatically
The data in question are 'cbitpos' denoting which addressing bit is the
encryption bit and 'reduced_phys_bits' denoting how many physical
address space we lose by turning on the encryption. Both of these are
hypervisor dependent and thus will be the same for all the guest
residing on the same host, but need to be specified for future migration
purposes.
But given we can probe them from domain capabilities, we don't need the
user to provide them and thus enhancing cli user experience. This
requires a new _SEV domaincapabilities XML class to be created so that
we can query the specific properties.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Erik Skultety
480a6834c2 virtinst: cli: Provide a default value for the 'policy' argument
Policy is a 4-byte bitfield used to turn on/off certain behaviour within
the SEV firmware. For a detailed table of supported flags, see
https://libvirt.org/formatdomain.html#launchSecurity.
Most of the flags are related to advanced features (some of them don't
even exist at the moment), except for the first 2 bits which determine
whether debug mode should be turned on and whether the same key should
be used to encrypt memory of multiple guests respectively.

>From security POV, most users will probably want separate keys for
individual guests, thus the value 0x03 was selected as the policy
default.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Erik Skultety
45f3a47c84 virtinst: cli: Introduce parser support for SEV launch security
Introduce both the launchSecurity XML and parser classes. While at it,
add launchSecurity as a property instance to the Guest class too.

The parser requires the 'type' argument to be mandatory since in the
future it will determine different code paths, therefore
'--launchSecurity foo=bar' is incorrect.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2019-06-11 13:00:34 -04:00
Athina Plaskasoviti
7a52e4c80d cli: Add --numatune memory.placement
XML Mapping:

<numatune>
  ...
  <memory placement=X/>
  ...
</numatune>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-06-10 09:53:36 -04:00
Cole Robinson
b4c9e4b114 tests: Skip unattended tests unless osinfo is new enough 2019-06-09 20:19:45 -04:00
Cole Robinson
361657ad15 virtinst: Add a lot of test code coverage
* Delete dead code
* Add tests for various device default code paths
* Rework certain conditions a bit so code coverage always hits them
2019-06-09 18:59:50 -04:00
Cole Robinson
d9b41bf887 tests: Add clitest coverage for network-install resources 2019-06-09 10:14:48 -04:00
Cole Robinson
4a04af38f1 tests: clitest: Add windows unattended unittest 2019-06-08 15:33:37 -04:00
Cole Robinson
635361f0bd tests: Add osinfo URL and URL unattended tests 2019-06-08 10:20:36 -04:00
Cole Robinson
37adfb0150 urlfetcher: Add http and ftp unit test mocking 2019-06-07 21:25:41 -04:00
Cole Robinson
566a4681a8 support: Rework support check invocations
SupportCache.check_support(SUPPORT_FOOBAR, args) becomes
SupportCache.foobar(args)

And SupportCache absorbs the caching infrastructure from
VirtinstConnection.

For now we add some hackery to hide the API change from callers, but
this will be undone in the next patch
2019-06-07 16:25:39 -04:00
Cole Robinson
d167021b0f osdict: Drop the solaris10 x2apic hack
The upstream kvm bug has never been resolved. I think this is
obscure enough nowadays that we don't need to track and test it
2019-06-05 16:35:34 -04:00
Cole Robinson
2510c299f5 Use shutil.which instead of distutils find_executable
The former is the more standard library method for this
with python3
2019-06-05 16:35:34 -04:00
Cole Robinson
bc232eb8de devices: disk: Drop DIR+floppy validation
Libvirt already gives us a similar warning at parse time, this is
obscure enough that we don't need to catch it upfront
2019-06-05 11:13:33 -04:00
Athina Plaskasoviti
27a51b2210 cli: Add --iothreads iothreadids.iothread[0-9]*.id
XML Mapping:

<domain>
...
<iothreadids>
  <iothread id="X"/>
  ...
</iothreadids>
...
</domain>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-06-04 14:17:01 -04:00
Athina Plaskasoviti
8c708210db cli: Add --iothreads
XML Mapping:

<domain>
...
  <iothreads>X</iothreads>
...
</domain>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-06-04 10:58:31 -04:00
Athina Plaskasoviti
304b323f5d cli: Fix add --memballoon stats.period
XML Mapping

<memballoon model=...>
  <stats period="10"/>
</memballoon>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-05-29 14:03:14 -04:00
Athina Plaskasoviti
ebf2199875 cli: Add --memballoon autodeflate
XML Mapping:

<memballoon model=...>
  <autodeflate>on</autodeflate>
</memballoon>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-05-23 10:03:27 -04:00
Athina Plaskasoviti
35c53fc02c cli: Add --disk rawio
XML mapping:

<disk type=... rawio="yes">
...
</disk>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-05-20 15:32:04 +02:00
Athina Plaskasoviti
d171489f7d cli: Add --disk wwn
XML mapping:

<disk>
  <wwn>...</wwn>
</disk>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-05-17 15:29:18 -04:00
Cole Robinson
de59d33a59 tests: clitest: Move all skip checks into their own class 2019-05-16 14:24:20 -04:00
Cole Robinson
4e3e38cad1 tests: Fix test suite failures on f29 libvirt 4.7.0 2019-05-16 11:29:12 -04:00
Cole Robinson
6394ab7f9a cli: --graphics: Add zlib.compression=
This maps --graphics zlib.compression=auto to the XML:

  <graphics>
    <zlib compression='auto'/>
  </graphics>
2019-05-16 10:21:19 -04:00
Cole Robinson
aeff4e248f tests: Fix testsuite on non-latest libvirt
The memory hotplug changes only work on libvirt 5.3.0, among a few
other pieces. Still do the XML compare but skip domain define if
the new check_version_define comparison fails.
2019-05-15 20:19:58 -04:00
Cole Robinson
f5c5c815e4 cli: Add --seclabel alias for --security
The <domain> XML it alters is called <seclabel>, and security is
really generic sounding. Add the alias and switch the documentation
over to prefer --seclabel
2019-05-15 17:49:58 -04:00
Cole Robinson
23f7b4fa7e tests: clitest: Cover all address.* options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
7eedcac1e7 tests: clitest: Cover all char options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
2b613d2ef5 tests: clitest: Cover all --rng options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
65f3197a02 tests: clitest: Cover all --vcpus and --video options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
cc6ca85ce8 tests: clitest: Cover all --network options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
e2e9c0cadd tests: clitest: Cover all --sysinfo options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
a8fedab9f2 tests: clitest: Cover all --memdev options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
d5c7771e49 tests: clitest: Cover all --graphics options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
56f47faf49 tests: clitest: Cover all --features options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
4543ef2baa tests: clitest: Cover all --disk options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
0947045f11 tests: clitest: Cover all --cpu options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
58daf6722e tests: clitest: Cover all --controller options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
5f5c7daca1 tests: clitest: Cover all --clock options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
f986273e17 tests: cli: Cover all --hostdev options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
fa8cbe5628 tests: clitest: Cover all --memorybacking options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
0da94e25b2 tests: clitest: Cover all --blkiotune and --idmap aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
dbb6f338ab tests: clitest: Cover all --vsock options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
084122dfbe tests: clitest: Cover all --tpm options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
0b2206be0e tests: clitest: Cover all --pm and --numatune options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
300400f26c tests: clitest: Cover all --boot options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
dc0f9632ee tests: Repurpose spice-gl test as a generic singleton test
We need another entrypoint for singleton testing
2019-05-15 17:34:01 -04:00
Cole Robinson
61639d9b14 cli: Only use regex matching if the subopt contains [
If we use regex matching all the time, we can erroneously match
certain strings. This already let some cli regressions through
with recent patches.
2019-05-15 14:47:53 -04:00
Cole Robinson
384607e502 cli: Strip find_inst regex from completion results
It doesn't really work with the argcompleter, so show the non-regex
version of the suboption
2019-05-15 13:18:39 -04:00
Cole Robinson
af2182d890 cli: --memorybacking: Add discard= and allocation.mode= 2019-05-14 15:58:36 -04:00
Cole Robinson
90f5b29789 cli: --memorybacking: Convert hugepages.page to a list
There can be more than 1 <memoryBacking><hugepages><page> element.
Adjust the cli options to match:

- hugepages.page[0-9]*.size
- hugepages.page[0-9]*.unit
- hugepages.page[0-9]*.nodeset
2019-05-14 15:58:36 -04:00