Commit Graph

144 Commits

Author SHA1 Message Date
Jiri Denemark
5d513d4659 qemu-caps: Get host model directly from Qemu when available
When qmp query-cpu-model-expansion is available probe Qemu for its view of the
host model. In kvm environments this can provide a more complete view of the
host model because features supported by Qemu and Kvm can be considered.

Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
2017-01-06 12:24:57 +01:00
Collin L. Walling
fab9d6e1a9 qemu: qmp query-cpu-model-expansion command
query-cpu-model-expansion is used to get a list of features for a given cpu
model name or to get the model and features of the host hardware/environment
as seen by Qemu/kvm.

Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
2017-01-06 12:24:57 +01:00
Collin L. Walling
dedfa94368 test-data: Qemu caps replies and xml for s390x qemu 2.7 and 2.8
Expected Qemu replies for versions 2.7 and 2.8 from the s390x
Qemu binary.

Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
2017-01-06 12:24:56 +01:00
Peter Krempa
cf44dc072a qemu: capabilities: Add gluster.debug_level detection for 2.8.0+
Qemu 2.8.0+ changes arguments structure for blockdev-add in the effort
to make it finally stable. Since libvirt recently added the detection of
gluster debug support relying on the old syntax we need to add the new
as well.
2016-12-07 13:34:22 +01:00
Peter Krempa
c168c910c5 test: qemucaps: Bump 2.8.0 state to current master
Qemu decided to change a parameter name in rc-state which was not
captured by the 2.8.0 data. Bump it to current version.
2016-12-07 13:34:22 +01:00
John Ferlan
d3364dfdc8 caps: Add new capability for the iotune group name
Add the capability to detect if the qemu binary can support the feature
to use throttling.group.
2016-12-05 18:12:08 -05:00
Jiri Denemark
a1adfb0f06 qemu: Add support for unavailable-features
QEMU 2.8.0 adds support for unavailable-features in
query-cpu-definitions reply. The unavailable-features array lists CPU
features which prevent a corresponding CPU model from being usable on
current host. It can only be used when all the unavailable features are
disabled. Empty array means the CPU model can be used without
modifications.

We can use unavailable-features for providing CPU model usability info
in domain capabilities XML:

    <domainCapabilities>
      ...
      <cpu>
        <mode name='host-passthrough' supported='yes'/>
        <mode name='host-model' supported='yes'>
          <model fallback='allow'>Skylake-Client</model>
          ...
        </mode>
        <mode name='custom' supported='yes'>
          <model usable='yes'>qemu64</model>
          <model usable='yes'>qemu32</model>
          <model usable='no'>phenom</model>
          <model usable='yes'>pentium3</model>
          <model usable='yes'>pentium2</model>
          <model usable='yes'>pentium</model>
          <model usable='yes'>n270</model>
          <model usable='yes'>kvm64</model>
          <model usable='yes'>kvm32</model>
          <model usable='yes'>coreduo</model>
          <model usable='yes'>core2duo</model>
          <model usable='no'>athlon</model>
          <model usable='yes'>Westmere</model>
          <model usable='yes'>Skylake-Client</model>
          ...
        </mode>
      </cpu>
      ...
    </domainCapabilities>

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-28 09:11:22 +01:00
Jiri Denemark
047e7dd9ec tests: Add QEMU 2.8.0 capabilities data
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-28 09:11:15 +01:00
Jiri Denemark
0237f1ceb6 tests: Update capabilities for QEMU 2.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 21:00:19 +01:00
Jiri Denemark
0d2c389fad tests: Update capabilities for QEMU 2.6.0 (ppc64le)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:59:57 +01:00
Jiri Denemark
f8b7b075b6 tests: Update capabilities for QEMU 2.6.0 (aarch64, GICv3)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:59:34 +01:00
Jiri Denemark
451dc19353 tests: Update capabilities for QEMU 2.6.0 (aarch64, GICv2)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
e6bad6b63d tests: Update capabilities for QEMU 2.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
ca6b026303 tests: Update capabilities for QEMU 2.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
f9b754c29a tests: Update capabilities for QEMU 2.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
d5a6521013 tests: Update capabilities for QEMU 2.1.1
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
58c7620cdc tests: Update capabilities for QEMU 1.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
c0bf82b6ab tests: Update capabilities for QEMU 1.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
cbe19bf006 tests: Update capabilities for QEMU 1.5.3
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
58ed524966 tests: Update capabilities for QEMU 1.4.2
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
0ba2b9d33d tests: Update capabilities for QEMU 1.3.1
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
79b898e319 tests: Update capabilities for QEMU 1.2.2
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
7bf6f345e0 qemu: Probe CPU models for KVM and TCG
CPU models (and especially some additional details which we will start
probing for later) differ depending on the accelerator. Thus we need to
call query-cpu-definitions in both KVM and TCG mode to get all data we
want.

