Commit Graph

641 Commits

Author SHA1 Message Date
Peter Krempa
2f451d8114 tests: qemucapabilities: Update capabilities for qemu-5.2 dev cycle
Update to commit v5.1.0-2207-g96292515c0

Recent changes include deprecation of 'nbd-server-add' and addition of
'block-export-add'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-10-19 13:36:58 +02:00
Nico Pache
5032b247e9 QEMU: declare qemu capabilities for the Virtio Free page reporting feature
This patch will introduce the free-page-reporting feature capabilities
that are in qemu 5.1

Signed-off-by: Nico Pache <npache@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-10-13 17:02:42 +02:00
Michal Privoznik
b647654cbb qemu: Track default-ram-id machine attribute
The machine structure has another (optional) attribute:
default-ram-id, which specifies the alias of the default RAM
object. While the alias is private, it can never change in order
to not break migration. QEMU uses the alias when allocating
regular, not NUMA memory. In order to switch to new command line
and maintain migration, save this ID.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-10-01 12:04:48 +02:00
Michal Privoznik
66c5674e79 qemu_capabilities: Add QEMU_CAPS_USB_HOST_HOSTDEVICE
This capability tracks whether "usb-host" device has "hostdevice"
attribute. This attribute allows us to specify full path to the
USB device ("/dev/bus/usb/$bus/$dev") but more importantly, since
QEMU uses qemu_open() for this attribute it allows us to pass
pre-opened FD and have QEMU not bother with opening the file at
all.

The attribute was added in v5.1.0-rc0~71^2~1 QEMU commit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-10-01 10:50:43 +02:00
Peter Krempa
ce54d182ba tests: qemucapabilities: Update capabilities for qemu-5.2 dev cycle
Mid-cycle caps resync. Notable change is that virtio-blk enables
multiqueue by default and the addition of
'calc-dirty-rate'/'query-dirty-rate' QMP commands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-10-01 10:05:31 +02:00
Peter Krempa
86628e0cff qemucapabilitiesdata: Add test data for x86_64 for the qemu-5.2 dev cycle
The machine types for this cycle were already added and qemu also added
a property for the machine type object called "default-ram-id".

Also "block-bitmap-mapping" is supported as a migration parameter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-08-24 16:43:22 +02:00
Peter Krempa
9abf742986 tests: qemucapabilities: Update data for qemu-v5.1.0 release
qemu-v5.1.0 is released now. There weren't any noticable changes since
our last update to 'rc2'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-24 16:43:10 +02:00
Peter Krempa
7877e0d2e4 tests: qemucapabitilies: Bump for 5.1 caps to rc2 for x86_64
Note that 'numa-mem-supported' turned off for certain machine types
which in turn forced us to generate a newer command line in certain
tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-31 10:27:51 +02:00
Peter Krempa
30932473e1 qemu: caps: Enable QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI
Enable it when regular QEMU_CAPS_BLOCKDEV is present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-07-17 07:41:21 +02:00
Michal Privoznik
c2f15f1b18 qemu: Introduce QEMU_CAPS_NUMA_HMAT capability
This capability tracks whether QEMU is capable of defining HMAT
ACPI table for the guest.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-07-08 12:05:24 +02:00
Daniel Henrique Barboza
096a42000e qemu: Extend QEMU capabilities with 'spapr-tpm-proxy'
Expose the TPM Proxy support for PPC64 guests by creating a new
cap called QEMU_CAPS_DEVICE_SPAPR_TPM_PROXY.

This device is part of the machinery the guest need to orchestrate
with the PPC64 Ultravisor the transition to the Secure VM (SVM)
mode. Inside QEMU, this device will be used with the H_TPM_COMM
hypercall to connect with the TPM Resource Manager, enabling
the guest to open and close TPM sessions with the host TPM.

Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-06-23 17:27:50 +02:00
Menno Lageman
dd1bc914f9 qemu: format address wdith on intel-iommu command line
Format the address width attribute. Depending on the version of
QEMU it is named 'aw-bits' or 'x-aw-bits'.

Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-06-23 15:53:10 +02:00
Jiri Denemark
5fba42c21b qemu: Probe for a few params supported by migrate-set-parameters
These parameters were originally set via dedicated commands which are
now deprecated. We want to use migrate-set-parameters instead if
possible.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2020-06-17 10:25:33 +02:00
Michal Privoznik
9ce32b0935 qemu: Introduce fw_cfg capability
This capability tracks whether QEMU supports -fw_cfg command line
option, more specifically whether it allows specifying filename.

There are some releases of QEMU which support -fw_cfg but not
filename. If this is ever a problem we can refine the capability
later on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-10 14:00:38 +02:00
Jiri Denemark
f48bdbdfe4 qemu: Avoid probing unsupported migratable CPU expansion
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-06-09 20:32:50 +02:00
Jiri Denemark
8662b34f18 qemu: Probe for migrtability support in CPU expansion
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-06-09 20:32:50 +02:00
Jiri Denemark
2bfa2fea02 qemu: Probe for .migratable property of a CPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-06-09 20:32:50 +02:00
Peter Krempa
031a6be132 qemucapabilitiestest: Bump qemu-5.1 capabilities for x86_64
QEMU added the machine types for the 5.1 release so let's update them.

Other notable changes are 'cpu-throttle-tailslow' migration property,
'zlib' compression for qcow2 images and absrtact socket support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-06-04 09:39:19 +02:00
Michal Privoznik
bba05b01ce qemu: Track numa-mem-supported machine attribute
There is 'numa-mem-supported' machine attribute which specifies
whether '-numa mem=' is supported. Store it in our capabilities
as it will be used in later commits when building the command
line.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-05-18 10:23:05 +02:00
Chris Jester-Young
1ca9b8ff9d qemu: pvscsi: Add capability
This capability flags support for `-device pvscsi`, which provides the
VMware paravirtual SCSI controller.

Signed-off-by: Chris Jester-Young <cky@cky.nz>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2020-05-13 09:30:20 +02:00
Peter Krempa
3b7ca6d419 qemu: capabilities: Introduce QEMU_CAPS_VIRTIO_BLK_SCSI_DEFAULT_DISABLED
Historically the 'scsi' passthrough feature of virtio-blk-pci
was enabled by default. Libvirt was disabling it due to security
implications outlined in libvirt commit v0.9.9-4-g177db08775 if it was
not explicitly requested. In qemu commit v2.4.0-1566-ged65fd1a27 the
default value was changed to disabled in preparation for virtio-1.
Starting from QEMU-5.0 the 'scsi' property was also deprecated. There
replacement for the functionality is to use 'virtio-scsi' for the
purpose. This isn't a direct replacement though.

Add capability named QEMU_CAPS_VIRTIO_BLK_SCSI_DEFAULT_DISABLED which
allows us to stop formatting the 'scsi=' property if it's disabled by
default and not requested so that we don't use deprecated features.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-05-12 06:55:00 +02:00
Andrea Bolognani
7c42aafb09 tests: Add capabilities for QEMU 5.0.0 on riscv64
The churn in the output files is caused primarily by the fact that
blockdev support has been introduced.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-05-06 15:08:51 +02:00
Andrea Bolognani
55e1c2b68a tests: Update capabilities for QEMU 5.0.0 on ppc64
The churn in the output files is caused primarily by the fact that
replies were generated on a POWER9 machine, which is good because
we didn't have coverage of that before.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-05-06 15:08:49 +02:00
Andrea Bolognani
b51755278a tests: Update capabilities for QEMU 5.0.0 on aarch64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-05-06 15:08:41 +02:00
Peter Krempa
22f0da4e69 qemucapabilitiesdata: Add test data for x86_64 for the qemu-5.1 dev cycle
Start the new capability file for the new development cycle of QEMU.

Note that compared to previous version this was generated on an AMD cpu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-05-06 11:11:17 +02:00
Peter Krempa
3fafd0921c qemucapabilitiesdata: Update x86_64 capabilities to 5.0.0 release
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-05-06 11:11:17 +02:00
Tobin Feldman-Fitzthum
5ffff9b9e2 qemu: Introduce QEMU_CAPS_TCG
Since QEMU 2.10 it is possible to disable TCG when building
QEMU. Introduce a capability that reflects this.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-28 11:10:54 +02:00
Daniel Henrique Barboza
199dd6f693 qemu: Add capability for IBS pSeries feature
IBS (Indirect Branch Speculation) is the last capability added
in QEMU 2.12 related to Spectre mitigation for Power. It was
added in commit 4be8d4e7d935.

This patch introduces it as QEMU_CAPS_MACHINE_PSERIES_CAP_IBS.
Like CFPC and SBBC, users might want to tune in IBS based on
their HW and guest OS requirements, and it's better to do it
so in a proper Libvirt feature than to put QEMU arguments
in the middle of the domain XML.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-27 14:43:10 +02:00
Daniel Henrique Barboza
249a5c789e qemu: Add capability for SBBC pSeries feature
SBBC (Speculation Barrier Bounds Checking) is another capability
related to Spectre mitigation efforts in Power processors. It
was implemented in QEMU 2.12 by commit 09114fd81799.

