Commit Graph

1175 Commits

Author SHA1 Message Date
Pavel Hrdina
29f815fbd2 domcapabilities: remove recommended CPU features from security features
These features are only recommended to be enabled since they improve
performance of the VMs if security features are enabled.

pcid is a very useful perf feature, but missing in some silicon
so not portable.

pdpe1gb lets the guest use 1 GB pages which is good for perf
but again not all silicon can do it.

amd-ssbd is a security feature which fixes the same SSBD flaws as the
virt-ssbd feature does. virt-ssbd is usable across all CPU models
affected by SSBD, while amd-ssbd is only available in very new silicon.
So virt-ssbd is the bette rchoice.

amd-no-ssb just indicates that the CPU is not affected by SSBD, so not
critical to expose. I expect a future named CPU model will include that
where appropriate.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-04 11:49:29 +02:00
Cole Robinson
d252061b4b tests: inject: Update test cases 2019-04-03 20:23:55 -04:00
Fabiano Fidêncio
5de172501c unattended: Add product-key to Unattended data
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-04-01 16:28:52 -04:00
Lin Ma
4c3b27c835 testdriver: Add genid example
Signed-off-by: Lin Ma <lma@suse.com>
2019-04-01 13:54:21 -04:00
Pavel Hrdina
986097d5f8 cloner: don't fail to clone VM if nvram file doesn't exist
If a VM is defined and never started the nvram file might not exist and
in that case it's created by libvirt automatically on the first start.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-28 16:07:13 +01:00
Cole Robinson
ffe7be601b tests: uitests: Fix CPU model test
We need to use a fake domcaps URI after 95d1275f57
2019-03-26 11:43:12 -04:00
Cole Robinson
fcabcb7a95 tests: clitest: Add a test case for the last commit
We need a custom test driver input to reproduce the pool collision
2019-03-26 11:15:46 -04:00
Cole Robinson
3be238b03e tests: test_urls: Add --*libosinfo, --iso-only, --url-only
These are options that will help tweak the test_urls logic,
to help as we try to ensure libosinfo covers all the cases
we care about.
2019-03-24 12:32:03 -04:00
Cole Robinson
97a5af1e43 urldetect: Use libosinfo for tree detection too
Ask libosinfo for tree detection, but still fall back to our
own implementation if libosinfo fails
2019-03-24 12:27:46 -04:00
Cole Robinson
e7cdb695c3 test_urls: debian8 urls are dead, remove them 2019-03-24 11:14:47 -04:00
Andrea Bolognani
7b9de27a99 guest: Add default RNG to s390x guests
As long as it's supported by both QEMU and the guest OS,
there's really no reason not to add it.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 14:16:28 -04:00
Jim Fehlig
8d9743d69f virt-install: Add support for xenbus controller
libvirt commit 09eb1ae0 added support for a new 'xenbus' controller
type. Add support for the controller in virtinst, including support
for the maxGrantFrames attribute.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2019-03-21 14:15:40 -04:00
Cole Robinson
7afbb90b4d virt-xml: Handle VM names that look like id/uuid (bz 1679025)
Previously we assume they are id/uuid, so if it's actually the VM
name then the command fails. Now we always check for a name first,

https://bugzilla.redhat.com/show_bug.cgi?id=1679025
2019-03-21 13:45:58 -04:00
Andrea Bolognani
f23b01be53 guest: Add VirtIO input devices to s390x guests with graphics
We're not including any input devices in the generated XML
for s390x guests, and the results is that it's not possible
to interact with them short of using the serial console or
connecting through ssh, which is fine but probably not what
is expected when graphics are present.

USB input devices are not a good fit for s390x guests: USB
requires PCI, and PCI is not widely available or used on
s390x; VirtIO devices, on the other hand, are a perfect
match since s390x guests use basically no emulated devices
and rely on VirtIO for most functionality.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:31:20 +01:00
Andrea Bolognani
5dad99216e guest: Add USB input devices to pSeries guests with graphics
libvirt already does this for us, sort of: it will automatically
add a USB keyboard and mouse to ppc64 guests with graphics;
in addition, these devices are impossible to remove.

Unfortunately this results in a pretty poor experience for the
user, since the relative pointing device makes interacting with
the GUI an exercise in frustration.

