libvirt/tests/qemucapabilitiesdata
Jiri Denemark 3100f43a1d qemu: Detect exit-on-error argument of migrate-incoming
The exit-on-error argument (added in QEMU 9.1.0) can be used to tell
QEMU not to exit when incoming migration fails so that the error can be
retrieved via QMP. This patch adds a new capability bit indicating
support for the new argument.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:21:21 +01:00
..
caps_5.2.0_aarch64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_5.2.0_aarch64.xml qemu_capabilities: Introduce QEMU_CAPS_NETDEV_USER 2024-07-01 12:32:16 +02:00
caps_5.2.0_ppc64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_5.2.0_ppc64.xml qemu_capabilities: Introduce QEMU_CAPS_NETDEV_USER 2024-07-01 12:32:16 +02:00
caps_5.2.0_riscv64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_5.2.0_riscv64.xml qemu_capabilities: Introduce QEMU_CAPS_NETDEV_USER 2024-07-01 12:32:16 +02:00
caps_5.2.0_s390x.replies qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM 2024-11-11 10:15:06 +01:00
caps_5.2.0_s390x.xml qemu_capabilities: Introduce QEMU_CAPS_NETDEV_USER 2024-07-01 12:32:16 +02:00
caps_5.2.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_5.2.0_x86_64.xml qemu_capabilities: Introduce QEMU_CAPS_NETDEV_USER 2024-07-01 12:32:16 +02:00
caps_6.0.0_aarch64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_6.0.0_aarch64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_6.0.0_s390x.replies qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM 2024-11-11 10:15:06 +01:00
caps_6.0.0_s390x.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_6.0.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_6.0.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_6.1.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_6.1.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_6.2.0_aarch64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_6.2.0_aarch64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_6.2.0_ppc64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_6.2.0_ppc64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_6.2.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_6.2.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.0.0_aarch64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_7.0.0_aarch64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.0.0_aarch64+hvf.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_7.0.0_aarch64+hvf.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.0.0_ppc64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_7.0.0_ppc64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.0.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_7.0.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.1.0_ppc64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_7.1.0_ppc64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.1.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_7.1.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.2.0_ppc.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_7.2.0_ppc.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.2.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_7.2.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_7.2.0_x86_64+hvf.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_7.2.0_x86_64+hvf.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.0.0_riscv64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_8.0.0_riscv64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.0.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_8.0.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.1.0_s390x.replies qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM 2024-11-11 10:15:06 +01:00
caps_8.1.0_s390x.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.1.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_8.1.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.2.0_aarch64.replies tests: qemucaps: Make JSON output identical to python's 'json.dump' method 2024-02-01 10:39:40 +01:00
caps_8.2.0_aarch64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.2.0_armv7l.replies qemucapabilitiestest: Add test dump for 'armv7l' architecture 2024-03-06 16:30:35 +01:00
caps_8.2.0_armv7l.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.2.0_loongarch64.replies Add test script for loongarch 2024-03-21 14:42:27 +01:00
caps_8.2.0_loongarch64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.2.0_s390x.replies qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM 2024-11-11 10:15:06 +01:00
caps_8.2.0_s390x.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_8.2.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_8.2.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_9.0.0_sparc.replies qemucapabilitiestest: Add 'qemu_9.0.0.sparc' capabilities from TCG 2024-07-01 16:13:12 +02:00
caps_9.0.0_sparc.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_9.0.0_x86_64.replies qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT 2024-08-21 17:10:51 +02:00
caps_9.0.0_x86_64.xml qemu: capabilities: Introduce QEMU_CAPS_SNAPSHOT_INTERNAL_QMP capability 2024-10-09 15:22:00 +02:00
caps_9.1.0_riscv64.replies tests: qemucapabilitiesdata: Add caps for 'caps_9.1.0_riscv64' (captured on x86_64) 2024-09-05 15:24:55 +02:00
caps_9.1.0_riscv64.xml qemu: Detect exit-on-error argument of migrate-incoming 2024-12-19 15:21:21 +01:00
caps_9.1.0_s390x.replies qemu_capabilities: query deprecated features for host-model 2024-12-17 11:45:50 +01:00
caps_9.1.0_s390x.xml qemu: Detect exit-on-error argument of migrate-incoming 2024-12-19 15:21:21 +01:00
caps_9.1.0_x86_64.replies tests: qemucapabilities: Update 'caps_9.1.0_x86_64' for final release 2024-09-05 15:24:55 +02:00
caps_9.1.0_x86_64.xml qemu: Detect exit-on-error argument of migrate-incoming 2024-12-19 15:21:21 +01:00
caps_9.2.0_s390x.replies qemu_capabilities: query deprecated features for host-model 2024-12-17 11:45:50 +01:00
caps_9.2.0_s390x.xml qemu: Detect exit-on-error argument of migrate-incoming 2024-12-19 15:21:21 +01:00
caps_9.2.0_x86_64.replies tests: qemucapabilitiesdata: Update 'x86_64' capabilities for the qemu-9.2 dev cycle 2024-11-19 13:06:02 +01:00
caps_9.2.0_x86_64.xml qemu: Detect exit-on-error argument of migrate-incoming 2024-12-19 15:21:21 +01:00
README.rst tests: Fix typo in README.rst of qemucapabilitiesdata 2024-09-16 18:14:07 +02:00