This patch introduces it as QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC to
be implemented in the next patch. Like the case with the now
implemented CFPC, exposing this feature in the XML allows for
a cleaner way for users to tune the SBBC accordingly, given
that not all hypervisor and guest setups supports this
Spectre mitigation.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-27 14:43:04 +02:00
Daniel Henrique Barboza
a0a2c8ab73 qemu: Add capability for CFPC pSeries feature
CFPC (Cache Flush on Privilege Change) is one of the capabilities
added to QEMU to mitigate Spectre vulnerabilities in Power chips.
It was implemented in QEMU 2.12 by commit 6898aed77f46.

This capability is still used today due to differences in how
the host setup (hardware and firmware/kernel) can handle this
mitigation. Its default value also varies with the pseries machine
version of the time. There's also certain OSes, like AIX, that
might not support the default value of the pseries machine the
guest uses.

Exposing this in the Libvirt XML as a feature will allow users to tune
CFPC values in a cleaner way, instead of hacking parameters in
<qemu:commandline> elements.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-27 14:42:55 +02:00
Peter Krempa
b4ee473578 qemucapabilitiesdata: riscv: Remove call to 'query-machines'
The riscv capabilities code doesn't use the data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-27 08:13:52 +02:00
Han Han
cbdd6c4df4 qemu_capabilities: Introduce QEMU_CAPS_AIO_IO_URING
Add io_uring value to capability replies.

The capability QEMU_CAPS_AIO_IO_URING will be used for io_uring aio mode,
introduced from QEMU 5.0, linux 5.1.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2020-04-24 09:17:05 +02:00
Peter Krempa
6ed1219244 qemucapstest: Refresh data for qemu 5.0 on x86_64
Bump to v5.0.0-rc3-8-g3119154db0 and make sure that 'liburing' is picked
up by qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-04-23 15:56:32 +02:00
Laine Stump
cbd4ab4cc6 qemu: new capabilities flag pcie-root-port.hotplug
This caps flag is set when the qemu binary supports the option
"hotplug" for pcie-root-port, ioh3420 (Intel pcie-root-port) and
xio3130-downstream (Intel pcie-downstream-port). If it's available,
it's possible to disable hotplugging/unplugging devices on a
particular port by adding ",hotplug=off" to the qemu device
commandline. This option first appears in qemu-5.0.0.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-12 22:30:10 -04:00
Bjoern Walk
979500e1c1 qemu: capabilities: add 'packed' capability
Add the capability for QEMU's packed virtqueues for virtio that supposedly have
better cache utilization and performance compared to the default split queues.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-04-08 16:26:03 +02:00
Bjoern Walk
763416e192 qemu: capabilities: update qemu-4.2 capabilities for s390x
Update s390x capabilities for QEMU 4.2 with the actual GA version for
QEMU and on the latest z15 machine.

This picks up the new blockdev capability, so we need to refresh a bunch
of test cases as well.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-04-08 14:46:24 +02:00
Christian Schoenebeck
8fe6e82d1c qemu: capabilities: add QEMU_CAPS_FSDEV_MULTIDEVS
The QEMU 9pfs 'multidevs' option exists since QEMU 4.2. Probe QEMU's
command line set though to check whether this option is really
available, and if yes enable this new QEMU_CAPS_FSDEV_MULTIDEVS
capability on libvirt side.

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-04-06 13:55:12 +02:00
Peter Krempa
a743583e4f qemu: capabilities: Update qemu-5.0.0 capabilities for x86_64 to rc1
Now that v5.0.0-rc1 was tagged, update the capabilities to make sure
that everything works as expected.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-04-03 09:53:49 +02:00
Ján Tomko
47e84b06ec qemu: add QEMU_CAPS_STORAGE_WERROR
Detect the werror property on SCSI and virtio disks.
But clear it if the QEMU supports usb-storage device without it
also supporting this option for usb-storage.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2020-04-01 15:45:48 +02:00
Daniel Henrique Barboza
1d5f16ba81 qemu: capabilities: update qemu-5.0.0 capabilities for ppc64
Update ppc64 capabilities to pick up the new NVDIMM capability
support for ppc64.

Since the ppc64 capabilities weren't updated for some time, the
bulk of the changes here are related to the blockdev support
(see commit c6a9e54ce3 for info) that we are picking up just
now.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-03-24 10:02:34 +01:00
Peter Krempa
d6498be165 qemu: capabilities: Introduce QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY
The capability is based on qemu's support of using blockdev-snapshot to
install backing chain also for images which are in use by a block-copy
job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2020-03-13 13:09:12 +01:00
Peter Krempa
7c7fda15f3 qemu: capabilities: Update qemu-5.0.0 capabilities for x86_64
Update to v4.2.0-2265-g67923a7ea6 to pick up recent addition of
'allow-write-only-overlay' feature of 'blockdev-snapshot' command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2020-03-13 13:09:12 +01:00
Peter Krempa
b7991c903c qemu: capabilities: Add capability for the 'flat' argument of 'query-named-block-nodes'
Detect the presence of the flag and make it available internally as
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-03-04 14:39:24 +01:00
Peter Krempa
7680f3369a tests: qemucapabilities: Update capabilities of qemu-5.0.0 on x86_64
Update to v4.2.0-1858-gdb736e0437 which contains my commit for 'flat'
output of 'query-named-block-nodes'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-03-04 14:39:18 +01:00
Ján Tomko
d99128a62b qemu: add QEMU_CAPS_DEVICE_VHOST_USER_FS
Introduced by QEMU commit 98fc1ada4cf70af0f1df1a2d7183cf786fc7da05
    virtio: add vhost-user-fs base device

Released in QEMU v4.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
2020-03-04 12:08:50 +01:00
Andrea Bolognani
204e2306e5 qemu: Add the QEMU_CAPS_CPU_KVM_NO_ADJVTIME capability
We will use this capability to detect whether the QEMU binary
supports the kvm-no-adjvtime CPU feature.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-02-14 12:09:02 +01:00
Stefan Berger
0e4c2ed490 tests: Extend ppc64 capabilities data with TPM related XML and responses
This patch extends the ppc64 capabilities data with TPM related XML
and responses. The replies and xml files are copies of the 4.2.0 version
of these files with TPM related data added.

We also need to copy qemu_4.2.0.ppc64.xml to qemu_5.0.0.ppc64.xml.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-02-05 19:57:10 +01:00
Andrea Bolognani
79ebc31a1b tests: Add capabilities for QEMU 5.0.0 on aarch64
This will be the first QEMU version that will support the
kvm-no-adjvtime CPU feature.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-02-03 09:20:28 +01:00
Laine Stump
cad65f222f qemu: add capabilities flag for failover feature
Presence of the virtio-net-pci option called "failover" indicates
support in a qemu binary of a simplistic bonding of a virtio-net
device with another PCI device. This feature allows migration of
guests that have a network device assigned to a guest with VFIO, by
creating a network bond device in the guest consisting of the
VFIO-assigned device and a virtio-net-pci device, then temporarily
(and automatically) unplugging the VFIO net device prior to migration
(and hotplugging an equivalent device on the migration
destination). (The feature is called "failover" because the bond
device uses the vfio-pci netdev for normal guest networking, but
"fails over" to the virtio-net-pci netdev once the vfio-pci device is
unplugged for migration.)

Full functioning of the feature also requires support in the
virtio-net driver in the guest OS (since that is where the bond device
resides), but if the "failover" commandline option is present for the
virtio-net-pci device in qemu, at least the qemu part of the feature
is available, and libvirt can add the proper options to both the
virtio-net-pci and vfio-pci device commandlines to indicate qemu
should attempt doing the failover during migration.

This patch just adds the qemu capabilities flag "virtio-net.failover".

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-29 15:33:29 -05:00
Peter Krempa
0f73d707ea tests: Add caps for upcoming qemu-5.0
Based on upstream commit 3e08b2b9cb64. This version already dropped the
pre-historic machine types and supports only machine types starting from
'pc-1.0'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-01-27 14:55:03 +01:00
Han Han
9378713f56 qemu_capabilities: Introduce QEMU_CAPS_OBJECT_RNG_BUILTIN
It is used to check if qemu is capable of rng-builtin object.

This object is added since qemu-4.2.0-rc0, commit 6c4e9d48.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-01-24 17:03:21 +01:00
Thomas Huth
e7a65484ba qemu: Refuse to use "ps2" on machines that do not have this bus
The "ps2" bus is only available on certain machines like x86. On
machines like s390x, we should refuse to add a device to this bus
instead of silently ignoring it.

Looking at the QEMU sources, PS/2 is only available if the QEMU binary
has the "i8042" device, so let's check for that and only allow "ps2"
devices if this QEMU device is available, or if we're on x86 anyway
(so we don't have to fake the QEMU_CAPS_DEVICE_I8042 capability in
all the tests that use <input ... bus='ps2'/> in their xml data).

Reported-by: Sebastian Mitterle <smitterl@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1763191
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-01-23 12:57:03 +01:00
Daniel P. Berrangé
4cf8dd0c57 qemu: add support for specifying CPU "dies" topology parameter
QEMU since 4.1.0 supports the "dies" parameter for -smp

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-16 15:11:55 +00:00
Daniel P. Berrangé
42b3e5b9e4 qemu: store the emulator name in the capabilities XML
We don't need this for any functional purpose, but when debugging hosts
it is useful to know what binary a given capabilities XML document is
associated with.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-23 16:39:38 +00:00
Peter Krempa
3e719fe949 test: qemucaps: Refresh x86_64 caps probe data for the qemu-4.2 release
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-12-18 09:49:31 +01:00
Michal Privoznik
c4062d5620 qemu_capabilities: Introduce QEMU_CAPS_DRIVE_NVME
This capability tracks if qemu is capable of:

  -drive file.driver=nvme

