Commit Graph

1362 Commits

Author SHA1 Message Date
Cole Robinson 9cbe5f9742 virt-install: Move --install kernel/initrd handling to installtreemedia
This essentially gives us kernel upload, http access, and initrd inject
for free, and ensures that the source file is kept in pristine shape
2019-06-13 14:00:04 -04:00
Cole Robinson b746d919a9 virt-install: Add --install kernel_args=X,kernel_args_overwrite=yes|no
--install kernel_args=X acts like --extra-args. If
kernel_args_overwrite=yes is also specified, it overwrites whatever
default kernel args we would have used for the install method.
2019-06-13 14:00:04 -04:00
Cole Robinson 69d5e62cbb tests: Add an example of --extra-args with post install --boot cmdline=X 2019-06-13 14:00:04 -04:00
Cole Robinson 216b1f2a2d installer: Reject --unattended method=cdrom on remote connection
It's not wired up yet
2019-06-13 14:00:04 -04:00
Cole Robinson 69c20d5256 installer: install_{kernel,initrd} imply an install phase 2019-06-13 14:00:04 -04:00
Cole Robinson b4cc9c7cea uitests: Fix prefs XML editor flakeyness 2019-06-13 13:50:52 -04:00
Cole Robinson 2266b650a5 preferences: Disable XML editing by default
This adds a field in gsettings and preferences UI to enable
XML editing. It's off by default. The XML tab page is still visible,
but the textview is not editable, and there's a warning at the top:

  XML editing is disabled in 'Preferences'.
  Only enable it if you know what you are doing.

When the setting is enabled, the warning goes away and the textview
is editable. This puts a roadblock up for people that don't know what
they are doing, but still advertises the feature and keeps the
UI surface difference fairly small between on/off states.
2019-06-13 07:17:34 -04:00
Cole Robinson 2a1cf411dd tests: Add XML editing UI tests 2019-06-13 07:17:34 -04:00
Andrea Bolognani c88e492331 guest: Enable qemu-ga by default on s390x
It was disabled with commit 2aca20141e back in 2015, but
these days we have it enabled for all other architectures and
there doesn't seem to be a good reason for s390x to keep being
the outlier.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-06-13 09:16:45 +02:00
Cole Robinson 1f4a5a1b43 cli: Add --install bootdev=X,kernel=X,initrd=Z
This is the beginning of a big --install option, which will be used
for tweaking less common elements of the install process
2019-06-11 17:55:09 -04:00
Cole Robinson a4a577bd23 tests: Finish off installer and kernelupload coverage 2019-06-11 17:55:09 -04:00
Cole Robinson de90716eb4 unattended: Choose a default profile name if none specified
We default to 'desktop' if none specified, otherwise we choose the
first alphabetical profile available. Make bare '--unattended' a
valid option
2019-06-11 17:55:09 -04:00
Cole Robinson 034d112181 unattended: Finish off code coverage testing 2019-06-11 17:55:09 -04:00
Cole Robinson 13b3790829 virt-install: Print when we set default memory and disk
Since we never defaulted here before, print out the values we are
setting. Users can see right away if they actually want those values
or not.
2019-06-11 17:55:09 -04:00
Cole Robinson cb0e37786f tests: clitest: More infrastructure to skip default arguments
To allow testing virt-install without default --ram added for example
2019-06-11 17:55:09 -04:00
Cole Robinson b3e6ebe28b virt-install: Generate default --name
This uses the same logic as virt-manager. The name is mostly
derived from --os-variant naming, but we have fallback defaults too.

