Commit Graph

6735 Commits

Author SHA1 Message Date
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 436c471b15 virt-install: Drop the serial extra_args warnings
There's been multiple reports that these aren't really valid nowadays.
systemd is smart enough to make this work automagically. So just drop
it
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 ecb60c3062 Drop use of logging.info
Just use logging.debug in these random places
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 387614c641 generatename: Move libvirt collision handling to callers
Make every caller pass an explicit cb that handles libvirt
collision processing. Makes it easier to see exactly what is going
on at the call impls
2019-06-11 17:54:45 -04:00
Cole Robinson 4cdf2e4a78 generatename: Remove collidelist
Fold it in to the callback of the single remaining user
2019-06-11 17:54:45 -04:00
Cole Robinson 47a6f3a6d5 storage: Handle guest collision checking
This pattern is already used in two places. Formalize and centralize
it
2019-06-11 17:54:45 -04:00
Cole Robinson 58dfe05344 virtManager: Remove some unnecessary generatename collidelist usage
The libvirt callbacks will handle this for us already
2019-06-11 17:54:45 -04:00
Cole Robinson 6e6a0b8a6a connection: Use shared default pool lookup logic
It wasn't abiding a different pool name pointing to our default
path
2019-06-11 17:54:45 -04:00
Cole Robinson 088657a2b8 storage: Kill get_default_dir
The last location is in virt-convert, which has weird local directory
creation semantics. Just have it use storage APIs like we do
everywhere else
2019-06-11 17:54:45 -04:00
Cole Robinson e27202d178 createpool: Use StoragePool.default_target_path
Indirectly, rather than the less useful get_default_dir
2019-06-11 17:54:45 -04:00
Cole Robinson abb4719cee addstorage: Drop non-storagepool fallback code
This isn't tested, and the usecase will error later anyways when
we attempt to create storage.
2019-06-11 17:54:45 -04:00
Cole Robinson 8bfa04c230 storage: Split apart build_default_pool, and document it 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 db4d348950 domain: cpu: Rework vcpus setting slightly
Move it to Guest, where we have a more hollistic view of the issues.
This will be needed in later patches
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
Cole Robinson ffcf713e06 cli: Drop warnings about video accel3d
Libvirt has provided explicit errors here for a while
2019-06-11 17:51:25 -04:00
Cole Robinson 203c0d4a6c virt-install: Call install.get_search_paths
Similar to what we do via create.py
2019-06-11 17:51:25 -04:00
Cole Robinson b7465fdcf8 installertreemedia: Move url() to is_network_url()
And then have callers just access location. It's more clear IMO
2019-06-11 17:51:25 -04:00
Cole Robinson 59f1eabf27 installtreemedia: Simplify unattended kernel_args logic
Let unattended kernel args take precedence, we implicitly require
a new enough osinfo-db that provides the info we need
2019-06-11 17:51:25 -04:00
Cole Robinson 41757d8e2d man: virt-install: Drop reference to mageia URL support
We support it, but we don't do distro detection so defaults are
going to be crappy.
2019-06-11 17:51:25 -04:00
Cole Robinson 66ffafe148 urldetect: Drop old mandriva URL support
Mandriva hasn't existed since 2011. Drop references to it
2019-06-11 17:51:25 -04:00
Cole Robinson fe82973e1c urldetect: Drop explict ALTLinux support
libosinfo should cover this for us now
2019-06-11 17:51:25 -04:00
Erik Skultety 5ed4a77d6c man: Provide a documentation for the SEV feature
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 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
Cole Robinson a80242d998 cli: Call validate() on is_single objects too
The way the code was nested, we skipped calling validate() on
XMLChildProperty is_single objects. There's no reason to do that,
so adjust it.

We need to do some hasattr checking here, because --os-variant and
--location objects aren't XMLBuilders with validate defined. That's
really an issue of having XMLBuilder assumptions baked into the
generic CLI parsing infrastructure. Unwinding that is for another day
2019-06-11 11:09:56 -04:00
Cole Robinson 102a49771f urlfetcher: Unlink file if download is aborted 2019-06-10 13:13:26 -04:00
Cole Robinson c9af3f94ce installinject: Use genisoimage instead of mkisofs
On Fedora mkisofs and genisoimage are identical and shipped in the
same package. On debian only genisoimage is shipped due to some
historical weirdness or licensing dispute or something. So just
prefer the genisoimage naming
2019-06-10 09:54:07 -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 578451fe72 urldetect: Don't run regex against None SUSE product name
We are implicitly depending on random dict ordering for what
order we process Distro matching. Our test suite mocking and
different debian ordering revealed a case we could be trying to
run a regex against None. Fix it. The dict ordering issue will
be fixed separately
2019-06-10 08:44:20 -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