The feature was added in QEMU's commit of v2.12.0-rc0~104^2~2.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-12-17 10:04:44 +01:00
Peter Krempa
c6a9e54ce3 qemu: enable blockdev support
Now that all pieces are in place (hopefully) let's enable -blockdev.

We base the capability on presence of the fix for 'auto-read-only' on
files so that blockdev works properly, mandate that qemu supports
explicit SCSI id strings to avoid ABI regression and that the fix for
'savevm' is present so that internal snapshots work.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-11-22 12:51:27 +01:00
Peter Krempa
5b4b503be6 qemu: capabilities: Add detection of the 'savevm' fix for -blockdev
The 'savevm' HMP command didn't work properly with blockdev as it tried
to do snapshot of everything including the protocol nodes accessing
files which are not snapshottable. Qemu fixed this bug so now we need to
detect it to allow enabling blockdev.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-11-22 12:51:27 +01:00
Peter Krempa
3460fef5a0 qemu: caps: Add capability for dynamic 'auto-read-only' support for files
Initial implementation of 'auto-read-only' didn't reopen the backing
files when needed. For '-blockdev' to work we need to be able to tel
qemu to open a file read-only and change it during blockjobs as we label
backing chains with a sVirt label which does not allow writing. The
dynamic auto-read-only supports this as it reopens files when writing
is demanded.

Add a capability to detect that the posix file based backends support
the dynamic part.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-11-22 12:51:27 +01:00
Peter Krempa
73445e49e0 tests: qemucapabilities: Refresh data for unreleased qemu-4.2 on x86_64
The data is captured from qemu v4.2.0-rc2-19-g2061735ff0

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-11-22 12:51:27 +01:00
Jiri Denemark
a882db7bea qemu: Probe for default CPU types
QEMU 4.2.0 will report default CPU types used by each machine type and
we will want to start using it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:06 +01:00
Jiri Denemark
e41e3b29be qemu: Probe machine types for both KVM and TCG
Almost all TCG query-machines replies match KVM. The only exceptions are
4.2.0 replies on s390x which differ in the reported default CPU type.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:06 +01:00
Jiri Denemark
d5d2d8e34a qemu: Make probed machine types depend on accelerator
Some specifics of machine types may depend on the accelerator and thus
the data should be moved to virQEMUCapsAccel. The TCG machine types are
just copied from the ones probed for KVM to simplify the changes to
qemucapabilitiestest data files.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:06 +01:00
Jiri Denemark
a068413e7c qemu: Move machine type data in capabilities cache
In preparation for making machine types dependent on the accelerator,
the <machine> elements are formatted between <cpu type='kvm'> and
<cpu type='tcg'>.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:06 +01:00
Jiri Denemark
fe893a19eb qemu: Add virQEMUCaps{Load,Format}Accel
The new functions are designed to load and format capabilities which
depend on the accelerator (host CPU expansion and CPU models).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:06 +01:00
Jiri Denemark
94b9e68263 qemu: Store typename from query-cpu-definitions in qemuCaps
We need to create a mapping between CPU model names and their
corresponding QOM types.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:06 +01:00
Jiri Denemark
de0ad11263 tests: Update 4.2.0 capabilities data on ppc64
Generated with "spapr/kvm: Set default cpu model for all machine
classes" fix for QEMU applied.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:05 +01:00
Jiri Denemark
10f07def3a tests: Add capabilities for QEMU 4.2.0 on s390x
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-20 17:22:05 +01:00
Andrea Bolognani
25c52cb32f qemu: Perform full expansion on ARM
The ARM implementation of query-cpu-model-expansion only
supports full expansion, so we have to make sure we're using
that expansion mode if we want to obtain any useful data.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019-11-07 16:09:14 +01:00
Andrea Bolognani
42bc9d9a9a qemu: Query max-arm-cpu properties
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019-11-07 16:09:09 +01:00
Andrea Bolognani
d1b5c2c5ba qemu: Introduce QEMU_CAPS_ARM_MAX_CPU
Mirrors the existing QEMU_CAPS_X86_MAX_CPU.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019-11-07 16:09:07 +01:00
Andrea Bolognani
448b7f81fc tests: Update capabilities for QEMU 4.2.0 on aarch64
Unfortunately this results in a lot of churn because of the eigth
hundred and change QEMU commits since the file was last touched,
but the only part we actually care about is the fact that the
query-cpu-model-expansion QMP command is now available on aarch64.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019-11-07 16:08:44 +01:00
Andrea Bolognani
c4d6465aa7 tests: testQemuCapsIterate: Pass prefix and version to callback
Right now we're passing a "base" string that contains both,
separated by an underscore. Some changes that we're going to
introduce later will require us to have the version number on its
own, and instead of delegating the task of splitting the two apart
to the callback it make more sense to perform it upfront.

This change results in quite a bit of churn because we're now
using the version number only, without the prefix, to calculate
the dummy microcodeVersion.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-10-24 17:21:14 +02:00
Andrea Bolognani
4d95f557d6 tests: Add capabilities for QEMU 4.2.0 on aarch64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-10-11 09:37:33 +02:00
Andrea Bolognani
c5330fcefa tests: Add capabilities for QEMU 4.2.0 on ppc64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-10-11 09:37:25 +02:00
Daniel Henrique Barboza
86a8e5a84c qemu: Add capability for the ccf-assist pSeries feature
Linux kernel 5.1 added a new PPC KVM capability named
KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST, which is exposed to the QEMU guest
since QEMU commit 8ff43ee404d under a new sPAPR capability called
SPAPR_CAP_CCF_ASSIST. This cap indicates whether the processor supports
hardware acceleration for the count cache flush workaround, which
is a software workaround that flushes the count cache on context
switch. If the processor has this hardware acceleration, the software
flush can be shortened, resulting in performance gain.

This hardware acceleration is defaulted to 'off' in QEMU. The reason
is that earlier versions of the Power 9 processor didn't support
it (it is available on Power 9 DD2.3 and newer), and defaulting this
option to 'on' would break migration compatibility between the Power 9
processor class.

However, the user running a P9 DD2.3+ hypervisor might want to create
guests with ccf-assist=on, accepting the downside of only being able
to migrate them only between other P9 DD2.3+ hosts running upstream
kernel 5.1+, to get a performance boost.

This patch adds this new capability to Libvirt, with the name of
QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2019-10-09 17:45:09 -04:00
Jonathon Jongsma
9bfcf0f62d qemu: add ramfb capability
Add a qemu capbility to see if the standalone ramfb device is available.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2019-10-09 14:46:30 -04:00
Jiri Denemark
db873ab3bc qemu: Adapt to changed ppc64 CPU model names
QEMU 2.11 for ppc64 changed all CPU model names to lower case. Since
libvirt can't change the model names for compatibility reasons, we need
to translate the matching lower case models to the names known by
libvirt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-10-09 09:53:41 +02:00
Collin Walling
adb689bc2a qemu_capabilities: introduce QEMU_CAPS_QUERY_CPU_MODEL_COMPARISON
This capability enables comparison of CPU models via QMP.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielh413@gmail.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Message-Id: <1568924706-2311-13-git-send-email-walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-10-07 10:10:17 +02:00
Collin Walling
db8bd39f6b qemu_capabilities: introduce QEMU_CAPS_QUERY_CPU_MODEL_BASELINE
This capability enables baselining of CPU models via QMP.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielh413@gmail.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Message-Id: <1568924706-2311-9-git-send-email-walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-10-07 10:09:49 +02:00
Peter Krempa
c419a43565 tests: qemucapabilities: Update caps of qemu-4.1 to released version
Now that qemu 4.1 was released we can update the capabilities to the
final form.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2019-09-27 09:43:37 +02:00
Peter Krempa
19898df4a9 tests: add qemu capabilities data for qemu 4.2
Add capabilities test data for upcoming qemu 4.2.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-09-27 07:20:14 +02:00
Marc-André Lureau
86e068e5d6 qemu: add vhost-user-gpu capabilities checks
Those new devices are available since QEMU 4.1.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-09-24 12:29:29 -04:00
Michal Privoznik
f73e62a17c Revert "qemu: add socket datagram capability"
This reverts commit 0cebb6422a.

This capability is not used anywhere and also it is not contained
in any release so it's safe to just remove it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-09-19 11:38:44 +02:00
Michal Privoznik
c83412bd3c Revert "Temporarily disable bla"
This reverts commit 385543a543.