Tests in tests/domaincapstest.c are temporarily switched to TCG to avoid
having to squash even more stuff into this single patch. They will all
be switched back later in separate commits.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:27 +01:00
Jiri Denemark
429a7b231c qemu: Probe KVM state earlier
Let's set QEMU_CAPS_KVM and QEMU_CAPS_ENABLE_KVM early so that the rest
of the probing code can use these capabilities to handle KVM/TCG replies
differently.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-11-25 20:34:26 +01:00
Eric Farman
c271fc1f35 qemu: Introduce vhost-scsi capability
Do all the stuff for the vhost-scsi capability in QEMU,
so it's in place for our checks later.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2016-11-24 12:15:26 -05:00
Andrea Bolognani
36e9b16e24 tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on aarch64 gicv3
Add QMP schema data query for aarch64. The gic capabilities are
unfortunately queried after the QMP schema and thus this patch needs to
undo the temporary removal of the declared support for query-qmp-schema.

Note that as a gicv3 machine was not available the schema data is taken
from the gicv2 case. It should be identical since qemu would be built
from the same source.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:52:40 +01:00
Andrea Bolognani
10b108a603 tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on aarch64 gicv2
Add QMP schema data query for aarch64. The gic capabilities are
unfortunately queried after the QMP schema and thus this patch needs to
undo the temporary removal of the declared support for query-qmp-schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:52:40 +01:00
Prasanna Kumar Kalever
74bbb8c2ec qemu: capabilities: Detect support for gluster debug setting
Teach qemu driver to detect whether qemu supports specifying debug level
for gluster volumes.

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:52:40 +01:00
Peter Krempa
70c7025d3b qemu: capabilities: Add support for QMP schema introspection
Allow detecting capabilities according to the qemu QMP schema. This is
necessary as sometimes the availability of certain options depends on
the presence of a field in the schema.

This patch adds support for loading the QMP schema when detecting qemu
capabilities and adds a very simple query language to allow traversing
the schema and selecting a certain element from it.

The infrastructure in this patch uses a query path to set a specific
capability flag according to the availability of the given element in
the schema.
2016-11-09 16:51:54 +01:00
Peter Krempa
4182ffa0a8 tests: qemucaps: Temporarily remove 'query-qmp-schema' from test data
Remove the command from the supported commands list temporarily so that
QMP introspection code can be added without breaking tests and having to
tweak the test data in the same commit.

This will be later reverted and test data will be added. The aarch64
code is special as it calls additional commands and thus the test data
can't be added upfront.
2016-11-09 16:50:32 +01:00
Andrea Bolognani
4a3d34729a tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on ppc64le
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:50:32 +01:00
Pavel Hrdina
782579bec6 tests: qemucaps: Add QMP introspection data for qemu 2.7.0 on x86
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:50:32 +01:00
Pavel Hrdina
a2cc6bf953 tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on x86
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:50:32 +01:00
Pavel Hrdina
56ef5184e1 tests: qemucaps: Add QMP introspection data for qemu 2.5.0 on x86
Add output of 'query-qmp-schema' to the capabilities test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:50:32 +01:00
Andrea Bolognani
30d0a8f9e4 tests: qemucaps: Update aarch64 gicv2 replies for qemu 2.6.0 release
Sync up to the released version of qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:50:32 +01:00
Andrea Bolognani
33877c815d tests: qemucaps: Update ppc64 replies for qemu 2.6.0 release
Sync up to the released version of qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2016-11-09 16:50:32 +01:00
Martin Kletzander
22d94ca46d qemu: Add capabilities for ivshmem-{plain,doorbell}
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-11-02 16:05:39 +01:00
John Ferlan
d379552b41 caps: Add new capability for the bps/iops throttling length
Add the capability to detect if the qemu binary can support the feature
to use bps-max-length and friends.
2016-10-25 17:16:26 -04:00
Pavel Hrdina
6869428c12 qemu_capabilities: check for existence of virtio-vga
Commit 21373feb added support for primary virtio-vga device but it was
checking for virtio-gpu.  Let's check for existence of virtio-vga if we
want to use it.