As of commit 186bb479d0f4, libvirt will still add the USB
keyboard automatically but will skip the USB mouse if a USB
tablet is already present, so by explicitly including USB input
devices in the generated XML we can create guests that are
actually usable.

We can do this unconditionally, without having to worry about
what version of libvirt we're running against: if it's new
enough we'll take advantage of the fix, and if not then the
resulting guest will not be any more broken than it would have
been before.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:31:20 +01:00
Andrea Bolognani
6a24a2a13a tests: cli: Add simple guests with graphics
These cover the use case "I want to get an existing guest
image running in the cloud, and I need graphics".

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:29:46 +01:00
Andrea Bolognani
e5b8c97896 tests: cli: Add simple headless guests
These cover the use case "I want to get an existing guest
image running in the cloud, and I don't need graphics".

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 15:28:25 +01:00
Andrea Bolognani
d409c76848 tests: cli: Drop existing aarch64-graphics test
We're going to add a number of tests covering the same scenario
on multiple architectures soon, so this one is no longer needed
and would in fact cause a name clash if it stayed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-21 14:54:04 +01:00
Pavel Hrdina
fb5136a6a9 domain: cpu: automatically add CPU security features for "custom" mode
If user selects specific CPU model to be configured for guest we will
automatically add CPU security features to make sure that the guest is
not vulnerable to these CPU HW bugs.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:45:49 +01:00
Pavel Hrdina
6423f653fd domain: cpu: introduce set_model function
We will need to pass another variable into the setter so we cannot use
the property setter.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:45:49 +01:00
Pavel Hrdina
f7bdebc0de tests: capabilities: remove testCPUAPI
This test case is pointless, get_cpu_values() calls only libvirt API
which will return list of CPUs known to libvirt and we check whether
that list is correct.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:49 +01:00
Pavel Hrdina
8f870c3fca tests: xmlparse: use set_special_mode function
CPU mode is never set directly using mode attribute, instead we use
setter function with some extra logic that needs to be done.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-03-19 13:41:46 +01:00
Vasudeva Kamath
648115334d virt-install: Add driver_queues argument to --controller
<controller> can have additional <driver> sub element with queues as property,
which is currently not exposed via virt-install. This commit exposes this option
similar to queues in network configuration.

(crobinso: add test case)
2019-03-12 10:17:06 -04:00
Cole Robinson
81b26de46d tests: test_urls: centos5 detection works now 2019-03-12 09:50:28 -04:00
Cole Robinson
9688815237 urldetect: Rework _allstores building a bit
Rename it ALLSTORES since it's a global variable
Split out the building from the altering
2019-03-08 16:52:33 -05:00
Cole Robinson
32034c6847 Revert "devices: disk: Use virtio-scsi for CDROMs where supported"
This reverts commit a746150bef.

See discussion:
https://www.redhat.com/archives/virt-tools-list/2019-March/msg00058.html

Apparently some debian versions struggle with this. Let's stick with
the old method until there's a sufficiently compelling reason to change

Some adjustment is required to deal with changes added by later patches
2019-03-08 11:39:20 -05:00
Cole Robinson
6780bc0c0e tests: clitest: Tweak test input to match latest libvirt
rbd volumes no longer report format=raw. adjust the test input
to generate the expected output.
2019-03-06 14:35:15 -05:00
Andrea Bolognani
db6c7070e2 devices: disk: Don't prefer virtio-scsi for aarch64/virt
Back when this was introduced in 2014 (commit aa772f01e1) using
virtio-scsi instead of virtio-blk made sense, because virtio-pci
support on aarch64/virt was still not widely available and
virtio-mmio couldn't do hotplug.

These days, however, virtio-pci availability is something that
we can assume is present on any remotely reasonable deployment
target, so it's better to no longer behave differently than
other architectures.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Andrea Bolognani
a746150bef devices: disk: Use virtio-scsi for CDROMs where supported
We already use virtio-blk for regular disks whenever possible,
and there's no good reason not to do the same with virtio-scsi
when dealing with CDROMs instead of artificially limiting its
use to s390x and ppc64/pseries guests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Andrea Bolognani
47753eab26 guest: Use virtio-scsi where supported
Right now we're limiting use of virtio-scsi to ppc64/pseries
and aarch64/virt guests, but there's really no reason not to
use it wherever it's available.