I've mistakenly pushed wrong branch.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2019-09-19 11:26:56 +02:00
Michal Privoznik
385543a543 Temporarily disable bla
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2019-09-18 17:01:07 +02:00
Marc-André Lureau
0cebb6422a qemu: add socket datagram capability
Datagram socket is available since qemu 4.0, commit
fdec16e3c2a614e2861f3086b05d444b5d8c3406 ("net/socket: learn to talk
with a unix dgram socket").

Required for slirp-helper communication.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019-09-06 12:47:47 +02:00
Jiri Denemark
598ec0db68 qemu: Check for drop-cache capability
QEMU 4.0.0 and newer automatically drops caches at the end of migration.
Let's check for this capability so that we can allow migration when disk
cache is turned on.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Acked-By: Peter Krempa <pkrempa@redhat.com>
2019-08-14 09:36:43 +02:00
Andrea Bolognani
8aa75435ff tests: Update replies for QEMU 2.12.0 on aarch64
We have some early replies that don't quite match with how
QEMU 2.12.0 as released behaves.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019-08-12 16:49:31 +02:00
Jonathon Jongsma
086c19d699 qemu: Add bochs-display capability
Check whether qemu supports the bochs-display device and set a
capability. Update tests.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2019-07-15 10:21:21 +02:00
Peter Krempa
4586b11bed tests: qemucaps: Update 4.1.0 capabilities to a more recent version
Update the capabilities from a non-upstream version (9c70209b63 is not
in qemu.git) to qemu upstream commit 33d6099906 (2019/06/18) so that we
get the QMP schema 'features' field support and are able to detect that
the 'file' block backend supports dynamic auto-read-only.

Note that I've rebuilt this on a machine with a more modern kernel and
microcode which exposes e.g. the recent CPU bug mitigations, thus I
opted to keep the CPU changes rather than trying to do a franken-caps
by updating only the output of query-qmp-schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2019-06-20 09:13:37 +02:00
Jiri Denemark
a3f2c802d2 qemu: Don't use full CPU model expansion
We used type=full expansion on the result of previous type=static
expansion to get all possible spellings of CPU features. Since we can
now translate the QEMU's canonical names to our names, we can drop this
magic and do only type=static CPU model expansion.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-20 00:22:39 +02:00
Jiri Denemark
5030a7450b qemu_command: Use canonical names of CPU features
When building QEMU command line, we should use the preferred spelling of
each CPU feature without relying on compatibility aliases (which may be
removed at some point).

The "unavailable-features" CPU property is used as a witness for the
correct names of the features in our translation table.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-20 00:22:39 +02:00
Jiri Denemark
6f6401fbae qemu: Probe host CPU after capabilities
The way we call query-cpu-model-expansion will rely on some capabilities
bits. Let's make sure all capabilities are set before probing host CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-20 00:22:38 +02:00
Jiri Denemark
0d254bce4e qemu: Probe for "unavailable-features" CPU property
It is similar to "filtered-features" property, which reports CPUID bits
corresponding to disabled features, but more general. The
"unavailable-features" property supports both CPUID and MSR features by
listing their names.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-20 00:22:38 +02:00
Jiri Denemark
2a4c232106 qemu: Probe for max-x86_64-cpu type
We will use it to check whether QEMU supports a specific CPU property.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-20 00:22:38 +02:00
Jiri Denemark
fb5bde121f tests: Add QEMU caps data for future 4.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-20 00:22:38 +02:00
Eric Blake
6abda7a445 backup: Add two new qemu capabilities
Add two capabilities for testing features required for the upcoming
virDomainBackupBegin: use block-dirty-bitmap-merge as the generic
witness of bitmap support needed for checkpoints (since all of the
bitmap management functionalities were finalized in the same qemu 4.0
release), and the bitmap parameter to nbd-server-add for pull-mode
backup support.  Even though both capabilities are likely to be
present or absent together (that is, it is unlikely to encounter a
qemu that backports only one of the two), it still makes sense to keep
two capabilities as the two uses are orthogonal (full backups don't
require checkpoints, push mode backups don't require NBD bitmap
support, and checkpoints can be used for more than just incremental
backups).

Existing code is not affected by the new capabilities.

Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
2019-06-11 21:42:57 -05:00
Andrea Bolognani
124eb803fc qemu: Introduce QEMU_CAPS_MACHINE_VIRT_IOMMU
This capability can be used to figure out whether the
QEMU binary at hand supports the machine type property
we need in order to enable SMMUv3 IOMMU support.

Unfortunately we can't avoid probing the RISC-V binaries
along with the ARM ones, since both architectures have
their own 'virt' machine type.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-06-03 17:40:45 +02:00
Andrea Bolognani
a251095e13 qemu: Only probe available machine types
Since we know the full list of machine types supported
by the QEMU binary when probing machine type properties,
we can save some work (and eventually test suite churn,
as more architecture-specific machine types need to be
probed) by only probing machines that we know exist.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2019-05-17 14:59:40 +02:00
Andrea Bolognani
35e4c15326 tests: Refresh capabilities for QEMU on ppc64
Now that we're probing machine type properties using the
latest machine type rather than the "spapr-machine" parent,
we can finally discover properties that are not available
on all machine types.

This commit refreshes replies for QEMU 4.0.0 as well as
3.1.0 to show not only that we're actually discovering new
machine type properties this way, but also that the number
of available machine type properties increases with each
subsequent QEMU release.

If qom-list-properties had been available in QEMU 2.10.0,
we could now drop the explicit version number checks for
the QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT and
QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT capabilities, but
unfortunately it wasn't, so we have to keep them around
still.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2019-05-17 14:59:37 +02:00
Andrea Bolognani
d22c6221fc qemu: Probe canonicalized machine type
Now that we have the list of machine types available when
probing machine type properties, we can list properties for
the canonicalized version of the "pseries" machine type
instead of having to go through "spapr-machine", which we
know to be the parent type for all "pseries-*-machine"
types. By doing this, we'll be able to find even properties
that are only available from a certain versioned machine
type forward, and can't thus be obtained when looking at
the parent type only.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2019-05-17 14:59:34 +02:00
Andrea Bolognani
295a42e19f qemu: Move call to virQEMUCapsProbeQMPMachineProps()
We're going to need information about available machine types
when probing machine type properties soon, and that means we
have to change the order we call QMP commands.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2019-05-17 14:59:29 +02:00
Boris Fiuczynski
fb6c1f16c5 tests: Add capabilities for QEMU 4.0.0 on s390x
In addition adjusting iothreads-virtio-scsi-ccw.s390x-latest.args to prevent
accidential drive id exposure by QEMU fixed by commit a1dce96236
(qemu: Use the 'device_id' property of SCSI disks to avoid regressing),
and also adjusting *s390x-latest.args files to qemu deprecation changes made
in commit e8c2c8bd07 (Prefer '-overcommit mem-lock' over -realtime mlock').

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2019-05-06 14:49:19 +02:00
Andrea Bolognani
1ec22af93a tests: Add capabilities for QEMU 4.0.0 on ppc64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
2019-05-06 11:57:59 +02:00
Andrea Bolognani
ce478958a3 tests: Add capabilities for QEMU 4.0.0 on aarch64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
2019-05-06 11:57:57 +02:00
Andrea Bolognani
0cf8cf7d7c tests: Refresh capabilities for QEMU 4.0.0 on riscv64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
2019-05-06 11:57:56 +02:00
Andrea Bolognani
f9357d5a51 tests: Refresh capabilities for QEMU 4.0.0 on riscv32
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
2019-05-06 11:56:22 +02:00
Peter Krempa
7dfee399a8 tests: qemucaps: Bump capability test data for qemu-4.0 release on x86_64
Capture and update the 4.0.0 qemu version replies now that it was
released. I opted to keep the CPU differences as there was a qemu bug
which reported an empty string in CPU caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2019-05-06 10:10:18 +02:00
Daniel Henrique Barboza
dca1b1d007 qemu_capabilities: Add QEMU_CAPS_QUERY_CURRENT_MACHINE
QEMU commit 46ea94ca9cf ("qmp: query-current-machine with
wakeup-suspend-support") added a new QMP command called
'query-current-machine' that retrieves guest parameters that
can vary in the same machine model (e.g. ACPI support for x86 VMs
depends on the '--no-acpi' option). Currently, this API has a single
flag, 'wakeup-suspend-support', that indicates whether the guest has
the capability of waking up from suspended state.

Introduce a libvirt capability that reflects whether qemu has the
monitor command.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2019-04-25 11:43:53 +02:00
Michal Privoznik
be51feff69 qemu_capabilities: Introduce QEMU_CAPS_OVERCOMMIT
Added in QEMU commit of v3.0.0-rc0~48^2~9 (then fixed by
v3.1.0-rc0~119^2~37) QEMU is replacing '-realtime mlock' with
'-overcommit mem-lock'. Add a capability to tell if we're dealing
new new enough qemu to use the replacement.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-04-12 13:42:39 +02:00
Michal Privoznik
a08c4b3741 qemu: Always assume QEMU_CAPS_REALTIME_MLOCK
The '-realtime mlock' cmd line argument was introduced in QEMU
commit v1.5.0-rc0~190 which matches minimal QEMU version we
require. Therefore, the capability will always be present.

Apparently, nearly none of our xml2argv test cases had the
capability hence slightly bigger change under qemuxml2argvdata/.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-04-12 13:39:42 +02:00
Andrea Bolognani
e602e86881 tests: Refresh capabilities for QEMU 4.0.0 on RISC-V
There are a few differences, but the one we're interested in is
that PCIe Root Ports are finally available: as a result of this,
our riscv64-virt-headless guest will switch from virtio-mmio to
virtio-pci.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-04 09:52:23 +02:00
Peter Krempa
c358adc571 qemu: capabilities: Always assume disk snapshot caps
'blockdev-snapshot-sync' is present in QEMU since v0.14.0-rc0 and
'transaction' since v1.1.0 (52e7c241ac766406f05fa)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-04-03 11:58:10 +02:00
Peter Krempa
72e88ca0a2 qemu: capabilities: Always assume QEMU_CAPS_DRIVE_MIRROR
qemu added the 'drive-mirror' command in v1.3.0 (d9b902db3fb71fdc)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-04-03 11:58:10 +02:00
Peter Krempa
852afb2dc4 qemu: capabilities: Always assume QEMU_CAPS_BLOCK_COMMIT
qemu added the 'block-commit' command in v1.3.0 (ed61fc10e8c8d2)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-04-03 11:58:10 +02:00
Peter Krempa
d5654a7537 qemu: capabilities: Always assume QEMU_CAPS_BLOCKJOB_ASYNC
This was detected by the presence of 'block-stream' which is present in
qemu since v1.1 (db58f9c0605fa151b8c4)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-04-03 11:58:09 +02:00
Cole Robinson
f15111f65c qemu: capabilities: Add virtio/vhost {non-}transitional
Add a single QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL that
will be set if any of the following qemu devices are found:

    virtio-blk-pci-transitional
    virtio-blk-pci-non-transitional
    virtio-net-pci-transitional
    virtio-net-pci-non-transitional
    vhost-scsi-pci-transitional
    vhost-scsi-pci-non-transitional
    virtio-rng-pci-transitional
    virtio-rng-pci-non-transitional
    virtio-9p-pci-transitional
    virtio-9p-pci-non-transitional
    virtio-balloon-pci-transitional
    virtio-balloon-pci-non-transitional
    vhost-vsock-pci-transitional
    vhost-vsock-pci-non-transitional
    virtio-input-host-pci-transitional
    virtio-input-host-pci-non-transitional
    virtio-scsi-pci-transitional
    virtio-scsi-pci-non-transitional
    virtio-serial-pci-transitional
    virtio-serial-pci-non-transitional

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-03-04 11:08:40 -05:00
Ján Tomko
b4a4e8f71a qemu: do not format <usedQMP/> in qemu caps XML
Since commit a7424faff QMP is always used.

Also, commit 932534e8 removed the last use of this apart from:
* parsing/formatting this in the caps cache
* using it as a temporary variable to know when to report an error

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-02-12 14:02:38 +01:00
Peter Krempa
22d7222ec0 qemu: caps: Don't call 'query-events' when we probe events from QMP schema
Avoid calling the command and fix test fallout.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 10:11:20 +01:00
Peter Krempa
850bb78a6e qemu: caps: Always assume QEMU_CAPS_DEVICE_TRAY_MOVED
The event was added by qemu commit 6f382ed226f3 released in v1.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 10:11:20 +01:00
Peter Krempa
8c191a9061 qemu: caps: Always assume QEMU_CAPS_DEVICE_DEL_EVENT
DEVICE_DELETED was added in qemu commit 0402a5d65ec00 which was released
in v1.5.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 10:11:20 +01:00
Peter Krempa
ea34af1f35 qemu: caps: Always assume QEMU_CAPS_SEAMLESS_MIGRATION
The event was added by qemu commit 2fdd16e239c2a2 released in v1.3.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 10:11:20 +01:00
Peter Krempa
3f2fa8f303 qemu: caps: Always assume QEMU_CAPS_BALLOON_EVENT
The event was added to qemu by commit 973603a813c5d60 which is contained
in the 1.2.0 release.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 10:11:19 +01:00
Peter Krempa
85a8e364f3 qemu: caps: Introduce capability for 'device_id' property of 'scsi-disk'
The property allows to control the guest-visible content of the vendor
specific designator of the 'Device Identification' page of a SCSI
device's VPD (vital product data).

QEMU was leaking the id string of -drive as the value if the 'serial' of
the disk was not specified. Switching to -blockdev would impose an ABI
change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 08:48:33 +01:00
Peter Krempa
8440f83529 test: qemucaps: Update caps with scsi 'device_id' property
Based on qemu commit 'v3.1.0-1445-ga61faa3d02'. Will allow checking
for the scsi 'device_id' property.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 08:48:33 +01:00
Peter Krempa
1dcba456fa qemu: caps: Always assume presence of 'ide-hd' and 'ide-cd' devices
The split of ide-disk into the two separate devices was introduced by
qemu commit 1f56e32a7f4b3 released in qemu v0.15.

Note that when compared to the previous commit which made sure that no
disk related tests were touched, in this case it's not as careful.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 08:34:17 +01:00
Peter Krempa
4bf49bc566 qemu: caps: Always assume presence of 'scsi-hd' and 'scsi-cd' device
The split of scsi-disk into the two separate devices was introduced by
qemu commit b443ae67 released in qemu v0.15.

All changes to test files are not really related to disk testing thanks
to previous refactors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 08:34:17 +01:00
Peter Krempa
e67b6dcf36 qemu: capabilities: Probe caps for 'ide-hd' instead of 'ide-drive'
Since commit a4cda054e7 we are using 'ide-hd' and 'ide-cd' instead of
'ide-drive'. We also should probe capabilities for 'ide-hd' instead of
'ide-drive'. It is safe to do as 'ide-drive' is the common denominator
of both 'ide-hd' and 'ide-cd' so all the properties were common.

For now the test data are modified by just changing the appropriate type
when probing for caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 08:30:38 +01:00
Peter Krempa
7d114e1b72 qemu: capabilities: Probe caps for 'scsi-hd' instead of 'scsi-disk'
Since commit 02e8d0cfdf we are using 'scsi-hd' and 'scsi-cd' instead of
'scsi-disk'. We also should probe capabilities for 'scsi-hd' instead of
'scsi-disk'. It is safe to do as 'scsi-disk' is the common denominator
of both 'scsi-hd' and 'scsi-cd' so all the properties were common.

For now the test data are modified by just changing the appropriate type
when probing for caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 08:23:26 +01:00
Peter Krempa
aedd20386d tests: qemucaps: Make fake 'microcodeVersion' depend on filename instead of length
To avoid changes to the filled in microcode in case we change the caps
replies file for any reason make the number depend on the filename.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-02-08 08:23:26 +01:00
Andrea Bolognani
030f963129 tests: Add capabilities data for QEMU 4.0.0 on RISC-V
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-02-01 11:57:33 +01:00
Cole Robinson
fb0d0d6c54 tests: Add capabilities data for QEMU 4.0.0 x86_64
The next release of QEMU is going to be 4.0.0. A bit early, but
this adds capabilities data for x86_64 from current qemu git
15bede554162dda822cd762c689edb6fa32b6e3b

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-01-21 17:29:10 -05:00
Luyao Zhong
404766dbcc qemu: Introduce QEMU_CAPS_DEVICE_NVDIMM_UNARMED capability
This capability tracks if nvdimm has the unarmed attribute or not
for the nvdimm readonly xml attribute.

Signed-off-by: Luyao Zhong <luyao.zhong@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2019-01-02 09:00:34 -05:00
Luyao Zhong
55b4fc78b6 qemu: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM capability
This capability tracks if memory-backend-file has the pmem
attribute or not.

Signed-off-by: Luyao Zhong <luyao.zhong@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2019-01-02 09:00:34 -05:00
Luyao Zhong
e9b28cc9bc qemu: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN capability
This capability tracks if memory-backend-file has the align
attribute or not.

Signed-off-by: Luyao Zhong <luyao.zhong@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2019-01-02 09:00:34 -05:00
Erik Skultety
312063b766 qemu: caps: Introduce QEMU_EGL_HEADLESS_RENDERNODE capability
Now that we have QAPI introspection of display types in QEMU upstream,
we can check whether the 'rendernode' option is supported with
egl-headless display type.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-12-03 14:56:08 +01:00
Erik Skultety
9c4afbda34 test: caps: Add capabilities for QEMU 3.1.0
These are based on QEMU v3.1.0-rc2-41-g4822f1ee9e.

Acked-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-11-29 08:54:01 +01:00
Andrea Bolognani
0029eace52 qemu: Introduce QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-27 17:12:18 +01:00
Andrea Bolognani
e95bcd8d18 tests: Add capabilities data for QEMU 3.1.0 on ppc64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-27 17:12:15 +01:00
John Ferlan
9aec374b01 qemu: Detect whether iothread polling is supported
Add a capability check for IOThread polling (all were added at the
same time, so only one check is necessary).

Based on code originally posted by Pavel Hrdina <phrdina@redhat.com>
with the only changes to include the more recent QEMU releases.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
2018-11-19 07:26:40 -05:00
Marc-André Lureau
a6fd5b596a qemu: check memory-backend-memfd.hugetlb capability
QEMU 3.1 should only expose the property if the host is actually
capable of creating hugetable-backed memfd. However, it may fail
at runtime depending on requested "hugetlbsize".

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-11-16 08:57:12 +01:00
Marc-André Lureau
21b18ea5d9 qemu: add memory-backend-memfd capability check
Check availability of "-object memory-backend-memfd".

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-11-16 08:57:12 +01:00
Yi Min Zhao
29ad952f7e qemu: Introduce zPCI capability
Let's introduce zPCI capability.

Signed-off-by: Yi Min Zhao <zyimin@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-11-15 12:32:17 +01:00
Andrea Bolognani
5095394e1e qemu: Drop QEMU_CAPS_DEVICE_SCSI_GENERIC
It was already available in 1.5.0, so we can assume it's
present and avoid checking for it at runtime.

This commit is best viewed with 'git show -w'.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-09-21 16:50:46 +02:00
Boris Fiuczynski
d7434ae800 tests: Add capabilities data for QEMU 3.0.0 on s390x
The QEMU binary is compiled from the v3.0.0 tag.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2018-09-20 16:24:58 -04:00
Andrea Bolognani
b38a85a321 qemu: Drop QEMU_CAPS_CHARDEV_SPICEPORT
The capability was introduced in QEMU 1.5.0, which is our
minimum supported QEMU version these days.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-09-12 15:36:46 +02:00
Andrea Bolognani
d6a1d0af62 qemu: Drop QEMU_CAPS_VNC_WEBSOCKET
The capability was introduced in QEMU 1.3.1 and we require
QEMU 1.5.0 these days.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-09-12 15:35:58 +02:00
Ján Tomko
4168e33755 qemu: remove leftover property probing
Previous commits removed all capabilities from per-device property
probing for:

  pci-assign
  kvm-pci-assign
  usb-host
  scsi-generic

Remove them from the virQEMUCapsDeviceProps list and get rid of the
redundant device-list-properties QMP calls.

Note that 'pci-assign' was already useless, because the QMP version
of the device is called 'kvm-pci-assign', see libvirt commit 7257480
from 2012.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Ján Tomko
9b17c9392a qemu: always assume QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX
Introduced by QEMU commit 28b77657 in v1.0-rc4~21^2~8.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Ján Tomko
b5acaaae36 qemu: always assume QEMU_CAPS_VFIO_PCI_BOOTINDEX
Introduced by QEMU commit c29029d which was included in 1.5.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Ján Tomko
8a741a8e31 qemu: always assume QEMU_CAPS_USB_HOST_BOOTINDEX
Added by QEMU commit 65bb3a5 contained in v1.1.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Ján Tomko
40f3c23c0f qemu: always assume QEMU_CAPS_USB_REDIR_BOOTINDEX
Added by QEMU commit 65bb3a5 contained in v1.1.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Ján Tomko
9eae152fcb qemu: always assume QEMU_CAPS_PCI_BOOTINDEX
At the time of the addition of 'pci-assign' in QEMU commit
v1.3.0-rc0~572^2 the bootindex argument was already supported.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Ján Tomko
e30b5d6b89 qemu: always assume QEMU_CAPS_PCI_CONFIGFD
At the time of the addition of 'pci-assign' in QEMU commit
v1.3.0-rc0~572^2 the configfd argument was already supported.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Ján Tomko
c2d739a747 qemu: drop unused QEMU_CAPS_DEVICE_USB_NET
Added by commit fc66c1603c and not used since.

Also, the device was present in QEMU 1.5.0 so this capability
will not be needed if we ever decide to implement usb-net support.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-09-07 17:26:17 +02:00
Daniel P. Berrangé
b985d1a774 qemu: record the QEMU default machine in capabilities
We don't honour the QEMU default machine type anymore, always using the
libvirt chosen default instead. The QEMU argv parser, however, will need
to know the exacty QEMU default, so we must record that info.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-28 11:49:01 +01:00
Peter Krempa
f2019083de qemu: capabilities: Always assume QEMU_CAPS_ADD_FD
The capability was usable since qemu 1.3 so we can remove all the
detection code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-08-24 15:58:34 +02:00
Peter Krempa
22d8f55b21 qemu: capabilities: Detect active block commit via QMP schema probing if possible
For versions where we can probe that the arguments are optional we can
perform the probing by a schema query rather than sending a separate
command to do so.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-08-24 15:58:34 +02:00
Lubomir Rintel
869cb692fa tests: Add RISC-V architectures
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-08-24 13:23:36 +02:00
Erik Skultety
77f51ab520 qemu: caps: Format SEV platform data into qemuCaps cache
Since we're not saving the platform-specific data into a cache, we're
not going to populate the structure, which in turn will cause a crash
upon calling virNodeGetSEVInfo because of a NULL pointer dereference.
Ultimately, we should start caching this data along with host-specific
capabilities like NUMA and SELinux stuff into a separate cache, but for
the time being, this is a semi-proper fix for a potential crash.

Backtrace (requires libvirtd restart to load qemu caps from cache):
    #0 qemuGetSEVInfoToParams
    #1 qemuNodeGetSEVInfo
    #2 virNodeGetSEVInfo
    #3 remoteDispatchNodeGetSevInfo
    #4 remoteDispatchNodeGetSevInfoHelper
    #5 virNetServerProgramDispatchCall
    #6 virNetServerProgramDispatch
    #7 virNetServerProcessMsg
    #8 virNetServerHandleJob
    #9 virThreadPoolWorker
    #10 virThreadHelper

https: //bugzilla.redhat.com/show_bug.cgi?id=1612009
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
2018-08-20 07:18:21 +02:00
Erik Skultety
764491c9dd qemu: Fix probing of AMD SEV support
So the procedure to detect SEV support works like this:
1) we detect that sev-guest is among the QOM types and set the cap flag
2) we probe the monitor for SEV support
    - this is tricky, because QEMU with compiled SEV support will always
    report -object sev-guest and query-sev-capabilities command, that
    however doesn't mean SEV is supported
3) depending on what the monitor returned, we either keep or clear the
capability flag for SEV