Virtio video device is currently represented by three different models
*virtio-gpu-device*, *virtio-gpu-pci* and *virtio-vga*.  The first two
models are tied together and if virtio video devices is compiled in they
both exist.  However, the *virtio-vga* model doesn't have to exist on
some architectures even if the first two models exist.  So we cannot
group all three together.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-10-12 17:46:48 +02:00
Pavel Hrdina
f5eae0a595 qemu_capabilities: detect properties for virtio-gpu-device
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-10-12 17:46:47 +02:00
Pavel Hrdina
05af6784b1 qemu_capabilities: mark QEMU_CAPS_VGA_QXL capability as deprecated
If QEMU in question supports QMP, this capability is set if
QEMU_CAPS_DEVICE_QXL was set based on existence of "-device qxl". If
libvirt needs to parse *help*, because there is no QMP support, it
checks for existence of "-vga qxl", but it also parses output of
"-device ?" and sets QEMU_CAPS_DEVICE_QXL too.

Now that libvirt supports only QEMU that has "-device" implemented it's
safe to drop this capability and stop using it.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-10-12 17:46:47 +02:00
Pavel Hrdina
34a4447bd4 qemu_capabilities: join capabilities for qxl and qxl-vga devices
This patch simplifies QEMU capabilities for QXL video device.  QEMU
exposes this device as *qxl-vga* and *qxl* and they are both the same
device with the same set of parameters, the only difference is that
*qxl-vga* includes VGA compatibility.

Based on QEMU code they are tied together so it's safe to check only for
presence of only one of them.

This patch also removes an invalid test case "video-qxl-sec-nodevice"
where there is only *qxl-vga* device and *qxl* device is not present.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-10-12 17:46:47 +02:00
Daniel P. Berrange
5dee668632 qemu: fix command line building for iommu devices
The intel-iommu device has existed since QEMU 2.2.0, but
it was only possible to create it with -device since
QEMU 2.7.0, thanks to:

  commit 621d983a1f9051f4cfc3f402569b46b77d8449fc
  Author: Marcel Apfelbaum <marcel@redhat.com>
  Date:   Mon Jun 27 18:38:34 2016 +0300

    hw/iommu: enable iommu with -device

    Use the standard '-device intel-iommu' to create the IOMMU device.
    The legacy '-machine,iommu=on' can still be used.

The libvirt capability check & command line formatting code
is thus broken for all QEMU versions 2.2.0 -> 2.6.0 inclusive.

This fixes it to use iommu=on instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-10-07 16:52:35 +01:00
Pavel Hrdina
4e4b7fbf01 test: update capability replies for qemu-2.7.0
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-09-20 11:46:30 +02:00
Peter Krempa
920bbe5c15 qemu: capabilities: Extract availability of new cpu hotplug for machine types
QEMU reports whether 'query-hotpluggable-cpus' is supported for a given
machine type. Extract and cache the information using the capability
cache.

When copying the capabilities for a new start of qemu, mask out the
presence of QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS if the machine type
doesn't support hotpluggable cpus.
2016-08-24 15:44:47 -04:00
Peter Krempa
f17ddfeee3 qemu: Add capability for query-hotpluggable-cpus command 2016-08-24 15:44:47 -04:00
Ján Tomko
41f5c2ca27 Introduce QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY
Check whether the disable-legacy property is present on the following
devices:
  virtio-balloon-pci
  virtio-blk-pci
  virtio-scsi-pci
  virtio-serial-pci
  virtio-9p-pci
  virtio-net-pci
  virtio-rng-pci
  virtio-gpu-pci
  virtio-input-host-pci
  virtio-keyboard-pci
  virtio-mouse-pci
  virtio-tablet-pci

Assuming that if QEMU knows other virtio devices where this property
is applicable, it will have at least one of these devices.

Added in QEMU by:
commit e266d421490e0ae83044bbebb209b2d3650c0ba6
    virtio-pci: add flags to enable/disable legacy/modern
2016-08-17 18:13:06 +02:00
Peter Krempa
2cda2628db tests: qemucapabilities: Add data for qemu 2.7.0
As of (v2.7.0-rc1-52-g42e0d60)
2016-08-05 09:47:08 +02:00
Michal Privoznik
d0e4be9d02 Introduce SMM feature
Since its release of 2.4.0 qemu is able to enable System
Management Module in the firmware, or disable it. We should
expose this capability in the XML. Unfortunately, there's no good
way to determine whether the binary we are talking to supports
it. I mean, if qemu's run with real machine type, the smm
attribute can be seen in 'qom-list /machine' output. But it's not
there when qemu's run with -M none. Therefore we're stuck with
version based check.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-08-04 17:14:20 +02:00
Ján Tomko
8e7e79738d Add QEMU_CAPS_DEVICE_INTEL_IOMMU
Check whether QEMU supports -device intel-iommu

Note that the presence of this option does not mean that it's
usable because of a bug in earlier QEMU versions, but it's
better than nothing.

https://bugzilla.redhat.com/show_bug.cgi?id=1235580
2016-07-12 12:36:13 +02:00