=========================
QEMU capabilities testing
=========================

Purpose
=======

Test data in this directory is used:

 - to excercise the capability parsing code in ``qemucapabilitiestest``

 - provides "real" capabilities data for test suites such as ``domaincapstest``
   ``qemuxmlconftest``, and others

 - provides the required data to validate the QMP commands used by libvirt
   against qemu's QMP schema

Naming
======

Files in this directory have the following naming scheme::

  caps_$QEMUVERSION_$ARCHITECTURE.$SUFFIX

or::

  caps_$QEMUVERSION_$ARCHITECTURE+$VARIANT.$SUFFIX

``$QEMUVERSION``

  Numeric representation of the qemu version, e.g.: ``7.0.0``

``$ARCHITECTURE``

  Architecture string such as ``x86_64``, ``aarch64``, etc.

``$SUFFIX``

  ``.replies`` for the dump of the QMP communication used to probe qemu.
  ``.xml`` for the generated capability dump

``$VARIANT``

  The variant name is an optional arbitrary string, not containing any dot.

  A variant is an additional named version of capabilities for given version and
  architecture tuple. This allows for testing special cases which e.g. depend
  on a specific host platform or operating system feature, which differs from
  the main tests. Note that in the test code the variant name is an empty string
  or includes the '+' sign for ease of use.

Known test variants
-------------------

``+hvf``

  Variant of the test data using the Apple OSX Hypervisor Framework acceleration
  for qemu.


Usage in tests
==============

Test suites such as ``qemucapabilitiestest`` or ``domaincapstest`` pick up the
test data automatically once the corresponding ``.xml`` or ``.replies`` file
is present in ``tests/qemucapabilitiesdata``.

Other test suites such as ``qemuxmlconftest`` provide macros which invoke test
cases using this data such as ``DO_TEST_CAPS_LATEST``.

Capturing QEMU capabilities
===========================

QEMU capabilities are captured by running the ``qemucapsprobe`` on the QEMU
binary on given architecture and then capturing the output. Since virtualization
acceleration is also probed it's required to run it on real hardware.

The capabilities dumps contain also host-specific information such as the exact
CPU definition of the machine where it was ran on, thus they can differ
significantly when run on other machines.

Probing QEMU
------------

Run the ``qemucapsprobe`` tool::

  $ LIBVIRT_BUILDDIR/tests/qemucapsprobe /path/to/qemu > output.replies

The tool spawns the qemu binary and performs probing as if libvirt would do that.
The QMP conversation between qemu and libvirt is dumped to stdout. User
running the probe must be able to access the virtualization accelerator (e.g.
have proper permissions on ``/dev/kvm``)

Generating the output files
---------------------------

Place the captured output ``.replies`` file into this directory and run::

  $ VIR_TEST_REGENERATE_OUTPUT=1 ninja test

This runs the test-suite instructing it to update and/or generate all new data
the test would normally expect.

Manual modifications the ``.replies`` file
==========================================

In certain cases it's impractical or impossible to re-generate the ``.replies``
file on a code change causing a change to the actual QMP query process.

In such case a careful manual modification of the ``.replies`` is tolerated.

To aid such modification the tool ``scripts/qemu-replies-tool.py`` can be
used.

The tool validates and updates the numbering of the entries in the QMP dump in
case something was modified.

The tool also allows programatic modification of the ``.replies`` file.

Fake test data dumps for certain architectures
==============================================

For some architectures it was impossible or impractical to fetch real capability
dumps. To ensure coverage of certain cases the dumps were collected from
corresponding binaries running on a different architecture.

Capabilities dumps for the following architectures are usually produced on real
hardware:

  - x86_64
  - aarch64
  - ppc64
  - s390x

In most other cases, x86_64 will be used as the host architecture. A fake caps
dump can be usually spotted by absence of KVM support.