This results in virtio-scsi being now used on s390x, where no
other sensible SCSI controller implementation is available
anyway, and x86, where you alreayd didn't want end up using
lsilogic.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Cole Robinson
0c82a6b78c tests: uitests: Fix createpool with new libvirt collision checks 2019-03-06 13:46:24 -05:00
Marc Hartmayer
908b8e8d7c tests: virt-xml: Add test cases for --start option
The test cases verify that:

 + --start works
 + --define --start works
 + --no-define --start works
 + --start works in combination with --add and --remove
 + combination of --start --update isn't valid
 + combination of --define --no-define --start isn't valid

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer
c2bff50977 tests: cli: Add test case for --no-define argument
Add a test case validating mutual exclusivity of `--no-define` and
'--define' arguments.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer
c896d19d76 tests: cli: Add boot.order tests
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer
1b53594002 tests: Add test case for reorder_boot_order method
Add a test case for `reorder_boot_order`. It verifies that the OS boot
order is removed and that all other boot order indices are adjusted
accordingly.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer
ecc0861c89 tests: xmlparse: refactor method for generating out file path
Refactor method for generating out file path. It will be used in a
upcoming patch.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:15:38 -05:00
Marc Hartmayer
5bad22e837 tests: Use (get|set)_prop
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-06 13:13:13 -05:00
Cole Robinson
d470019cda tests: osdict: Add more install script testing 2019-03-05 16:38:22 -05:00
Cole Robinson
a3147e95db tests: osdict: test basic get_install_script 2019-03-05 16:38:22 -05:00
Fabiano Fidêncio
e8893f2178 virt-install: Add --unattended
--unattended is currently a no-op parameter that will be used to perform
unattended installations.

For now, if someone tries to use --unattended virt-install will fail as
the option is still not supported.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Cole Robinson
ef279273af virt-manager: add --show-domain-delete
Launches delete wizard on top of a VM window, so when domain is
deleted, VM window disappears and the whole app exits
2019-03-04 14:04:34 -05:00
Cole Robinson
4f66c423f7 cloner: Handle --nonsparse for qcow2 images (bz 1675743)
https://bugzilla.redhat.com/show_bug.cgi?id=1675743
2019-03-04 14:04:34 -05:00
Cole Robinson
be15a01bb2 tests: test_urls: require explicit distro= value
Most tests have a distro= value specified already. Make distro=none
required for those tests since they are limited
2019-03-02 16:52:24 -05:00
Pavel Hrdina
57db41854c virt-clone: fix force-copy of empty cdrom or floppy disk
There is nothing to copy so don't try to generate new path.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-02-28 18:05:31 +01:00
Pavel Hrdina
a0b42327c6 graphics: move all listen code into one place
Instead of duplicating the code into CLI and GUI move it into graphics
device file which is used from both places.  This also fixes a bug in
virt-xml where changing listen to address was not working.

This also changes behavior to always configure one listen type when
using CLI listen option or GUI.  If user wants to modify only specific
listen type they can use listens[] options from CLI.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-02-28 11:48:09 +01:00
Cole Robinson
05f4abe0d7 tests: Add osdict get_location/--os-variant install=X tests
Just failure coverage for the command line so far, we will need
some new infrastructure to test more than that
2019-02-18 11:17:57 -05:00
Cole Robinson
8a02081ebf cli: Add --os-variant full_id=X sub option
For specifying a distro via the full osinfo URL ID
2019-02-07 16:29:38 -05:00
Cole Robinson
4a2ff83b51 cli: Parameterize --os-variant
For now it just takes a single name= parameter that maps to
the current behavior
2019-02-07 16:27:01 -05:00
Cole Robinson
91cdb485cb virt-install: Drop xenpv install warnings
These may still be relevant, but I think it's fine just to let
the config fail to install. I'm not even sure if anyone is trying
xenpv these days...
2019-02-07 15:13:30 -05:00
Cole Robinson
a5e01c947d virt-install: set_install_defaults before disk validation
So we validate the CDROM disk contents too. This revealed we were
using a cdrom path in the test driver that was assigned as a
writeable disk to another test VM, which is a correct warning, so
fix the fallout, and ensure that we don't warn when colliding with
another cdrom device
2019-02-07 15:00:27 -05:00