Commit a349c6c21c added an explicit check for "GenericError" in the
monitor reply to prevent libvirtd to spam logs about missing
'query-sev-capabilities' command. At the same time though, it returned
success in this case which means that we didn't clear the capability
flag afterwards and happily formatted SEV into qemuCaps. Therefore,
adjust all the relevant callers to handle -1 on errors, 0 on SEV being
unsupported and 1 on SEV being supported.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
2018-08-20 07:18:11 +02:00
Peter Krempa
1315be9936 tests: qemucapabilities: Update capability data for qemu 3.0.0
Update for the release of qemu 3.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-08-15 10:02:24 +02:00
Peter Krempa
caccbba64a qemu: capabilities: Always assume QEMU_CAPS_BOOTINDEX
The field was added in qemu v0.13.0-rc0-731-g1ca4d09ae0 so all supported
qemu versions now use it.

There's a LOT of test fallout as we did not use capabilities close
enough to upstream for many of our tests.

Several tests had a 'bootindex' variant. Since they'd become redundant
they are also removed here.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-08-09 17:00:54 +02:00
Erik Skultety
11c7bdac6d qemu: caps: Add vfio-pci.display capability
QEMU 2.12 introduced a new vfio-pci device option 'display=on/off/auto'.
This patch introduces the necessary capability.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-07-18 18:16:07 +02:00
Erik Skultety
7ab7d0ed49 qemu: caps: Introduce a capability for egl-headless
Since QEMU 2.10, it's possible to use a new type of display -
egl-headless which uses drm nodes to provide OpenGL support. This patch
adds a capability for that. However, since QEMU doesn't provide a QMP
command to probe it, we have to base the capability on specific QEMU
version.

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-07-18 18:15:58 +02:00
Erik Skultety
aaf105da59 tests: Update capabilities data for QEMU 3.0.0 x86_64
The original capabilities didn't include a patched kernel for spectre,
SPICE gl support and had xen support enabled which we already have
dropped.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-07-17 11:43:06 +02:00
Erik Skultety
fa39de4f86 tests: Add capabilities data for QEMU 2.11 x86_64
We were missing these for x86_64 arch, so this is just for completeness.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-07-17 11:43:06 +02:00
Peter Krempa
a087a8e60a qemu: capabilities: Add capability for werror/rerror for 'usb-device' frontend
Support for specifying it with the -device frontend was added recently.
Add a capability for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-07-10 13:37:51 +02:00
Peter Krempa
8b4a31efc0 tests: qemucaps: Add test data for upcoming qemu 3.0.0
Based on qemu commit ab3257c281c1a1a91da1090ac9e38ddd8f860c63

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-07-10 13:37:51 +02:00
Andrea Bolognani
755a5765ac qemu: Add capability for the HTM pSeries feature
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-07-03 09:46:52 +02:00
Andrea Bolognani
90e6e0fae8 qemu: Add capability for the HPT maxpagesize feature
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-06-26 10:15:44 +02:00
Andrea Bolognani
0a527017c4 tests: Add replies for QEMU 3.0.0 on ppc64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-06-26 10:15:36 +02:00
Peter Krempa
e6be524508 tests: qemucapabilities: Test commands used to query capabilities
Use qemuMonitorTestNewFromFileFull which allows to test commands used
along with providing replies. This has two advantages:

1) It's easier to see which command was used when looking at the files
2) We check that the used commands are actually in the correct order

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-06-12 10:27:50 +02:00
Brijesh Singh
d4005609f3 qemu: Provide support to query the SEV capability
QEMU version >= 2.12 provides support for launching an encrypted VMs on
AMD x86 platform using Secure Encrypted Virtualization (SEV) feature.
This patch adds support to query the SEV capability from the qemu.

Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-06-12 09:51:59 +02:00
Martin Kletzander
3ea32b635d qemu: Add capability flag for setting the extended tseg size
For getting the reply I queried the newest and oldest QEMU using
test/qemucapsprobe.  From the differences I only extracted the reply to the new
QMP command and discarded the rest.  For all the versions below the one which
added support for the new option I used the output from the oldest QEMU release
and for those that support it I used the output from the newest one.

In order to make doubly sure the reply is where it is supposed to be (the
replies files are very forgiving) I added the property to all the replies files,
reran the tests again and fixed the order in replies files so that all the
versions are reporting the new capability.  Then removed that one property.

After that I used test/qemucapsfixreplies to fix the reply IDs.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-08 10:28:46 +02:00
Stefan Berger
b50edcd894 qemu: Extend QEMU capabilities with 'tpm-emulator'
Extend the QEMU capabilities with tpm-emulator support.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-06 10:48:41 -04:00
Daniel P. Berrangé
7cef131efe qemu: probe for -chardev 'fd' parameter for FD passing
QEMU >= 2.12 will support passing of pre-opened file descriptors for
socket based character devices.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-06-05 17:16:47 +01:00
Ján Tomko
f672fa3b1d Introduce QEMU_CAPS_DEVICE_VHOST_VSOCK
Add a new capability flag for vhost-vsock-device

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-05-29 15:42:03 +02:00
John Ferlan
3005002e0e qemu: Add VM Generation ID device capability
Add the query of the device objects for the vmgenid device

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
2018-05-25 08:04:57 -04:00
Peter Krempa
e969af4cec qemu: caps: Add capability for blockdev-add/blockdev-del
The capability also represents that 'blockdev-add' is functional. It's
necessary to detect it via presence of 'blockdev-del' since blockdev-add
did not have the unsupported 'x-blockdev-add' version previously and
thus would be marked as present even if we could not use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-23 13:18:25 +02:00
Filip Alac
3b8d050911 qemu: capabilities: Add 'hda-output' sound codec to capabilities
Signed-off-by: Filip Alac <filipalac@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-05-23 09:51:53 +02:00
Ján Tomko
6dbe7243f9 Reintroduce QEMU_CAPS_SECCOMP_SANDBOX
Commit 766d5c1b deprecated the capability, because we were assuming
it for every QEMU binary. At the time of the introduction, there
was no way to probe for this via QMP.

