From a63d9ba90ed8336e025d3b8741266635ebe87d59 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Fri, 21 Jul 2023 23:25:10 +0200 Subject: [PATCH] libvirt-9.5.0-3.el9 - tests: remove acpi support from s390x ccw hotplug tests (rhbz#2168499) - tests: add capabilities for QEMU 8.1.0 on s390x (rhbz#2168499) - qemu: add run-with async-teardown capability (rhbz#2168499) - qemu: allow use of async teardown in domain (rhbz#2168499) - conf: domcaps: Add 'async-teardown' domain capability (rhbz#2168499) - qemu: S390 does not provide physical address size (rhbz#2224016) - nodedev: report mdev persistence properly (rhbz#2143158) - node_device: Don't leak error message buffer from virMdevctlListDefined|Active (rhbz#2143158) Resolves: rhbz#2143158, rhbz#2168499, rhbz#2224016 --- ...Add-async-teardown-domain-capability.patch | 1011 + ...er-from-virMdevctlListDefined-Active.patch | 79 + ...dev-report-mdev-persistence-properly.patch | 104 + ...es-not-provide-physical-address-size.patch | 175 + ...d-run-with-async-teardown-capability.patch | 97 + ...llow-use-of-async-teardown-in-domain.patch | 836 + ...capabilities-for-QEMU-8.1.0-on-s390x.patch | 39773 ++++++++++++++++ ...support-from-s390x-ccw-hotplug-tests.patch | 127 + libvirt.spec | 20 +- 9 files changed, 42221 insertions(+), 1 deletion(-) create mode 100644 libvirt-conf-domcaps-Add-async-teardown-domain-capability.patch create mode 100644 libvirt-node_device-Don-t-leak-error-message-buffer-from-virMdevctlListDefined-Active.patch create mode 100644 libvirt-nodedev-report-mdev-persistence-properly.patch create mode 100644 libvirt-qemu-S390-does-not-provide-physical-address-size.patch create mode 100644 libvirt-qemu-add-run-with-async-teardown-capability.patch create mode 100644 libvirt-qemu-allow-use-of-async-teardown-in-domain.patch create mode 100644 libvirt-tests-add-capabilities-for-QEMU-8.1.0-on-s390x.patch create mode 100644 libvirt-tests-remove-acpi-support-from-s390x-ccw-hotplug-tests.patch diff --git a/libvirt-conf-domcaps-Add-async-teardown-domain-capability.patch b/libvirt-conf-domcaps-Add-async-teardown-domain-capability.patch new file mode 100644 index 0000000..ab6ada5 --- /dev/null +++ b/libvirt-conf-domcaps-Add-async-teardown-domain-capability.patch @@ -0,0 +1,1011 @@ +From f2c5bbfda0b2fb54cf65917f6c5b72d27c9a9813 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Boris Fiuczynski +Date: Mon, 17 Jul 2023 17:12:08 +0200 +Subject: [PATCH] conf: domcaps: Add 'async-teardown' domain capability + +Add async-teardown to the features list in domain capabilities allowing +high level management to introspect the availability of the asynchronous +teardown feature. + +Signed-off-by: Boris Fiuczynski +Reviewed-by: Michal Privoznik +(cherry picked from commit aece25f66517a327c2a6bde4d06b432d415ed7da) + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168499 + +Signed-off-by: Boris Fiuczynski +--- + docs/formatdomaincaps.rst | 6 ++++++ + src/conf/domain_capabilities.c | 1 + + src/conf/domain_capabilities.h | 1 + + src/conf/schemas/domaincaps.rng | 9 +++++++++ + src/qemu/qemu_capabilities.c | 1 + + tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml | 1 + + tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 + + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + + tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 + + tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 + + tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.1.0.sparc.xml | 1 + + tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 1 + + tests/domaincapsdata/qemu_5.2.0.s390x.xml | 1 + + tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml | 1 + + tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 1 + + tests/domaincapsdata/qemu_6.0.0.s390x.xml | 1 + + tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml | 1 + + tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 1 + + tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 1 + + tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.0.0-hvf.aarch64+hvf.xml | 1 + + tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml | 1 + + tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 1 + + tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 1 + + tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 1 + + tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml | 1 + + tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml | 1 + + tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_7.2.0.ppc.xml | 1 + + tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml | 1 + + tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml | 1 + + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 + + tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 + + tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 + + tests/domaincapsdata/qemu_8.1.0.s390x.xml | 1 + + tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 + + 74 files changed, 87 insertions(+) + +diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst +index 9dae941d18..0f8015d4dd 100644 +--- a/docs/formatdomaincaps.rst ++++ b/docs/formatdomaincaps.rst +@@ -647,6 +647,7 @@ capabilities. All features occur as children of the main ``features`` element. + + + ++ + + 47 + 1 +@@ -711,6 +712,11 @@ presence of the ``backup`` element even if ``supported='no'`` implies that the + ``VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA`` flag for ``virDomainUndefine`` is + supported. + ++async-teardown ++^^^^^^^^^^^^^^ ++ ++Reports whether the asynchronous teardown feature can be enabled. ++ + s390-pv capability + ^^^^^^^^^^^^^^^^^^ + +diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c +index c076af7808..2fa5756184 100644 +--- a/src/conf/domain_capabilities.c ++++ b/src/conf/domain_capabilities.c +@@ -40,6 +40,7 @@ VIR_ENUM_IMPL(virDomainCapsFeature, + "genid", + "backingStoreInput", + "backup", ++ "async-teardown", + "s390-pv", + ); + +diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h +index 2624269eab..01bcfa2e39 100644 +--- a/src/conf/domain_capabilities.h ++++ b/src/conf/domain_capabilities.h +@@ -248,6 +248,7 @@ typedef enum { + VIR_DOMAIN_CAPS_FEATURE_GENID, + VIR_DOMAIN_CAPS_FEATURE_BACKING_STORE_INPUT, + VIR_DOMAIN_CAPS_FEATURE_BACKUP, ++ VIR_DOMAIN_CAPS_FEATURE_ASYNC_TEARDOWN, + VIR_DOMAIN_CAPS_FEATURE_S390_PV, + + VIR_DOMAIN_CAPS_FEATURE_LAST +diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng +index 19bd6f7128..99ef148d44 100644 +--- a/src/conf/schemas/domaincaps.rng ++++ b/src/conf/schemas/domaincaps.rng +@@ -300,6 +300,9 @@ + + + ++ ++ ++ + + + +@@ -315,6 +318,12 @@ + + + ++ ++ ++ ++ ++ ++ + + + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index c9f4b17208..338608f0a2 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -6296,6 +6296,7 @@ static const struct virQEMUCapsDomainFeatureCapabilityTuple domCapsTuples[] = { + { VIR_DOMAIN_CAPS_FEATURE_GENID, QEMU_CAPS_DEVICE_VMGENID }, + { VIR_DOMAIN_CAPS_FEATURE_BACKING_STORE_INPUT, QEMU_CAPS_LAST }, + { VIR_DOMAIN_CAPS_FEATURE_BACKUP, QEMU_CAPS_INCREMENTAL_BACKUP }, ++ { VIR_DOMAIN_CAPS_FEATURE_ASYNC_TEARDOWN, QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN }, + }; + + +diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +index f408c2a969..f6c9622a56 100644 +--- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +@@ -248,6 +248,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml +index 4427634d7c..3e9485c7d0 100644 +--- a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml +@@ -262,6 +262,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml +index 981a06856d..9aa1d946ae 100644 +--- a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml ++++ b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml +@@ -194,6 +194,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml +index 981a06856d..9aa1d946ae 100644 +--- a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml ++++ b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml +@@ -194,6 +194,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +index a3289573bd..770a67bff1 100644 +--- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml ++++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +@@ -162,6 +162,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsdata/qemu_4.2.0.s390x.xml +index c35bed1326..da271825f9 100644 +--- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml +@@ -268,6 +268,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +index cbe083f1f1..513ca3caf4 100644 +--- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +@@ -248,6 +248,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml +index 6b68d4f2a5..64a6b7dea7 100644 +--- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml +@@ -250,6 +250,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml +index 20a8c9a583..7ee0dcf664 100644 +--- a/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml +@@ -147,6 +147,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml +index 39b1b4c1f2..95366f3edf 100644 +--- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml +@@ -264,6 +264,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml +index f84aec44c9..c8cd609bc8 100644 +--- a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml +@@ -207,6 +207,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml b/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml +index 833cb4bb2e..1f0fc66f53 100644 +--- a/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml +@@ -150,6 +150,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml +index f84aec44c9..c8cd609bc8 100644 +--- a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml +@@ -207,6 +207,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml +index 4b3f490942..c80fbb8ec6 100644 +--- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml +@@ -169,6 +169,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml +index 603d842dfe..c8338b0889 100644 +--- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml +@@ -250,6 +250,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml +index cdbbe86ede..3f170d469f 100644 +--- a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml +@@ -251,6 +251,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml +index 8950900e72..097ffce9f9 100644 +--- a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml +@@ -264,6 +264,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.1.0.sparc.xml b/tests/domaincapsdata/qemu_5.1.0.sparc.xml +index 6f92de2b6c..7a04ea6c12 100644 +--- a/tests/domaincapsdata/qemu_5.1.0.sparc.xml ++++ b/tests/domaincapsdata/qemu_5.1.0.sparc.xml +@@ -133,6 +133,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml +index 1ef28a71e4..ba0785dcf9 100644 +--- a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml +@@ -251,6 +251,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml +index 46a3a44cdd..1474488d7b 100644 +--- a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml +@@ -251,6 +251,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml b/tests/domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml +index 20a8c9a583..7ee0dcf664 100644 +--- a/tests/domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml +@@ -147,6 +147,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml +index edb622240e..ec89689a36 100644 +--- a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml +@@ -264,6 +264,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml +index af01bdfbe9..a36255f6f8 100644 +--- a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml +@@ -207,6 +207,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml b/tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml +index 833cb4bb2e..1f0fc66f53 100644 +--- a/tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml +@@ -150,6 +150,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml +index af01bdfbe9..a36255f6f8 100644 +--- a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml +@@ -207,6 +207,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml +index b465ad1030..538b790ba3 100644 +--- a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml +@@ -169,6 +169,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsdata/qemu_5.2.0.s390x.xml +index 9dbf118713..99faaad866 100644 +--- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml +@@ -270,6 +270,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml +index 09db834535..1b4f379bbb 100644 +--- a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml +@@ -251,6 +251,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml +index b1a2be10e6..b8e9a26e68 100644 +--- a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml +@@ -253,6 +253,7 @@ + + + ++ + + 47 + 1 +diff --git a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml +index 29b95a836f..2b99ae36b6 100644 +--- a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml +@@ -267,6 +267,7 @@ + + + ++ + + 47 + 1 +diff --git a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml +index 67889c4572..010fc6916e 100644 +--- a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml ++++ b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml +@@ -209,6 +209,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml +index 67889c4572..010fc6916e 100644 +--- a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml ++++ b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml +@@ -209,6 +209,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsdata/qemu_6.0.0.s390x.xml +index f0a8b196f5..df3708f801 100644 +--- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml +@@ -271,6 +271,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml +index 693ae0a7f1..652cc0ef8d 100644 +--- a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml +@@ -253,6 +253,7 @@ + + + ++ + + 47 + 1 +diff --git a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml +index a161d6aa20..628684c171 100644 +--- a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml +@@ -254,6 +254,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml +index 7bfe6f802c..ab0aae0439 100644 +--- a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml +@@ -267,6 +267,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml +index 8c4f8cc860..8f1a0bcb29 100644 +--- a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml +@@ -254,6 +254,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml +index 0449f562df..50be45c069 100644 +--- a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml +@@ -254,6 +254,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml +index f15111c590..a670f306dd 100644 +--- a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml +@@ -269,6 +269,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml +index 241e893df6..424f7cf606 100644 +--- a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml ++++ b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml +@@ -216,6 +216,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml +index 241e893df6..424f7cf606 100644 +--- a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml ++++ b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml +@@ -216,6 +216,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml +index a9f7aefbc9..94edf1878e 100644 +--- a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml ++++ b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml +@@ -168,6 +168,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml +index fa1f7a2316..6cd7ac6616 100644 +--- a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml +@@ -254,6 +254,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.0.0-hvf.aarch64+hvf.xml b/tests/domaincapsdata/qemu_7.0.0-hvf.aarch64+hvf.xml +index bcabf66d2a..d51de8273f 100644 +--- a/tests/domaincapsdata/qemu_7.0.0-hvf.aarch64+hvf.xml ++++ b/tests/domaincapsdata/qemu_7.0.0-hvf.aarch64+hvf.xml +@@ -170,6 +170,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml +index e793278d41..e5f05ab1a7 100644 +--- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml +@@ -255,6 +255,7 @@ + + + ++ + + + no +diff --git a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml +index 6ff9df5766..6e067c8c20 100644 +--- a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml +@@ -270,6 +270,7 @@ + + + ++ + + + no +diff --git a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml +index 6aa5e78612..51a579218f 100644 +--- a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml ++++ b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml +@@ -215,6 +215,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml +index 6aa5e78612..51a579218f 100644 +--- a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml ++++ b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml +@@ -215,6 +215,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml +index 78f8d3cac4..f8b72ce7af 100644 +--- a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml ++++ b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml +@@ -173,6 +173,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml +index 1d1505f757..603ad39077 100644 +--- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml +@@ -255,6 +255,7 @@ + + + ++ + + + no +diff --git a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml +index 047763bd43..5cceec1882 100644 +--- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml +@@ -254,6 +254,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml +index b8621b5efd..858085883f 100644 +--- a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml +@@ -268,6 +268,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.1.0.ppc64.xml b/tests/domaincapsdata/qemu_7.1.0.ppc64.xml +index f3a436d859..52a578a733 100644 +--- a/tests/domaincapsdata/qemu_7.1.0.ppc64.xml ++++ b/tests/domaincapsdata/qemu_7.1.0.ppc64.xml +@@ -166,6 +166,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml +index 95452bb0a4..de378e74c7 100644 +--- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml +@@ -254,6 +254,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml b/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml +index d6dc93d957..ff25d4bffb 100644 +--- a/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml ++++ b/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml +@@ -177,6 +177,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml +index d0029c65da..3fba78a251 100644 +--- a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml +@@ -260,6 +260,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml +index a5744e41fa..86079797c9 100644 +--- a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml ++++ b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml +@@ -258,6 +258,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml +index a5744e41fa..86079797c9 100644 +--- a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml +@@ -258,6 +258,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.2.0.ppc.xml b/tests/domaincapsdata/qemu_7.2.0.ppc.xml +index 59ace0a0b2..eee1859c1c 100644 +--- a/tests/domaincapsdata/qemu_7.2.0.ppc.xml ++++ b/tests/domaincapsdata/qemu_7.2.0.ppc.xml +@@ -152,6 +152,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml b/tests/domaincapsdata/qemu_7.2.0.x86_64.xml +index fecb7e4a0a..52d6cfe929 100644 +--- a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_7.2.0.x86_64.xml +@@ -260,6 +260,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml +index ef2637ab26..efe9d3eb52 100644 +--- a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml +@@ -261,6 +261,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml b/tests/domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml +index 5254d8807a..6ce952d910 100644 +--- a/tests/domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml ++++ b/tests/domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml +@@ -153,6 +153,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml +index cde1d70f09..1e2001ee09 100644 +--- a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml +@@ -263,6 +263,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml b/tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml +index 68aa0d6189..43de2072b9 100644 +--- a/tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml ++++ b/tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml +@@ -156,6 +156,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml +index ebae9e34d6..04e63d752c 100644 +--- a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml +@@ -261,6 +261,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml +index effa6f6630..f8165fe212 100644 +--- a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml ++++ b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml +@@ -262,6 +262,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml +index c36bac3fd2..ea9e085af5 100644 +--- a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml ++++ b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml +@@ -262,6 +262,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.1.0.s390x.xml b/tests/domaincapsdata/qemu_8.1.0.s390x.xml +index 6b78a718b0..d70b639503 100644 +--- a/tests/domaincapsdata/qemu_8.1.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_8.1.0.s390x.xml +@@ -278,6 +278,7 @@ + + + ++ + + + +diff --git a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml +index 48e9444deb..51a104798f 100644 +--- a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml ++++ b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml +@@ -262,6 +262,7 @@ + + + ++ + + + +-- +2.41.0 diff --git a/libvirt-node_device-Don-t-leak-error-message-buffer-from-virMdevctlListDefined-Active.patch b/libvirt-node_device-Don-t-leak-error-message-buffer-from-virMdevctlListDefined-Active.patch new file mode 100644 index 0000000..865c2df --- /dev/null +++ b/libvirt-node_device-Don-t-leak-error-message-buffer-from-virMdevctlListDefined-Active.patch @@ -0,0 +1,79 @@ +From f158b6573ac39bdd1ba36c3900e65afffe57f3ca Mon Sep 17 00:00:00 2001 +Message-ID: +From: Peter Krempa +Date: Wed, 19 Jul 2023 15:22:22 +0200 +Subject: [PATCH] node_device: Don't leak error message buffer from + virMdevctlListDefined|Active + +nodeDeviceUpdateMediatedDevices invokes virMdevctlListDefined and +virMdevctlListActive both of which were passed the same 'errmsg' buffer. + +Since virCommandSetErrorBuffer() always allocates the error buffer one +of them was leaked. + +Fix it by populating the 'errmsg' buffer only on failure of +virMdevctlListActive|Defined which invoke the command. + +Add a comment to nodeDeviceGetMdevctlListCommand reminding how +virCommandSetErrorBuffer() works. + +Fixes: 44a0f2f0c8f +Signed-off-by: Peter Krempa +Reviewed-by: Boris Fiuczynski + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2143158 + +(cherry picked from commit 7ca777cc09242cb3a30b12d5e0e396c6aaf1a5e7) +Signed-off-by: Jonathon Jongsma +--- + src/node_device/node_device_driver.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c +index 5dc45ddbb4..2ef9197adc 100644 +--- a/src/node_device/node_device_driver.c ++++ b/src/node_device/node_device_driver.c +@@ -1044,6 +1044,15 @@ virMdevctlSetAutostart(virNodeDeviceDef *def, bool autostart, char **errmsg) + } + + ++/** ++ * nodeDeviceGetMdevctlListCommand: ++ * @defined: list mdevctl entries with persistent config ++ * @output: filled with the output of mdevctl once invoked ++ * @errmsg: always allocated, optionally filled with error from 'mdevctl' ++ * ++ * Prepares a virCommand structure to invoke 'mdevctl' caller is responsible to ++ * free the buffers which are filled by the virCommand infrastructure. ++ */ + virCommand* + nodeDeviceGetMdevctlListCommand(bool defined, + char **output, +@@ -1624,9 +1633,11 @@ virMdevctlListDefined(virNodeDeviceDef ***devs, char **errmsg) + { + int status; + g_autofree char *output = NULL; +- g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(true, &output, errmsg); ++ g_autofree char *errbuf = NULL; ++ g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(true, &output, &errbuf); + + if (virCommandRun(cmd, &status) < 0 || status != 0) { ++ *errmsg = g_steal_pointer(&errbuf); + return -1; + } + +@@ -1642,9 +1653,11 @@ virMdevctlListActive(virNodeDeviceDef ***devs, char **errmsg) + { + int status; + g_autofree char *output = NULL; +- g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(false, &output, errmsg); ++ g_autofree char *errbuf = NULL; ++ g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(false, &output, &errbuf); + + if (virCommandRun(cmd, &status) < 0 || status != 0) { ++ *errmsg = g_steal_pointer(&errbuf); + return -1; + } + +-- +2.41.0 diff --git a/libvirt-nodedev-report-mdev-persistence-properly.patch b/libvirt-nodedev-report-mdev-persistence-properly.patch new file mode 100644 index 0000000..39e53bc --- /dev/null +++ b/libvirt-nodedev-report-mdev-persistence-properly.patch @@ -0,0 +1,104 @@ +From c2150285aff9b308b969d5fc6f32f75db620dfe3 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Jonathon Jongsma +Date: Tue, 18 Jul 2023 14:47:49 -0500 +Subject: [PATCH] nodedev: report mdev persistence properly + +Since commit 44a0f2f0, we now query mdevctl for transient (active) mdevs +in order to gather attributes for the mdev. Unfortunately, this commit +introduced a regression because nodeDeviceUpdateMediatedDevice() assumed +that all mdevs returned from mdevctl were actually persistent mdevs but +we were using it to update transient mdevs. Refactor the function so +that we can use it to update both persistent and transient mdevs. + +Signed-off-by: Jonathon Jongsma +Reviewed-by: Michal Privoznik +Reviewed-by: Boris Fiuczynski + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2143158 + +(cherry picked from commit fa0d5f4ebc0aa178d9dea278914f9149a4c4af54) +Signed-off-by: Jonathon Jongsma +--- + src/node_device/node_device_driver.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c +index a2d0600560..5dc45ddbb4 100644 +--- a/src/node_device/node_device_driver.c ++++ b/src/node_device/node_device_driver.c +@@ -1339,11 +1339,12 @@ nodeDeviceDestroy(virNodeDevicePtr device) + /* takes ownership of @def and potentially frees it. @def should not be used + * after returning from this function */ + static int +-nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def) ++nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def, ++ bool defined) + { + virNodeDeviceObj *obj; + virObjectEvent *event; +- bool defined = false; ++ bool was_defined = false; + g_autoptr(virNodeDeviceDef) owned = def; + g_autofree char *name = g_strdup(owned->name); + +@@ -1359,13 +1360,13 @@ nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def) + bool changed; + virNodeDeviceDef *olddef = virNodeDeviceObjGetDef(obj); + +- defined = virNodeDeviceObjIsPersistent(obj); ++ was_defined = virNodeDeviceObjIsPersistent(obj); + /* Active devices contain some additional information (e.g. sysfs + * path) that is not provided by mdevctl, so re-use the existing + * definition and copy over new mdev data */ + changed = nodeDeviceDefCopyFromMdevctl(olddef, owned); + +- if (defined && !changed) { ++ if (was_defined && !changed) { + /* if this device was already defined and the definition + * hasn't changed, there's nothing to do for this device */ + virNodeDeviceObjEndAPI(&obj); +@@ -1373,11 +1374,11 @@ nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def) + } + } + +- /* all devices returned by virMdevctlListDefined() are persistent */ +- virNodeDeviceObjSetPersistent(obj, true); ++ if (defined) ++ virNodeDeviceObjSetPersistent(obj, true); + virNodeDeviceObjSetAutostart(obj, def->caps->data.mdev.autostart); + +- if (!defined) ++ if (!was_defined && defined) + event = virNodeDeviceEventLifecycleNew(name, + VIR_NODE_DEVICE_EVENT_DEFINED, + 0); +@@ -1447,7 +1448,7 @@ nodeDeviceDefineXML(virConnect *conn, + * have already received the uuid from virMdevctlDefine(), we can simply + * add the provisional device to the list and return it immediately and + * avoid this long delay. */ +- if (nodeDeviceUpdateMediatedDevice(g_steal_pointer(&def)) < 0) ++ if (nodeDeviceUpdateMediatedDevice(g_steal_pointer(&def), true) < 0) + return NULL; + + return virGetNodeDevice(conn, name); +@@ -1742,7 +1743,7 @@ nodeDeviceUpdateMediatedDevices(void) + removeMissingPersistentMdev, &data); + + for (i = 0; i < data.ndefs; i++) +- if (nodeDeviceUpdateMediatedDevice(defs[i]) < 0) ++ if (nodeDeviceUpdateMediatedDevice(defs[i], true) < 0) + return -1; + + /* Update active/transient mdev devices */ +@@ -1753,7 +1754,7 @@ nodeDeviceUpdateMediatedDevices(void) + } + + for (i = 0; i < act_ndefs; i++) +- if (nodeDeviceUpdateMediatedDevice(act_defs[i]) < 0) ++ if (nodeDeviceUpdateMediatedDevice(act_defs[i], false) < 0) + return -1; + + return 0; +-- +2.41.0 diff --git a/libvirt-qemu-S390-does-not-provide-physical-address-size.patch b/libvirt-qemu-S390-does-not-provide-physical-address-size.patch new file mode 100644 index 0000000..3c673f1 --- /dev/null +++ b/libvirt-qemu-S390-does-not-provide-physical-address-size.patch @@ -0,0 +1,175 @@ +From 5af7ae809ed21678c265a9559c9f70b90dcd31d9 Mon Sep 17 00:00:00 2001 +Message-ID: <5af7ae809ed21678c265a9559c9f70b90dcd31d9.1689974710.git.jdenemar@redhat.com> +From: Boris Fiuczynski +Date: Fri, 14 Jul 2023 16:38:14 +0200 +Subject: [PATCH] qemu: S390 does not provide physical address size + +Commit be1b7d5b18 introduced parsing /proc/cpuinfo for "address size" +which is not including on S390 and therefore reports an internal error. +Lets remove the parsing on S390. + +Signed-off-by: Boris Fiuczynski +Reviewed-by: Marc Hartmayer +Reviewed-by: Collin Walling +Signed-off-by: Michal Privoznik +Reviewed-by: Michal Privoznik +(cherry picked from commit 8417c1394cd4deccee07235d4f7b2c54b774b08d) + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2224016 + +Signed-off-by: Boris Fiuczynski +--- + src/cpu/cpu_x86.c | 2 +- + src/qemu/qemu_capabilities.c | 2 +- + src/util/virhostcpu.c | 12 ++++++++++-- + src/util/virhostcpu.h | 3 ++- + tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 - + tests/domaincapsdata/qemu_5.2.0.s390x.xml | 1 - + tests/domaincapsdata/qemu_6.0.0.s390x.xml | 1 - + tests/domaincapsdata/qemu_8.1.0.s390x.xml | 1 - + tests/domaincapsmock.c | 8 ++++++-- + 9 files changed, 20 insertions(+), 11 deletions(-) + +diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c +index 8d371d5501..3c0163c4d1 100644 +--- a/src/cpu/cpu_x86.c ++++ b/src/cpu/cpu_x86.c +@@ -2795,7 +2795,7 @@ virCPUx86GetHost(virCPUDef *cpu, + VIR_DEBUG("Host CPU does not support invariant TSC"); + } + +- if (virHostCPUGetPhysAddrSize(&addrsz) == 0) { ++ if (virHostCPUGetPhysAddrSize(cpuData->arch, &addrsz) == 0) { + virCPUMaxPhysAddrDef *addr = g_new0(virCPUMaxPhysAddrDef, 1); + + addr->bits = addrsz; +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 338608f0a2..85ea879f0b 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -3911,7 +3911,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, + } + + if (virQEMUCapsTypeIsAccelerated(type)) +- virHostCPUGetPhysAddrSize(&physAddrSize); ++ virHostCPUGetPhysAddrSize(hostArch, &physAddrSize); + + virQEMUCapsSetHostModel(qemuCaps, type, physAddrSize, cpu, migCPU, fullCPU); + +diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c +index 19195a1470..a15731e9ea 100644 +--- a/src/util/virhostcpu.c ++++ b/src/util/virhostcpu.c +@@ -1646,10 +1646,17 @@ virHostCPUGetSignature(char **signature) + } + + int +-virHostCPUGetPhysAddrSize(unsigned int *size) ++virHostCPUGetPhysAddrSize(const virArch hostArch, ++ unsigned int *size) + { + g_autoptr(FILE) cpuinfo = NULL; + ++ if (ARCH_IS_S390(hostArch)) { ++ /* Ensure size is set to 0 as physical address size is unknown */ ++ *size = 0; ++ return 0; ++ } ++ + if (!(cpuinfo = fopen(CPUINFO_PATH, "r"))) { + virReportSystemError(errno, _("Failed to open cpuinfo file '%1$s'"), + CPUINFO_PATH); +@@ -1669,7 +1676,8 @@ virHostCPUGetSignature(char **signature) + } + + int +-virHostCPUGetPhysAddrSize(unsigned int *size G_GNUC_UNUSED) ++virHostCPUGetPhysAddrSize(const virArch hostArch G_GNUC_UNUSED, ++ unsigned int *size G_GNUC_UNUSED) + { + errno = ENOSYS; + return -1; +diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h +index 5232fee36d..5f0d43e069 100644 +--- a/src/util/virhostcpu.h ++++ b/src/util/virhostcpu.h +@@ -87,7 +87,8 @@ virHostCPUTscInfo *virHostCPUGetTscInfo(void); + + int virHostCPUGetSignature(char **signature); + +-int virHostCPUGetPhysAddrSize(unsigned int *size); ++int virHostCPUGetPhysAddrSize(const virArch hostArch, ++ unsigned int *size); + + int virHostCPUGetHaltPollTime(pid_t pid, + unsigned long long *haltPollSuccess, +diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsdata/qemu_4.2.0.s390x.xml +index da271825f9..2566f42997 100644 +--- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml +@@ -38,7 +38,6 @@ + + + gen15a-base +- + + + +diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsdata/qemu_5.2.0.s390x.xml +index 99faaad866..12f38d3638 100644 +--- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml +@@ -38,7 +38,6 @@ + + + gen15a-base +- + + + +diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsdata/qemu_6.0.0.s390x.xml +index df3708f801..703f729ae2 100644 +--- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml +@@ -38,7 +38,6 @@ + + + gen15a-base +- + + + +diff --git a/tests/domaincapsdata/qemu_8.1.0.s390x.xml b/tests/domaincapsdata/qemu_8.1.0.s390x.xml +index d70b639503..3562e96965 100644 +--- a/tests/domaincapsdata/qemu_8.1.0.s390x.xml ++++ b/tests/domaincapsdata/qemu_8.1.0.s390x.xml +@@ -38,7 +38,6 @@ + + + gen16a-base +- + + + +diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c +index cecb333602..6ae0c4ad45 100644 +--- a/tests/domaincapsmock.c ++++ b/tests/domaincapsmock.c +@@ -37,9 +37,13 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UNUSED) + } + + int +-virHostCPUGetPhysAddrSize(unsigned int *size) ++virHostCPUGetPhysAddrSize(const virArch hostArch, ++ unsigned int *size) + { +- *size = 64; ++ if (ARCH_IS_S390(hostArch)) ++ *size = 0; ++ else ++ *size = 64; + return 0; + } + +-- +2.41.0 diff --git a/libvirt-qemu-add-run-with-async-teardown-capability.patch b/libvirt-qemu-add-run-with-async-teardown-capability.patch new file mode 100644 index 0000000..2f70b71 --- /dev/null +++ b/libvirt-qemu-add-run-with-async-teardown-capability.patch @@ -0,0 +1,97 @@ +From 1c1274ab6be81184ca2193a86735e2edb27aee8d Mon Sep 17 00:00:00 2001 +Message-ID: <1c1274ab6be81184ca2193a86735e2edb27aee8d.1689974709.git.jdenemar@redhat.com> +From: Boris Fiuczynski +Date: Wed, 5 Jul 2023 08:20:25 +0200 +Subject: [PATCH] qemu: add run-with async-teardown capability + +QEMU capability is looking in query-command-line-options response for +... + { + "parameters": [ + { + "name": "async-teardown", + "type": "boolean" + } + ], + "option": "run-with" + } +... +allow to use the QEMU option -run-with async-teardown=on|off + +Signed-off-by: Boris Fiuczynski +Reviewed-by: Thomas Huth +Reviewed-by: Michal Privoznik +(cherry picked from commit 65c6513811d1cdc7e97319164d7528411520dd0c) + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168499 + +Signed-off-by: Boris Fiuczynski +--- + src/qemu/qemu_capabilities.c | 4 ++++ + src/qemu/qemu_capabilities.h | 3 +++ + tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 + + 4 files changed, 9 insertions(+) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 7dad7231ee..c9f4b17208 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -694,6 +694,9 @@ VIR_ENUM_IMPL(virQEMUCaps, + "rbd-encryption-layering", /* QEMU_CAPS_RBD_ENCRYPTION_LAYERING */ + "rbd-encryption-luks-any", /* QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY */ + "qcow2-discard-no-unref", /* QEMU_CAPS_QCOW2_DISCARD_NO_UNREF */ ++ ++ /* 450 */ ++ "run-with.async-teardown", /* QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN */ + ); + + +@@ -3369,6 +3372,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { + { "spice", "gl", QEMU_CAPS_SPICE_GL }, + { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, + { "vnc", "power-control", QEMU_CAPS_VNC_POWER_CONTROL }, ++ { "run-with", "async-teardown", QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN }, + }; + + static int +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index ce545cb2cc..2460fa7fa0 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -674,6 +674,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ + QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY, /* luks-any (LUKS and LUKS2) encryption format for Ceph RBD */ + QEMU_CAPS_QCOW2_DISCARD_NO_UNREF, /* qcow2 block driver allows discards without unrefing the sector */ + ++ /* 450 */ ++ QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN, /* asynchronous teardown -run-with async-teardown=on|off */ ++ + QEMU_CAPS_LAST /* this must always be the last item */ + } virQEMUCapsFlags; + +diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml +index 23b5aece15..88c7ac89db 100644 +--- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml +@@ -114,6 +114,7 @@ + + + ++ + 8000050 + 39100245 + v8.0.0-1270-g1c12355b +diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml +index f717c83fec..475496a8c8 100644 +--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml +@@ -206,6 +206,7 @@ + + + ++ + 8000050 + 43100245 + v8.0.0-1739-g5f9dd6a8ce +-- +2.41.0 diff --git a/libvirt-qemu-allow-use-of-async-teardown-in-domain.patch b/libvirt-qemu-allow-use-of-async-teardown-in-domain.patch new file mode 100644 index 0000000..7bd21a3 --- /dev/null +++ b/libvirt-qemu-allow-use-of-async-teardown-in-domain.patch @@ -0,0 +1,836 @@ +From d216c360f9d0acda0726194aed81e145018a3951 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Boris Fiuczynski +Date: Wed, 5 Jul 2023 08:20:26 +0200 +Subject: [PATCH] qemu: allow use of async teardown in domain + +Asynchronous teardown can be specified if the QEMU binary supports it by +adding in the domain XML + + + ... + + ... + + +By default this new feature is disabled. + +Signed-off-by: Boris Fiuczynski +Reviewed-by: Thomas Huth +Signed-off-by: Michal Privoznik +Reviewed-by: Michal Privoznik +(cherry picked from commit 3bf02acdc5446b2c4a3078f99d8f5232acff9043) + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168499 + +Signed-off-by: Boris Fiuczynski +--- + docs/formatdomain.rst | 6 +++ + src/conf/domain_conf.c | 22 ++++++++++ + src/conf/domain_conf.h | 1 + + src/conf/schemas/domaincommon.rng | 9 ++++ + src/qemu/qemu_command.c | 22 ++++++++++ + src/qemu/qemu_validate.c | 9 ++++ + .../async-teardown.x86_64-latest.args | 37 ++++++++++++++++ + tests/qemuxml2argvdata/async-teardown.xml | 31 +++++++++++++ + ...0-async-teardown-disabled.s390x-6.0.0.args | 35 +++++++++++++++ + ...-async-teardown-disabled.s390x-latest.args | 36 +++++++++++++++ + .../s390-async-teardown-disabled.xml | 24 ++++++++++ + ...async-teardown-no-attrib.s390x-latest.args | 36 +++++++++++++++ + .../s390-async-teardown-no-attrib.xml | 24 ++++++++++ + .../s390-async-teardown.s390x-6.0.0.err | 1 + + .../s390-async-teardown.s390x-latest.args | 36 +++++++++++++++ + .../qemuxml2argvdata/s390-async-teardown.xml | 24 ++++++++++ + tests/qemuxml2argvtest.c | 7 +++ + .../async-teardown.x86_64-latest.xml | 44 +++++++++++++++++++ + ...90-async-teardown-disabled.s390x-6.0.0.xml | 36 +++++++++++++++ + ...0-async-teardown-disabled.s390x-latest.xml | 36 +++++++++++++++ + ...-async-teardown-no-attrib.s390x-latest.xml | 36 +++++++++++++++ + .../s390-async-teardown.s390x-latest.xml | 36 +++++++++++++++ + tests/qemuxml2xmltest.c | 6 +++ + 23 files changed, 554 insertions(+) + create mode 100644 tests/qemuxml2argvdata/async-teardown.x86_64-latest.args + create mode 100644 tests/qemuxml2argvdata/async-teardown.xml + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.xml + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args + create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.xml + create mode 100644 tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml + create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-6.0.0.xml + create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-latest.xml + create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-no-attrib.s390x-latest.xml + create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown.s390x-latest.xml + +diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst +index f29449f749..c61c8a3fec 100644 +--- a/docs/formatdomain.rst ++++ b/docs/formatdomain.rst +@@ -2000,6 +2000,7 @@ Hypervisors may allow certain CPU / machine features to be toggled on/off. + + 128 + ++ + + ... + +@@ -2230,6 +2231,11 @@ are: + tb-cache The size of translation block cache size an integer (a multiple of MiB) :since:`8.0.0` + =========== ============================================== =================================================== ============== + ++``async-teardown`` ++ Depending on the ``enabled`` attribute (values ``yes``, ``no``) enable or ++ disable QEMU asynchronous teardown to improve memory reclaiming on a guest. ++ :since:`Since 9.6.0` (QEMU only) ++ + Time keeping + ------------ + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 4121b6a054..5ac5c0b771 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -181,6 +181,7 @@ VIR_ENUM_IMPL(virDomainFeature, + "sbbc", + "ibs", + "tcg", ++ "async-teardown", + ); + + VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, +@@ -16689,6 +16690,20 @@ virDomainFeaturesDefParse(virDomainDef *def, + return -1; + break; + ++ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN: { ++ virTristateBool enabled; ++ ++ if (virXMLPropTristateBool(nodes[i], "enabled", ++ VIR_XML_PROP_NONE, &enabled) < 0) ++ return -1; ++ ++ if (enabled == VIR_TRISTATE_BOOL_ABSENT) ++ enabled = VIR_TRISTATE_BOOL_YES; ++ ++ def->features[val] = enabled; ++ break; ++ } ++ + case VIR_DOMAIN_FEATURE_LAST: + break; + } +@@ -20628,6 +20643,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDef *src, + + case VIR_DOMAIN_FEATURE_MSRS: + case VIR_DOMAIN_FEATURE_TCG: ++ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN: + case VIR_DOMAIN_FEATURE_LAST: + break; + } +@@ -27340,6 +27356,12 @@ virDomainDefFormatFeatures(virBuffer *buf, + virDomainFeatureTCGFormat(&childBuf, def); + break; + ++ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN: ++ if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT) ++ virBufferAsprintf(&childBuf, "\n", ++ virTristateBoolTypeToString(def->features[i])); ++ break; ++ + case VIR_DOMAIN_FEATURE_LAST: + break; + } +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index cddaa3824d..c857ba556f 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2170,6 +2170,7 @@ typedef enum { + VIR_DOMAIN_FEATURE_SBBC, + VIR_DOMAIN_FEATURE_IBS, + VIR_DOMAIN_FEATURE_TCG, ++ VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN, + + VIR_DOMAIN_FEATURE_LAST + } virDomainFeature; +diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng +index fcf9e00600..c2f56b0490 100644 +--- a/src/conf/schemas/domaincommon.rng ++++ b/src/conf/schemas/domaincommon.rng +@@ -6660,6 +6660,15 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index cde6ab4dde..ec5d8b52d4 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -10175,6 +10175,25 @@ qemuBuildCryptoCommandLine(virCommand *cmd, + } + + ++static int ++qemuBuildAsyncTeardownCommandLine(virCommand *cmd, ++ const virDomainDef *def, ++ virQEMUCaps *qemuCaps) ++{ ++ g_autofree char *async = NULL; ++ virTristateBool enabled = def->features[VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN]; ++ ++ if (enabled != VIR_TRISTATE_BOOL_ABSENT && ++ virQEMUCapsGet(qemuCaps, QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN)) { ++ async = g_strdup_printf("async-teardown=%s", ++ virTristateSwitchTypeToString(enabled)); ++ virCommandAddArgList(cmd, "-run-with", async, NULL); ++ } ++ ++ return 0; ++} ++ ++ + typedef enum { + QEMU_COMMAND_DEPRECATION_BEHAVIOR_NONE = 0, + QEMU_COMMAND_DEPRECATION_BEHAVIOR_OMIT, +@@ -10530,6 +10549,9 @@ qemuBuildCommandLine(virDomainObj *vm, + if (qemuBuildCryptoCommandLine(cmd, def, qemuCaps) < 0) + return NULL; + ++ if (qemuBuildAsyncTeardownCommandLine(cmd, def, qemuCaps) < 0) ++ return NULL; ++ + if (cfg->logTimestamp) + virCommandAddArgList(cmd, "-msg", "timestamp=on", NULL); + +diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c +index a53729d349..7e09e2c52f 100644 +--- a/src/qemu/qemu_validate.c ++++ b/src/qemu/qemu_validate.c +@@ -219,6 +219,15 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, + } + break; + ++ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN: ++ if (def->features[i] == VIR_TRISTATE_BOOL_YES && ++ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("asynchronous teardown is not available with this QEMU binary")); ++ return -1; ++ } ++ break; ++ + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_XEN: +diff --git a/tests/qemuxml2argvdata/async-teardown.x86_64-latest.args b/tests/qemuxml2argvdata/async-teardown.x86_64-latest.args +new file mode 100644 +index 0000000000..455382f1f0 +--- /dev/null ++++ b/tests/qemuxml2argvdata/async-teardown.x86_64-latest.args +@@ -0,0 +1,37 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ ++USER=test \ ++LOGNAME=test \ ++XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ ++XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ ++XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ ++/usr/bin/qemu-system-x86_64 \ ++-name guest=QEMUGuest1,debug-threads=on \ ++-S \ ++-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ ++-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ ++-accel tcg \ ++-cpu qemu64 \ ++-m size=219136k \ ++-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ ++-overcommit mem-lock=off \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ++-display none \ ++-no-user-config \ ++-nodefaults \ ++-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ ++-mon chardev=charmonitor,id=monitor,mode=control \ ++-rtc base=utc \ ++-no-shutdown \ ++-boot strict=on \ ++-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ ++-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ ++-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ ++-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ ++-audiodev '{"id":"audio1","driver":"none"}' \ ++-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ ++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ ++-run-with async-teardown=on \ ++-msg timestamp=on +diff --git a/tests/qemuxml2argvdata/async-teardown.xml b/tests/qemuxml2argvdata/async-teardown.xml +new file mode 100644 +index 0000000000..70c1eccc55 +--- /dev/null ++++ b/tests/qemuxml2argvdata/async-teardown.xml +@@ -0,0 +1,31 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ ++ ++ ++ /usr/bin/qemu-system-x86_64 ++ ++ ++ ++
++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args +new file mode 100644 +index 0000000000..57690530a2 +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args +@@ -0,0 +1,35 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ ++USER=test \ ++LOGNAME=test \ ++XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ ++XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ ++XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ ++/usr/bin/qemu-system-s390x \ ++-name guest=QEMUGuest1,debug-threads=on \ ++-S \ ++-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ ++-machine s390-ccw-virtio-6.0,usb=off,dump-guest-core=off,memory-backend=s390.ram \ ++-accel tcg \ ++-cpu qemu \ ++-m size=262144k \ ++-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \ ++-overcommit mem-lock=off \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ ++-display none \ ++-no-user-config \ ++-nodefaults \ ++-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ ++-mon chardev=charmonitor,id=monitor,mode=control \ ++-rtc base=utc \ ++-no-shutdown \ ++-boot strict=on \ ++-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \ ++-chardev pty,id=charconsole0 \ ++-device virtconsole,chardev=charconsole0,id=console0 \ ++-audiodev '{"id":"audio1","driver":"none"}' \ ++-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0001 \ ++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ ++-msg timestamp=on +diff --git a/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args +new file mode 100644 +index 0000000000..96b18b83ce +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args +@@ -0,0 +1,36 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ ++USER=test \ ++LOGNAME=test \ ++XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ ++XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ ++XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ ++/usr/bin/qemu-system-s390x \ ++-name guest=QEMUGuest1,debug-threads=on \ ++-S \ ++-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ ++-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ ++-accel tcg \ ++-cpu qemu \ ++-m size=262144k \ ++-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \ ++-overcommit mem-lock=off \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ ++-display none \ ++-no-user-config \ ++-nodefaults \ ++-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ ++-mon chardev=charmonitor,id=monitor,mode=control \ ++-rtc base=utc \ ++-no-shutdown \ ++-boot strict=on \ ++-device '{"driver":"virtio-serial-ccw","id":"virtio-serial0","devno":"fe.0.0000"}' \ ++-chardev pty,id=charconsole0 \ ++-device '{"driver":"virtconsole","chardev":"charconsole0","id":"console0"}' \ ++-audiodev '{"id":"audio1","driver":"none"}' \ ++-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ ++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ ++-run-with async-teardown=off \ ++-msg timestamp=on +diff --git a/tests/qemuxml2argvdata/s390-async-teardown-disabled.xml b/tests/qemuxml2argvdata/s390-async-teardown-disabled.xml +new file mode 100644 +index 0000000000..3939be0006 +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown-disabled.xml +@@ -0,0 +1,24 @@ ++ ++ QEMUGuest1 ++ 9aa4b45c-b9dd-45ef-91fe-862b27b4231f ++ 262144 ++ 262144 ++ ++ hvm ++ ++ ++ destroy ++ restart ++ destroy ++ ++ ++ ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args +new file mode 100644 +index 0000000000..cc7866499f +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args +@@ -0,0 +1,36 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ ++USER=test \ ++LOGNAME=test \ ++XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ ++XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ ++XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ ++/usr/bin/qemu-system-s390x \ ++-name guest=QEMUGuest1,debug-threads=on \ ++-S \ ++-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ ++-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ ++-accel tcg \ ++-cpu qemu \ ++-m size=262144k \ ++-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \ ++-overcommit mem-lock=off \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ ++-display none \ ++-no-user-config \ ++-nodefaults \ ++-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ ++-mon chardev=charmonitor,id=monitor,mode=control \ ++-rtc base=utc \ ++-no-shutdown \ ++-boot strict=on \ ++-device '{"driver":"virtio-serial-ccw","id":"virtio-serial0","devno":"fe.0.0000"}' \ ++-chardev pty,id=charconsole0 \ ++-device '{"driver":"virtconsole","chardev":"charconsole0","id":"console0"}' \ ++-audiodev '{"id":"audio1","driver":"none"}' \ ++-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ ++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ ++-run-with async-teardown=on \ ++-msg timestamp=on +diff --git a/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml +new file mode 100644 +index 0000000000..e069cd41ed +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml +@@ -0,0 +1,24 @@ ++ ++ QEMUGuest1 ++ 9aa4b45c-b9dd-45ef-91fe-862b27b4231f ++ 262144 ++ 262144 ++ ++ hvm ++ ++ ++ destroy ++ restart ++ destroy ++ ++ ++ ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err b/tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err +new file mode 100644 +index 0000000000..aa9a4739cb +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err +@@ -0,0 +1 @@ ++unsupported configuration: asynchronous teardown is not available with this QEMU binary +diff --git a/tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args b/tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args +new file mode 100644 +index 0000000000..cc7866499f +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args +@@ -0,0 +1,36 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ ++USER=test \ ++LOGNAME=test \ ++XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ ++XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ ++XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ ++/usr/bin/qemu-system-s390x \ ++-name guest=QEMUGuest1,debug-threads=on \ ++-S \ ++-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ ++-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ ++-accel tcg \ ++-cpu qemu \ ++-m size=262144k \ ++-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \ ++-overcommit mem-lock=off \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ ++-display none \ ++-no-user-config \ ++-nodefaults \ ++-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ ++-mon chardev=charmonitor,id=monitor,mode=control \ ++-rtc base=utc \ ++-no-shutdown \ ++-boot strict=on \ ++-device '{"driver":"virtio-serial-ccw","id":"virtio-serial0","devno":"fe.0.0000"}' \ ++-chardev pty,id=charconsole0 \ ++-device '{"driver":"virtconsole","chardev":"charconsole0","id":"console0"}' \ ++-audiodev '{"id":"audio1","driver":"none"}' \ ++-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ ++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ ++-run-with async-teardown=on \ ++-msg timestamp=on +diff --git a/tests/qemuxml2argvdata/s390-async-teardown.xml b/tests/qemuxml2argvdata/s390-async-teardown.xml +new file mode 100644 +index 0000000000..3291b1ada3 +--- /dev/null ++++ b/tests/qemuxml2argvdata/s390-async-teardown.xml +@@ -0,0 +1,24 @@ ++ ++ QEMUGuest1 ++ 9aa4b45c-b9dd-45ef-91fe-862b27b4231f ++ 262144 ++ 262144 ++ ++ hvm ++ ++ ++ destroy ++ restart ++ destroy ++ ++ ++ ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index c1bba779b3..9abaa72674 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -2701,6 +2701,13 @@ mymain(void) + + DO_TEST_CAPS_LATEST("crypto-builtin"); + ++ DO_TEST_CAPS_LATEST("async-teardown"); ++ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown", "s390x"); ++ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown-no-attrib", "s390x"); ++ DO_TEST_CAPS_ARCH_VER_PARSE_ERROR("s390-async-teardown", "s390x", "6.0.0"); ++ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown-disabled", "s390x"); ++ DO_TEST_CAPS_ARCH_VER("s390-async-teardown-disabled", "s390x", "6.0.0"); ++ + qemuTestDriverFree(&driver); + virFileWrapperClearPrefixes(); + +diff --git a/tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml b/tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml +new file mode 100644 +index 0000000000..e98308a9b1 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml +@@ -0,0 +1,44 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ qemu64 ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-x86_64 ++ ++ ++ ++ ++
++ ++ ++
++ ++ ++ ++
++ ++ ++ ++ ++