Print the name to stdout so users are informed about what we are
doing.
2019-06-11 17:55:05 -04:00
Cole Robinson 078348fbbf create: move generate_name to Guest
This will be used by virt-install.
Tweak the logic a bit to not have 'generic' in the name
2019-06-11 17:54:45 -04:00
Cole Robinson 01a07a1051 virt-install: Share required option logic for resources
There's some cases we were incorrectly setting osinfo defaults, when
mem or storage values had already been specified elsewhere
2019-06-11 17:54:45 -04:00
Cole Robinson 66fe00ddee guest: Don't hardcode vcpus = 1
libvirt has set this as the default forever, we don't need to set it
2019-06-11 17:54:42 -04:00
Cole Robinson 17d157820f guest: move libosinfo resource setting to virt-install
This puts all the default resource setting in one place, and the
only place that was depending on it, as virt-manager explicitly sets
the values on its own. This will be used in future patches to add
more default setup and report the values to the user
2019-06-11 17:51:25 -04:00
Cole Robinson e859d17e1a tests: Add an unattended netinst test case 2019-06-11 17:51:25 -04:00
Cole Robinson cc366fff7d cli: Add more code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson 75101ce27b tests: clitest: Remove some redundant argcomplete tests 2019-06-11 17:51:25 -04:00
Cole Robinson c33eb562c2 devices: graphics: Test remaining code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson b0b3ba4e1c devices: interface: Test remaining code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson f056798918 virtinst: Add a bunch of # pragma: no cover 2019-06-11 17:51:25 -04:00
Erik Skultety 8ab9dcd33f virtinst: guest: Provide further SEV support checks
These include platform checks - libvirt & QEMU - as well as
configuration - SEV is only supported with UEFI.
Another configuration requirement made in this patch is Q35 machine,
since ADM recommends Q35 in their setups even though SEV can work with
the legacy PC machine type, but we'd have to turn on
virtio-non-transitional for all virtio devices with some other potential
pitfalls along the way.

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 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
Erik Skultety 9bfdd92c0e tests: Introduce real-world AMD SEV domain capabilities
Rather than editing existing Intel domain capabilities by hand, use
capabilities from a real AMD HW. We're later going to use these to fill
in SEV platform specific data automatically.

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 4dd12e2e56 installer: Generate the unattended script only in installer
And pass it down to treemedia, which acts on our script wrapper
object. This is conceptually a bit simpler because we can see in
one place what data feeds the script build process, depending on
installer props
2019-06-09 20:19:42 -04:00
Cole Robinson ae5e9d9a2c virtinst: Add full test coverage for xml*.py files 2019-06-09 19:00:03 -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 261a0a0482 domain: seclabel: Drop some unneeded logic
* imagelabel is a runtime only XML attribute which we don't use at
  all, so drop parsing
* drop validation checks that libvirt will do for us
2019-06-09 18:34:48 -04:00
Cole Robinson b5a664bd1b virtinst: move UI only functions into virtManager
These throw off code coverage testing. They are mostly:

* pretty* device helpers
* network + snapshot validation + creation routines
2019-06-09 18:33:45 -04:00
Cole Robinson c9233aa6c3 tests: uitests: Run whole suite without testsuite hacks
We want to hit real network fetching, etc.
2019-06-09 14:26:03 -04:00
Cole Robinson b3a9b98e08 osdict: Standardize on OsMedia usage
* Make all API calls go through the _OsMedia object
* Move most of the unattended specific processing to unattended.py
* Rename requires_internet to is_netinst to clarify what it is checking
2019-06-09 11:26:28 -04:00
Cole Robinson 195d775c5b installertree: abspath convert MEDIA_DIR
Various parts of the code implicitly expect an absolute path
2019-06-09 10:50:21 -04:00
Cole Robinson 0113455065 tests: osdict: add basic list_os unittest 2019-06-09 10:40:26 -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 08baf0ee5f unattended: Handle libosinfo returning kernel url arg
Latest libosinfo will handle this. Check for it so we don't end up
with double options on the command line
2019-06-08 13:03:08 -04:00
Cole Robinson 635361f0bd tests: Add osinfo URL and URL unattended tests 2019-06-08 10:20:36 -04:00
Cole Robinson f01a534cfb tests: Use testsuirebr0 as the fake bridge name
It's more obvious in the output than 'eth0'
2019-06-08 09:24:33 -04:00
Cole Robinson b97003ddfc interface: Get more unittest coverage of _default_* 2019-06-08 09:24:25 -04:00
Cole Robinson f3b0830cf3 tests: Add run_without_testsuite_hacks decorator 2019-06-08 09:11:00 -04:00
Cole Robinson e9dcb4056d installer: Rework some test suite urlfetcher hacking
Rather than alter where we save the files, behave like normal but
only change what we store in the XML
2019-06-07 21:40:47 -04:00