However since QEMU 1.5.0 (which is the earliest version we support)
we can rely on the query-command-line-options command to detect this
feature.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-23 09:45:34 +02:00
Michal Privoznik
04dcc6e0e0 qemu: Introduce QEMU_CAPS_SCREENDUMP_DEVICE
As of v2.12.0-rc0~32^2 QEMU is capable specifying which display
device and head should the screendump be taken from. Track this
capability so that we can use it later in our virDomainScreenshot
API.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-05-17 17:06:31 +02:00
Shalini Chellathurai Saroja
c6e605dc0e tests: Update caps for QEMU 2.12.0 on s390x
Let us update the existing xml and replies files for QEMU 2.12.0 on
s390x.

Used a z14 using a QEMU 2.12 GA build and the following sequence:

  tests/qemucapsprobe /usr/bin/qemu-system-s390x > \
         tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies

  VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiestest
  VIR_TEST_REGENERATE_OUTPUT=1 tests/domaincapstest

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-16 14:19:57 -04:00
Maciej Wolny
3278a7bb26 qemu: Add QEMU_CAPS_SDL_GL to qemu capabilities
Support OpenGL acceleration capability when using SDL graphics.

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-15 16:50:38 -04:00
Shalini Chellathurai Saroja
263e65fd20 qemu: introduce vfio-ccw capability
Let us introduce the capability vfio-ccw for supporting the basic
channel I/O passthrough, which have been introduced in QEMU 2.10. The
current focus is to support dasd-eckd (cu_type/dev_type = 0x3990/0x3390)
as the target device.

Let us also introduce the capability QEMU_CAPS_CCW_CSSID_UNRESTRICTED
for virtual-css-bridge. This capability is based on the
cssid-unrestricted property which exists if QEMU no longer enforces
cssid restrictions based on ccw device types.

Vfio-ccw capability is dependent on the hidden virtual-css-bridge, so
that we are able to probe for the cssid-unrestriced property to make
sure the devices are visible to non-mcss-e enabled guests.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-14 12:12:02 -04:00
Shalini Chellathurai Saroja
f245a9791c qemu: introduce capability for virtual-css-bridge
Let us introduce the capability QEMU_CAPS_CCW for virtual-css-bridge
and replace QEMU_CAPS_VIRTIO_CCW with QEMU_CAPS_CCW in code segments
which identify support for ccw devices.

The virtual-css-bridge is part of the ccw support introduced in QEMU 2.7.
The QEMU_CAPS_CCW capability is based on the existence of the QEMU type.

Let us also add the capability QEMU_CAPS_CCW to the tests which
require support for ccw devices.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-14 11:26:15 -04:00
Michal Privoznik
72c1770aa0 qemu_capabilities: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD
This capability tracks if memory-backend-file has discard-data
attribute or not.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-05-14 09:42:20 +02:00
Michal Privoznik
8a94501e8c qemu_capabilities: Introduce QEMU_CAPS_QOM_LIST_PROPERTIES
This capability tracks if qemu has "qom-list-properties" monitor
command.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-05-14 09:42:20 +02:00
Michal Privoznik
b0cd8045f0 qemu: Detect pr-manager-helper capability
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-11 09:26:47 +02:00
Ján Tomko
941c8b0d00 Deprecate QEMU_CAPS_NO_KVM_PIT
The -no-kvm-pit-reinjection option has been deprecated since
its introduction in QEMU 1.3. See commit <1569fa1>.

Drop the capability since all the QEMUs we support allow tuning
the kvm-pit properties via -global.

Also add the QEMU_CAPS_KVM_PIT_TICK_POLICY to the clock-catchup
tests, since expecting it to succeed with QEMU that does not
have kvm-pit makes no sense.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-07 10:33:13 +02:00
Stefan Berger
9323c4bb88 qemu: Extend the capabilities with tpm-crb device
QEMU on x86_64 (since v2.12) can support tpm-crb devices.
Introduce qemu capabilities for this device.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-03 11:28:42 -04:00
Peter Krempa
51541809b8 qemu: caps: Add capability for TLS transport in the NBD server
The NBD server in qemu supports TLS transport. Detect this capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-30 14:57:38 +02:00
Peter Krempa
955df88de6 qemu: caps: Add capability for 'write-cache' parameter of disk frontends
QEMU translates the cache mode of a disk internally into 3 flags.
'write-cache' is a flag of the frontend while others are flag of the
backing storage. Add capability which will allow expressing it via the
frontend attribute.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-19 11:20:34 +02:00
Viktor Mihajlovski
5cff7b7db7 qemu: add capability detection for query-cpus-fast
Detect whether QEMU supports the QMP query-cpus-fast API
and set QEMU_CAPS_QUERY_CPUS_FAST in this case.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
2018-04-17 12:45:25 -04:00
Ján Tomko
31ca6a542e Introduce QEMU_CAPS_SECCOMP_BLACKLIST
QEMU commit 1bd6152 changed the default behavior from whitelist
to blacklist and introduced a few sets of system calls.

Use the 'elevateprivileges' parameter of -sandbox as a witness
of this change.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-17 16:29:38 +02:00
Ján Tomko
53fa2edb62 qemu: deprecate QEMU_CAPS_MACHINE_USB_OPT
Implied by QEMU >= 1.3.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:50:25 +02:00
Ján Tomko
5a41bd6df2 qemu: deprecate QEMU_CAPS_DISPLAY
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:49:21 +02:00
Ján Tomko
4a42ece13a qemu: deprecate QEMU_CAPS_HOST_PCI_MULTIDOMAIN
Implied by QEMU >= 1.2.0.
Delete the negative test cases now that they always pass.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:40:38 +02:00
Ján Tomko
027b7f9edf qemu: deprecate QEMU_CAPS_VNC_SHARE_POLICY
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:37:50 +02:00
Ján Tomko
84b40886f2 qemu: deprecate QEMU_CAPS_DUMP_GUEST_CORE
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:35:09 +02:00
Ján Tomko
69420756b2 qemu: deprecate QEMU_CAPS_MACHINE_OPT
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:24:09 +02:00
Ján Tomko
fd247f8fe7 qemu: deprecate QEMU_CAPS_IPV6_MIGRATION
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 13:01:28 +02:00
Ján Tomko
2089a801ba qemu: deprecate QEMU_CAPS_DTB
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 13:01:10 +02:00
Ján Tomko
766d5c1b5a qemu: deprecate QEMU_CAPS_SECCOMP_SANDBOX
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 13:00:53 +02:00
Ján Tomko
d91890f30c qemu: deprecate QEMU_CAPS_NETDEV_BRIDGE
Unused since commit <2d80fbb1>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 13:00:35 +02:00
Ján Tomko
da6df1be8c qemu: deprecate QEMU_CAPS_WAKEUP
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 13:00:18 +02:00
Ján Tomko
47b12ecfdf qemu: deprecate QEMU_CAPS_DRIVE_IOTUNE
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 13:00:06 +02:00
Ján Tomko
b6389394e0 qemu: deprecate QEMU_CAPS_FSDEV_WRITEOUT
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 12:57:14 +02:00
Ján Tomko
08ad06ca68 qemu: deprecate QEMU_CAPS_DRIVE_COPY_ON_READ
Implied by QEMU >= 1.2.0.

Also delete the now redundant disk-drive-copy-on-read test.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 12:56:49 +02:00
Ján Tomko
dd924fb05c qemu: deprecate QEMU_CAPS_FSDEV_READONLY
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 12:33:00 +02:00
Ján Tomko
5b2c3d404e qemu: deprecate QEMU_CAPS_DRIVE_CACHE_UNSAFE
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 20:32:26 +02:00
Ján Tomko
fe35b1ad64 qemu: deprecate QEMU_CAPS_NO_SHUTDOWN
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 20:31:42 +02:00
Ján Tomko
53f9437748 qemu: deprecate QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 17:12:06 +02:00
Ján Tomko
c3eaccfa60 qemu: deprecate QEMU_CAPS_CHARDEV_SPICEVMC
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 17:11:26 +02:00
Ján Tomko
0bfb93fff2 qemu: deprecate QEMU_CAPS_DRIVE_AIO
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:35:55 +02:00
Ján Tomko
3ebce7450a qemu: deprecate QEMU_CAPS_VGA_NONE
Last use was removed by commit 0586cf98 deprecating
QEMU_CAPS_DEVICE.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:31:56 +02:00
Ján Tomko
e3746addde qemu: deprecate QEMU_CAPS_SMBIOS_TYPE
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:31:36 +02:00
Ján Tomko
3a066efe7c qemu: deprecate QEMU_CAPS_NAME_PROCESS
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:28:40 +02:00
Ján Tomko
e559bf3826 qemu: deprecate QEMU_CAPS_FSDEV
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:27:54 +02:00
Ján Tomko
8b66c1bc85 qemu: deprecate QEMU_CAPS_BOOT_MENU
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:26:13 +02:00
Ján Tomko
61623e42bc qemu: deprecate QEMU_CAPS_NODEFCONFIG
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixed-up-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:16:16 +02:00
Ján Tomko
c1f684eac1 qemu: deprecate QEMU_CAPS_VHOST_NET
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 15:00:26 +02:00
Ján Tomko
470c3827cf qemu: deprecate QEMU_CAPS_RTC
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 14:55:55 +02:00
Ján Tomko
649a9dd7a4 qemu: deprecate QEMU_CAPS_SDL
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 14:54:58 +02:00
Ján Tomko
ebc0b50e9f qemu: deprecate QEMU_CAPS_DRIVE_SERIAL
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:17 +02:00
Ján Tomko
cc77a2b785 qemu: deprecate QEMU_CAPS_MEM_PATH
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:17 +02:00
Ján Tomko
cc32731a3c qemu: deprecate QEMU_CAPS_NO_USER_CONFIG
Implied by QEMU >= 1.2.0.

Delete this one first, because QEMU_CAPS_NODEFCONFIG is only used
when QEMU_CAPS_NO_USER_CONFIG is unsupported.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:17 +02:00
Ján Tomko
a32539dea1 qemu: deprecate QEMU_CAPS_MONITOR_JSON
We require QEMU >= 1.5.0, assume every QEMU supports it.
Sadly that does not let us trivially drop qemuMonitor's
priv->monJSON bool, because of qemuDomainQemuAttach.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:17 +02:00
Ján Tomko
ad8a7c4f85 qemu: deprecate QEMU_CAPS_NETDEV
This makes qemuDomainSupportsNetdev identical to
qemuDomainSupportsNicdev and leaves some code in
qemuDomainAttachNetDevice to be cleaned up later.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:16 +02:00
Ján Tomko
6826c99ac1 qemu: deprecate QEMU_CAPS_PCI_MULTIFUNCTION
Supported since QEMU 0.13, but we require QEMU 1.5.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:16 +02:00
Ján Tomko
c1bc9c662b Require QEMU 1.5.0
According to the policy described on https://libvirt.org/platforms.html
the QEMU versions in the oldest relevant releses are:

  SLES 12: 2.0.0
  RHEL 7: 1.5.3
  Ubuntu 14.04: 2.0.0

Set the minimum to 1.5.0 and drop support for RHEL 6.

This will let us assume lots of capabilities.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-10 15:16:44 +02:00
Andrea Bolognani
1764a51b95 qemu: Add QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE
This capability will be set when the pcie-pci-bridge device
is available in the QEMU binary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:12:15 +02:00
Peter Krempa
b874e297b2 qemu: caps: Add capability for LUKS encrypted qcow2 image support
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-03 15:48:38 +02:00
Andrea Bolognani
7dd5b0c54b tests: qemucapabilities: Drop mostly duplicated data
When GIC support was introduced (QEMU 2.6 timeframe) we needed
to make sure both GICv2 hardware and GICv3 hardware were handled
correctly, and that was achieved by having separate capabilities
data for each.

Now that we have capabilities data for several QEMU versions we
can stop storing data for GICv2 and GICv3 hardware separately,
and instead have GICv2 data for QEMU <= 2.10 and GICv3 data for
QEMU >= 2.12, without losing any coverage.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-03-23 20:27:52 +01:00
Farhan Ali
f79e38795e qemu: Introduce capabilities for virtio input ccw devices
QEMU on S390 (since v2.11) can support virtio input ccw devices.
Introduce qemu capabilities for these devices.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2018-03-23 19:40:20 +01:00
Farhan Ali
a6441402a5 qemu: Introduce a new capability for virtio-gpu-ccw
QEMU on S390 (since v2.11) can support virtio-gpu-ccw device.
Let's introduce a new qemu capability for the device.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2018-03-23 19:40:20 +01:00
Andrea Bolognani
116fcab069 tests: Add capabilities data for QEMU 2.12
The QEMU binary is compiled from the v2.12.0-rc0 tag.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-03-21 18:05:05 +01:00
Andrea Bolognani
a68ba68330 qemu: Take full advantage of conditional device property probing
Commit 4ae59411fa introduced the ability to make probing for
device properties conditional on a capability being set, but
didn't extend the use of this feature to existing devices.

This commit does the last bit of work, which results in a lot
of pointless QMP chatter no longer happening and our test suite
shrinking a fair bit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-03-08 16:05:46 +01:00
Shalini Chellathurai Saroja
ab9e2041c0 tests: Add capabilities for QEMU 2.11.0 on s390x
Let us introduce the xml and reply files for QEMU 2.11.0 on s390x.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2018-03-06 06:38:09 -05:00
John Ferlan
5870f95a7a qemu: Add dump completed event to the capabilities
Add the DUMP_COMPLETED check to the capabilities. This is the
mechanism used to determine whether the dump-guest-memory command
can support the "-detach" option and thus be able to wait on the
event and allow for a query of the progress of the dump.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2018-02-02 15:19:14 -05:00
Shivaprasad G Bhat
524207a5c2 qemu: Add capability for pseries machine's max-cpu-compat= parameter
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-01-05 17:00:58 +01:00
Paolo Bonzini
b527589d1f qemu: capabilities: force update if the microcode version does not match
A microcode update can cause the CPUID bits to change; an example
from the past was the update that disabled TSX on several Haswell
and Broadwell machines.

Therefore, place microcode version in the virQEMUCaps struct and
XML, and rebuild the cache if the versions do not match.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2018-01-04 16:52:03 +01:00
Andrea Bolognani
a45ecb7bf6 qemu: Add QEMU_CAPS_DEVICE_PL011
All serial devices shoule have an associated capability.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2017-11-28 15:58:37 +01:00
Andrea Bolognani
b0f1c291a0 qemu: Add QEMU_CAPS_DEVICE_ISA_SERIAL
All serial devices shoule have an associated capability.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2017-11-28 15:51:33 +01:00
John Ferlan
4f44b8b5ae qemu: Get capabilities to use iscsi password-secret argument
Detect the capability via the query-qmp-schema for blockdev-add
to find the 'password-secret' parameter that will allow the iSCSI
code to use the master secret object to encrypt the secret for an
and only need to provide the object id of the secret on the command
line thus obsfuscating the passphrase.
2017-11-24 11:47:26 -05:00
Peter Krempa
860a3c4bea qemu: caps: Add capability for 'share-rw' disk option
'share-rw' for the disk device configures qemu to allow concurrent
access to the backing storage.

The capability is checked in various supported disk frontend buses since
it does not make sense to partially backport it.
2017-11-23 18:26:48 +01:00
Michal Privoznik
13e148ebda qemu_capabilities: Introcude QEMU_CAPS_NUMA_DIST
This capability says if qemu is capable of specifying distances
between NUMA nodes on the command line. Unfortunately, there's no
real way to check this and thus we have to go with version check.
QEMU introduced this in 0f203430dd8 (and friend) which was
released in 2.10.0.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2017-11-23 14:54:31 +01:00
Pino Toscano
593639ffff qemu: add QEMU_CAPS_DEVICE_SCLPLMCONSOLE
Add a separate capability for the sclplmconsole device, and check it
specifically instead of using QEMU_CAPS_DEVICE_SCLPCONSOLE for that too.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2017-11-20 10:13:53 +01:00