import CS libvirt-10.10.0-15.el9

This commit is contained in:
eabdullin 2025-09-15 12:17:43 +00:00
parent 89c3f5c24c
commit 2d208de5b8
72 changed files with 58615 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From 9874072fc9396d609f1a0213bb06fa7e9a2fa019 Mon Sep 17 00:00:00 2001
Message-ID: <9874072fc9396d609f1a0213bb06fa7e9a2fa019.1747908717.git.jdenemar@redhat.com>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 25 Feb 2025 15:36:03 +0100
Subject: [PATCH] Add load average information type into virDomainGetGuestInfo
The public API part.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit c52c449fd40c7263896d5f17129207b815c3a09c)
https://issues.redhat.com/browse/RHEL-88447
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
include/libvirt/libvirt-domain.h | 1 +
src/libvirt-domain.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index f026ce197c..c04b696f03 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -6425,6 +6425,7 @@ typedef enum {
VIR_DOMAIN_GUEST_INFO_FILESYSTEM = (1 << 4), /* return filesystem information (Since: 5.7.0) */
VIR_DOMAIN_GUEST_INFO_DISKS = (1 << 5), /* return disks information (Since: 7.0.0) */
VIR_DOMAIN_GUEST_INFO_INTERFACES = (1 << 6), /* return interfaces information (Since: 7.10.0) */
+ VIR_DOMAIN_GUEST_INFO_LOAD = (1 << 7), /* return load averages (Since: 11.2.0) */
} virDomainGuestInfoTypes;
int virDomainGetGuestInfo(virDomainPtr domain,
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 7c6b93963c..24752a9888 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -13292,6 +13292,14 @@ virDomainSetVcpu(virDomainPtr domain,
* "if.<num>.addr.<num1>.addr" - the IP address of addr <num1>
* "if.<num>.addr.<num1>.prefix" - the prefix of IP address of addr <num1>
*
+ * VIR_DOMAIN_GUEST_INFO_LOAD:
+ * Returns load (the number of processes in the runqueue or waiting for disk
+ * I/O) as double values:
+ *
+ * "load.1m" - load averaged over 1 minute
+ * "load.5m" - load averaged over 5 minutes
+ * "load.15m" - load averaged over 15 minutes
+ *
* Using 0 for @types returns all information groups supported by the given
* hypervisor.
*
--
2.49.0

View File

@ -0,0 +1,280 @@
From 4c66a653f02c8259fdcf72fdcd801b594f73183e Mon Sep 17 00:00:00 2001
Message-ID: <4c66a653f02c8259fdcf72fdcd801b594f73183e.1749039441.git.jdenemar@redhat.com>
From: Collin Walling <walling@linux.ibm.com>
Date: Mon, 16 Dec 2024 18:03:58 -0500
Subject: [PATCH] conf: add deprecated_features attribute
Add a new a attribute, deprecated_features='on|off' to the <cpu>
element. This is used to toggle features flagged as deprecated on the
CPU model on or off. When this attribute is paired with 'on',
deprecated features will not be filtered. When paired with 'off', any
CPU features that are flagged as deprecated will be listed under the
CPU model with the 'disable' policy.
Example:
<cpu mode='host-model' check='partial' deprecated_features='off'/>
The absence of this attribute is equivalent to the 'on' option.
The deprecated features that will populate the domain XML are the same
features that result in the virsh domcapabilities command with the
--disable-deprecated-features argument present.
It is recommended to define a domain XML with this attribute set to
'off' to ensure migration to machines that may outright drop these
features in the future.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 62658bbf060784c757f96c9de3935f27885834aa)
JIRA: https://issues.redhat.com/browse/RHEL-89415
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
src/conf/cpu_conf.c | 11 +++++++
src/conf/cpu_conf.h | 1 +
src/conf/schemas/cputypes.rng | 5 +++
src/qemu/qemu_process.c | 11 +++++++
...el-deprecated-features-off.s390x-8.2.0.err | 1 +
...el-deprecated-features-off.s390x-8.2.0.xml | 25 +++++++++++++++
...-deprecated-features-off.s390x-latest.args | 32 +++++++++++++++++++
...l-deprecated-features-off.s390x-latest.xml | 25 +++++++++++++++
.../cpu-model-deprecated-features-off.xml | 15 +++++++++
tests/qemuxmlconftest.c | 3 ++
10 files changed, 129 insertions(+)
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.err
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.xml
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.args
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.xml
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.xml
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index dcc164d165..31425783ba 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -238,6 +238,7 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu)
copy->mode = cpu->mode;
copy->match = cpu->match;
copy->check = cpu->check;
+ copy->deprecated_feats = cpu->deprecated_feats;
copy->fallback = cpu->fallback;
copy->sockets = cpu->sockets;
copy->dies = cpu->dies;
@@ -450,6 +451,11 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
if (virXMLPropEnum(ctxt->node, "check", virCPUCheckTypeFromString,
VIR_XML_PROP_NONE, &def->check) < 0)
return -1;
+
+ if (virXMLPropTristateSwitch(ctxt->node, "deprecated_features",
+ VIR_XML_PROP_NONE,
+ &def->deprecated_feats) < 0)
+ return -1;
}
if (def->type == VIR_CPU_TYPE_HOST) {
@@ -748,6 +754,11 @@ virCPUDefFormatBufFull(virBuffer *buf,
virBufferAsprintf(&attributeBuf, " migratable='%s'",
virTristateSwitchTypeToString(def->migratable));
}
+
+ if (def->deprecated_feats) {
+ virBufferAsprintf(&attributeBuf, " deprecated_features='%s'",
+ virTristateSwitchTypeToString(def->deprecated_feats));
+ }
}
/* Format children */
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index f71d942ce6..28e26303ef 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -161,6 +161,7 @@ struct _virCPUDef {
virCPUMaxPhysAddrDef *addr;
virHostCPUTscInfo *tsc;
virTristateSwitch migratable; /* for host-passthrough mode */
+ virTristateSwitch deprecated_feats;
};
virCPUDef *virCPUDefNew(void);
diff --git a/src/conf/schemas/cputypes.rng b/src/conf/schemas/cputypes.rng
index 3a8910e09f..8edf1d14e3 100644
--- a/src/conf/schemas/cputypes.rng
+++ b/src/conf/schemas/cputypes.rng
@@ -439,6 +439,11 @@
<optional>
<ref name="cpuCheck"/>
</optional>
+ <optional>
+ <attribute name="deprecated_features">
+ <ref name="virOnOff"/>
+ </attribute>
+ </optional>
<optional>
<attribute name="migratable">
<ref name="virOnOff"/>
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c1ae324ad4..64683ecfe0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6429,6 +6429,17 @@ qemuProcessUpdateGuestCPU(virDomainDef *def,
&def->os.arch) < 0)
return -1;
+ if (def->cpu->deprecated_feats &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("toggling deprecated features for CPU model is unsupported"));
+ return -1;
+ }
+
+ if (def->cpu->deprecated_feats == VIR_TRISTATE_SWITCH_OFF) {
+ virQEMUCapsUpdateCPUDeprecatedFeatures(qemuCaps, def->virtType, def->cpu);
+ }
+
return 0;
}
diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.err b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.err
new file mode 100644
index 0000000000..936d1d5a46
--- /dev/null
+++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.err
@@ -0,0 +1 @@
+unsupported configuration: toggling deprecated features for CPU model is unsupported
diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.xml
new file mode 100644
index 0000000000..e1f7ba3857
--- /dev/null
+++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.xml
@@ -0,0 +1,25 @@
+<domain type='kvm'>
+ <name>guest</name>
+ <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio-8.2'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='host-model' check='partial' deprecated_features='off'/>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.args b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.args
new file mode 100644
index 0000000000..ba6e7c5304
--- /dev/null
+++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.args
@@ -0,0 +1,32 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-s390x \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-accel kvm \
+-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \
+-m size=219136k \
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 22782664-6b93-46bf-9595-317220dd2d1c \
+-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 \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.xml
new file mode 100644
index 0000000000..fdd87acb1d
--- /dev/null
+++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.xml
@@ -0,0 +1,25 @@
+<domain type='kvm'>
+ <name>guest</name>
+ <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='host-model' check='partial' deprecated_features='off'/>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.xml
new file mode 100644
index 0000000000..67950715ec
--- /dev/null
+++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-off.xml
@@ -0,0 +1,15 @@
+<domain type='kvm'>
+ <name>guest</name>
+ <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ </os>
+ <cpu mode='host-model' check='partial' deprecated_features='off'/>
+ <clock offset='utc'/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index e88aa6da92..bed562286d 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2300,6 +2300,9 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("cpu-s390-zEC12", "s390x");
DO_TEST_CAPS_ARCH_LATEST("cpu-s390-features", "s390x");
+ DO_TEST_CAPS_ARCH_VER_FAILURE("cpu-model-deprecated-features-off", "s390x", "8.2.0");
+ DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-off", "s390x");
+
DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell2", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell3", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
--
2.49.0

View File

@ -0,0 +1,198 @@
From 2cd8164cffc5be97e2836862a4fc44578dae2b47 Mon Sep 17 00:00:00 2001
Message-ID: <2cd8164cffc5be97e2836862a4fc44578dae2b47.1752749355.git.jdenemar@redhat.com>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Fri, 14 Mar 2025 17:13:31 +0100
Subject: [PATCH] conf: add passthrough and xtsup attributes for IOMMU
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For the newly supported AMD device.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 856f667c8a3b44417f3b5bb42db5e8bf971bacd4)
https://issues.redhat.com/browse/RHEL-50560
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
docs/formatdomain.rst | 8 +++++
src/conf/domain_conf.c | 30 +++++++++++++++++++
src/conf/domain_conf.h | 2 ++
src/conf/domain_validate.c | 9 ++++++
src/conf/schemas/domaincommon.rng | 10 +++++++
src/qemu/qemu_command.c | 2 ++
.../amd-iommu.x86_64-latest.args | 2 +-
tests/qemuxmlconfdata/amd-iommu.xml | 2 +-
8 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index ec7bdb07d0..847c9ebc6e 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -8885,6 +8885,14 @@ Example:
example to efficiently enable more than 255 vCPUs.
:since:`Since 10.7.0` (QEMU/KVM and ``intel`` model only)
+ ``passthrough``
+ Enable passthrough. In this mode, DMA read/writes are not translated.
+ :since:`Since 11.5.0` (QEMU/KVM and ``amd`` model only)
+
+ ``xtsup``
+ Enable x2APIC mode. Useful for higher number of guest CPUs.
+ :since:`Since 11.5.0` (QEMU/KVM and ``amd`` model only)
+
The ``virtio`` IOMMU devices can further have ``address`` element as described
in `Device addresses`_ (address has to by type of ``pci``).
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7c8591e509..286e59a4c7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14063,6 +14063,14 @@ virDomainIOMMUDefParseXML(virDomainXMLOption *xmlopt,
if (virXMLPropTristateSwitch(driver, "dma_translation", VIR_XML_PROP_NONE,
&iommu->dma_translation) < 0)
return NULL;
+
+ if (virXMLPropTristateSwitch(driver, "xtsup", VIR_XML_PROP_NONE,
+ &iommu->xtsup) < 0)
+ return NULL;
+
+ if (virXMLPropTristateSwitch(driver, "passthrough", VIR_XML_PROP_NONE,
+ &iommu->pt) < 0)
+ return NULL;
}
if (virDomainDeviceInfoParseXML(xmlopt, node, ctxt,
@@ -21682,6 +21690,20 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDef *src,
virTristateSwitchTypeToString(src->dma_translation));
return false;
}
+ if (src->pt != dst->pt) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target domain IOMMU device dma translation '%1$s' does not match source '%2$s'"),
+ virTristateSwitchTypeToString(dst->pt),
+ virTristateSwitchTypeToString(src->pt));
+ return false;
+ }
+ if (src->xtsup != dst->xtsup) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target domain IOMMU device dma translation '%1$s' does not match source '%2$s'"),
+ virTristateSwitchTypeToString(dst->xtsup),
+ virTristateSwitchTypeToString(src->xtsup));
+ return false;
+ }
return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info);
}
@@ -27735,6 +27757,14 @@ virDomainIOMMUDefFormat(virBuffer *buf,
virBufferAsprintf(&driverAttrBuf, " dma_translation='%s'",
virTristateSwitchTypeToString(iommu->dma_translation));
}
+ if (iommu->pt != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&driverAttrBuf, " passthrough='%s'",
+ virTristateSwitchTypeToString(iommu->pt));
+ }
+ if (iommu->xtsup != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&driverAttrBuf, " xtsup='%s'",
+ virTristateSwitchTypeToString(iommu->xtsup));
+ }
virXMLFormatElement(&childBuf, "driver", &driverAttrBuf, NULL);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 343bb9bae0..e59d2e6c5f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2987,6 +2987,8 @@ struct _virDomainIOMMUDef {
unsigned int aw_bits;
virDomainDeviceInfo info;
virTristateSwitch dma_translation;
+ virTristateSwitch xtsup;
+ virTristateSwitch pt;
};
typedef enum {
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 483cfbbe08..522fd0174f 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2999,6 +2999,15 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
break;
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
+ if (iommu->pt != VIR_TRISTATE_SWITCH_ABSENT ||
+ iommu->xtsup != VIR_TRISTATE_SWITCH_ABSENT) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("iommu model '%1$s' doesn't support some additional attributes"),
+ virDomainIOMMUModelTypeToString(iommu->model));
+ return -1;
+ }
+ break;
+
case VIR_DOMAIN_IOMMU_MODEL_LAST:
break;
}
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 38a0586f40..1b153acc48 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -6210,6 +6210,16 @@
<ref name="virOnOff"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="xtsup">
+ <ref name="virOnOff"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="passthrough">
+ <ref name="virOnOff"/>
+ </attribute>
+ </optional>
</element>
</optional>
<optional>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index de535029a8..fffc8be08a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6113,6 +6113,8 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
"s:driver", "amd-iommu",
"s:pci-id", iommu->info.alias,
"S:intremap", qemuOnOffAuto(iommu->intremap),
+ "T:pt", iommu->pt,
+ "T:xtsup", iommu->xtsup,
"T:device-iotlb", iommu->iotlb,
NULL) < 0)
return -1;
diff --git a/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.args b/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.args
index 36244edb3a..20d7e379e6 100644
--- a/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.args
@@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-no-shutdown \
-boot strict=on \
-device '{"driver":"AMDVI-PCI","id":"iommu0","bus":"pcie.0","addr":"0x1"}' \
--device '{"driver":"amd-iommu","pci-id":"iommu0","intremap":"on","device-iotlb":true}' \
+-device '{"driver":"amd-iommu","pci-id":"iommu0","intremap":"on","pt":true,"xtsup":true,"device-iotlb":true}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-global ICH9-LPC.noreboot=off \
-watchdog-action reset \
diff --git a/tests/qemuxmlconfdata/amd-iommu.xml b/tests/qemuxmlconfdata/amd-iommu.xml
index 0668ed4237..4ad79ce4ae 100644
--- a/tests/qemuxmlconfdata/amd-iommu.xml
+++ b/tests/qemuxmlconfdata/amd-iommu.xml
@@ -32,7 +32,7 @@
<watchdog model='itco' action='reset'/>
<memballoon model='none'/>
<iommu model='amd'>
- <driver intremap='on' iotlb='on'/>
+ <driver intremap='on' iotlb='on' passthrough='on' xtsup='on'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</iommu>
</devices>
--
2.50.1

View File

@ -0,0 +1,422 @@
From f4dffda866c49db8cd905d7fb4d35a70c996fa89 Mon Sep 17 00:00:00 2001
Message-ID: <f4dffda866c49db8cd905d7fb4d35a70c996fa89.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 17 Feb 2025 16:30:07 +0000
Subject: [PATCH] conf: introduce support for multiple ACPI tables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Currently we parse
<os>
<acpi>
<table type="slic">...path...</table>
</acpi>
</os>
into a flat 'char *slic_table' field which is rather an anti-pattern
as it has special cased a single attribute type.
This rewrites the internal design to permit multiple table types to
be parsed, should we add more in future. Each type is currently
permitted to only appear once.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 55f48d38522a4657815668dae9ed9184c8870766)
Resolves: https://issues.redhat.com/browse/RHEL-81041
---
src/conf/domain_conf.c | 92 +++++++++++++++++++++++----------
src/conf/domain_conf.h | 21 +++++++-
src/libvirt_private.syms | 2 +
src/libxl/libxl_conf.c | 5 +-
src/libxl/xen_xl.c | 15 ++++--
src/qemu/qemu_command.c | 13 +++--
src/security/security_dac.c | 18 ++++---
src/security/security_selinux.c | 16 +++---
src/security/virt-aa-helper.c | 5 +-
9 files changed, 134 insertions(+), 53 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 095b9bbaa2..b0628da279 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1456,6 +1456,11 @@ VIR_ENUM_IMPL(virDomainOsDefFirmwareFeature,
"secure-boot",
);
+VIR_ENUM_IMPL(virDomainOsACPITable,
+ VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST,
+ "slic",
+);
+
VIR_ENUM_IMPL(virDomainCFPC,
VIR_DOMAIN_CFPC_LAST,
"none",
@@ -3890,6 +3895,15 @@ virDomainSecDefFree(virDomainSecDef *def)
g_free(def);
}
+void virDomainOSACPITableDefFree(virDomainOSACPITableDef *def)
+{
+ if (!def)
+ return;
+ g_free(def->path);
+ g_free(def);
+}
+
+
static void
virDomainOSDefClear(virDomainOSDef *os)
{
@@ -3915,7 +3929,9 @@ virDomainOSDefClear(virDomainOSDef *os)
g_free(os->cmdline);
g_free(os->dtb);
g_free(os->root);
- g_free(os->slic_table);
+ for (i = 0; i < os->nacpiTables; i++)
+ virDomainOSACPITableDefFree(os->acpiTables[i]);
+ g_free(os->acpiTables);
virDomainLoaderDefFree(os->loader);
g_free(os->bootloader);
g_free(os->bootloaderArgs);
@@ -17849,40 +17865,57 @@ virDomainDefParseBootAcpiOptions(virDomainDef *def,
int n;
g_autofree xmlNodePtr *nodes = NULL;
g_autofree char *tmp = NULL;
+ size_t ntables = 0;
+ virDomainOSACPITableDef **tables = NULL;
+ size_t i;
if ((n = virXPathNodeSet("./os/acpi/table", ctxt, &nodes)) < 0)
return -1;
- if (n > 1) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("Only one acpi table is supported"));
- return -1;
- }
+ if (n == 0)
+ return 0;
- if (n == 1) {
- tmp = virXMLPropString(nodes[0], "type");
+ tables = g_new0(virDomainOSACPITableDef *, n);
+ for (i = 0; i < n; i++) {
+ g_autofree char *path = virXMLNodeContentString(nodes[i]);
+ virDomainOsACPITable type;
+ size_t j;
- if (!tmp) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("Missing acpi table type"));
- return -1;
+ if (!path)
+ goto error;
+
+ if (virXMLPropEnum(nodes[i], "type",
+ virDomainOsACPITableTypeFromString,
+ VIR_XML_PROP_REQUIRED,
+ &type) < 0)
+ goto error;
+
+ for (j = 0; j < i; j++) {
+ if (tables[j]->type == type) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("ACPI table type '%1$s' may only appear once"),
+ virDomainOsACPITableTypeToString(type));
+ goto error;
+ }
}
- if (STREQ_NULLABLE(tmp, "slic")) {
- VIR_FREE(tmp);
- if (!(tmp = virXMLNodeContentString(nodes[0])))
- return -1;
-
- def->os.slic_table = virFileSanitizePath(tmp);
- } else {
- virReportError(VIR_ERR_XML_ERROR,
- _("Unknown acpi table type: %1$s"),
- tmp);
- return -1;
- }
+ tables[ntables] = g_new0(virDomainOSACPITableDef, 1);
+ tables[ntables]->type = type;
+ tables[ntables]->path = virFileSanitizePath(path);
+ ntables++;
}
+ def->os.nacpiTables = ntables;
+ def->os.acpiTables = tables;
+
return 0;
+
+ error:
+ for (i = 0; i < ntables; i++) {
+ virDomainOSACPITableDefFree(tables[i]);
+ }
+ g_free(tables);
+ return -1;
}
@@ -28447,11 +28480,16 @@ virDomainDefFormatInternalSetRootName(virDomainDef *def,
def->os.dtb);
virBufferEscapeString(buf, "<root>%s</root>\n",
def->os.root);
- if (def->os.slic_table) {
+
+ if (def->os.nacpiTables) {
virBufferAddLit(buf, "<acpi>\n");
virBufferAdjustIndent(buf, 2);
- virBufferEscapeString(buf, "<table type='slic'>%s</table>\n",
- def->os.slic_table);
+ for (i = 0; i < def->os.nacpiTables; i++) {
+ virBufferAsprintf(buf, "<table type='%s'>",
+ virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
+ virBufferEscapeString(buf, "%s</table>\n",
+ def->os.acpiTables[i]->path);
+ }
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</acpi>\n");
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 2d38e8fa51..f52b80caec 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2462,6 +2462,24 @@ typedef enum {
VIR_ENUM_DECL(virDomainOsDefFirmwareFeature);
+typedef enum {
+ VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC,
+
+ VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST
+} virDomainOsACPITable;
+
+VIR_ENUM_DECL(virDomainOsACPITable);
+
+struct _virDomainOSACPITableDef {
+ virDomainOsACPITable type;
+ char *path;
+};
+
+typedef struct _virDomainOSACPITableDef virDomainOSACPITableDef;
+void virDomainOSACPITableDefFree(virDomainOSACPITableDef *def);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainOSACPITableDef, virDomainOSACPITableDefFree);
+
+
struct _virDomainOSDef {
int type;
virDomainOsDefFirmware firmware;
@@ -2484,7 +2502,8 @@ struct _virDomainOSDef {
char *cmdline;
char *dtb;
char *root;
- char *slic_table;
+ size_t nacpiTables;
+ virDomainOSACPITableDef **acpiTables;
virDomainLoaderDef *loader;
char *bootloader;
char *bootloaderArgs;
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 727ab52cfe..be313ad67b 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -609,6 +609,8 @@ virDomainObjTaint;
virDomainObjUpdateModificationImpact;
virDomainObjWait;
virDomainObjWaitUntil;
+virDomainOsACPITableTypeFromString;
+virDomainOsACPITableTypeToString;
virDomainOsDefFirmwareTypeFromString;
virDomainOsDefFirmwareTypeToString;
virDomainOSTypeFromString;
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index c404226e43..7d845b97ec 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -582,8 +582,9 @@ libxlMakeDomBuildInfo(virDomainDef *def,
VIR_TRISTATE_SWITCH_ON);
#endif
- /* copy SLIC table path to acpi_firmware */
- b_info->u.hvm.acpi_firmware = g_strdup(def->os.slic_table);
+ /* copy the table path to acpi_firmware */
+ if (def->os.nacpiTables)
+ b_info->u.hvm.acpi_firmware = g_strdup(def->os.acpiTables[0]->path);
if (def->nsounds > 0) {
/*
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
index 53f6871efc..062b753cea 100644
--- a/src/libxl/xen_xl.c
+++ b/src/libxl/xen_xl.c
@@ -106,6 +106,7 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
g_autofree char *bios = NULL;
g_autofree char *bios_path = NULL;
g_autofree char *boot = NULL;
+ g_autofree char *slic = NULL;
int val = 0;
if (xenConfigGetString(conf, "bios", &bios, NULL) < 0)
@@ -133,8 +134,15 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
}
}
- if (xenConfigCopyStringOpt(conf, "acpi_firmware", &def->os.slic_table) < 0)
+ if (xenConfigCopyStringOpt(conf, "acpi_firmware", &slic) < 0)
return -1;
+ if (slic != NULL) {
+ def->os.nacpiTables = 1;
+ def->os.acpiTables = g_new0(virDomainOSACPITableDef *, 1);
+ def->os.acpiTables[0] = g_new0(virDomainOSACPITableDef, 1);
+ def->os.acpiTables[0]->type = VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC;
+ def->os.acpiTables[0]->path = g_steal_pointer(&slic);
+ }
if (xenConfigCopyStringOpt(conf, "kernel", &def->os.kernel) < 0)
return -1;
@@ -1134,8 +1142,9 @@ xenFormatXLOS(virConf *conf, virDomainDef *def)
return -1;
}
- if (def->os.slic_table &&
- xenConfigSetString(conf, "acpi_firmware", def->os.slic_table) < 0)
+ if (def->os.nacpiTables &&
+ xenConfigSetString(conf, "acpi_firmware",
+ def->os.acpiTables[0]->path) < 0)
return -1;
if (def->os.kernel &&
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 24dac0ce0f..756dd2168b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -127,6 +127,11 @@ VIR_ENUM_IMPL(qemuNumaPolicy,
"restrictive",
);
+VIR_ENUM_DECL(qemuACPITableSIG);
+VIR_ENUM_IMPL(qemuACPITableSIG,
+ VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST,
+ "SLIC");
+
const char *
qemuAudioDriverTypeToString(virDomainAudioType type)
@@ -5968,6 +5973,7 @@ qemuBuildBootCommandLine(virCommand *cmd,
{
g_auto(virBuffer) boot_buf = VIR_BUFFER_INITIALIZER;
g_autofree char *boot_opts_str = NULL;
+ size_t i;
if (def->os.bootmenu) {
if (def->os.bootmenu == VIR_TRISTATE_BOOL_YES)
@@ -6001,11 +6007,12 @@ qemuBuildBootCommandLine(virCommand *cmd,
virCommandAddArgList(cmd, "-append", def->os.cmdline, NULL);
if (def->os.dtb)
virCommandAddArgList(cmd, "-dtb", def->os.dtb, NULL);
- if (def->os.slic_table) {
+ for (i = 0; i < def->os.nacpiTables; i++) {
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virCommandAddArg(cmd, "-acpitable");
- virBufferAddLit(&buf, "sig=SLIC,file=");
- virQEMUBuildBufferEscapeComma(&buf, def->os.slic_table);
+ virBufferAsprintf(&buf, "sig=%s,file=",
+ qemuACPITableSIGTypeToString(def->os.acpiTables[i]->type));
+ virQEMUBuildBufferEscapeComma(&buf, def->os.acpiTables[i]->path);
virCommandAddArgBuffer(cmd, &buf);
}
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 0505f4e4a3..b4d61bc576 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -2050,9 +2050,10 @@ virSecurityDACRestoreAllLabel(virSecurityManager *mgr,
virSecurityDACRestoreFileLabel(mgr, def->os.dtb) < 0)
rc = -1;
- if (def->os.slic_table &&
- virSecurityDACRestoreFileLabel(mgr, def->os.slic_table) < 0)
- rc = -1;
+ for (i = 0; i < def->os.nacpiTables; i++) {
+ if (virSecurityDACRestoreFileLabel(mgr, def->os.acpiTables[i]->path) < 0)
+ rc = -1;
+ }
if (def->pstore &&
virSecurityDACRestoreFileLabel(mgr, def->pstore->path) < 0)
@@ -2300,11 +2301,12 @@ virSecurityDACSetAllLabel(virSecurityManager *mgr,
user, group, true) < 0)
return -1;
- if (def->os.slic_table &&
- virSecurityDACSetOwnership(mgr, NULL,
- def->os.slic_table,
- user, group, true) < 0)
- return -1;
+ for (i = 0; i < def->os.nacpiTables; i++) {
+ if (virSecurityDACSetOwnership(mgr, NULL,
+ def->os.acpiTables[i]->path,
+ user, group, true) < 0)
+ return -1;
+ }
if (def->pstore &&
virSecurityDACSetOwnership(mgr, NULL,
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index cdc32d9b34..b8659e33d6 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -3013,9 +3013,10 @@ virSecuritySELinuxRestoreAllLabel(virSecurityManager *mgr,
virSecuritySELinuxRestoreFileLabel(mgr, def->os.dtb, true) < 0)
rc = -1;
- if (def->os.slic_table &&
- virSecuritySELinuxRestoreFileLabel(mgr, def->os.slic_table, true) < 0)
- rc = -1;
+ for (i = 0; i < def->os.nacpiTables; i++) {
+ if (virSecuritySELinuxRestoreFileLabel(mgr, def->os.acpiTables[i]->path, true) < 0)
+ rc = -1;
+ }
if (def->pstore &&
virSecuritySELinuxRestoreFileLabel(mgr, def->pstore->path, true) < 0)
@@ -3443,10 +3444,11 @@ virSecuritySELinuxSetAllLabel(virSecurityManager *mgr,
data->content_context, true) < 0)
return -1;
- if (def->os.slic_table &&
- virSecuritySELinuxSetFilecon(mgr, def->os.slic_table,
- data->content_context, true) < 0)
- return -1;
+ for (i = 0; i < def->os.nacpiTables; i++) {
+ if (virSecuritySELinuxSetFilecon(mgr, def->os.acpiTables[i]->path,
+ data->content_context, true) < 0)
+ return -1;
+ }
if (def->pstore &&
virSecuritySELinuxSetFilecon(mgr, def->pstore->path,
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index e82b5de2b4..e68e908994 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -1002,9 +1002,10 @@ get_files(vahControl * ctl)
if (vah_add_file(&buf, ctl->def->os.dtb, "r") != 0)
goto cleanup;
- if (ctl->def->os.slic_table)
- if (vah_add_file(&buf, ctl->def->os.slic_table, "r") != 0)
+ for (i = 0; i < ctl->def->os.nacpiTables; i++) {
+ if (vah_add_file(&buf, ctl->def->os.acpiTables[i]->path, "r") != 0)
goto cleanup;
+ }
if (ctl->def->pstore)
if (vah_add_file(&buf, ctl->def->pstore->path, "rw") != 0)
--
2.49.0

View File

@ -0,0 +1,103 @@
From 29ea0453595ee14cdd64b2e9c07343aa870426d0 Mon Sep 17 00:00:00 2001
Message-ID: <29ea0453595ee14cdd64b2e9c07343aa870426d0.1744876587.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Thu, 6 Mar 2025 19:19:12 -0500
Subject: [PATCH] conf: parse interface/source/@dev for all interface types
(with backend type='passt')
The original implementation of the passt backend for vhost-user
interfaces erroneously forgot to parse:
<source dev='blah'/>
for interface type='vhostuser', so it wasn't being added to the passt
commandline, and also wasn't being saved to the domain config. Now we
parse it whenever the <backend> type='passt', no matter what the
interface type, and then throw an error during validation if
source/@dev was specified for interface type = 'user|vhostuser' and
backend type != 'passt'.
Fixes: 1e9054b9c79d721a55f413c2983c5370044f8f60
Resolves: https://issues.redhat.com/browse/RHEL-82539
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 4c979edaa545c8425f7a856c06ebc0de939d4b9f)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/conf/domain_conf.c | 8 +++++---
src/conf/domain_validate.c | 8 +++++++-
.../qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.xml | 2 ++
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f6d3d849eb..726c3095ed 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9919,9 +9919,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
break;
case VIR_DOMAIN_NET_TYPE_USER:
- def->sourceDev = virXMLPropString(source_node, "dev");
- break;
-
case VIR_DOMAIN_NET_TYPE_NULL:
case VIR_DOMAIN_NET_TYPE_LAST:
break;
@@ -10036,6 +10033,11 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
return NULL;
}
+ if (def->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) {
+ def->sourceDev = virXMLPropString(source_node, "dev");
+ }
+
+
def->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT;
if (linkstate != NULL) {
if ((def->linkstate = virDomainNetInterfaceLinkStateTypeFromString(linkstate)) <= 0) {
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 597ae3d938..9cedc8d6d2 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2160,12 +2160,18 @@ virDomainNetDefValidate(const virDomainNetDef *net)
if (net->type != VIR_DOMAIN_NET_TYPE_USER &&
net->type != VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("The 'passt' backend can only be used with interface type='user' or type='vhostuser'"));
return -1;
}
}
+ if (net->sourceDev && net->backend.type != VIR_DOMAIN_NET_BACKEND_PASST) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("The 'dev' attribute of the <source> element can only be used with <interface> type='user' or type='vhostuser' if the <backend> type='passt'"));
+ return -1;
+ }
+
if (net->nPortForwards > 0) {
size_t p;
diff --git a/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.xml b/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.xml
index a1f9366722..529aff11f8 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.xml
+++ b/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.xml
@@ -33,6 +33,7 @@
<controller type='pci' index='0' model='pci-root'/>
<interface type='vhostuser'>
<mac address='00:11:22:33:44:55'/>
+ <source dev='eth42'/>
<ip address='172.17.2.0' family='ipv4' prefix='24'/>
<ip address='2001:db8:ac10:fd01::feed' family='ipv6'/>
<portForward proto='tcp' address='2001:db8:ac10:fd01::1:10'>
@@ -63,6 +64,7 @@
</interface>
<interface type='vhostuser'>
<mac address='00:11:22:33:44:11'/>
+ <source dev='eth43'/>
<model type='virtio'/>
<backend type='passt'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
--
2.49.0

View File

@ -0,0 +1,119 @@
From bfde8a471a604ddc3bfe7ee5baddbedc379ddf34 Mon Sep 17 00:00:00 2001
Message-ID: <bfde8a471a604ddc3bfe7ee5baddbedc379ddf34.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 17 Feb 2025 16:58:27 +0000
Subject: [PATCH] conf: support MSDM ACPI table type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The MSDM ACPI table is an alternative for the SLIC table type,
sometimes used by Microsoft for Windows Licensing checks:
https://learn.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653305(v=vs.85)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 32765cd14e99411dfd14a230be86f2aecf7e9a7a)
Resolves: https://issues.redhat.com/browse/RHEL-81041
---
docs/formatdomain.rst | 4 ++++
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/conf/schemas/domaincommon.rng | 1 +
src/libxl/libxl_domain.c | 1 +
src/qemu/qemu_command.c | 3 ++-
src/qemu/qemu_validate.c | 1 +
7 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index b03b5317aa..c144851b62 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -497,6 +497,10 @@ These options apply to any form of booting of the guest OS.
software licensing information. The ACPI table signature in the
header will be forced to ``SLIC`` (:since:`Since 1.3.5 (QEMU)`,
mis-interpreted as ``rawset`` :since:`Since 5.9.0 (Xen)`).
+ * ``msdm``: a single ACPI table with header and data, providing
+ Microsoft Data Management information. The ACPI table signature
+ in the header will be forced to ``MSDM``
+ (:since:`Since 11.2.0`).
Each type may be used only once, except for ``raw`` which can
appear multiple times.
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2ee0403c86..f6d3d849eb 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1461,6 +1461,7 @@ VIR_ENUM_IMPL(virDomainOsACPITable,
"raw",
"rawset",
"slic",
+ "msdm",
);
VIR_ENUM_IMPL(virDomainCFPC,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index bc3f42888e..961b7b056c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2466,6 +2466,7 @@ typedef enum {
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC,
+ VIR_DOMAIN_OS_ACPI_TABLE_TYPE_MSDM,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST
} virDomainOsACPITable;
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 99bcc90d4f..d46eb44588 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -7192,6 +7192,7 @@
<value>raw</value>
<value>rawset</value>
<value>slic</value>
+ <value>msdm</value>
</choice>
</attribute>
<ref name="absFilePath"/>
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index e31d92d903..c5a556ec78 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -339,6 +339,7 @@ libxlDomainDefValidate(const virDomainDef *def,
break;
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_MSDM:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("ACPI table type '%1$s' is not supported"),
virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index adf7b21b14..9fe191d3b9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -132,7 +132,8 @@ VIR_ENUM_IMPL(qemuACPITableSIG,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST,
"", /* raw */
"", /* rawset */
- "SLIC");
+ "SLIC",
+ "");
const char *
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index b088e54dd0..378f502ea7 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -734,6 +734,7 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
break;
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_MSDM:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("ACPI table type '%1$s' is not supported"),
virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
--
2.49.0

View File

@ -0,0 +1,669 @@
From 7a9d85a3159fdc0ecec40338f7f28df91ba08a0c Mon Sep 17 00:00:00 2001
Message-ID: <7a9d85a3159fdc0ecec40338f7f28df91ba08a0c.1747908717.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 18 Dec 2024 13:46:25 +0100
Subject: [PATCH] cpu_map: Add GraniteRapids-v2 CPU model
Introduced by QEMU 9.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 41a6de76bc6e31a206d9d82c84c5d485b710fe01)
https://issues.redhat.com/browse/RHEL-71897
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 4dbeaa7e1ce9fffb3e2a2b19ba10cc3d2c19091d)
Conflicts:
- tests/domaincapsdata/qemu_10.0.0* were updated by a later
upstream commit (712c39f987e1fb75a9fe3168dfb2501b719b5070)
which was already backported to RHEL-9 as commit
d056b57fff98c30ef64a695dec44a2ddfcc1c55b with the hunks
related to GraniteRapids-v2 removed, thus this backport has to
incorporate those hunks
https://issues.redhat.com/browse/RHEL-87796
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
=> 4c2001ea03d9466db571ddf07248c20d652ac775
---
src/cpu_map/index.xml | 1 +
src/cpu_map/meson.build | 1 +
src/cpu_map/x86_GraniteRapids-v2.xml | 206 ++++++++++++++++++
.../domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 57 +++++
.../domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 47 ++++
tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 57 +++++
.../domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 57 +++++
.../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 47 ++++
tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 57 +++++
9 files changed, 530 insertions(+)
create mode 100644 src/cpu_map/x86_GraniteRapids-v2.xml
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
index 8e74195312..dba2f21811 100644
--- a/src/cpu_map/index.xml
+++ b/src/cpu_map/index.xml
@@ -121,6 +121,7 @@
<include filename='x86_SapphireRapids-v3.xml'/>
<include filename='x86_GraniteRapids.xml'/>
<include filename='x86_GraniteRapids-v1.xml'/>
+ <include filename='x86_GraniteRapids-v2.xml'/>
<include filename='x86_SierraForest.xml'/>
<include filename='x86_SierraForest-v1.xml'/>
<include filename='x86_Denverton.xml'/>
diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build
index fa7faa4016..9a1c048620 100644
--- a/src/cpu_map/meson.build
+++ b/src/cpu_map/meson.build
@@ -77,6 +77,7 @@ cpumap_data = [
'x86_EPYC.xml',
'x86_features.xml',
'x86_GraniteRapids-v1.xml',
+ 'x86_GraniteRapids-v2.xml',
'x86_GraniteRapids.xml',
'x86_Haswell-IBRS.xml',
'x86_Haswell-noTSX-IBRS.xml',
diff --git a/src/cpu_map/x86_GraniteRapids-v2.xml b/src/cpu_map/x86_GraniteRapids-v2.xml
new file mode 100644
index 0000000000..855a43d4ad
--- /dev/null
+++ b/src/cpu_map/x86_GraniteRapids-v2.xml
@@ -0,0 +1,206 @@
+<cpus>
+ <model name='GraniteRapids-v2'>
+ <decode host='on' guest='off'/>
+ <signature family='6' model='173'/>
+ <vendor name='Intel'/>
+ <feature name='3dnowprefetch'/>
+ <feature name='abm'/>
+ <feature name='adx'/>
+ <feature name='aes'/>
+ <feature name='amx-bf16'/>
+ <feature name='amx-fp16'/>
+ <feature name='amx-int8'/>
+ <feature name='amx-tile'/>
+ <feature name='apic'/>
+ <feature name='arat'/>
+ <feature name='arch-capabilities'/>
+ <feature name='avx'/>
+ <feature name='avx-vnni'/>
+ <feature name='avx10'/>
+ <feature name='avx10-128'/>
+ <feature name='avx10-256'/>
+ <feature name='avx10-512'/>
+ <feature name='avx2'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-fp16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bmi1'/>
+ <feature name='bmi2'/>
+ <feature name='bus-lock-detect'/>
+ <feature name='cldemote'/>
+ <feature name='clflush'/>
+ <feature name='clflushopt'/>
+ <feature name='clwb'/>
+ <feature name='cmov'/>
+ <feature name='cx16'/>
+ <feature name='cx8'/>
+ <feature name='de'/>
+ <feature name='erms'/>
+ <feature name='f16c'/>
+ <feature name='fbsdp-no'/>
+ <feature name='fma'/>
+ <feature name='fpu'/>
+ <feature name='fsgsbase'/>
+ <feature name='fsrc'/>
+ <feature name='fsrm'/>
+ <feature name='fsrs'/>
+ <feature name='fxsr'/>
+ <feature name='fzrm'/>
+ <feature name='gfni'/>
+ <feature name='hle'/>
+ <feature name='ibrs-all'/>
+ <feature name='invpcid'/>
+ <feature name='la57'/>
+ <feature name='lahf_lm'/>
+ <feature name='lm'/>
+ <feature name='mca'/>
+ <feature name='mcdt-no'/>
+ <feature name='mce'/>
+ <feature name='mds-no'/>
+ <feature name='mmx'/>
+ <feature name='movbe'/>
+ <feature name='movdir64b'/>
+ <feature name='movdiri'/>
+ <feature name='msr'/>
+ <feature name='mtrr'/>
+ <feature name='nx'/>
+ <feature name='pae'/>
+ <feature name='pat'/>
+ <feature name='pbrsb-no'/>
+ <feature name='pcid'/>
+ <feature name='pclmuldq'/>
+ <feature name='pdpe1gb'/>
+ <feature name='pge'/>
+ <feature name='pku'/>
+ <feature name='pni'/>
+ <feature name='popcnt'/>
+ <feature name='prefetchiti'/>
+ <feature name='pschange-mc-no'/>
+ <feature name='psdp-no'/>
+ <feature name='pse'/>
+ <feature name='pse36'/>
+ <feature name='rdctl-no'/>
+ <feature name='rdpid'/>
+ <feature name='rdrand'/>
+ <feature name='rdseed'/>
+ <feature name='rdtscp'/>
+ <feature name='rtm'/>
+ <feature name='sbdr-ssdp-no'/>
+ <feature name='sep'/>
+ <feature name='serialize'/>
+ <feature name='sha-ni'/>
+ <feature name='skip-l1dfl-vmentry'/>
+ <feature name='smap'/>
+ <feature name='smep'/>
+ <feature name='spec-ctrl'/>
+ <feature name='ss'/>
+ <feature name='ssbd'/>
+ <feature name='sse'/>
+ <feature name='sse2'/>
+ <feature name='sse4.1'/>
+ <feature name='sse4.2'/>
+ <feature name='ssse3'/>
+ <feature name='syscall'/>
+ <feature name='taa-no'/>
+ <feature name='tsc'/>
+ <feature name='tsc-deadline'/>
+ <feature name='tsc_adjust'/>
+ <feature name='tsx-ldtrk'/>
+ <feature name='umip'/>
+ <feature name='vaes'/>
+ <feature name='vme'/>
+ <feature name='vmx-activity-hlt'/>
+ <feature name='vmx-apicv-register'/>
+ <feature name='vmx-apicv-vid'/>
+ <feature name='vmx-apicv-x2apic'/>
+ <feature name='vmx-apicv-xapic'/>
+ <feature name='vmx-cr3-load-noexit'/>
+ <feature name='vmx-cr3-store-noexit'/>
+ <feature name='vmx-cr8-load-exit'/>
+ <feature name='vmx-cr8-store-exit'/>
+ <feature name='vmx-desc-exit'/>
+ <feature name='vmx-entry-ia32e-mode'/>
+ <feature name='vmx-entry-load-efer'/>
+ <feature name='vmx-entry-load-pat'/>
+ <feature name='vmx-entry-load-perf-global-ctrl'/>
+ <feature name='vmx-entry-noload-debugctl'/>
+ <feature name='vmx-ept'/>
+ <feature name='vmx-ept-1gb'/>
+ <feature name='vmx-ept-2mb'/>
+ <feature name='vmx-ept-execonly'/>
+ <feature name='vmx-eptad'/>
+ <feature name='vmx-eptp-switching'/>
+ <feature name='vmx-exit-ack-intr'/>
+ <feature name='vmx-exit-load-efer'/>
+ <feature name='vmx-exit-load-pat'/>
+ <feature name='vmx-exit-load-perf-global-ctrl'/>
+ <feature name='vmx-exit-nosave-debugctl'/>
+ <feature name='vmx-exit-save-efer'/>
+ <feature name='vmx-exit-save-pat'/>
+ <feature name='vmx-exit-save-preemption-timer'/>
+ <feature name='vmx-flexpriority'/>
+ <feature name='vmx-hlt-exit'/>
+ <feature name='vmx-ins-outs'/>
+ <feature name='vmx-intr-exit'/>
+ <feature name='vmx-invept'/>
+ <feature name='vmx-invept-all-context'/>
+ <feature name='vmx-invept-single-context'/>
+ <feature name='vmx-invlpg-exit'/>
+ <feature name='vmx-invpcid-exit'/>
+ <feature name='vmx-invvpid-all-context'/>
+ <feature name='vmx-invvpid-single-addr'/>
+ <feature name='vmx-invvpid-single-context-noglobals'/>
+ <feature name='vmx-io-bitmap'/>
+ <feature name='vmx-io-exit'/>
+ <feature name='vmx-monitor-exit'/>
+ <feature name='vmx-movdr-exit'/>
+ <feature name='vmx-msr-bitmap'/>
+ <feature name='vmx-mtf'/>
+ <feature name='vmx-mwait-exit'/>
+ <feature name='vmx-nmi-exit'/>
+ <feature name='vmx-page-walk-4'/>
+ <feature name='vmx-page-walk-5'/>
+ <feature name='vmx-pause-exit'/>
+ <feature name='vmx-pml'/>
+ <feature name='vmx-posted-intr'/>
+ <feature name='vmx-preemption-timer'/>
+ <feature name='vmx-rdpmc-exit'/>
+ <feature name='vmx-rdrand-exit'/>
+ <feature name='vmx-rdseed-exit'/>
+ <feature name='vmx-rdtsc-exit'/>
+ <feature name='vmx-rdtscp-exit'/>
+ <feature name='vmx-secondary-ctls'/>
+ <feature name='vmx-shadow-vmcs'/>
+ <feature name='vmx-store-lma'/>
+ <feature name='vmx-true-ctls'/>
+ <feature name='vmx-tsc-offset'/>
+ <feature name='vmx-unrestricted-guest'/>
+ <feature name='vmx-vintr-pending'/>
+ <feature name='vmx-vmfunc'/>
+ <feature name='vmx-vmwrite-vmexit-fields'/>
+ <feature name='vmx-vnmi'/>
+ <feature name='vmx-vnmi-pending'/>
+ <feature name='vmx-vpid'/>
+ <feature name='vmx-wbinvd-exit'/>
+ <feature name='vmx-xsaves'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='wbnoinvd'/>
+ <feature name='x2apic'/>
+ <feature name='xfd'/>
+ <feature name='xgetbv1'/>
+ <feature name='xsave'/>
+ <feature name='xsavec'/>
+ <feature name='xsaveopt'/>
+ <feature name='xsaves'/>
+ </model>
+</cpus>
diff --git a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml
index e4d8862569..f1a7963d34 100644
--- a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml
@@ -565,6 +565,63 @@
<feature name='xfd'/>
<feature name='xsaves'/>
</blockers>
+ <model usable='no' vendor='Intel'>GraniteRapids-v2</model>
+ <blockers model='GraniteRapids-v2'>
+ <feature name='amx-bf16'/>
+ <feature name='amx-fp16'/>
+ <feature name='amx-int8'/>
+ <feature name='amx-tile'/>
+ <feature name='avx-vnni'/>
+ <feature name='avx10'/>
+ <feature name='avx10-128'/>
+ <feature name='avx10-256'/>
+ <feature name='avx10-512'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-fp16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bus-lock-detect'/>
+ <feature name='cldemote'/>
+ <feature name='erms'/>
+ <feature name='fbsdp-no'/>
+ <feature name='fsrc'/>
+ <feature name='fsrm'/>
+ <feature name='fsrs'/>
+ <feature name='fzrm'/>
+ <feature name='gfni'/>
+ <feature name='hle'/>
+ <feature name='ibrs-all'/>
+ <feature name='invpcid'/>
+ <feature name='la57'/>
+ <feature name='mcdt-no'/>
+ <feature name='movdir64b'/>
+ <feature name='movdiri'/>
+ <feature name='pbrsb-no'/>
+ <feature name='pcid'/>
+ <feature name='pku'/>
+ <feature name='prefetchiti'/>
+ <feature name='psdp-no'/>
+ <feature name='rtm'/>
+ <feature name='sbdr-ssdp-no'/>
+ <feature name='serialize'/>
+ <feature name='spec-ctrl'/>
+ <feature name='ss'/>
+ <feature name='taa-no'/>
+ <feature name='tsx-ldtrk'/>
+ <feature name='vaes'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='xfd'/>
+ <feature name='xsaves'/>
+ </blockers>
<model usable='no' vendor='Intel' canonical='Haswell-v1'>Haswell</model>
<blockers model='Haswell'>
<feature name='erms'/>
diff --git a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml
index a21ed4997e..9a7d39c1f8 100644
--- a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml
@@ -733,6 +733,53 @@
<feature name='xsavec'/>
<feature name='xsaves'/>
</blockers>
+ <model usable='no' vendor='Intel'>GraniteRapids-v2</model>
+ <blockers model='GraniteRapids-v2'>
+ <feature name='amx-bf16'/>
+ <feature name='amx-fp16'/>
+ <feature name='amx-int8'/>
+ <feature name='amx-tile'/>
+ <feature name='arch-capabilities'/>
+ <feature name='avx-vnni'/>
+ <feature name='avx10'/>
+ <feature name='avx10-128'/>
+ <feature name='avx10-256'/>
+ <feature name='avx10-512'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-fp16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bus-lock-detect'/>
+ <feature name='cldemote'/>
+ <feature name='gfni'/>
+ <feature name='hle'/>
+ <feature name='invpcid'/>
+ <feature name='mcdt-no'/>
+ <feature name='movdir64b'/>
+ <feature name='movdiri'/>
+ <feature name='pcid'/>
+ <feature name='prefetchiti'/>
+ <feature name='rtm'/>
+ <feature name='serialize'/>
+ <feature name='spec-ctrl'/>
+ <feature name='ssbd'/>
+ <feature name='tsc-deadline'/>
+ <feature name='tsc_adjust'/>
+ <feature name='tsx-ldtrk'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='xfd'/>
+ <feature name='xsavec'/>
+ <feature name='xsaves'/>
+ </blockers>
<model usable='no' vendor='Intel' canonical='Haswell-v1'>Haswell</model>
<blockers model='Haswell'>
<feature name='hle'/>
diff --git a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml b/tests/domaincapsdata/qemu_10.0.0.x86_64.xml
index f4989749ce..64dc451eda 100644
--- a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_10.0.0.x86_64.xml
@@ -564,6 +564,63 @@
<feature name='xfd'/>
<feature name='xsaves'/>
</blockers>
+ <model usable='no' vendor='Intel'>GraniteRapids-v2</model>
+ <blockers model='GraniteRapids-v2'>
+ <feature name='amx-bf16'/>
+ <feature name='amx-fp16'/>
+ <feature name='amx-int8'/>
+ <feature name='amx-tile'/>
+ <feature name='avx-vnni'/>
+ <feature name='avx10'/>
+ <feature name='avx10-128'/>
+ <feature name='avx10-256'/>
+ <feature name='avx10-512'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-fp16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bus-lock-detect'/>
+ <feature name='cldemote'/>
+ <feature name='erms'/>
+ <feature name='fbsdp-no'/>
+ <feature name='fsrc'/>
+ <feature name='fsrm'/>
+ <feature name='fsrs'/>
+ <feature name='fzrm'/>
+ <feature name='gfni'/>
+ <feature name='hle'/>
+ <feature name='ibrs-all'/>
+ <feature name='invpcid'/>
+ <feature name='la57'/>
+ <feature name='mcdt-no'/>
+ <feature name='movdir64b'/>
+ <feature name='movdiri'/>
+ <feature name='pbrsb-no'/>
+ <feature name='pcid'/>
+ <feature name='pku'/>
+ <feature name='prefetchiti'/>
+ <feature name='psdp-no'/>
+ <feature name='rtm'/>
+ <feature name='sbdr-ssdp-no'/>
+ <feature name='serialize'/>
+ <feature name='spec-ctrl'/>
+ <feature name='ss'/>
+ <feature name='taa-no'/>
+ <feature name='tsx-ldtrk'/>
+ <feature name='vaes'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='xfd'/>
+ <feature name='xsaves'/>
+ </blockers>
<model usable='no' vendor='Intel' canonical='Haswell-v1'>Haswell</model>
<blockers model='Haswell'>
<feature name='erms'/>
diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml
index 99445e5f44..d5db9af49e 100644
--- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml
@@ -565,6 +565,63 @@
<feature name='xfd'/>
<feature name='xsaves'/>
</blockers>
+ <model usable='no' vendor='Intel'>GraniteRapids-v2</model>
+ <blockers model='GraniteRapids-v2'>
+ <feature name='amx-bf16'/>
+ <feature name='amx-fp16'/>
+ <feature name='amx-int8'/>
+ <feature name='amx-tile'/>
+ <feature name='avx-vnni'/>
+ <feature name='avx10'/>
+ <feature name='avx10-128'/>
+ <feature name='avx10-256'/>
+ <feature name='avx10-512'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-fp16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bus-lock-detect'/>
+ <feature name='cldemote'/>
+ <feature name='erms'/>
+ <feature name='fbsdp-no'/>
+ <feature name='fsrc'/>
+ <feature name='fsrm'/>
+ <feature name='fsrs'/>
+ <feature name='fzrm'/>
+ <feature name='gfni'/>
+ <feature name='hle'/>
+ <feature name='ibrs-all'/>
+ <feature name='invpcid'/>
+ <feature name='la57'/>
+ <feature name='mcdt-no'/>
+ <feature name='movdir64b'/>
+ <feature name='movdiri'/>
+ <feature name='pbrsb-no'/>
+ <feature name='pcid'/>
+ <feature name='pku'/>
+ <feature name='prefetchiti'/>
+ <feature name='psdp-no'/>
+ <feature name='rtm'/>
+ <feature name='sbdr-ssdp-no'/>
+ <feature name='serialize'/>
+ <feature name='spec-ctrl'/>
+ <feature name='ss'/>
+ <feature name='taa-no'/>
+ <feature name='tsx-ldtrk'/>
+ <feature name='vaes'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='xfd'/>
+ <feature name='xsaves'/>
+ </blockers>
<model usable='no' vendor='Intel' canonical='Haswell-v1'>Haswell</model>
<blockers model='Haswell'>
<feature name='erms'/>
diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml
index 8bf967c99f..7ccdc11412 100644
--- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml
@@ -733,6 +733,53 @@
<feature name='xsavec'/>
<feature name='xsaves'/>
</blockers>
+ <model usable='no' vendor='Intel'>GraniteRapids-v2</model>
+ <blockers model='GraniteRapids-v2'>
+ <feature name='amx-bf16'/>
+ <feature name='amx-fp16'/>
+ <feature name='amx-int8'/>
+ <feature name='amx-tile'/>
+ <feature name='arch-capabilities'/>
+ <feature name='avx-vnni'/>
+ <feature name='avx10'/>
+ <feature name='avx10-128'/>
+ <feature name='avx10-256'/>
+ <feature name='avx10-512'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-fp16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bus-lock-detect'/>
+ <feature name='cldemote'/>
+ <feature name='gfni'/>
+ <feature name='hle'/>
+ <feature name='invpcid'/>
+ <feature name='mcdt-no'/>
+ <feature name='movdir64b'/>
+ <feature name='movdiri'/>
+ <feature name='pcid'/>
+ <feature name='prefetchiti'/>
+ <feature name='rtm'/>
+ <feature name='serialize'/>
+ <feature name='spec-ctrl'/>
+ <feature name='ssbd'/>
+ <feature name='tsc-deadline'/>
+ <feature name='tsc_adjust'/>
+ <feature name='tsx-ldtrk'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='xfd'/>
+ <feature name='xsavec'/>
+ <feature name='xsaves'/>
+ </blockers>
<model usable='no' vendor='Intel' canonical='Haswell-v1'>Haswell</model>
<blockers model='Haswell'>
<feature name='hle'/>
diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml
index 40aa971144..05a5ce4bee 100644
--- a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml
@@ -564,6 +564,63 @@
<feature name='xfd'/>
<feature name='xsaves'/>
</blockers>
+ <model usable='no' vendor='Intel'>GraniteRapids-v2</model>
+ <blockers model='GraniteRapids-v2'>
+ <feature name='amx-bf16'/>
+ <feature name='amx-fp16'/>
+ <feature name='amx-int8'/>
+ <feature name='amx-tile'/>
+ <feature name='avx-vnni'/>
+ <feature name='avx10'/>
+ <feature name='avx10-128'/>
+ <feature name='avx10-256'/>
+ <feature name='avx10-512'/>
+ <feature name='avx512-bf16'/>
+ <feature name='avx512-fp16'/>
+ <feature name='avx512-vpopcntdq'/>
+ <feature name='avx512bitalg'/>
+ <feature name='avx512bw'/>
+ <feature name='avx512cd'/>
+ <feature name='avx512dq'/>
+ <feature name='avx512f'/>
+ <feature name='avx512ifma'/>
+ <feature name='avx512vbmi'/>
+ <feature name='avx512vbmi2'/>
+ <feature name='avx512vl'/>
+ <feature name='avx512vnni'/>
+ <feature name='bus-lock-detect'/>
+ <feature name='cldemote'/>
+ <feature name='erms'/>
+ <feature name='fbsdp-no'/>
+ <feature name='fsrc'/>
+ <feature name='fsrm'/>
+ <feature name='fsrs'/>
+ <feature name='fzrm'/>
+ <feature name='gfni'/>
+ <feature name='hle'/>
+ <feature name='ibrs-all'/>
+ <feature name='invpcid'/>
+ <feature name='la57'/>
+ <feature name='mcdt-no'/>
+ <feature name='movdir64b'/>
+ <feature name='movdiri'/>
+ <feature name='pbrsb-no'/>
+ <feature name='pcid'/>
+ <feature name='pku'/>
+ <feature name='prefetchiti'/>
+ <feature name='psdp-no'/>
+ <feature name='rtm'/>
+ <feature name='sbdr-ssdp-no'/>
+ <feature name='serialize'/>
+ <feature name='spec-ctrl'/>
+ <feature name='ss'/>
+ <feature name='taa-no'/>
+ <feature name='tsx-ldtrk'/>
+ <feature name='vaes'/>
+ <feature name='vpclmulqdq'/>
+ <feature name='xfd'/>
+ <feature name='xsaves'/>
+ </blockers>
<model usable='no' vendor='Intel' canonical='Haswell-v1'>Haswell</model>
<blockers model='Haswell'>
<feature name='erms'/>
--
2.49.0

View File

@ -0,0 +1,51 @@
From 9a44ff8f39bc9873ea9efa42d5705dab5f43be2a Mon Sep 17 00:00:00 2001
Message-ID: <9a44ff8f39bc9873ea9efa42d5705dab5f43be2a.1747908717.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 18 Dec 2024 13:30:16 +0100
Subject: [PATCH] cpu_map: Add avx10* CPU features
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 30f05acf354437a776b528487bb70ddccf324cd2)
https://issues.redhat.com/browse/RHEL-87796
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/cpu_map/x86_features.xml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
index 08bf014604..8be8fab42e 100644
--- a/src/cpu_map/x86_features.xml
+++ b/src/cpu_map/x86_features.xml
@@ -469,6 +469,9 @@
<feature name='prefetchiti'>
<cpuid eax_in='0x00000007' ecx_in='0x00000001' edx='0x00004000'/>
</feature>
+ <feature name='avx10'>
+ <cpuid eax_in='0x00000007' ecx_in='0x00000001' edx='0x00080000'/>
+ </feature>
<!-- cpuid level 0x00000007, 0x0002 (edx) -->
<feature name='mcdt-no'>
@@ -541,6 +544,17 @@
<cpuid eax_in='0x00000014' ecx_in='0x00000000' ecx='0x80000000'/>
</feature>
+ <!-- cpuid level 0x00000024, 0x0000 (ebx) -->
+ <feature name='avx10-128'>
+ <cpuid eax_in='0x00000024' ecx_in='0x00000000' ebx='0x00010000'/>
+ </feature>
+ <feature name='avx10-256'>
+ <cpuid eax_in='0x00000024' ecx_in='0x00000000' ebx='0x00020000'/>
+ </feature>
+ <feature name='avx10-512'>
+ <cpuid eax_in='0x00000024' ecx_in='0x00000000' ebx='0x00040000'/>
+ </feature>
+
<!-- cpuid level 0x80000001 (ecx) -->
<feature name='lahf_lm'>
<alias name='lahf-lm' source='qemu'/>
--
2.49.0

View File

@ -0,0 +1,46 @@
From a28c3abf6f5c7c1d8d45b3fc681f6768e2a3d7a9 Mon Sep 17 00:00:00 2001
Message-ID: <a28c3abf6f5c7c1d8d45b3fc681f6768e2a3d7a9.1747908718.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 18 Dec 2024 13:27:40 +0100
Subject: [PATCH] cpu_map: Add sha512, sm3, and sm4 CPU features
Introduced by Clearwater Forest platform.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 212b7d8e280cabddef1f0996bd9553c6a55babd8)
https://issues.redhat.com/browse/RHEL-71898
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 153ee694e806ebf1ba684c1b7ddfa7a90c9d3adf)
https://issues.redhat.com/browse/RHEL-87796
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/cpu_map/x86_features.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
index 8be8fab42e..0e1fee6e98 100644
--- a/src/cpu_map/x86_features.xml
+++ b/src/cpu_map/x86_features.xml
@@ -416,6 +416,15 @@
</feature>
<!-- cpuid level 0x00000007, 0x0001 (eax) -->
+ <feature name='sha512'>
+ <cpuid eax_in='0x00000007' ecx_in='0x00000001' eax='0x00000001'/>
+ </feature>
+ <feature name='sm3'>
+ <cpuid eax_in='0x00000007' ecx_in='0x00000001' eax='0x00000002'/>
+ </feature>
+ <feature name='sm4'>
+ <cpuid eax_in='0x00000007' ecx_in='0x00000001' eax='0x00000004'/>
+ </feature>
<feature name='avx-vnni'>
<cpuid eax_in='0x00000007' ecx_in='0x00000001' eax='0x00000010'/>
</feature>
--
2.49.0

View File

@ -0,0 +1,61 @@
From 229d362a429fdcf64f91cf2422ab6a402d0af3fa Mon Sep 17 00:00:00 2001
Message-ID: <229d362a429fdcf64f91cf2422ab6a402d0af3fa.1752749355.git.jdenemar@redhat.com>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Wed, 19 Mar 2025 01:55:02 +0100
Subject: [PATCH] docs: formatdomain: document intel-only IOMMU attributes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 6291b0af3dd6a34b5a0f5f56dafa881d9c262f57)
https://issues.redhat.com/browse/RHEL-50560
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
docs/formatdomain.rst | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 961d20a41d..a950ee1cb4 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -8857,14 +8857,15 @@ Example:
``caching_mode``
The ``caching_mode`` attribute with possible values ``on`` and ``off`` can
be used to turn on the VT-d caching mode (useful for assigned devices).
- :since:`Since 3.4.0` (QEMU/KVM only)
+ :since:`Since 3.4.0` (QEMU/KVM and ``intel`` model only)
``eim``
The ``eim`` attribute (with possible values ``on`` and ``off``) can be
used to configure Extended Interrupt Mode. A q35 domain with split I/O
APIC (as described in `Hypervisor features`_), and
both interrupt remapping and EIM turned on for the IOMMU, will be able to
- use more than 255 vCPUs. :since:`Since 3.4.0` (QEMU/KVM only)
+ use more than 255 vCPUs. :since:`Since 3.4.0` (QEMU/KVM and ``intel`` model
+ only)
``iotlb``
The ``iotlb`` attribute with possible values ``on`` and ``off`` can be
@@ -8874,14 +8875,14 @@ Example:
``aw_bits``
The ``aw_bits`` attribute can be used to set the address width to allow
mapping larger iova addresses in the guest. :since:`Since 6.5.0` (QEMU/KVM
- only)
+ and ``intel`` model only)
``dma_translation``
The ``dma_translation`` attribute with possible values ``on`` and ``off`` can
be used to turn off the dma translation for IOMMU. It is useful when only
interrupt remapping is required but dma translation overhead is unwanted, for
example to efficiently enable more than 255 vCPUs.
- :since:`Since 10.7.0` (QEMU/KVM only)
+ :since:`Since 10.7.0` (QEMU/KVM and ``intel`` model only)
The ``virtio`` IOMMU devices can further have ``address`` element as described
in `Device addresses`_ (address has to by type of ``pci``).
--
2.50.1

View File

@ -0,0 +1,49 @@
From e9899b64816f8086038098b44690df076d93d8d8 Mon Sep 17 00:00:00 2001
Message-ID: <e9899b64816f8086038098b44690df076d93d8d8.1744876588.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 8 Apr 2025 16:25:37 +0200
Subject: [PATCH] esx: Accept empty "path" URI component same way as "/"
When connecting to "esx://" URI there's code which prints a warning that
the path is not "empty". The check validates that "uri->path" is "/".
In case when the user uses URI such as:
esx://hostname
the warning is printed as well. Since there is no effective difference
betweeen the two allow empty strings as well.
Resolves: https://issues.redhat.com/browse/RHEL-86459
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 59f40ba67cc7d0a3f8eeb601c2f3c84def24a361)
---
src/esx/esx_driver.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 6ae4ef9658..512ca6c028 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -687,7 +687,9 @@ esxConnectToVCenter(esxPrivate *priv,
g_autofree char *url = NULL;
if (!hostSystemIPAddress &&
- (!priv->parsedUri->path || STREQ(priv->parsedUri->path, "/"))) {
+ (!priv->parsedUri->path ||
+ STREQ(priv->parsedUri->path, "") ||
+ STREQ(priv->parsedUri->path, "/"))) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Path has to specify the datacenter and compute resource"));
return -1;
@@ -799,6 +801,7 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
if (STRCASENEQ(conn->uri->scheme, "vpx") &&
+ STRNEQ(conn->uri->path, "") &&
STRNEQ(conn->uri->path, "/")) {
VIR_WARN("Ignoring unexpected path '%s' for non-vpx scheme '%s'",
conn->uri->path, conn->uri->scheme);
--
2.49.0

View File

@ -0,0 +1,119 @@
From b554cae09e7870484240b023865bd13fe56878d1 Mon Sep 17 00:00:00 2001
Message-ID: <b554cae09e7870484240b023865bd13fe56878d1.1752749355.git.jdenemar@redhat.com>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Mon, 9 Jun 2025 15:40:12 +0200
Subject: [PATCH] esx: Allow specifying different CA bundle for remote
connections
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add new URI parameter which allows for using non-system CA certificates
to verify remote peers.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 6c9a0beeca1c6a54eda5d15ba27925c734d51279)
Resolves: https://issues.redhat.com/browse/RHEL-97440
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
docs/drvesx.rst | 16 ++++++++++++++--
src/esx/esx_util.c | 4 ++++
src/esx/esx_util.h | 1 +
src/esx/esx_vi.c | 3 +++
4 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/docs/drvesx.rst b/docs/drvesx.rst
index 13c2bc37e5..84416562ba 100644
--- a/docs/drvesx.rst
+++ b/docs/drvesx.rst
@@ -91,7 +91,7 @@ Multiple parameters are separated by ``&``.
::
- ?no_verify=1&auto_answer=1&proxy=socks://example-proxy.com:23456
+ ?no_verify=1&auto_answer=1&proxy=socks://example-proxy.com:23456&cacert=certs/ca-bundle.pem
The driver understands the extra parameters shown below.
@@ -146,6 +146,16 @@ The driver understands the extra parameters shown below.
| | | ``port`` allows to override |
| | | the default port 1080. |
+-----------------+-----------------------------+-----------------------------+
+| ``cacert`` | Path to a file with one | The specified file will be |
+| | or more certificates | used for verifying the |
+| | | remote host certificate |
+| | | instead of the default |
+| | | system one. |
+| | | :since:`Since 11.5.0`. |
+| | | Does nothing if |
+| | | ``no_verify`` is set |
+| | | to ``1``. |
++-----------------+-----------------------------+-----------------------------+
Authentication
~~~~~~~~~~~~~~
@@ -181,8 +191,10 @@ error like this one:
error: internal error curl_easy_perform() returned an error: Peer certificate cannot be authenticated with known CA certificates (60)
-Where are two ways to solve this problem:
+Where are three ways to solve this problem:
+- Use the ``cacert`` `Extra parameters`_ to point to a certificate bundle
+ with the CA that signed the SSL certificate used on the ESX server.
- Use the ``no_verify=1`` `Extra parameters`_ to disable server
certificate verification.
- Generate new SSL certificates signed by a CA known to your client computer
diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c
index cb9638f360..7ee0e5f7c0 100644
--- a/src/esx/esx_util.c
+++ b/src/esx/esx_util.c
@@ -135,6 +135,9 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURI *uri)
goto cleanup;
}
}
+ } else if (STRCASEEQ(queryParam->name, "cacert")) {
+ g_clear_pointer(&(*parsedUri)->cacert, g_free);
+ (*parsedUri)->cacert = g_strdup(queryParam->value);
} else {
VIR_WARN("Ignoring unexpected query parameter '%s'",
queryParam->name);
@@ -168,6 +171,7 @@ esxUtil_FreeParsedUri(esxUtil_ParsedUri **parsedUri)
g_free((*parsedUri)->vCenter);
g_free((*parsedUri)->proxy_hostname);
g_free((*parsedUri)->path);
+ g_free((*parsedUri)->cacert);
g_free(*parsedUri);
}
diff --git a/src/esx/esx_util.h b/src/esx/esx_util.h
index 088c943e64..58bc44e744 100644
--- a/src/esx/esx_util.h
+++ b/src/esx/esx_util.h
@@ -44,6 +44,7 @@ struct _esxUtil_ParsedUri {
char *proxy_hostname;
int proxy_port;
char *path;
+ char *cacert;
};
int esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURI *uri);
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 3ecd406e1d..d49daa5bc6 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -343,6 +343,9 @@ esxVI_CURL_Connect(esxVI_CURL *curl, esxUtil_ParsedUri *parsedUri)
parsedUri->proxy_port);
}
+ if (parsedUri->cacert)
+ curl_easy_setopt(curl->handle, CURLOPT_CAINFO, parsedUri->cacert);
+
if (virMutexInit(&curl->lock) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not initialize CURL mutex"));
--
2.50.1

View File

@ -0,0 +1,63 @@
From 7caecd5f75f22d6bab74efcb3bc151f8bf441ec9 Mon Sep 17 00:00:00 2001
Message-ID: <7caecd5f75f22d6bab74efcb3bc151f8bf441ec9.1744876587.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 25 Mar 2025 07:23:01 +0100
Subject: [PATCH] esxConnectListAllDomains: Don't propagate failure to lookup a
single domain
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In esxConnectListAllDomains if the lookup of the VM name and UUID fails
for a single VM (possible e.g. with broken storage) the whole API would
return failure even when there are working VMs.
Rework the lookup so that if a subset fails we ignore the failure on
those. We report an error only if lookup of all of the objects failed.
Failure is reported from the last one.
Resolves: https://issues.redhat.com/browse/RHEL-80606
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 7d4de62cfa8c684b2d63a48c71f0ae009acddf62)
---
src/esx/esx_driver.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 554fb3e18f..6ae4ef9658 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -4792,18 +4792,20 @@ esxConnectListAllDomains(virConnectPtr conn,
virtualMachine = virtualMachine->_next) {
g_autofree char *name = NULL;
- if (needIdentity) {
- if (esxVI_GetVirtualMachineIdentity(virtualMachine, &id,
- &name, uuid) < 0) {
- goto cleanup;
- }
- }
+ /* If the lookup of the required properties fails for some of the machines
+ * in the list it's preferrable to return the valid objects instead of
+ * failing outright */
+ if ((needIdentity && esxVI_GetVirtualMachineIdentity(virtualMachine, &id, &name, uuid) < 0) ||
+ (needPowerState && esxVI_GetVirtualMachinePowerState(virtualMachine, &powerState) < 0)) {
- if (needPowerState) {
- if (esxVI_GetVirtualMachinePowerState(virtualMachine,
- &powerState) < 0) {
+ /* Raise error only if we didn't successfuly fill any domain */
+ if (count == 0 && !virtualMachine->_next)
goto cleanup;
- }
+
+ /* failure to fetch information of a single VM must not interrupt
+ * the lookup of the rest */
+ virResetLastError();
+ continue;
}
/* filter by active state */
--
2.49.0

View File

@ -0,0 +1,58 @@
From 0b2b30820c623e11aced21adb1692ed23430c064 Mon Sep 17 00:00:00 2001
Message-ID: <0b2b30820c623e11aced21adb1692ed23430c064.1749039441.git.jdenemar@redhat.com>
From: Collin Walling <walling@linux.ibm.com>
Date: Mon, 16 Dec 2024 18:03:55 -0500
Subject: [PATCH] libvirt-domain: introduce
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES
Introduce domain flag used to filter deprecated features from the
domain's CPU model.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 4e2c8de2047e21d98443944a2bfe94529b269efa)
JIRA: https://issues.redhat.com/browse/RHEL-89415
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/libvirt/libvirt-domain.h | 12 ++++++++++++
src/libvirt-domain.c | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index c04b696f03..df13b72f7b 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1491,6 +1491,18 @@ int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
int virDomainMigrateStartPostCopy(virDomainPtr domain,
unsigned int flags);
+/**
+ * virConnectGetDomainCapabilitiesFlags:
+ *
+ * Domain capabilities flags.
+ *
+ * Since: 11.0.0
+ */
+typedef enum {
+ /* Report host model with deprecated features disabled. (Since: 11.0.0) */
+ VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES = (1 << 0),
+} virConnectGetDomainCapabilitiesFlags;
+
char * virConnectGetDomainCapabilities(virConnectPtr conn,
const char *emulatorbin,
const char *arch,
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 24752a9888..efc26a41d9 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -12166,7 +12166,7 @@ virDomainSetUserPassword(virDomainPtr dom,
* @arch: domain architecture
* @machine: machine type
* @virttype: virtualization type
- * @flags: extra flags; not used yet, so callers should always pass 0
+ * @flags: extra flags; bitwise-OR of virConnectGetDomainCapabilitiesFlags
*
* Prior creating a domain (for instance via virDomainCreateXML
* or virDomainDefineXML) it may be suitable to know what the
--
2.49.0

View File

@ -0,0 +1,51 @@
From a96d1c90832b639c81f6cd893a79610d4379594d Mon Sep 17 00:00:00 2001
Message-ID: <a96d1c90832b639c81f6cd893a79610d4379594d.1744876587.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 7 Apr 2025 13:35:37 +0200
Subject: [PATCH] libvirt-host: Clarify/fix description of the CPU frequency
field
The 'virNodeInfo' field for CPU frequency is named 'mhz'. The docs were
mentioning 'mHZ', which is neither the field name nor proper spelling of
the unit.
Reword the paragraph to mention "CPU frequency" instead and explicitly
name the field in virNodeInfo struct.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit e54cc1500ccfb36cd5b67eb4d886c491fdda5b2b)
https://issues.redhat.com/browse/RHEL-86197
---
src/libvirt-host.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index b3a6421a7f..318a664d24 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -410,9 +410,9 @@ virConnectGetMaxVcpus(virConnectPtr conn,
* Use of this API is strongly discouraged as the information provided
* is not guaranteed to be accurate on all hardware platforms.
*
- * The mHZ value merely reflects the speed that the first CPU in the
- * machine is currently running at. This speed may vary across CPUs
- * and changes continually as the host OS throttles.
+ * The CPU frequency value (field 'mhz' in virNodeInfo) merely reflects the
+ * speed that the first CPU in the machine is currently running at. This speed
+ * may vary across CPUs and changes continually as the host OS throttles.
*
* The nodes/sockets/cores/threads data is potentially inaccurate as
* it assumes a symmetric installation. If one NUMA node has more
@@ -420,7 +420,7 @@ virConnectGetMaxVcpus(virConnectPtr conn,
* wrong. It is also not able to report about CPU dies.
*
* Applications are recommended to use the virConnectGetCapabilities()
- * call instead, which provides all the information except CPU mHZ,
+ * call instead, which provides all the information except CPU frequency,
* in a more accurate representation.
*
* Returns 0 in case of success and -1 in case of failure.
--
2.49.0

View File

@ -0,0 +1,85 @@
From fb8c22b5606b2c3d0881df8df05ad1c909b247b2 Mon Sep 17 00:00:00 2001
Message-ID: <fb8c22b5606b2c3d0881df8df05ad1c909b247b2.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 26 Feb 2025 19:10:42 +0000
Subject: [PATCH] libxl: support 'rawset' ACPI table type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This fixes representation of the 'acpi_firmware' config in the Xen
driver, which repesents a concatenation of tables of any type.
Use of 'type=slic' is accepted on input for backwards compatibility.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit dac6ecba6f75bff11fbddb2bce8ca9b576ea6a74)
Resolves: https://issues.redhat.com/browse/RHEL-81041
---
docs/formatdomain.rst | 2 +-
src/libxl/libxl_domain.c | 5 +++--
src/libxl/xen_xl.c | 2 +-
tests/xlconfigdata/test-fullvirt-acpi-slic.xml | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index ff06efb69f..b03b5317aa 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -492,7 +492,7 @@ These options apply to any form of booting of the guest OS.
signature auto-detected from header (:since:`Since 11.2.0 (QEMU)`).
* ``rawset``: concatenation of multiple ACPI tables with header
and data, each with any ACPI signature, auto-detected from header
- (:since:`Since 11.2.0`).
+ (:since:`Since 11.2.0 (Xen)`).
* ``slic``: a single ACPI table with header and data, providing
software licensing information. The ACPI table signature in the
header will be forced to ``SLIC`` (:since:`Since 1.3.5 (QEMU)`,
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index e564d9e5fe..e31d92d903 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -333,11 +333,12 @@ libxlDomainDefValidate(const virDomainDef *def,
for (i = 0; i < def->os.nacpiTables; i++) {
switch (def->os.acpiTables[i]->type) {
- case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC: /* Back compat for historical mistake,
+ * functionally the same as 'rawset' */
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
break;
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
- case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("ACPI table type '%1$s' is not supported"),
virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
index 062b753cea..9d06315661 100644
--- a/src/libxl/xen_xl.c
+++ b/src/libxl/xen_xl.c
@@ -140,7 +140,7 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
def->os.nacpiTables = 1;
def->os.acpiTables = g_new0(virDomainOSACPITableDef *, 1);
def->os.acpiTables[0] = g_new0(virDomainOSACPITableDef, 1);
- def->os.acpiTables[0]->type = VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC;
+ def->os.acpiTables[0]->type = VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET;
def->os.acpiTables[0]->path = g_steal_pointer(&slic);
}
diff --git a/tests/xlconfigdata/test-fullvirt-acpi-slic.xml b/tests/xlconfigdata/test-fullvirt-acpi-slic.xml
index 366d877624..bf617e5e05 100644
--- a/tests/xlconfigdata/test-fullvirt-acpi-slic.xml
+++ b/tests/xlconfigdata/test-fullvirt-acpi-slic.xml
@@ -8,7 +8,7 @@
<type arch='x86_64' machine='xenfv'>hvm</type>
<loader type='rom' format='raw'>/usr/lib/xen/boot/hvmloader</loader>
<acpi>
- <table type='slic'>/sys/firmware/acpi/tables/SLIC</table>
+ <table type='rawset'>/sys/firmware/acpi/tables/SLIC</table>
</acpi>
<boot dev='cdrom'/>
</os>
--
2.49.0

View File

@ -0,0 +1,55 @@
From 90859b9c9cda1ab3daa34847ac4608cf451102ce Mon Sep 17 00:00:00 2001
Message-ID: <90859b9c9cda1ab3daa34847ac4608cf451102ce.1744876588.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 7 Apr 2025 14:58:41 +0200
Subject: [PATCH] manpages: virsh: Use disclaimer from 'virNodeGetInfo()' for
'virsh nodeinfo'
Adapt the disclarimer about the data not being accurate in many cases
from the API docs to the virsh command using the aforementioned API.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 617e2dc3194204a88309e3da55bec8743a5df2ea)
https://issues.redhat.com/browse/RHEL-86197
---
docs/manpages/virsh.rst | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 2e525d3fac..aea920b7a7 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -427,10 +427,25 @@ nodeinfo
nodeinfo
Returns basic information about the node, like number and type of CPU,
-and size of the physical memory. The output corresponds to virNodeInfo
-structure. Specifically, the "CPU socket(s)" field means number of CPU
-sockets per NUMA cell. The information libvirt displays is dependent
-upon what each architecture may provide.
+and size of the physical memory.
+
+Use of this command is strongly discouraged as the information provided
+is not guaranteed to be accurate on all hardware platforms.
+
+The *CPU frequency* value merely reflects the speed that the first CPU in the
+machine is currently running at. This speed may vary across CPUs and changes
+continually as the host OS throttles.
+
+The data structure used to fetch the data is not extensible thus only supports
+global nodes/sockets/cores/threads (sockets/cores/threads is per NUMA node)
+topology information. If the host CPU has any further groupings (e.g.
+dies, clusters, etc) or the NUMA topology is non-symmetrical the data structure
+can't faithfully represent the system. In such cases a fake topology
+(nodes = 1, sockets = 1, cores = number of host cpus, threads = 1) which
+only correctly represents the total host CPU count is reported.
+
+Recommended replacement is to use the *capabilities* command which reports
+the data (except frequency) under ``/capabilities/host/topology`` XPath.
nodecpumap
--
2.49.0

View File

@ -0,0 +1,44 @@
From 2ea12b6f6eed044dd7100ed19565319227f7384f Mon Sep 17 00:00:00 2001
Message-ID: <2ea12b6f6eed044dd7100ed19565319227f7384f.1742990721.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Thu, 13 Mar 2025 13:01:19 +0100
Subject: [PATCH] network: Free inhibitor in networkStateCleanup()
The shutdown inhibitor is created in networkStateInitialize() but
corresponding call to virInhibitorFree() is missing in
networkStateCleanup() leading to a memleak:
116 (72 direct, 44 indirect) bytes in 1 blocks are definitely lost in loss record 1,769 of 1,998
at 0x484CEF3: calloc (vg_replace_malloc.c:1675)
by 0x4F0E7A9: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.8000.5)
by 0x4993B9B: virInhibitorNew (virinhibitor.c:152)
by 0x5279394: networkStateInitialize (bridge_driver.c:654)
by 0x4CC74DC: virStateInitialize (libvirt.c:665)
by 0x15B719: daemonRunStateInit (remote_daemon.c:613)
by 0x49F2B44: virThreadHelper (virthread.c:256)
by 0x5356662: start_thread (in /usr/lib64/libc.so.6)
by 0x53D7DA3: clone (in /usr/lib64/libc.so.6)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 8701ba4feb528109da8b72fa48a8ada50a235807)
Resolves: https://issues.redhat.com/browse/RHEL-83064
---
src/network/bridge_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index ce793c12ef..adcff6f34f 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -802,6 +802,8 @@ networkStateCleanup(void)
network_driver->lockFD);
}
+ virInhibitorFree(network_driver->inhibitor);
+
virObjectUnref(network_driver->config);
virObjectUnref(network_driver->dnsmasqCaps);
--
2.49.0

View File

@ -0,0 +1,72 @@
From aeff1ebf96b595337f14ef6d1412d6c407bdc085 Mon Sep 17 00:00:00 2001
Message-ID: <aeff1ebf96b595337f14ef6d1412d6c407bdc085.1747908717.git.jdenemar@redhat.com>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 25 Feb 2025 15:36:32 +0100
Subject: [PATCH] qemu: Add support for VIR_DOMAIN_GUEST_INFO_LOAD
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit b4cf9c8cba45e65551aa9440dea2c3757a96aa0c)
https://issues.redhat.com/browse/RHEL-88447
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
src/qemu/qemu_driver.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8a354a606a..11dbbc1aab 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19276,7 +19276,8 @@ static const unsigned int qemuDomainGetGuestInfoSupportedTypes =
VIR_DOMAIN_GUEST_INFO_HOSTNAME |
VIR_DOMAIN_GUEST_INFO_FILESYSTEM |
VIR_DOMAIN_GUEST_INFO_DISKS |
- VIR_DOMAIN_GUEST_INFO_INTERFACES;
+ VIR_DOMAIN_GUEST_INFO_INTERFACES |
+ VIR_DOMAIN_GUEST_INFO_LOAD;
static int
qemuDomainGetGuestInfoCheckSupport(unsigned int types,
@@ -19563,6 +19564,10 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
qemuAgentDiskInfo **agentdiskinfo = NULL;
virDomainInterfacePtr *ifaces = NULL;
size_t nifaces = 0;
+ double load1m = 0;
+ double load5m = 0;
+ double load15m = 0;
+ bool format_load = false;
size_t i;
virCheckFlags(0, -1);
@@ -19633,6 +19638,14 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
nifaces = rc;
}
+ if (supportedTypes & VIR_DOMAIN_GUEST_INFO_LOAD) {
+ rc = qemuAgentGetLoadAvg(agent, &load1m, &load5m, &load15m, report_unsupported);
+ if (rc == -1)
+ goto exitagent;
+ if (rc >= 0)
+ format_load = true;
+ }
+
qemuDomainObjExitAgent(vm, agent);
virDomainObjEndAgentJob(vm);
@@ -19659,6 +19672,12 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
virDomainInterfaceFormatParams(ifaces, nifaces, params, nparams, &maxparams);
}
+ if (format_load) {
+ virTypedParamsAddDouble(params, nparams, &maxparams, "load.1m", load1m);
+ virTypedParamsAddDouble(params, nparams, &maxparams, "load.5m", load5m);
+ virTypedParamsAddDouble(params, nparams, &maxparams, "load.15m", load15m);
+ }
+
ret = 0;
cleanup:
--
2.49.0

View File

@ -0,0 +1,36 @@
From 5c4270439f99bd52f91613a6ee833aa4bcb131c4 Mon Sep 17 00:00:00 2001
Message-ID: <5c4270439f99bd52f91613a6ee833aa4bcb131c4.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 15 Jan 2025 13:00:36 +0100
Subject: [PATCH] qemu: Allow virtio-mem on CCW
After previous commits, we can allow virtio-mem to live on CCW
channel.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit ee0320a7fccc8088bc2830fe949ae2339db208cb)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b6c36d85d7..4234e4605b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7673,9 +7673,10 @@ qemuDomainDefValidateMemoryHotplugDevice(const virDomainMemoryDef *mem,
case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM:
if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
+ mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("only 'pci' addresses are supported for the %1$s device"),
+ _("only 'pci' and 'ccw' addresses are supported for the %1$s device"),
virDomainMemoryModelTypeToString(mem->model));
return -1;
}
--
2.49.0

View File

@ -0,0 +1,38 @@
From d874530eaded03d0b90139c9bbd80902b9464e87 Mon Sep 17 00:00:00 2001
Message-ID: <d874530eaded03d0b90139c9bbd80902b9464e87.1741876175.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Tue, 18 Feb 2025 11:24:32 +0100
Subject: [PATCH] qemu: Avoid crash in qemuDomainCheckCPU with unknown host CPU
When we don't have any information about host CPU (for example when
running on an aarch64 host), the virQEMUCapsGetHostModel would return
NULL.
Fixes: f928eb5fc80ca0ed7277f2513b63aed36c09d275
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/747
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Tested-by: Jaroslav Suchanek <jsuchane@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 43eae1b7077104d4e2ed52447407a335c2d093e3)
https://issues.redhat.com/browse/RHEL-81747
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/qemu/qemu_domain.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 92035dd281..1ccaff90d9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11446,6 +11446,7 @@ qemuDomainCheckCPU(virArch arch,
/* Force compat check if the CPU model is not found in qemuCaps or
* we don't have host CPU data from QEMU */
if (!cpu->model ||
+ !hypervisorCPU ||
hypervisorCPU->fallback != VIR_CPU_FALLBACK_FORBID ||
virQEMUCapsGetCPUBlockers(qemuCaps, virtType,
cpu->model, &blockers) < 0)
--
2.48.1

View File

@ -0,0 +1,50 @@
From b2e5469f35657b7d46842b39be04ecc34e5ff659 Mon Sep 17 00:00:00 2001
Message-ID: <b2e5469f35657b7d46842b39be04ecc34e5ff659.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 20 Jan 2025 17:10:24 +0100
Subject: [PATCH] qemu: Do NOT autoadd NUMA node for s390
In some cases, we might automatically add a NUMA node. But this
doesn't work for s390 really, because in its commit
v2.12.0-rc0~41^2~6 QEMU forbade specifying NUMA nodes for s390.
Suppress automatic adding of NUMA node on our side.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit a8ed747b9a8c5cbd07557edc66962bc26205d7fb)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_domain.c | 3 ++-
src/qemu/qemu_postparse.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 89e1b50366..b6c36d85d7 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7761,7 +7761,8 @@ qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
return 0;
}
- if (!ARCH_IS_PPC64(def->os.arch)) {
+ if (!ARCH_IS_PPC64(def->os.arch) &&
+ !ARCH_IS_S390(def->os.arch)) {
/* due to guest support, qemu would silently enable NUMA with one node
* once the memory hotplug backend is enabled. To avoid possible
* confusion we will enforce user originated numa configuration along
diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c
index 892330646a..141847b0ef 100644
--- a/src/qemu/qemu_postparse.c
+++ b/src/qemu/qemu_postparse.c
@@ -1806,6 +1806,7 @@ qemuDomainDefNumaAutoAdd(virDomainDef *def,
if (!abiUpdate ||
!virDomainDefHasMemoryHotplug(def) ||
+ qemuDomainIsS390CCW(def) ||
virDomainNumaGetNodeCount(def->numa) > 0) {
return 0;
}
--
2.49.0

View File

@ -0,0 +1,135 @@
From b6e803fc90bb9d49345adca4f38856ce97fde9f8 Mon Sep 17 00:00:00 2001
Message-ID: <b6e803fc90bb9d49345adca4f38856ce97fde9f8.1744876588.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 9 Apr 2025 15:35:20 +0200
Subject: [PATCH] qemu: Properly propagate migration state to TPM cleanup code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When migrating a domain with TPM state on a shared disk, we need to skip
TPM cleanup on both ends. So far the code only handled successful
migration and skipped the cleanup on the source host. But if the
migration failed for some reason, the cleanup would be incorrectly
called on the destination host removing the TPM files even though the
domain was still running on the source host.
https://issues.redhat.com/browse/RHEL-82411
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 97ed7f22b089c5fdd9ee02cffc6854f6e021ab2b)
https://issues.redhat.com/browse/RHEL-86800
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/qemu/qemu_driver.c | 7 +++++--
src/qemu/qemu_migration.c | 6 +++---
src/qemu/qemu_process.c | 8 ++------
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f8f3d2c725..4c6eff9286 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3853,6 +3853,7 @@ processMonitorEOFEvent(virQEMUDriver *driver,
const char *auditReason = "shutdown";
unsigned int stopFlags = 0;
virObjectEvent *event = NULL;
+ bool migration;
if (vm->def->id != domid) {
VIR_DEBUG("Domain %s was restarted, ignoring EOF",
@@ -3863,6 +3864,8 @@ processMonitorEOFEvent(virQEMUDriver *driver,
if (qemuProcessBeginStopJob(vm, VIR_JOB_DESTROY, true) < 0)
return;
+ migration = vm->job->asyncJob == VIR_ASYNC_JOB_MIGRATION_IN;
+
if (!virDomainObjIsActive(vm)) {
VIR_DEBUG("Domain %p '%s' is not active, ignoring EOF",
vm, vm->def->name);
@@ -3877,7 +3880,7 @@ processMonitorEOFEvent(virQEMUDriver *driver,
auditReason = "failed";
}
- if (vm->job->asyncJob == VIR_ASYNC_JOB_MIGRATION_IN) {
+ if (migration) {
stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED;
qemuMigrationDstErrorSave(driver, vm->def->name,
qemuMonitorLastError(priv->mon));
@@ -3890,7 +3893,7 @@ processMonitorEOFEvent(virQEMUDriver *driver,
virObjectEventStateQueue(driver->domainEventState, event);
endjob:
- qemuDomainRemoveInactive(driver, vm, 0, false);
+ qemuDomainRemoveInactive(driver, vm, 0, migration);
qemuProcessEndStopJob(vm);
}
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 62da892254..5cb7642315 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3592,7 +3592,7 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver,
* and there is no 'goto cleanup;' in the middle of those */
VIR_FREE(priv->origname);
virDomainObjRemoveTransientDef(vm);
- qemuDomainRemoveInactive(driver, vm, 0, false);
+ qemuDomainRemoveInactive(driver, vm, 0, true);
}
virDomainObjEndAPI(&vm);
virErrorRestore(&origErr);
@@ -6963,7 +6963,7 @@ qemuMigrationDstFinishActive(virQEMUDriver *driver,
}
if (!qemuDomainObjIsActive(vm))
- qemuDomainRemoveInactive(driver, vm, VIR_DOMAIN_UNDEFINE_TPM, false);
+ qemuDomainRemoveInactive(driver, vm, VIR_DOMAIN_UNDEFINE_TPM, true);
virErrorRestore(&orig_err);
return NULL;
@@ -7099,7 +7099,7 @@ qemuMigrationProcessUnattended(virQEMUDriver *driver,
qemuMigrationJobFinish(vm);
if (!virDomainObjIsActive(vm))
- qemuDomainRemoveInactive(driver, vm, 0, false);
+ qemuDomainRemoveInactive(driver, vm, 0, true);
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index fac5678439..ad7e99750f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8731,7 +8731,6 @@ void qemuProcessStop(virQEMUDriver *driver,
size_t i;
g_autofree char *timestamp = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
- bool outgoingMigration;
VIR_DEBUG("Shutting down vm=%p name=%s id=%d pid=%lld, "
"reason=%s, asyncJob=%s, flags=0x%x",
@@ -8807,10 +8806,7 @@ void qemuProcessStop(virQEMUDriver *driver,
qemuDomainCleanupRun(driver, vm);
- outgoingMigration = (flags & VIR_QEMU_PROCESS_STOP_MIGRATED) &&
- (asyncJob == VIR_ASYNC_JOB_MIGRATION_OUT);
-
- qemuExtDevicesStop(driver, vm, outgoingMigration);
+ qemuExtDevicesStop(driver, vm, !!(flags & VIR_QEMU_PROCESS_STOP_MIGRATED));
qemuDBusStop(driver, vm);
@@ -9070,7 +9066,7 @@ qemuProcessAutoDestroy(virDomainObj *dom,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
- qemuDomainRemoveInactive(driver, dom, 0, false);
+ qemuDomainRemoveInactive(driver, dom, 0, !!(stopFlags & VIR_QEMU_PROCESS_STOP_MIGRATED));
qemuProcessEndStopJob(dom);
--
2.49.0

View File

@ -0,0 +1,230 @@
From c28859cbaeac298adbe957956cf8442c9a6b7264 Mon Sep 17 00:00:00 2001
Message-ID: <c28859cbaeac298adbe957956cf8442c9a6b7264.1744876588.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Tue, 11 Mar 2025 10:05:28 +0100
Subject: [PATCH] qemu: Rename outgoingMigration parameter in various TPM
functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The parameter is used to skip TPM state cleanup on outgoing migration
with shared storage. But we also need to skip the cleanup after a failed
incoming migration. Let's call the parameter "migration" to reflect its
usage on both sides of migration.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit a5e4ca6f02dc8250f84163a0d19b69300affde43)
https://issues.redhat.com/browse/RHEL-86800
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/qemu/qemu_domain.c | 8 ++++----
src/qemu/qemu_domain.h | 2 +-
src/qemu/qemu_extdevice.c | 8 ++++----
src/qemu/qemu_extdevice.h | 4 ++--
src/qemu/qemu_tpm.c | 19 +++++++++----------
src/qemu/qemu_tpm.h | 4 ++--
6 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1ccaff90d9..89e1b50366 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5749,7 +5749,7 @@ static void
qemuDomainRemoveInactiveCommon(virQEMUDriver *driver,
virDomainObj *vm,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration)
+ bool migration)
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autofree char *snapDir = NULL;
@@ -5775,7 +5775,7 @@ qemuDomainRemoveInactiveCommon(virQEMUDriver *driver,
if (rmdir(chkDir) < 0 && errno != ENOENT)
VIR_WARN("unable to remove checkpoint directory %s", chkDir);
}
- qemuExtDevicesCleanupHost(driver, vm->def, flags, outgoingMigration);
+ qemuExtDevicesCleanupHost(driver, vm->def, flags, migration);
}
@@ -5788,14 +5788,14 @@ void
qemuDomainRemoveInactive(virQEMUDriver *driver,
virDomainObj *vm,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration)
+ bool migration)
{
if (vm->persistent) {
/* Short-circuit, we don't want to remove a persistent domain */
return;
}
- qemuDomainRemoveInactiveCommon(driver, vm, flags, outgoingMigration);
+ qemuDomainRemoveInactiveCommon(driver, vm, flags, migration);
virDomainObjListRemove(driver->domains, vm);
}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index e810f79599..6246988491 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -689,7 +689,7 @@ int qemuDomainMomentDiscardAll(void *payload,
void qemuDomainRemoveInactive(virQEMUDriver *driver,
virDomainObj *vm,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration);
+ bool migration);
void
qemuDomainRemoveInactiveLocked(virQEMUDriver *driver,
diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c
index 2384bab7a6..7451e0fa03 100644
--- a/src/qemu/qemu_extdevice.c
+++ b/src/qemu/qemu_extdevice.c
@@ -154,7 +154,7 @@ void
qemuExtDevicesCleanupHost(virQEMUDriver *driver,
virDomainDef *def,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration)
+ bool migration)
{
size_t i;
@@ -165,7 +165,7 @@ qemuExtDevicesCleanupHost(virQEMUDriver *driver,
virDomainTPMDef *tpm = def->tpms[i];
if (tpm->type == VIR_DOMAIN_TPM_TYPE_EMULATOR)
- qemuExtTPMCleanupHost(driver, tpm, flags, outgoingMigration);
+ qemuExtTPMCleanupHost(driver, tpm, flags, migration);
}
}
@@ -266,7 +266,7 @@ qemuExtDevicesStart(virQEMUDriver *driver,
void
qemuExtDevicesStop(virQEMUDriver *driver,
virDomainObj *vm,
- bool outgoingMigration)
+ bool migration)
{
virDomainDef *def = vm->def;
size_t i;
@@ -283,7 +283,7 @@ qemuExtDevicesStop(virQEMUDriver *driver,
for (i = 0; i < def->ntpms; i++) {
if (def->tpms[i]->type == VIR_DOMAIN_TPM_TYPE_EMULATOR)
- qemuExtTPMStop(driver, vm, outgoingMigration);
+ qemuExtTPMStop(driver, vm, migration);
}
for (i = 0; i < def->nnets; i++) {
diff --git a/src/qemu/qemu_extdevice.h b/src/qemu/qemu_extdevice.h
index d4ac9f395c..36f7fb77a8 100644
--- a/src/qemu/qemu_extdevice.h
+++ b/src/qemu/qemu_extdevice.h
@@ -48,7 +48,7 @@ int qemuExtDevicesPrepareHost(virQEMUDriver *driver,
void qemuExtDevicesCleanupHost(virQEMUDriver *driver,
virDomainDef *def,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration)
+ bool migration)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuExtDevicesStart(virQEMUDriver *driver,
@@ -59,7 +59,7 @@ int qemuExtDevicesStart(virQEMUDriver *driver,
void qemuExtDevicesStop(virQEMUDriver *driver,
virDomainObj *vm,
- bool outgoingMigration)
+ bool migration)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
bool qemuExtDevicesHasDevice(virDomainDef *def);
diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
index f5e0184e54..f910a26286 100644
--- a/src/qemu/qemu_tpm.c
+++ b/src/qemu/qemu_tpm.c
@@ -907,7 +907,8 @@ qemuTPMEmulatorInitPaths(virDomainTPMDef *tpm,
* @driver: QEMU driver
* @tpm: TPM definition
* @flags: flags indicating whether to keep or remove TPM persistent state
- * @outgoingMigration: whether cleanup is due to an outgoing migration
+ * @migration: whether cleanup is due to a successful outgoing or failed
+ * incoming migration
*
* Clean up persistent storage for the swtpm.
*/
@@ -915,14 +916,12 @@ static void
qemuTPMEmulatorCleanupHost(virQEMUDriver *driver,
virDomainTPMDef *tpm,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration)
+ bool migration)
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
- /* Never remove the state in case of outgoing migration with shared
- * storage.
- */
- if (outgoingMigration &&
+ /* Never remove the state in case of migration with shared storage. */
+ if (migration &&
virFileIsSharedFS(tpm->data.emulator.source_path, cfg->sharedFilesystems) == 1)
return;
@@ -1293,9 +1292,9 @@ void
qemuExtTPMCleanupHost(virQEMUDriver *driver,
virDomainTPMDef *tpm,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration)
+ bool migration)
{
- qemuTPMEmulatorCleanupHost(driver, tpm, flags, outgoingMigration);
+ qemuTPMEmulatorCleanupHost(driver, tpm, flags, migration);
}
@@ -1319,7 +1318,7 @@ qemuExtTPMStart(virQEMUDriver *driver,
void
qemuExtTPMStop(virQEMUDriver *driver,
virDomainObj *vm,
- bool outgoingMigration)
+ bool migration)
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autofree char *shortName = virDomainDefGetShortName(vm->def);
@@ -1329,7 +1328,7 @@ qemuExtTPMStop(virQEMUDriver *driver,
return;
qemuTPMEmulatorStop(cfg->swtpmStateDir, shortName);
- if (outgoingMigration && qemuTPMHasSharedStorage(driver, vm->def))
+ if (migration && qemuTPMHasSharedStorage(driver, vm->def))
restoreTPMStateLabel = false;
if (qemuSecurityRestoreTPMLabels(driver, vm, restoreTPMStateLabel, false) < 0)
diff --git a/src/qemu/qemu_tpm.h b/src/qemu/qemu_tpm.h
index 7096060a2a..37813087cf 100644
--- a/src/qemu/qemu_tpm.h
+++ b/src/qemu/qemu_tpm.h
@@ -38,7 +38,7 @@ int qemuExtTPMPrepareHost(virQEMUDriver *driver,
void qemuExtTPMCleanupHost(virQEMUDriver *driver,
virDomainTPMDef *tpm,
virDomainUndefineFlagsValues flags,
- bool outgoingMigration)
+ bool migration)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuExtTPMStart(virQEMUDriver *driver,
@@ -52,7 +52,7 @@ int qemuExtTPMStart(virQEMUDriver *driver,
void qemuExtTPMStop(virQEMUDriver *driver,
virDomainObj *vm,
- bool outgoingMigration)
+ bool migration)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuExtTPMSetupCgroup(virQEMUDriver *driver,
--
2.49.0

View File

@ -0,0 +1,86 @@
From 6fa979b9735e988971203bca10903ba587a27f79 Mon Sep 17 00:00:00 2001
Message-ID: <6fa979b9735e988971203bca10903ba587a27f79.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 15 Jan 2025 15:48:41 +0100
Subject: [PATCH] qemu: Validate virtio-mem-ccw
There are basically two differences between virtio-mem-ccw and
virtio-mem-pci. s390 doesn't allow mixing different page sizes
and there's no NUMA support in QEMU.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit 541dfe40bc9b3fe90d488ab85df8ea3ea31b8249)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_validate.c | 35 ++++++++++++++++++++++++++++++++---
1 file changed, 32 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 1c61038f93..97f8f58ffd 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -5259,7 +5259,8 @@ qemuValidateDomainDeviceDefHub(virDomainHubDef *hub,
static int
-qemuValidateDomainDeviceDefMemory(virDomainMemoryDef *mem,
+qemuValidateDomainDeviceDefMemory(const virDomainMemoryDef *mem,
+ const virDomainDef *def,
virQEMUCaps *qemuCaps)
{
virSGXCapability *sgxCaps;
@@ -5298,12 +5299,40 @@ qemuValidateDomainDeviceDefMemory(virDomainMemoryDef *mem,
break;
case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM:
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI)) {
+ if ((mem->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI)) ||
+ (mem->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("virtio-mem isn't supported by this QEMU binary"));
return -1;
}
+ if (mem->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
+ /* virtio-mem-ccw has a few differences compared to virtio-mem-pci:
+ *
+ * 1) corresponding memory-backing-* object can't have a different
+ * page size than the boot memory (see s390_machine_device_plug()
+ * in qemu sources).
+ * 2) Since its commit v2.12.0-rc0~41^2~6 QEMU doesn't allow NUMA
+ * for s390.
+ */
+
+ if (mem->source.virtio_mem.pagesize != 0 &&
+ def->mem.nhugepages &&
+ mem->source.virtio_mem.pagesize != def->mem.hugepages[0].size) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("virtio-mem-ccw can't use different page size than the boot memory"));
+ return -1;
+ }
+
+ if (mem->targetNode != 0 && mem->targetNode != -1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("NUMA nodes are not supported for virtio-mem-ccw"));
+ return -1;
+ }
+ }
+
if (mem->target.virtio_mem.dynamicMemslots == VIR_TRISTATE_BOOL_YES &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -5490,7 +5519,7 @@ qemuValidateDomainDeviceDef(const virDomainDeviceDef *dev,
return qemuValidateDomainDeviceDefSound(dev->data.sound, qemuCaps);
case VIR_DOMAIN_DEVICE_MEMORY:
- return qemuValidateDomainDeviceDefMemory(dev->data.memory, qemuCaps);
+ return qemuValidateDomainDeviceDefMemory(dev->data.memory, def, qemuCaps);
case VIR_DOMAIN_DEVICE_SHMEM:
return qemuValidateDomainDeviceDefShmem(dev->data.shmem, qemuCaps);
--
2.49.0

View File

@ -0,0 +1,337 @@
From 62862c4c7302758d304dd876f26712a75df26e08 Mon Sep 17 00:00:00 2001
Message-ID: <62862c4c7302758d304dd876f26712a75df26e08.1752749355.git.jdenemar@redhat.com>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Fri, 14 Mar 2025 17:13:09 +0100
Subject: [PATCH] qemu: add IOMMU model amd
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Introduce a new IOMMU device model 'amd', both the parser
and the formatter for QEMU because of our enum warnings.
https://issues.redhat.com/browse/RHEL-50560
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 14760600914ea6b5da778dd470823e734becf630)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
docs/formatdomain.rst | 5 ++-
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/conf/domain_validate.c | 13 +++++++
src/conf/schemas/domaincommon.rng | 1 +
src/qemu/qemu_command.c | 28 +++++++++++++
src/qemu/qemu_domain_address.c | 4 ++
src/qemu/qemu_validate.c | 22 +++++++++++
.../amd-iommu.x86_64-latest.args | 35 +++++++++++++++++
.../amd-iommu.x86_64-latest.xml | 1 +
tests/qemuxmlconfdata/amd-iommu.xml | 39 +++++++++++++++++++
tests/qemuxmlconftest.c | 2 +
12 files changed, 150 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxmlconfdata/amd-iommu.x86_64-latest.args
create mode 120000 tests/qemuxmlconfdata/amd-iommu.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/amd-iommu.xml
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index a950ee1cb4..ec7bdb07d0 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -8841,8 +8841,9 @@ Example:
``model``
Supported values are ``intel`` (for Q35 guests) ``smmuv3``
- (:since:`since 5.5.0`, for ARM virt guests), and ``virtio``
- (:since:`since 8.3.0`, for Q35 and ARM virt guests).
+ (:since:`since 5.5.0`, for ARM virt guests), ``virtio``
+ (:since:`since 8.3.0`, for Q35 and ARM virt guests) and
+ ``amd`` (:since:`since 11.5.0`).
``driver``
The ``driver`` subelement can be used to configure additional options, some
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 726c3095ed..7c8591e509 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1349,6 +1349,7 @@ VIR_ENUM_IMPL(virDomainIOMMUModel,
"intel",
"smmuv3",
"virtio",
+ "amd",
);
VIR_ENUM_IMPL(virDomainVsockModel,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 20be6f7c05..343bb9bae0 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2973,6 +2973,7 @@ typedef enum {
VIR_DOMAIN_IOMMU_MODEL_INTEL,
VIR_DOMAIN_IOMMU_MODEL_SMMUV3,
VIR_DOMAIN_IOMMU_MODEL_VIRTIO,
+ VIR_DOMAIN_IOMMU_MODEL_AMD,
VIR_DOMAIN_IOMMU_MODEL_LAST
} virDomainIOMMUModel;
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 9cedc8d6d2..483cfbbe08 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2986,6 +2986,18 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
}
break;
+ case VIR_DOMAIN_IOMMU_MODEL_AMD:
+ if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT ||
+ iommu->eim != VIR_TRISTATE_SWITCH_ABSENT ||
+ iommu->aw_bits != 0 ||
+ iommu->dma_translation != VIR_TRISTATE_SWITCH_ABSENT) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("iommu model '%1$s' doesn't support some additional attributes"),
+ virDomainIOMMUModelTypeToString(iommu->model));
+ return -1;
+ }
+ break;
+
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
case VIR_DOMAIN_IOMMU_MODEL_LAST:
break;
@@ -3003,6 +3015,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
break;
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ case VIR_DOMAIN_IOMMU_MODEL_AMD:
case VIR_DOMAIN_IOMMU_MODEL_LAST:
break;
}
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index d46eb44588..38a0586f40 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -6174,6 +6174,7 @@
<value>intel</value>
<value>smmuv3</value>
<value>virtio</value>
+ <value>amd</value>
</choice>
</attribute>
<interleave>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index fb70c79a94..de535029a8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6051,6 +6051,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
virQEMUCaps *qemuCaps)
{
g_autoptr(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) wrapperProps = NULL;
const virDomainIOMMUDef *iommu = def->iommu;
if (!iommu)
@@ -6095,6 +6096,32 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
/* There is no -device for SMMUv3, so nothing to be done here */
return 0;
+ case VIR_DOMAIN_IOMMU_MODEL_AMD:
+ if (virJSONValueObjectAdd(&wrapperProps,
+ "s:driver", "AMDVI-PCI",
+ "s:id", iommu->info.alias,
+ NULL) < 0)
+ return -1;
+
+ if (qemuBuildDeviceAddressProps(wrapperProps, def, &iommu->info) < 0)
+ return -1;
+
+ if (qemuBuildDeviceCommandlineFromJSON(cmd, wrapperProps, def, qemuCaps) < 0)
+ return -1;
+
+ if (virJSONValueObjectAdd(&props,
+ "s:driver", "amd-iommu",
+ "s:pci-id", iommu->info.alias,
+ "S:intremap", qemuOnOffAuto(iommu->intremap),
+ "T:device-iotlb", iommu->iotlb,
+ NULL) < 0)
+ return -1;
+
+ if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0)
+ return -1;
+
+ return 0;
+
case VIR_DOMAIN_IOMMU_MODEL_LAST:
default:
virReportEnumRangeError(virDomainIOMMUModel, iommu->model);
@@ -6921,6 +6948,7 @@ qemuBuildMachineCommandLine(virCommand *cmd,
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ case VIR_DOMAIN_IOMMU_MODEL_AMD:
/* These IOMMUs are formatted in qemuBuildIOMMUCommandLine */
break;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index b73ac9ebf1..d8ab5a03f7 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -941,6 +941,9 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
return virtioFlags | VIR_PCI_CONNECT_INTEGRATED;
+ case VIR_DOMAIN_IOMMU_MODEL_AMD:
+ return pciFlags | VIR_PCI_CONNECT_INTEGRATED;
+
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
case VIR_DOMAIN_IOMMU_MODEL_LAST:
@@ -2359,6 +2362,7 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def,
switch (iommu->model) {
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ case VIR_DOMAIN_IOMMU_MODEL_AMD:
if (virDeviceInfoPCIAddressIsWanted(&iommu->info) &&
qemuDomainPCIAddressReserveNextAddr(addrs, &iommu->info) < 0) {
return -1;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 97f8f58ffd..ddfb14399a 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -5153,6 +5153,28 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu,
}
break;
+ case VIR_DOMAIN_IOMMU_MODEL_AMD:
+ if (!qemuDomainIsQ35(def)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("IOMMU device: '%1$s' is only supported with Q35 machines"),
+ virDomainIOMMUModelTypeToString(iommu->model));
+ return -1;
+ }
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AMD_IOMMU_PCI_ID)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("IOMMU device: '%1$s' is not supported with this QEMU binary"),
+ virDomainIOMMUModelTypeToString(iommu->model));
+ return -1;
+ }
+ if (iommu->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
+ iommu->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("IOMMU device: '%1$s' needs a PCI address"),
+ virDomainIOMMUModelTypeToString(iommu->model));
+ return -1;
+ }
+ break;
+
case VIR_DOMAIN_IOMMU_MODEL_LAST:
default:
virReportEnumRangeError(virDomainIOMMUModel, iommu->model);
diff --git a/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.args b/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.args
new file mode 100644
index 0000000000..36244edb3a
--- /dev/null
+++ b/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.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-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 q35,usb=off,kernel_irqchip=split,dump-guest-core=off,memory-backend=pc.ram,acpi=on \
+-accel kvm \
+-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":"AMDVI-PCI","id":"iommu0","bus":"pcie.0","addr":"0x1"}' \
+-device '{"driver":"amd-iommu","pci-id":"iommu0","intremap":"on","device-iotlb":true}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-global ICH9-LPC.noreboot=off \
+-watchdog-action reset \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.xml b/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.xml
new file mode 120000
index 0000000000..5ba3d4b91b
--- /dev/null
+++ b/tests/qemuxmlconfdata/amd-iommu.x86_64-latest.xml
@@ -0,0 +1 @@
+amd-iommu.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/amd-iommu.xml b/tests/qemuxmlconfdata/amd-iommu.xml
new file mode 100644
index 0000000000..0668ed4237
--- /dev/null
+++ b/tests/qemuxmlconfdata/amd-iommu.xml
@@ -0,0 +1,39 @@
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='q35'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <ioapic driver='qemu'/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <watchdog model='itco' action='reset'/>
+ <memballoon model='none'/>
+ <iommu model='amd'>
+ <driver intremap='on' iotlb='on'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </iommu>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index bed562286d..e59ed73088 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2774,6 +2774,8 @@ mymain(void)
DO_TEST_CAPS_LATEST("acpi-table");
DO_TEST_CAPS_LATEST("acpi-table-many");
+ DO_TEST_CAPS_LATEST("amd-iommu");
+
DO_TEST_CAPS_LATEST("intel-iommu");
DO_TEST_CAPS_LATEST("intel-iommu-caching-mode");
DO_TEST_CAPS_LATEST("intel-iommu-eim");
--
2.50.1

View File

@ -0,0 +1,690 @@
From 40243a6838c8f22c2be519ff8347c03c730caf45 Mon Sep 17 00:00:00 2001
Message-ID: <40243a6838c8f22c2be519ff8347c03c730caf45.1755522824.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 16 Jul 2025 16:40:01 +0100
Subject: [PATCH] qemu: add ability to set TLS priority string with QEMU
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
QEMU will either use the GNUTLS default priority string of "NORMAL",
or on Fedora/RHEL related distros, "@QEMU,SYSTEM", which resolves to
a configuration in /etc/crypto-policies/back-ends/gnutls.config.
The latter gives the sysadmin the ability to change the priority
string used for GNUTLS at deployment time, either system side, or
exclusively for QEMU, avoiding the hardcoded GNUTLS defaults.
There are still some limitations to this:
* Priorities cannot be set for different areas of QEMU
functionality (migration, vnc, nbd, etc)
* Priorities are fixed at the time when QEMU first
triggers GNUTLS to load its config file, often
immediately at startup.
We recently uncovered a QEMU bug that causes crashes in live
migration with TLS-1.3, where the easiest workaround is to
change the TLS priorities. We can't change this on the running
QEMU, but fortunately it is possible to change it on the target
QEMU and the TLS handshake will make it take effect on both
src and dst.
The problem is, while fixing the immediate incoming and outgoing
live migration problems, the workaround will apply to everything
else that QEMU does for the rest of the time that process exists.
We want to make it possible to set the TLS priorities only for
the current migrations, such that if the target QEMU has a fixed
GNUTLS, it will not have its TLS priorities hobbled for the next
live migration.
To achieve this we need libvirt to be able to (optionally) set
the TLS priority string with QEMU. While live migration is the
most pressing need, the new qemu.conf parameters are wired up
for every subsystem for greater selectivity in future.
With this we can activate the GNUTLS workaround for running
QEMU processes by editting qemu.conf and restarting virtqemud,
and later undo this the same way.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 14e41ac9f365b148e69088c5ffeb565a0f9ba326)
- Added dummy vxhsTLSpriority field and adapted old test data files
Resolves: https://issues.redhat.com/browse/RHEL-106276
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/conf/storage_source_conf.c | 2 +
src/conf/storage_source_conf.h | 1 +
src/qemu/libvirtd_qemu.aug | 6 +++
src/qemu/qemu.conf.in | 37 +++++++++++++++++++
src/qemu/qemu_backup.c | 5 ++-
src/qemu/qemu_blockjob.c | 1 +
src/qemu/qemu_command.c | 15 ++++++--
src/qemu/qemu_command.h | 1 +
src/qemu/qemu_conf.c | 22 +++++++++++
src/qemu/qemu_conf.h | 8 ++++
src/qemu/qemu_domain.c | 3 ++
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_hotplug.c | 4 +-
src/qemu/qemu_hotplug.h | 1 +
src/qemu/qemu_migration_params.c | 1 +
src/qemu/test_libvirtd_qemu.aug.in | 6 +++
...rk-tlsx509-nbd-hostname.x86_64-latest.args | 2 +-
.../graphics-vnc-tls-secret.x86_64-5.2.0.args | 2 +-
...graphics-vnc-tls-secret.x86_64-latest.args | 2 +-
...-tlsx509-secret-chardev.x86_64-latest.args | 2 +-
tests/qemuxmlconftest.c | 6 +++
21 files changed, 117 insertions(+), 11 deletions(-)
diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c
index ca956a1b7c..dc6e6bde32 100644
--- a/src/conf/storage_source_conf.c
+++ b/src/conf/storage_source_conf.c
@@ -838,6 +838,7 @@ virStorageSourceCopy(const virStorageSource *src,
def->compat = g_strdup(src->compat);
def->tlsAlias = g_strdup(src->tlsAlias);
def->tlsCertdir = g_strdup(src->tlsCertdir);
+ def->tlsPriority = g_strdup(src->tlsPriority);
def->tlsHostname = g_strdup(src->tlsHostname);
def->query = g_strdup(src->query);
def->vdpadev = g_strdup(src->vdpadev);
@@ -1191,6 +1192,7 @@ virStorageSourceClear(virStorageSource *def)
VIR_FREE(def->tlsAlias);
VIR_FREE(def->tlsCertdir);
+ VIR_FREE(def->tlsPriority);
VIR_FREE(def->tlsHostname);
VIR_FREE(def->ssh_user);
diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h
index e6cbb93c06..760b60bd40 100644
--- a/src/conf/storage_source_conf.h
+++ b/src/conf/storage_source_conf.h
@@ -392,6 +392,7 @@ struct _virStorageSource {
* certificate directory with listen and verify bools. */
char *tlsAlias;
char *tlsCertdir;
+ char *tlsPriority;
/* TLS hostname override */
char *tlsHostname;
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index 3f018f39a0..711806b2a8 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -30,6 +30,7 @@ module Libvirtd_qemu =
let default_tls_entry = str_entry "default_tls_x509_cert_dir"
| bool_entry "default_tls_x509_verify"
| str_entry "default_tls_x509_secret_uuid"
+ | str_entry "default_tls_priority"
let vnc_entry = str_entry "vnc_listen"
| bool_entry "vnc_auto_unix_socket"
@@ -37,6 +38,7 @@ module Libvirtd_qemu =
| str_entry "vnc_tls_x509_cert_dir"
| bool_entry "vnc_tls_x509_verify"
| str_entry "vnc_tls_x509_secret_uuid"
+ | str_entry "vnc_tls_priority"
| str_entry "vnc_password"
| bool_entry "vnc_sasl"
| str_entry "vnc_sasl_dir"
@@ -54,15 +56,18 @@ module Libvirtd_qemu =
| str_entry "chardev_tls_x509_cert_dir"
| bool_entry "chardev_tls_x509_verify"
| str_entry "chardev_tls_x509_secret_uuid"
+ | str_entry "chardev_tls_priority"
let migrate_entry = str_entry "migrate_tls_x509_cert_dir"
| bool_entry "migrate_tls_x509_verify"
| str_entry "migrate_tls_x509_secret_uuid"
+ | str_entry "migrate_tls_priority"
| bool_entry "migrate_tls_force"
let backup_entry = str_entry "backup_tls_x509_cert_dir"
| bool_entry "backup_tls_x509_verify"
| str_entry "backup_tls_x509_secret_uuid"
+ | str_entry "backup_tls_priority"
let vxhs_entry = bool_entry "vxhs_tls"
| str_entry "vxhs_tls_x509_cert_dir"
@@ -71,6 +76,7 @@ module Libvirtd_qemu =
let nbd_entry = bool_entry "nbd_tls"
| str_entry "nbd_tls_x509_cert_dir"
| str_entry "nbd_tls_x509_secret_uuid"
+ | str_entry "nbd_tls_priority"
let nogfx_entry = bool_entry "nographics_allow_host_audio"
diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in
index 988d176a28..8bf18d06b2 100644
--- a/src/qemu/qemu.conf.in
+++ b/src/qemu/qemu.conf.in
@@ -62,6 +62,18 @@
#default_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+# Libvirt allows QEMU to use its built-in TLS priority by default,
+# however, this allows overriding it at runtime. This is especially
+# useful if TLS priority needs to be changed for an operation run
+# against an existing running QEMU.
+#
+# This must be a valid GNUTLS priority string:
+#
+# https://gnutls.org/manual/html_node/Priority-Strings.html
+#
+#default_tls_priority = "@SYSTEM"
+
+
# VNC is configured to listen on 127.0.0.1 by default.
# To make it listen on all public interfaces, uncomment
# this next option.
@@ -127,6 +139,11 @@
#vnc_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+# Override QEMU default GNUTLS priority string for VNC
+#
+#vnc_tls_priority = "@SYSTEM"
+
+
# The default VNC password. Only 8 bytes are significant for
# VNC passwords. This parameter is only used if the per-domain
# XML config does not already provide a password. To allow
@@ -278,6 +295,11 @@
#chardev_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+# Override QEMU default GNUTLS priority string for character devices
+#
+#chardev_tls_priority = "@SYSTEM"
+
+
# Enable use of TLS encryption for all VxHS network block devices that
# don't specifically disable.
#
@@ -366,6 +388,11 @@
#nbd_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+# Override QEMU default GNUTLS priority string for NBD
+#
+#nbd_tls_priority = "@SYSTEM"
+
+
# In order to override the default TLS certificate location for migration
# certificates, supply a valid path to the certificate directory. If the
# provided path does not exist, libvirtd will fail to start. If the path is
@@ -405,6 +432,11 @@
#migrate_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+# Override QEMU default GNUTLS priority string for live migration
+#
+#migrate_tls_priority = "@SYSTEM"
+
+
# By default TLS is requested using the VIR_MIGRATE_TLS flag, thus not requested
# automatically. Setting 'migate_tls_force' to "1" will prevent any migration
# which is not using VIR_MIGRATE_TLS to ensure higher level of security in
@@ -450,6 +482,11 @@
#backup_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+# Override QEMU default GNUTLS priority string for NBD backups
+#
+#backup_tls_priority = "@SYSTEM"
+
+
# By default, if no graphical front end is configured, libvirt will disable
# QEMU audio output since directly talking to alsa/pulseaudio may not work
# with various security settings. If you know what you're doing, enable
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index f64639d501..d416f0f0c7 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -725,8 +725,9 @@ qemuBackupBeginPrepareTLS(virDomainObj *vm,
}
if (qemuBuildTLSx509BackendProps(cfg->backupTLSx509certdir, true,
- cfg->backupTLSx509verify, tlsObjAlias,
- tlsKeySecretAlias,
+ cfg->backupTLSx509verify,
+ cfg->backupTLSpriority,
+ tlsObjAlias, tlsKeySecretAlias,
tlsProps) < 0)
return -1;
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 4e77543fa8..4d94703807 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -623,6 +623,7 @@ qemuBlockJobCleanStorageSourceRuntime(virStorageSource *src)
VIR_FREE(src->nodenameformat);
VIR_FREE(src->tlsAlias);
VIR_FREE(src->tlsCertdir);
+ VIR_FREE(src->tlsPriority);
}
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index fffc8be08a..243729800b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1253,6 +1253,7 @@ qemuBuildObjectSecretCommandLine(virCommand *cmd,
* @tlspath: path to the TLS credentials
* @listen: boolean listen for client or server setting
* @verifypeer: boolean to enable peer verification (form of authorization)
+ * @priority: GNUTLS priority string override (optional)
* @alias: alias for the TLS credentials object
* @secalias: if one exists, the alias of the security object for passwordid
* @propsret: json properties to return
@@ -1265,6 +1266,7 @@ int
qemuBuildTLSx509BackendProps(const char *tlspath,
bool isListen,
bool verifypeer,
+ const char *priority,
const char *alias,
const char *secalias,
virJSONValue **propsret)
@@ -1273,6 +1275,7 @@ qemuBuildTLSx509BackendProps(const char *tlspath,
"s:dir", tlspath,
"s:endpoint", (isListen ? "server": "client"),
"b:verify-peer", (isListen ? verifypeer : true),
+ "S:priority", priority,
"S:passwordid", secalias,
NULL) < 0)
return -1;
@@ -1286,6 +1289,7 @@ qemuBuildTLSx509BackendProps(const char *tlspath,
* @tlspath: path to the TLS credentials
* @listen: boolean listen for client or server setting
* @verifypeer: boolean to enable peer verification (form of authorization)
+ * @priority: GNUTLS priority string override (optional)
* @certEncSecretAlias: alias of a 'secret' object for decrypting TLS private key
* (optional)
* @alias: TLS object alias
@@ -1300,14 +1304,15 @@ qemuBuildTLSx509CommandLine(virCommand *cmd,
const char *tlspath,
bool isListen,
bool verifypeer,
+ const char *priority,
const char *certEncSecretAlias,
const char *alias,
virQEMUCaps *qemuCaps)
{
g_autoptr(virJSONValue) props = NULL;
- if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, alias,
- certEncSecretAlias, &props) < 0)
+ if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, priority,
+ alias, certEncSecretAlias, &props) < 0)
return -1;
if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)
@@ -1350,6 +1355,7 @@ qemuBuildChardevCommand(virCommand *cmd,
if (qemuBuildTLSx509CommandLine(cmd, chrSourcePriv->tlsCertPath,
dev->data.tcp.listen,
chrSourcePriv->tlsVerify,
+ chrSourcePriv->tlsPriority,
tlsCertEncSecAlias,
objalias, qemuCaps) < 0) {
return -1;
@@ -8144,6 +8150,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfig *cfg,
cfg->vncTLSx509certdir,
true,
cfg->vncTLSx509verify,
+ cfg->vncTLSpriority,
secretAlias,
gfxPriv->tlsAlias,
qemuCaps) < 0)
@@ -10995,8 +11002,8 @@ qemuBuildStorageSourceAttachPrepareCommon(virStorageSource *src,
}
if (src->haveTLS == VIR_TRISTATE_BOOL_YES &&
- qemuBuildTLSx509BackendProps(src->tlsCertdir, false, true, src->tlsAlias,
- tlsKeySecretAlias, &data->tlsProps) < 0)
+ qemuBuildTLSx509BackendProps(src->tlsCertdir, false, true, src->tlsPriority,
+ src->tlsAlias, tlsKeySecretAlias, &data->tlsProps) < 0)
return -1;
return 0;
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 76c514b5f7..948a633668 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -62,6 +62,7 @@ int qemuBuildSecretInfoProps(qemuDomainSecretInfo *secinfo,
int qemuBuildTLSx509BackendProps(const char *tlspath,
bool isListen,
bool verifypeer,
+ const char *priority,
const char *alias,
const char *secalias,
virJSONValue **propsret);
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 7c15c521c7..93e1f7938b 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -422,6 +422,9 @@ virQEMUDriverConfigLoadDefaultTLSEntry(virQEMUDriverConfig *cfg,
if (virConfGetValueString(conf, "default_tls_x509_secret_uuid",
&cfg->defaultTLSx509secretUUID) < 0)
return -1;
+ if (virConfGetValueString(conf, "default_tls_priority",
+ &cfg->defaultTLSpriority) < 0)
+ return -1;
return 0;
}
@@ -521,6 +524,9 @@ virQEMUDriverConfigLoadSpecificTLSEntry(virQEMUDriverConfig *cfg,
#val "_tls_x509_secret_uuid", \
&cfg->val## TLSx509secretUUID) < 0) \
return -1; \
+ if ((rv = virConfGetValueString(conf, #val "_tls_priority", \
+ &cfg->val## TLSpriority)) < 0) \
+ return -1; \
} while (0)
#define GET_CONFIG_TLS_CERTINFO_SERVER(val) \
@@ -1305,6 +1311,22 @@ virQEMUDriverConfigSetDefaults(virQEMUDriverConfig *cfg)
#undef SET_TLS_SECRET_UUID_DEFAULT
+#define SET_TLS_PRIORITY_DEFAULT(val) \
+ do { \
+ if (!cfg->val## TLSpriority && \
+ cfg->defaultTLSpriority) { \
+ cfg->val## TLSpriority = g_strdup(cfg->defaultTLSpriority); \
+ } \
+ } while (0)
+
+ SET_TLS_PRIORITY_DEFAULT(vnc);
+ SET_TLS_PRIORITY_DEFAULT(chardev);
+ SET_TLS_PRIORITY_DEFAULT(migrate);
+ SET_TLS_PRIORITY_DEFAULT(backup);
+ SET_TLS_PRIORITY_DEFAULT(nbd);
+
+#undef SET_TLS_PRIORITY_DEFAULT
+
/*
* If a "SYSCONFDIR" + "pki/libvirt-<val>" exists, then assume someone
* has created a val specific area to place service specific certificates.
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 42cdb6f883..b650f52262 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -115,6 +115,7 @@ struct _virQEMUDriverConfig {
bool defaultTLSx509verify;
bool defaultTLSx509verifyPresent;
char *defaultTLSx509secretUUID;
+ char *defaultTLSpriority;
bool vncAutoUnixSocket;
bool vncTLS;
@@ -123,6 +124,7 @@ struct _virQEMUDriverConfig {
bool vncSASL;
char *vncTLSx509certdir;
char *vncTLSx509secretUUID;
+ char *vncTLSpriority;
char *vncListen;
char *vncPassword;
char *vncSASLdir;
@@ -140,25 +142,31 @@ struct _virQEMUDriverConfig {
bool chardevTLSx509verify;
bool chardevTLSx509verifyPresent;
char *chardevTLSx509secretUUID;
+ char *chardevTLSpriority;
char *migrateTLSx509certdir;
bool migrateTLSx509verify;
bool migrateTLSx509verifyPresent;
char *migrateTLSx509secretUUID;
+ char *migrateTLSpriority;
bool migrateTLSForce;
char *backupTLSx509certdir;
bool backupTLSx509verify;
bool backupTLSx509verifyPresent;
char *backupTLSx509secretUUID;
+ char *backupTLSpriority;
bool vxhsTLS;
char *vxhsTLSx509certdir;
char *vxhsTLSx509secretUUID;
+ char *vxhsTLSpriority; /* unused / dummy field to keep
+ * GET_CONFIG_TLS_CERTINFO_COMMON happy */
bool nbdTLS;
char *nbdTLSx509certdir;
char *nbdTLSx509secretUUID;
+ char *nbdTLSpriority;
unsigned int remotePortMin;
unsigned int remotePortMax;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index cc47adb724..8879a45ffb 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -955,6 +955,7 @@ qemuDomainChrSourcePrivateDispose(void *obj)
qemuDomainChrSourcePrivateClearFDPass(priv);
g_free(priv->tlsCertPath);
+ g_free(priv->tlsPriority);
g_free(priv->tlsCredsAlias);
@@ -8686,6 +8687,7 @@ qemuDomainPrepareChardevSourceOne(virDomainDeviceDef *dev,
if (charsrc->data.tcp.haveTLS == VIR_TRISTATE_BOOL_YES) {
charpriv->tlsCertPath = g_strdup(data->cfg->chardevTLSx509certdir);
+ charpriv->tlsPriority = g_strdup(data->cfg->chardevTLSpriority);
charpriv->tlsVerify = data->cfg->chardevTLSx509verify;
}
}
@@ -8785,6 +8787,7 @@ qemuProcessPrepareStorageSourceTLSNBD(virStorageSource *src,
src->tlsAlias = qemuAliasTLSObjFromSrcAlias(parentAlias);
src->tlsCertdir = g_strdup(cfg->nbdTLSx509certdir);
+ src->tlsPriority = g_strdup(cfg->nbdTLSpriority);
if (cfg->nbdTLSx509secretUUID) {
qemuDomainStorageSourcePrivate *srcpriv = qemuDomainStorageSourcePrivateFetch(src);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 63f422bbcb..3f16f86da8 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -381,6 +381,7 @@ struct _qemuDomainChrSourcePrivate {
char *tlsCertPath; /* path to certificates if TLS is requested */
bool tlsVerify; /* whether server should verify client certificates */
+ char *tlsPriority; /* optional GNUTLS priority string */
char *tlsCredsAlias; /* alias of the x509 tls credentials object */
};
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index ff09b58bfe..c6704cbebe 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1717,6 +1717,7 @@ qemuDomainGetTLSObjects(qemuDomainSecretInfo *secinfo,
const char *tlsCertdir,
bool tlsListen,
bool tlsVerify,
+ const char *tlsPriority,
const char *alias,
virJSONValue **tlsProps,
virJSONValue **secProps)
@@ -1730,7 +1731,7 @@ qemuDomainGetTLSObjects(qemuDomainSecretInfo *secinfo,
secAlias = secinfo->alias;
}
- if (qemuBuildTLSx509BackendProps(tlsCertdir, tlsListen, tlsVerify,
+ if (qemuBuildTLSx509BackendProps(tlsCertdir, tlsListen, tlsVerify, tlsPriority,
alias, secAlias, tlsProps) < 0)
return -1;
@@ -1774,6 +1775,7 @@ qemuDomainAddChardevTLSObjects(virQEMUDriver *driver,
cfg->chardevTLSx509certdir,
dev->data.tcp.listen,
cfg->chardevTLSx509verify,
+ cfg->chardevTLSpriority,
*tlsAlias, &tlsProps, &secProps) < 0)
return -1;
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
index 4fe7f4923e..5d32487047 100644
--- a/src/qemu/qemu_hotplug.h
+++ b/src/qemu/qemu_hotplug.h
@@ -38,6 +38,7 @@ int qemuDomainGetTLSObjects(qemuDomainSecretInfo *secinfo,
const char *tlsCertdir,
bool tlsListen,
bool tlsVerify,
+ const char *tlsPriority,
const char *alias,
virJSONValue **tlsProps,
virJSONValue **secProps);
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 98822012cc..3858cca907 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -1143,6 +1143,7 @@ qemuMigrationParamsEnableTLS(virQEMUDriver *driver,
if (qemuDomainGetTLSObjects(priv->migSecinfo,
cfg->migrateTLSx509certdir, tlsListen,
cfg->migrateTLSx509verify,
+ cfg->migrateTLSpriority,
*tlsAlias, &tlsProps, &secProps) < 0)
return -1;
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 86b3844d2c..b916af35ee 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -5,12 +5,14 @@ module Test_libvirtd_qemu =
{ "default_tls_x509_cert_dir" = "/etc/pki/qemu" }
{ "default_tls_x509_verify" = "1" }
{ "default_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
+{ "default_tls_priority" = "@SYSTEM" }
{ "vnc_listen" = "0.0.0.0" }
{ "vnc_auto_unix_socket" = "1" }
{ "vnc_tls" = "1" }
{ "vnc_tls_x509_cert_dir" = "/etc/pki/libvirt-vnc" }
{ "vnc_tls_x509_verify" = "1" }
{ "vnc_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
+{ "vnc_tls_priority" = "@SYSTEM" }
{ "vnc_password" = "XYZ12345" }
{ "vnc_sasl" = "1" }
{ "vnc_sasl_dir" = "/some/directory/sasl2" }
@@ -26,19 +28,23 @@ module Test_libvirtd_qemu =
{ "chardev_tls_x509_cert_dir" = "/etc/pki/libvirt-chardev" }
{ "chardev_tls_x509_verify" = "1" }
{ "chardev_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
+{ "chardev_tls_priority" = "@SYSTEM" }
{ "vxhs_tls" = "1" }
{ "vxhs_tls_x509_cert_dir" = "/etc/pki/libvirt-vxhs" }
{ "vxhs_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
{ "nbd_tls" = "1" }
{ "nbd_tls_x509_cert_dir" = "/etc/pki/libvirt-nbd" }
{ "nbd_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
+{ "nbd_tls_priority" = "@SYSTEM" }
{ "migrate_tls_x509_cert_dir" = "/etc/pki/libvirt-migrate" }
{ "migrate_tls_x509_verify" = "1" }
{ "migrate_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
+{ "migrate_tls_priority" = "@SYSTEM" }
{ "migrate_tls_force" = "0" }
{ "backup_tls_x509_cert_dir" = "/etc/pki/libvirt-backup" }
{ "backup_tls_x509_verify" = "1" }
{ "backup_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
+{ "backup_tls_priority" = "@SYSTEM" }
{ "nographics_allow_host_audio" = "1" }
{ "remote_display_port_min" = "5900" }
{ "remote_display_port_max" = "65535" }
diff --git a/tests/qemuxmlconfdata/disk-network-tlsx509-nbd-hostname.x86_64-latest.args b/tests/qemuxmlconfdata/disk-network-tlsx509-nbd-hostname.x86_64-latest.args
index 4ee9a0631b..77d38c3020 100644
--- a/tests/qemuxmlconfdata/disk-network-tlsx509-nbd-hostname.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/disk-network-tlsx509-nbd-hostname.x86_64-latest.args
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-boot strict=on \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-object '{"qom-type":"secret","id":"objlibvirt-1-storage_tls0-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \
--object '{"qom-type":"tls-creds-x509","id":"objlibvirt-1-storage_tls0","dir":"/etc/pki/libvirt-nbd","endpoint":"client","verify-peer":true,"passwordid":"objlibvirt-1-storage_tls0-secret0"}' \
+-object '{"qom-type":"tls-creds-x509","id":"objlibvirt-1-storage_tls0","dir":"/etc/pki/libvirt-nbd","endpoint":"client","verify-peer":true,"priority":"@SYSTEM:-VERS-TLS1.3","passwordid":"objlibvirt-1-storage_tls0-secret0"}' \
-blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com","port":"1234"},"tls-creds":"objlibvirt-1-storage_tls0","tls-hostname":"test-hostname","node-name":"libvirt-1-storage","read-only":false,"cache":{"direct":true,"no-flush":false}}' \
-device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"libvirt-1-storage","id":"virtio-disk3","bootindex":1,"write-cache":"on"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
diff --git a/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-5.2.0.args b/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-5.2.0.args
index 11f8b3f4f0..3c3002dd4f 100644
--- a/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-5.2.0.args
+++ b/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-5.2.0.args
@@ -30,7 +30,7 @@ SASL_CONF_PATH=/etc/sasl2 \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-audiodev '{"id":"audio1","driver":"none"}' \
-object secret,id=vnc-tls-creds0-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
--object tls-creds-x509,id=vnc-tls-creds0,dir=/etc/pki/libvirt-vnc,endpoint=server,verify-peer=on,passwordid=vnc-tls-creds0-secret0 \
+-object tls-creds-x509,id=vnc-tls-creds0,dir=/etc/pki/libvirt-vnc,endpoint=server,verify-peer=on,priority=@SYSTEM:-VERS-TLS1.3,passwordid=vnc-tls-creds0-secret0 \
-vnc 127.0.0.1:3,tls-creds=vnc-tls-creds0,sasl=on,audiodev=audio1 \
-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
diff --git a/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-latest.args b/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-latest.args
index 50cc8532d1..32d7be1d3b 100644
--- a/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-latest.args
@@ -29,7 +29,7 @@ SASL_CONF_PATH=/etc/sasl2 \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-object '{"qom-type":"secret","id":"vnc-tls-creds0-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \
--object '{"qom-type":"tls-creds-x509","id":"vnc-tls-creds0","dir":"/etc/pki/libvirt-vnc","endpoint":"server","verify-peer":true,"passwordid":"vnc-tls-creds0-secret0"}' \
+-object '{"qom-type":"tls-creds-x509","id":"vnc-tls-creds0","dir":"/etc/pki/libvirt-vnc","endpoint":"server","verify-peer":true,"priority":"@SYSTEM:-VERS-TLS1.3","passwordid":"vnc-tls-creds0-secret0"}' \
-vnc 127.0.0.1:3,tls-creds=vnc-tls-creds0,sasl=on,audiodev=audio1 \
-device '{"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
diff --git a/tests/qemuxmlconfdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args b/tests/qemuxmlconfdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args
index c227a04112..492d1be626 100644
--- a/tests/qemuxmlconfdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args
@@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \
-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \
-object '{"qom-type":"secret","id":"charserial1-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \
--object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"passwordid":"charserial1-secret0"}' \
+-object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"priority":"@SYSTEM:-VERS-TLS1.3","passwordid":"charserial1-secret0"}' \
-chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \
-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \
-audiodev '{"id":"audio1","driver":"none"}' \
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index e59ed73088..a0af6429d1 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -1598,7 +1598,9 @@ mymain(void)
DO_TEST_CAPS_VER("disk-network-tlsx509-nbd", "5.2.0");
DO_TEST_CAPS_LATEST("disk-network-tlsx509-nbd");
DO_TEST_CAPS_VER_PARSE_ERROR("disk-network-tlsx509-nbd-hostname", "6.2.0");
+ driver.config->nbdTLSpriority = g_strdup("@SYSTEM:-VERS-TLS1.3");
DO_TEST_CAPS_LATEST("disk-network-tlsx509-nbd-hostname");
+ VIR_FREE(driver.config->nbdTLSpriority);
DO_TEST_CAPS_LATEST("disk-network-http");
VIR_FREE(driver.config->nbdTLSx509secretUUID);
VIR_FREE(driver.config->vxhsTLSx509secretUUID);
@@ -1714,9 +1716,11 @@ mymain(void)
driver.config->vncTLS = 1;
driver.config->vncTLSx509verify = 1;
DO_TEST_CAPS_LATEST("graphics-vnc-tls");
+ driver.config->vncTLSpriority = g_strdup("@SYSTEM:-VERS-TLS1.3");
driver.config->vncTLSx509secretUUID = g_strdup("6fd3f62d-9fe7-4a4e-a869-7acd6376d8ea");
DO_TEST_CAPS_VER("graphics-vnc-tls-secret", "5.2.0");
DO_TEST_CAPS_LATEST("graphics-vnc-tls-secret");
+ VIR_FREE(driver.config->vncTLSpriority);
VIR_FREE(driver.config->vncTLSx509secretUUID);
driver.config->vncSASL = driver.config->vncTLSx509verify = driver.config->vncTLS = 0;
DO_TEST_CAPS_LATEST("graphics-vnc-egl-headless");
@@ -1865,7 +1869,9 @@ mymain(void)
driver.config->chardevTLSx509verify = 0;
DO_TEST_CAPS_LATEST("serial-tcp-tlsx509-chardev-notls");
driver.config->chardevTLSx509secretUUID = g_strdup("6fd3f62d-9fe7-4a4e-a869-7acd6376d8ea");
+ driver.config->chardevTLSpriority = g_strdup("@SYSTEM:-VERS-TLS1.3");
DO_TEST_CAPS_LATEST("serial-tcp-tlsx509-secret-chardev");
+ VIR_FREE(driver.config->chardevTLSpriority);
VIR_FREE(driver.config->chardevTLSx509secretUUID);
driver.config->chardevTLS = 0;
DO_TEST_CAPS_LATEST("serial-many-chardev");
--
2.50.1

View File

@ -0,0 +1,84 @@
From 5df4d5dc38491553e3d1e454f1cd233bda0b990a Mon Sep 17 00:00:00 2001
Message-ID: <5df4d5dc38491553e3d1e454f1cd233bda0b990a.1755522824.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 16 Jul 2025 16:32:05 +0100
Subject: [PATCH] qemu: fix order of VNC TLS config entries
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For TLS config parameters, the 'verify' option always comes before the
'secret_uuid' option, except in the VNC case which has them reversed.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 845e1b5138f37dbf91e5b08b7d54d963a6ec0452)
Resolves: https://issues.redhat.com/browse/RHEL-106276
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/qemu/libvirtd_qemu.aug | 2 +-
src/qemu/qemu.conf.in | 12 ++++++------
src/qemu/test_libvirtd_qemu.aug.in | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index 1377fd89cc..3f018f39a0 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -35,8 +35,8 @@ module Libvirtd_qemu =
| bool_entry "vnc_auto_unix_socket"
| bool_entry "vnc_tls"
| str_entry "vnc_tls_x509_cert_dir"
- | str_entry "vnc_tls_x509_secret_uuid"
| bool_entry "vnc_tls_x509_verify"
+ | str_entry "vnc_tls_x509_secret_uuid"
| str_entry "vnc_password"
| bool_entry "vnc_sasl"
| str_entry "vnc_sasl_dir"
diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in
index 89c9b6b913..3365834200 100644
--- a/src/qemu/qemu.conf.in
+++ b/src/qemu/qemu.conf.in
@@ -101,12 +101,6 @@
#vnc_tls_x509_cert_dir = "/etc/pki/libvirt-vnc"
-# Uncomment and use the following option to override the default secret
-# UUID provided in the default_tls_x509_secret_uuid parameter.
-#
-#vnc_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
-
-
# The default TLS configuration only uses certificates for the server
# allowing the client to verify the server's identity and establish
# an encrypted channel.
@@ -125,6 +119,12 @@
#vnc_tls_x509_verify = 1
+# Uncomment and use the following option to override the default secret
+# UUID provided in the default_tls_x509_secret_uuid parameter.
+#
+#vnc_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000"
+
+
# The default VNC password. Only 8 bytes are significant for
# VNC passwords. This parameter is only used if the per-domain
# XML config does not already provide a password. To allow
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 69fdae215a..86b3844d2c 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -9,8 +9,8 @@ module Test_libvirtd_qemu =
{ "vnc_auto_unix_socket" = "1" }
{ "vnc_tls" = "1" }
{ "vnc_tls_x509_cert_dir" = "/etc/pki/libvirt-vnc" }
-{ "vnc_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
{ "vnc_tls_x509_verify" = "1" }
+{ "vnc_tls_x509_secret_uuid" = "00000000-0000-0000-0000-000000000000" }
{ "vnc_password" = "XYZ12345" }
{ "vnc_sasl" = "1" }
{ "vnc_sasl_dir" = "/some/directory/sasl2" }
--
2.50.1

View File

@ -0,0 +1,253 @@
From 1910eee655456fff9f60e1a8d27e6b608a390953 Mon Sep 17 00:00:00 2001
Message-ID: <1910eee655456fff9f60e1a8d27e6b608a390953.1752749355.git.jdenemar@redhat.com>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Wed, 12 Mar 2025 16:10:31 +0100
Subject: [PATCH] qemu: introduce QEMU_CAPS_AMD_IOMMU
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Check for the presence of the amd-iommu device, so we can conditionalize
probing for its properties.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 14192af47ab8eda8bb9b9eee14fd1090addbb731)
https://issues.redhat.com/browse/RHEL-50560
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 1 +
tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 1 +
17 files changed, 18 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6bff55f58e..8db6d19fda 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -726,6 +726,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 470 */
"virtio-mem-ccw", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW */
"blockdev-set-active", /* QEMU_CAPS_BLOCKDEV_SET_ACTIVE */
+ "amd-iommu", /* QEMU_CAPS_AMD_IOMMU */
);
@@ -1416,6 +1417,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "sev-snp-guest", QEMU_CAPS_SEV_SNP_GUEST },
{ "acpi-erst", QEMU_CAPS_DEVICE_ACPI_ERST },
{ "virtio-mem-ccw", QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW },
+ { "amd-iommu", QEMU_CAPS_AMD_IOMMU },
};
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 8de392bf0f..484d1b5f1d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -705,6 +705,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 470 */
QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW, /* -device virtio-mem-ccw */
QEMU_CAPS_BLOCKDEV_SET_ACTIVE, /* blockdev-set-active QMP command supported */
+ QEMU_CAPS_AMD_IOMMU, /* -device amd-iommu */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
index e09b6e6e1a..8854b48a56 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
@@ -211,6 +211,7 @@
<flag name='chardev-reconnect-miliseconds'/>
<flag name='netdev-stream-reconnect-miliseconds'/>
<flag name='blockdev-set-active'/>
+ <flag name='amd-iommu'/>
<version>9002050</version>
<microcodeVersion>43100285</microcodeVersion>
<package>v9.2.0-1636-gffaf7f0376</package>
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml
index 4cd05fa7ec..c46b023c78 100644
--- a/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml
@@ -161,6 +161,7 @@
<flag name='virtio-crypto'/>
<flag name='usb-mtp'/>
<flag name='netdev.user'/>
+ <flag name='amd-iommu'/>
<version>5002000</version>
<microcodeVersion>43100243</microcodeVersion>
<package>v5.2.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml
index a8897fb80b..c7f2da0de6 100644
--- a/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml
@@ -174,6 +174,7 @@
<flag name='usb-mtp'/>
<flag name='netdev.user'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>6000000</version>
<microcodeVersion>43100242</microcodeVersion>
<package>v6.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml
index 0f2995a2d3..c3792a2ba8 100644
--- a/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml
@@ -180,6 +180,7 @@
<flag name='usb-mtp'/>
<flag name='netdev.user'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>6001000</version>
<microcodeVersion>43100243</microcodeVersion>
<package>v6.1.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml
index 582b0e9b52..8c904abf1f 100644
--- a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml
@@ -182,6 +182,7 @@
<flag name='usb-mtp'/>
<flag name='netdev.user'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>6002000</version>
<microcodeVersion>43100244</microcodeVersion>
<package>v6.2.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml
index fd317a9afa..0268960643 100644
--- a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml
@@ -190,6 +190,7 @@
<flag name='acpi-erst'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>7000000</version>
<microcodeVersion>43100243</microcodeVersion>
<package>v7.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml
index 32e4e8e1bb..8c0534264c 100644
--- a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml
@@ -195,6 +195,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>7001000</version>
<microcodeVersion>43100244</microcodeVersion>
<package>v7.1.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
index 0ebcb94a31..6e2204602b 100644
--- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
@@ -199,6 +199,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>7002000</version>
<microcodeVersion>43100245</microcodeVersion>
<package>v7.2.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
index 025ced01d9..6daef743bf 100644
--- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
@@ -199,6 +199,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>7002000</version>
<microcodeVersion>43100245</microcodeVersion>
<package>v7.2.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
index 5f45788b77..f28b8df68e 100644
--- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
@@ -203,6 +203,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>8000000</version>
<microcodeVersion>43100244</microcodeVersion>
<package>v8.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
index 7dee7f94c2..d6fbb11064 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
@@ -205,6 +205,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>8001000</version>
<microcodeVersion>43100245</microcodeVersion>
<package>v8.1.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
index 51e14736cd..27ecaee290 100644
--- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
@@ -208,6 +208,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>8002000</version>
<microcodeVersion>43100246</microcodeVersion>
<package>v8.2.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
index 4b64547b11..452e7384c0 100644
--- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
@@ -210,6 +210,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>9000000</version>
<microcodeVersion>43100245</microcodeVersion>
<package>v9.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml
index 06600f48fb..26883bd672 100644
--- a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml
@@ -208,6 +208,7 @@
<flag name='intel-iommu.dma-translation'/>
<flag name='machine-i8042-opt'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='amd-iommu'/>
<version>9001000</version>
<microcodeVersion>43100246</microcodeVersion>
<package>v9.1.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml
index 982b7ad436..1353761fab 100644
--- a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml
@@ -210,6 +210,7 @@
<flag name='snapshot-internal-qmp'/>
<flag name='chardev-reconnect-miliseconds'/>
<flag name='netdev-stream-reconnect-miliseconds'/>
+ <flag name='amd-iommu'/>
<version>9001090</version>
<microcodeVersion>43100247</microcodeVersion>
<package>v9.2.0-rc0-42-g3428a3894c</package>
--
2.50.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,111 @@
From 74aeb210bdbeba3389eff4f07860217dd8bb068e Mon Sep 17 00:00:00 2001
Message-ID: <74aeb210bdbeba3389eff4f07860217dd8bb068e.1747908718.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Fri, 4 Apr 2025 19:44:52 -0400
Subject: [PATCH] qemu: make passt+vhostuser reconnect behave identically to
passt+user
When "original passt" support was added, we decided that we always
wanted to reconnect (i.e. restart the passt process) if it was somehow
terminated. Generic vhost-user, on the other hand, only turns on
reconnect if specified by the user in the config. But there is no
reason to require the user to specify this if the other end of the
vhost-user socket is a passt process - we know what has happened and
what we want to do; no reason to do the *wrong* thing by default, and
force the user to make an arbitrary decision about what to add to the
config in order to make it do the *right* thing; instead we just
hardcode it to always do the right thing.
(NB: when the backend is passt, <interface type='vhostuser'> has
always ignored the reconnect setting in <source> when parsing and
formatting, just as it has always ignored the socket path (since that
also is not user configurable for the passt backend)
Resolves: https://issues.redhat.com/browse/RHEL-80169
Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 44abaa0128ac0fc8be9de4eebc15c03809bf5867)
Conflicts:
tests/qemuxmlconfdata/schema-reorder-domain-subelements.x86_64-latest.args:
This file (created by upstream commit be5332c81d28) was modified
upstream but doesin't exist downstream
https://issues.redhat.com/browse/RHEL-80169
Signed-off-by: Laine Stump <laine@redhat.com>
---
src/qemu/qemu_passt.c | 16 +++++++++++++---
.../net-vhostuser-passt.x86_64-latest.args | 6 +++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c
index bc495eca1e..fcc34de384 100644
--- a/src/qemu/qemu_passt.c
+++ b/src/qemu/qemu_passt.c
@@ -36,7 +36,7 @@ VIR_LOG_INIT("qemu.passt");
#define PASST "passt"
-
+#define QEMU_PASST_RECONNECT_TIMEOUT 5
static char *
qemuPasstCreatePidFilename(virDomainObj *vm,
@@ -106,11 +106,15 @@ qemuPasstAddNetProps(virDomainObj *vm,
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT)) {
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS)) {
- if (virJSONValueObjectAdd(netprops, "u:reconnect-ms", 5000, NULL) < 0)
+ if (virJSONValueObjectAdd(netprops, "u:reconnect-ms",
+ QEMU_PASST_RECONNECT_TIMEOUT * 1000, NULL) < 0) {
return -1;
+ }
} else {
- if (virJSONValueObjectAdd(netprops, "u:reconnect", 5, NULL) < 0)
+ if (virJSONValueObjectAdd(netprops, "u:reconnect",
+ QEMU_PASST_RECONNECT_TIMEOUT, NULL) < 0) {
return -1;
+ }
}
}
@@ -182,6 +186,12 @@ qemuPasstPrepareVhostUser(virDomainObj *vm,
*/
g_free(net->data.vhostuser->data.nix.path);
net->data.vhostuser->data.nix.path = qemuPasstCreateSocketPath(vm, net);
+
+ /* reconnect is always enabled, with timeout always at 5 seconds, when
+ * using passt
+ */
+ net->data.vhostuser->data.nix.reconnect.enabled = VIR_TRISTATE_BOOL_YES;
+ net->data.vhostuser->data.nix.reconnect.timeout = QEMU_PASST_RECONNECT_TIMEOUT;
}
int
diff --git a/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args b/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args
index 7c030d7067..afbbe188cf 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args
@@ -28,13 +28,13 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-boot strict=on \
-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \
-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-storage","id":"ide0-0-0","bootindex":1}' \
--chardev socket,id=charnet0,path=/var/run/libvirt/qemu/passt/-1-QEMUGuest1-net0.socket \
+-chardev socket,id=charnet0,path=/var/run/libvirt/qemu/passt/-1-QEMUGuest1-net0.socket,reconnect-ms=5000 \
-netdev '{"type":"vhost-user","chardev":"charnet0","id":"hostnet0"}' \
-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.0","addr":"0x2"}' \
--chardev socket,id=charnet1,path=/var/run/libvirt/qemu/passt/-1-QEMUGuest1-net1.socket \
+-chardev socket,id=charnet1,path=/var/run/libvirt/qemu/passt/-1-QEMUGuest1-net1.socket,reconnect-ms=5000 \
-netdev '{"type":"vhost-user","chardev":"charnet1","id":"hostnet1"}' \
-device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"00:11:22:33:44:11","bus":"pci.0","addr":"0x3"}' \
--chardev socket,id=charnet2,path=/var/run/libvirt/qemu/passt/-1-QEMUGuest1-net2.socket \
+-chardev socket,id=charnet2,path=/var/run/libvirt/qemu/passt/-1-QEMUGuest1-net2.socket,reconnect-ms=5000 \
-netdev '{"type":"vhost-user","chardev":"charnet2","id":"hostnet2"}' \
-device '{"driver":"virtio-net-pci","netdev":"hostnet2","id":"net2","mac":"00:11:22:33:44:11","bus":"pci.0","addr":"0x4"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
--
2.49.0

View File

@ -0,0 +1,119 @@
From a34cd486d22bf36ea64a6dd14541138fcca31b37 Mon Sep 17 00:00:00 2001
Message-ID: <a34cd486d22bf36ea64a6dd14541138fcca31b37.1747908718.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Fri, 4 Apr 2025 16:57:21 -0400
Subject: [PATCH] qemu: make processNetDevStreamDisconnectedEvent() reusable
We will be adding a new event whose response will be *exactly* the
same as the response to NETDEV_STREAM_DISCONNECTED. Rather than doing
a copy-paste of the complete function that does the processing, turn
that function into something more generic that takes the name of the
event as an arg (the event name is only used in log messages).
Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 03a6bc7752ec73d7ea222d5386e8f4124fe51c7f)
Conflicts:
src/qemu/qemu_driver.c:
In context surrounding a chunk, the arguments to
processNicRxFilterChangedEvent() changed upstream (due to upstream
commit 50981052a5f)
https://issues.redhat.com/browse/RHEL-80169
Signed-off-by: Laine Stump <laine@redhat.com>
---
src/qemu/qemu_driver.c | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 89bb10756e..3373dfb845 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3618,8 +3618,9 @@ processDeviceDeletedEvent(virQEMUDriver *driver,
static void
-processNetdevStreamDisconnectedEvent(virDomainObj *vm,
- const char *netdevId)
+processNetdevDisconnectedEvent(virDomainObj *vm,
+ const char *netdevId,
+ const char *eventName)
{
virDomainDeviceDef dev;
virDomainNetDef *def;
@@ -3634,13 +3635,13 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
*/
if (!devAlias) {
- VIR_WARN("Received NETDEV_STREAM_DISCONNECTED event for unrecognized netdev %s from domain %p %s",
- netdevId, vm, vm->def->name);
+ VIR_WARN("Received %s event for unrecognized netdev %s from domain %p %s",
+ eventName, netdevId, vm, vm->def->name);
return;
}
- VIR_DEBUG("Received NETDEV_STREAM_DISCONNECTED event for device %s from domain %p %s",
- devAlias, vm, vm->def->name);
+ VIR_DEBUG("Received %s event for device %s from domain %p %s",
+ eventName, devAlias, vm, vm->def->name);
if (virDomainObjBeginJob(vm, VIR_JOB_QUERY) < 0)
return;
@@ -3651,28 +3652,28 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
}
if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0) {
- VIR_WARN("NETDEV_STREAM_DISCONNECTED event received for non-existent device %s in domain %s",
- devAlias, vm->def->name);
+ VIR_WARN("%s event received for non-existent device %s in domain %s",
+ eventName, devAlias, vm->def->name);
goto endjob;
}
if (dev.type != VIR_DOMAIN_DEVICE_NET) {
- VIR_WARN("NETDEV_STREAM_DISCONNECTED event received for non-network device %s in domain %s",
- devAlias, vm->def->name);
+ VIR_WARN("%s event received for non-network device %s in domain %s",
+ eventName, devAlias, vm->def->name);
goto endjob;
}
def = dev.data.net;
if (def->backend.type != VIR_DOMAIN_NET_BACKEND_PASST) {
- VIR_DEBUG("ignore NETDEV_STREAM_DISCONNECTED event for non-passt network device %s in domain %s",
- def->info.alias, vm->def->name);
+ VIR_DEBUG("ignore %s event for non-passt network device %s in domain %s",
+ eventName, def->info.alias, vm->def->name);
goto endjob;
}
/* handle the event - restart the passt process with its original
* parameters
*/
- VIR_DEBUG("process NETDEV_STREAM_DISCONNECTED event for network device %s in domain %s",
- def->info.alias, vm->def->name);
+ VIR_DEBUG("process %s event for network device %s in domain %s",
+ eventName, def->info.alias, vm->def->name);
if (qemuPasstStart(vm, def) < 0)
goto endjob;
@@ -3682,6 +3683,14 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
}
+static void
+processNetdevStreamDisconnectedEvent(virDomainObj *vm,
+ const char *netdevId)
+{
+ processNetdevDisconnectedEvent(vm, netdevId, "NETDEV_STREAM_DISCONNECTED");
+}
+
+
static void
processNicRxFilterChangedEvent(virDomainObj *vm,
const char *devAlias)
--
2.49.0

View File

@ -0,0 +1,243 @@
From db00ca8dbb2feacf9307ce6e07058ff39ca7e3d6 Mon Sep 17 00:00:00 2001
Message-ID: <db00ca8dbb2feacf9307ce6e07058ff39ca7e3d6.1749039441.git.jdenemar@redhat.com>
From: Collin Walling <walling@linux.ibm.com>
Date: Mon, 16 Dec 2024 18:03:53 -0500
Subject: [PATCH] qemu: parse deprecated-props from query-cpu-model-expansion
response
query-cpu-model-expansion may report an array of deprecated properties.
This array is optional, and may not be supported for a particular
architecture or reported for a particular CPU model. If the output is
present, then capture it and store in a qemuMonitorCPUModelInfo struct
for later use.
The deprecated features will be retained in qemuCaps->kvm->hostCPU.info
and will be stored in the capabilities cache file under the <hostCPU>
element using the following format:
<deprecatedFeatures>
<property name='bpb'/>
<property name='csske'/>
<property name='cte'/>
<property name='te'/>
</deprecatedFeatures>
At this time the data is only queried, parsed, and cached. The data
will be utilized in a subsequent patch.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 45140d293007c1b29f7563bf6ee9640e27769b96)
JIRA: https://issues.redhat.com/browse/RHEL-89415
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
src/qemu/qemu_capabilities.c | 31 +++++++++++++++++++
src/qemu/qemu_monitor.c | 3 ++
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 18 +++++++++++
.../qemucapabilitiesdata/caps_9.1.0_s390x.xml | 6 ++++
.../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 6 ++++
6 files changed, 65 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b507027667..b1faea3ac7 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4029,6 +4029,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps,
const char *typeStr)
{
xmlNodePtr hostCPUNode;
+ xmlNodePtr deprecated_props;
g_autofree xmlNodePtr *nodes = NULL;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autoptr(qemuMonitorCPUModelInfo) hostCPU = NULL;
@@ -4121,6 +4122,24 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps,
}
}
+ ctxt->node = hostCPUNode;
+
+ if ((deprecated_props = virXPathNode("./deprecatedFeatures", ctxt))) {
+ g_autoptr(GPtrArray) props = virXMLNodeGetSubelementList(deprecated_props, NULL);
+
+ hostCPU->deprecated_props = g_new0(char *, props->len + 1);
+
+ for (i = 0; i < props->len; i++) {
+ xmlNodePtr prop = g_ptr_array_index(props, i);
+
+ if (!(hostCPU->deprecated_props[i] = virXMLPropString(prop, "name"))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("missing 'name' attribute for a host CPU model deprecated property in QEMU capabilities cache"));
+ return -1;
+ }
+ }
+ }
+
caps->hostCPU.info = g_steal_pointer(&hostCPU);
return 0;
}
@@ -4853,6 +4872,18 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel *caps,
virBufferAddLit(buf, "/>\n");
}
+ if (model->deprecated_props) {
+ virBufferAddLit(buf, "<deprecatedFeatures>\n");
+ virBufferAdjustIndent(buf, 2);
+
+ for (i = 0; i < g_strv_length(model->deprecated_props); i++)
+ virBufferAsprintf(buf, "<property name='%s'/>\n",
+ model->deprecated_props[i]);
+
+ virBufferAdjustIndent(buf, -2);
+ virBufferAddLit(buf, "</deprecatedFeatures>\n");
+ }
+
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</hostCPU>\n");
}
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index ed63b7a29b..3945aa92e5 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3319,6 +3319,7 @@ qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfo *model_info)
g_free(model_info->props[i].value.string);
}
+ g_strfreev(model_info->deprecated_props);
g_free(model_info->props);
g_free(model_info->name);
g_free(model_info);
@@ -3363,6 +3364,8 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig)
}
}
+ copy->deprecated_props = g_strdupv(orig->deprecated_props);
+
return copy;
}
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index bcb39409ac..acb3279e45 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1160,6 +1160,7 @@ struct _qemuMonitorCPUModelInfo {
char *name;
size_t nprops;
qemuMonitorCPUProperty *props;
+ GStrv deprecated_props;
bool migratability;
};
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 5df32922fb..edf6fac76e 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5130,6 +5130,7 @@ qemuMonitorJSONParseCPUModelExpansionData(virJSONValue *data,
bool fail_no_props,
virJSONValue **cpu_model,
virJSONValue **cpu_props,
+ virJSONValue **cpu_deprecated_props,
const char **cpu_name)
{
if (qemuMonitorJSONParseCPUModelData(data, "query-cpu-model-expansion",
@@ -5137,6 +5138,12 @@ qemuMonitorJSONParseCPUModelExpansionData(virJSONValue *data,
cpu_name) < 0)
return -1;
+ /*
+ * Unconditionally check for the deprecated-props array, as
+ * it is not a guarantee response even if QEMU supports it.
+ */
+ *cpu_deprecated_props = virJSONValueObjectGetArray(data, "deprecated-props");
+
return 0;
}
@@ -5144,6 +5151,7 @@ qemuMonitorJSONParseCPUModelExpansionData(virJSONValue *data,
static int
qemuMonitorJSONParseCPUModelExpansion(const char *cpu_name,
virJSONValue *cpu_props,
+ virJSONValue *cpu_deprecated_props,
qemuMonitorCPUModelInfo **model_info)
{
g_autoptr(qemuMonitorCPUModelInfo) expanded_model = NULL;
@@ -5151,6 +5159,12 @@ qemuMonitorJSONParseCPUModelExpansion(const char *cpu_name,
if (qemuMonitorJSONParseCPUModel(cpu_name, cpu_props, &expanded_model) < 0)
return -1;
+ if (cpu_deprecated_props &&
+ virJSONValueArraySize(cpu_deprecated_props) &&
+ (!(expanded_model->deprecated_props = virJSONValueArrayToStringList(cpu_deprecated_props)))) {
+ return -1;
+ }
+
*model_info = g_steal_pointer(&expanded_model);
return 0;
}
@@ -5215,6 +5229,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon,
g_autoptr(virJSONValue) fullData = NULL;
virJSONValue *cpu_model;
virJSONValue *cpu_props = NULL;
+ virJSONValue *cpu_deprecated_props = NULL;
const char *cpu_name = "";
int rc;
@@ -5228,6 +5243,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon,
if (qemuMonitorJSONParseCPUModelExpansionData(data, fail_no_props,
&cpu_model, &cpu_props,
+ &cpu_deprecated_props,
&cpu_name) < 0)
return -1;
@@ -5246,11 +5262,13 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon,
if (qemuMonitorJSONParseCPUModelExpansionData(fullData, fail_no_props,
&cpu_model, &cpu_props,
+ &cpu_deprecated_props,
&cpu_name) < 0)
return -1;
}
return qemuMonitorJSONParseCPUModelExpansion(cpu_name, cpu_props,
+ cpu_deprecated_props,
model_info);
}
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
index 50e9a60a1f..5e8db88e52 100644
--- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
@@ -193,6 +193,12 @@
<property name='te' type='boolean' value='true'/>
<property name='cmm' type='boolean' value='true'/>
<property name='vxpdeh2' type='boolean' value='true'/>
+ <deprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </deprecatedFeatures>
</hostCPU>
<cpu type='kvm' name='z13' typename='z13-s390x-cpu' usable='yes'/>
<cpu type='kvm' name='z990.3' typename='z990.3-s390x-cpu' usable='yes'/>
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
index 6d4f6726fb..79a149d187 100644
--- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
@@ -196,6 +196,12 @@
<property name='te' type='boolean' value='true'/>
<property name='cmm' type='boolean' value='true'/>
<property name='vxpdeh2' type='boolean' value='true'/>
+ <deprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </deprecatedFeatures>
</hostCPU>
<cpu type='kvm' name='z13' typename='z13-s390x-cpu' usable='yes'/>
<cpu type='kvm' name='z990.3' typename='z990.3-s390x-cpu' usable='yes'/>
--
2.49.0

View File

@ -0,0 +1,94 @@
From f61b747b0420d71efe33f836a1117d4741ecd716 Mon Sep 17 00:00:00 2001
Message-ID: <f61b747b0420d71efe33f836a1117d4741ecd716.1742990721.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 11 Mar 2025 09:04:18 +0100
Subject: [PATCH] qemu: process: Remove un-updated 'qemuProcessStartWarnShmem'
The checks in qemuProcessStartWarnShmem are no longer current. Since
previous patch made it fatal for vhost-user interfaces to be configured
without shared memory this warning code can be deleted.
Resolves: https://issues.redhat.com/browse/RHEL-80533
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 080c7fd341619a3d1986a00265addaf45b63aacf)
https://issues.redhat.com/browse/RHEL-84133
---
src/qemu/qemu_process.c | 54 -----------------------------------------
1 file changed, 54 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 722e982b9e..fac5678439 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5406,56 +5406,6 @@ qemuProcessMakeDir(virQEMUDriver *driver,
}
-static void
-qemuProcessStartWarnShmem(virDomainObj *vm)
-{
- size_t i;
- bool check_shmem = false;
- bool shmem = vm->def->nshmems;
-
- /*
- * For vhost-user to work, the domain has to have some type of
- * shared memory configured. We're not the proper ones to judge
- * whether shared hugepages or shm are enough and will be in the
- * future, so we'll just warn in case neither is configured.
- * Moreover failing would give the false illusion that libvirt is
- * really checking that everything works before running the domain
- * and not only we are unable to do that, but it's also not our
- * aim to do so.
- */
- for (i = 0; i < vm->def->nnets; i++) {
- if (virDomainNetGetActualType(vm->def->nets[i]) ==
- VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
- check_shmem = true;
- break;
- }
- }
-
- if (!check_shmem)
- return;
-
- /*
- * This check is by no means complete. We merely check
- * whether there are *some* hugepages enabled and *some* NUMA
- * nodes with shared memory access.
- */
- if (!shmem && vm->def->mem.nhugepages) {
- for (i = 0; i < virDomainNumaGetNodeCount(vm->def->numa); i++) {
- if (virDomainNumaGetNodeMemoryAccessMode(vm->def->numa, i) ==
- VIR_DOMAIN_MEMORY_ACCESS_SHARED) {
- shmem = true;
- break;
- }
- }
- }
-
- if (!shmem) {
- VIR_WARN("Detected vhost-user interface without any shared memory, "
- "the interface might not be operational");
- }
-}
-
-
static int
qemuProcessStartValidateGraphics(virDomainObj *vm)
{
@@ -5690,10 +5640,6 @@ qemuProcessStartValidate(virQEMUDriver *driver,
if (qemuProcessStartValidateTSC(driver, vm) < 0)
return -1;
- VIR_DEBUG("Checking for any possible (non-fatal) issues");
-
- qemuProcessStartWarnShmem(vm);
-
return 0;
}
--
2.49.0

View File

@ -0,0 +1,110 @@
From 0cc716142961427bd257a528ef54b87b3a053ade Mon Sep 17 00:00:00 2001
Message-ID: <0cc716142961427bd257a528ef54b87b3a053ade.1747908718.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Fri, 4 Apr 2025 19:38:28 -0400
Subject: [PATCH] qemu: put vhost-user code that's special for passt in a
helper function
Rather than duplicating these two lines of chr device object setup for
hotplug and domain start, put them in a helper function that's called
from both places. That way when we need to setup *more* stuff specific
to passt+vhostuser, we can just add it in that one place.
Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 95ff77f2896478e039673bb552affec2c5a5e822)
https://issues.redhat.com/browse/RHEL-80169
Signed-off-by: Laine Stump <laine@redhat.com>
---
src/qemu/qemu_hotplug.c | 7 +------
src/qemu/qemu_passt.c | 19 +++++++++++++++++++
src/qemu/qemu_passt.h | 3 +++
src/qemu/qemu_process.c | 9 ++-------
4 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c8746f5e22..ff09b58bfe 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1264,12 +1264,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
if (net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) {
- /* vhostuser needs socket path in this location, and when
- * backend is passt, the path is derived from other info,
- * not taken from config.
- */
- g_free(net->data.vhostuser->data.nix.path);
- net->data.vhostuser->data.nix.path = qemuPasstCreateSocketPath(vm, net);
+ qemuPasstPrepareVhostUser(vm, net);
if (qemuPasstStart(vm, net) < 0)
goto cleanup;
diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c
index b9616d1c63..bc495eca1e 100644
--- a/src/qemu/qemu_passt.c
+++ b/src/qemu/qemu_passt.c
@@ -165,6 +165,25 @@ qemuPasstSetupCgroup(virDomainObj *vm,
}
+void
+qemuPasstPrepareVhostUser(virDomainObj *vm,
+ virDomainNetDef *net)
+{
+ /* There are some options on the QEMU commandline for a vhost-user
+ * chr device that are normally configurable, but when it is passt
+ * speaking to the vhost-user device those things are
+ * derived/fixed. This function, which is called prior to
+ * generating the QEMU commandline, sets thos derived/fixed things
+ * in the chr device object.
+ */
+
+ /* The socket path is not user-configurable for passt - it is
+ * derived from other info
+ */
+ g_free(net->data.vhostuser->data.nix.path);
+ net->data.vhostuser->data.nix.path = qemuPasstCreateSocketPath(vm, net);
+}
+
int
qemuPasstStart(virDomainObj *vm,
virDomainNetDef *net)
diff --git a/src/qemu/qemu_passt.h b/src/qemu/qemu_passt.h
index e0b9aaac8d..ea545ccf38 100644
--- a/src/qemu/qemu_passt.h
+++ b/src/qemu/qemu_passt.h
@@ -37,5 +37,8 @@ int qemuPasstSetupCgroup(virDomainObj *vm,
virDomainNetDef *net,
virCgroup *cgroup);
+void qemuPasstPrepareVhostUser(virDomainObj *vm,
+ virDomainNetDef *net);
+
char *qemuPasstCreateSocketPath(virDomainObj *vm,
virDomainNetDef *net);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 2076ad8208..c1ae324ad4 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5898,13 +5898,8 @@ qemuProcessPrepareDomainNetwork(virDomainObj *vm)
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
if (net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) {
- /* when using the passt backend, the path of the
- * unix socket is always derived from other info
- * *not* manually given in the config, but all the
- * vhostuser code looks for it there.
- */
- g_free(net->data.vhostuser->data.nix.path);
- net->data.vhostuser->data.nix.path = qemuPasstCreateSocketPath(vm, net);
+ /* some extra setup of internal data for passt vhostuser mode */
+ qemuPasstPrepareVhostUser(vm, net);
}
break;
--
2.49.0

View File

@ -0,0 +1,56 @@
From 13ff514007822c650ad0f3006882e2f85aab9b48 Mon Sep 17 00:00:00 2001
Message-ID: <13ff514007822c650ad0f3006882e2f85aab9b48.1747908718.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Fri, 4 Apr 2025 16:48:23 -0400
Subject: [PATCH] qemu: remove nonsensical sanity check in
processNetdevStreamDisconnectedEvent()
By definition QEMU will never send a NETDEV_STREAM_DISCONNECTED event
if it doesn't support the reconnect option for a stream netdev. And
even if, by some comedy of errors, it did send
NETDEV_STREAM_DISCONNECTED in that case, our response to the event
doesn't request anything at all of QEMU (much less something that
would fail if QEMU didn't understand NETDEV_STREAM_DISCONNECTED) - it
just starts a new passt process to replace the one that has been
terminated, so we don't need to check the QEMU capabilities for
QEMU_CAPS_NETDEV_STREAM_RECONNECT.
Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 51a54dc1c4ecf37d60acee1cb94252e51c5ef627)
https://issues.redhat.com/browse/RHEL-80169
Signed-off-by: Laine Stump <laine@redhat.com>
---
src/qemu/qemu_driver.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 11dbbc1aab..89bb10756e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3623,7 +3623,6 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
{
virDomainDeviceDef dev;
virDomainNetDef *def;
- virQEMUCaps *qemuCaps = QEMU_DOMAIN_PRIVATE(vm)->qemuCaps;
const char *devAlias = STRSKIP(netdevId, "host");
/* The event sends us the "netdev-id", but we don't store the
@@ -3669,12 +3668,6 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
goto endjob;
}
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT)) {
- VIR_WARN("ignore NETDEV_STREAM_DISCONNECTED event for passt network device %s in domain %s - QEMU binary does not support reconnect",
- def->info.alias, vm->def->name);
- goto endjob;
- }
-
/* handle the event - restart the passt process with its original
* parameters
*/
--
2.49.0

View File

@ -0,0 +1,224 @@
From 1be043d47792afe408bef01a5c169dcd4e98e782 Mon Sep 17 00:00:00 2001
Message-ID: <1be043d47792afe408bef01a5c169dcd4e98e782.1747908718.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Fri, 4 Apr 2025 17:16:43 -0400
Subject: [PATCH] qemu: respond to NETDEV_VHOST_USER_DISCONNECTED event
This response to this event is identical to NETDEV_STREAM_DISCONNECTED
(start a new passt process to replace the one that just disappeared -
see commitf62ce81b8a5), except that the new passt process will have
"--vhost-user" appended to the commandline. Fortunately that
difference is already handled based on the virDomainNetDef contents,
so we can, in fact, respond to the new event in exactly the same
manner.
Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit dedf1ada95f046310827194eb8794fa18975b9e7)
Conflicts:
src/qemu/qemu_driver.c:
In context surrounding a chunk, the arguments to
processNicRxFilterChangedEvent() changed upstream (due to upstream
commit 50981052a5f)
https://issues.redhat.com/browse/RHEL-80169
Signed-off-by: Laine Stump <laine@redhat.com>
---
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 11 +++++++++++
src/qemu/qemu_monitor.c | 11 +++++++++++
src/qemu/qemu_monitor.h | 6 ++++++
src/qemu/qemu_monitor_json.c | 16 ++++++++++++++++
src/qemu/qemu_process.c | 18 ++++++++++++++++++
7 files changed, 64 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 4234e4605b..cc47adb724 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10038,6 +10038,7 @@ qemuProcessEventFree(struct qemuProcessEvent *event)
case QEMU_PROCESS_EVENT_WATCHDOG:
case QEMU_PROCESS_EVENT_DEVICE_DELETED:
case QEMU_PROCESS_EVENT_NETDEV_STREAM_DISCONNECTED:
+ case QEMU_PROCESS_EVENT_NETDEV_VHOST_USER_DISCONNECTED:
case QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED:
case QEMU_PROCESS_EVENT_SERIAL_CHANGED:
case QEMU_PROCESS_EVENT_GUEST_CRASHLOADED:
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 6246988491..63f422bbcb 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -465,6 +465,7 @@ typedef enum {
QEMU_PROCESS_EVENT_GUESTPANIC,
QEMU_PROCESS_EVENT_DEVICE_DELETED,
QEMU_PROCESS_EVENT_NETDEV_STREAM_DISCONNECTED,
+ QEMU_PROCESS_EVENT_NETDEV_VHOST_USER_DISCONNECTED,
QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED,
QEMU_PROCESS_EVENT_SERIAL_CHANGED,
QEMU_PROCESS_EVENT_JOB_STATUS_CHANGE,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3373dfb845..b374b1978c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3691,6 +3691,14 @@ processNetdevStreamDisconnectedEvent(virDomainObj *vm,
}
+static void
+processNetdevVhostUserDisconnectedEvent(virDomainObj *vm,
+ const char *netdevId)
+{
+ processNetdevDisconnectedEvent(vm, netdevId, "NETDEV_VHOST_USER_DISCONNECTED");
+}
+
+
static void
processNicRxFilterChangedEvent(virDomainObj *vm,
const char *devAlias)
@@ -4089,6 +4097,9 @@ static void qemuProcessEventHandler(void *data, void *opaque)
case QEMU_PROCESS_EVENT_NETDEV_STREAM_DISCONNECTED:
processNetdevStreamDisconnectedEvent(vm, processEvent->data);
break;
+ case QEMU_PROCESS_EVENT_NETDEV_VHOST_USER_DISCONNECTED:
+ processNetdevVhostUserDisconnectedEvent(vm, processEvent->data);
+ break;
case QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED:
processNicRxFilterChangedEvent(vm, processEvent->data);
break;
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 82aa1cbc5f..ed63b7a29b 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1267,6 +1267,17 @@ qemuMonitorEmitNetdevStreamDisconnected(qemuMonitor *mon,
}
+void
+qemuMonitorEmitNetdevVhostUserDisconnected(qemuMonitor *mon,
+ const char *devAlias)
+{
+ VIR_DEBUG("mon=%p", mon);
+
+ QEMU_MONITOR_CALLBACK(mon, domainNetdevVhostUserDisconnected,
+ mon->vm, devAlias);
+}
+
+
void
qemuMonitorEmitSerialChange(qemuMonitor *mon,
const char *devAlias,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 672cd6487e..bcb39409ac 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -255,6 +255,9 @@ typedef void (*qemuMonitorDomainDeviceUnplugErrCallback)(qemuMonitor *mon,
typedef void (*qemuMonitorDomainNetdevStreamDisconnectedCallback)(qemuMonitor *mon,
virDomainObj *vm,
const char *devAlias);
+typedef void (*qemuMonitorDomainNetdevVhostUserDisconnectedCallback)(qemuMonitor *mon,
+ virDomainObj *vm,
+ const char *devAlias);
typedef void (*qemuMonitorDomainNicRxFilterChangedCallback)(qemuMonitor *mon,
virDomainObj *vm,
const char *devAlias);
@@ -403,6 +406,7 @@ struct _qemuMonitorCallbacks {
qemuMonitorDomainMemoryDeviceSizeChange domainMemoryDeviceSizeChange;
qemuMonitorDomainDeviceUnplugErrCallback domainDeviceUnplugError;
qemuMonitorDomainNetdevStreamDisconnectedCallback domainNetdevStreamDisconnected;
+ qemuMonitorDomainNetdevVhostUserDisconnectedCallback domainNetdevVhostUserDisconnected;
};
qemuMonitor *qemuMonitorOpen(virDomainObj *vm,
@@ -490,6 +494,8 @@ void qemuMonitorEmitDeviceUnplugErr(qemuMonitor *mon,
const char *devAlias);
void qemuMonitorEmitNetdevStreamDisconnected(qemuMonitor *mon,
const char *devAlias);
+void qemuMonitorEmitNetdevVhostUserDisconnected(qemuMonitor *mon,
+ const char *devAlias);
void qemuMonitorEmitNicRxFilterChanged(qemuMonitor *mon,
const char *devAlias);
void qemuMonitorEmitSerialChange(qemuMonitor *mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 6f9f495888..be5d3be7e6 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -85,6 +85,7 @@ static void qemuMonitorJSONHandleMemoryFailure(qemuMonitor *mon, virJSONValue *d
static void qemuMonitorJSONHandleMemoryDeviceSizeChange(qemuMonitor *mon, virJSONValue *data);
static void qemuMonitorJSONHandleDeviceUnplugErr(qemuMonitor *mon, virJSONValue *data);
static void qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMonitor *mon, virJSONValue *data);
+static void qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemuMonitor *mon, virJSONValue *data);
typedef struct {
const char *type;
@@ -108,6 +109,7 @@ static qemuEventHandler eventHandlers[] = {
{ "MIGRATION", qemuMonitorJSONHandleMigrationStatus, },
{ "MIGRATION_PASS", qemuMonitorJSONHandleMigrationPass, },
{ "NETDEV_STREAM_DISCONNECTED", qemuMonitorJSONHandleNetdevStreamDisconnected, },
+ { "NETDEV_VHOST_USER_DISCONNECTED", qemuMonitorJSONHandleNetdevVhostUserDisconnected, },
{ "NIC_RX_FILTER_CHANGED", qemuMonitorJSONHandleNicRxFilterChanged, },
{ "PR_MANAGER_STATUS_CHANGED", qemuMonitorJSONHandlePRManagerStatusChanged, },
{ "RDMA_GID_STATUS_CHANGED", qemuMonitorJSONHandleRdmaGidStatusChanged, },
@@ -1044,6 +1046,20 @@ qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMonitor *mon, virJSONValue *da
}
+static void
+qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemuMonitor *mon, virJSONValue *data)
+{
+ const char *name;
+
+ if (!(name = virJSONValueObjectGetString(data, "netdev-id"))) {
+ VIR_WARN("missing device in NETDEV_VHOST_USER_DISCONNECTED event");
+ return;
+ }
+
+ qemuMonitorEmitNetdevVhostUserDisconnected(mon, name);
+}
+
+
static void
qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitor *mon, virJSONValue *data)
{
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ad7e99750f..2076ad8208 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1402,6 +1402,23 @@ qemuProcessHandleNetdevStreamDisconnected(qemuMonitor *mon G_GNUC_UNUSED,
}
+static void
+qemuProcessHandleNetdevVhostUserDisconnected(qemuMonitor *mon G_GNUC_UNUSED,
+ virDomainObj *vm,
+ const char *devAlias)
+{
+ virObjectLock(vm);
+
+ VIR_DEBUG("Device %s Netdev vhost-user Disconnected in domain %p %s",
+ devAlias, vm, vm->def->name);
+
+ qemuProcessEventSubmit(vm, QEMU_PROCESS_EVENT_NETDEV_VHOST_USER_DISCONNECTED,
+ 0, 0, g_strdup(devAlias));
+
+ virObjectUnlock(vm);
+}
+
+
static void
qemuProcessHandleNicRxFilterChanged(qemuMonitor *mon G_GNUC_UNUSED,
virDomainObj *vm,
@@ -1848,6 +1865,7 @@ static qemuMonitorCallbacks monitorCallbacks = {
.domainMemoryDeviceSizeChange = qemuProcessHandleMemoryDeviceSizeChange,
.domainDeviceUnplugError = qemuProcessHandleDeviceUnplugErr,
.domainNetdevStreamDisconnected = qemuProcessHandleNetdevStreamDisconnected,
+ .domainNetdevVhostUserDisconnected = qemuProcessHandleNetdevVhostUserDisconnected,
};
static void
--
2.49.0

View File

@ -0,0 +1,326 @@
From 6921381e6831f942029b922e6f0ef6b7ca0c6c58 Mon Sep 17 00:00:00 2001
Message-ID: <6921381e6831f942029b922e6f0ef6b7ca0c6c58.1755522824.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 16 Jul 2025 16:30:52 +0100
Subject: [PATCH] qemu: sanitize blank lines in config file
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We mostly use 2 blank lines between config file entries to
improve readability. Fix where we don't do that.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 0b9cfa791f2bd135ea36fe03fd1a8d6c8bf5e3d6)
Resolves: https://issues.redhat.com/browse/RHEL-106276
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/qemu/qemu.conf.in | 41 ++++++++++++++++++++++++++++++++++++++---
1 file changed, 38 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in
index 3365834200..988d176a28 100644
--- a/src/qemu/qemu.conf.in
+++ b/src/qemu/qemu.conf.in
@@ -48,7 +48,7 @@
#
#default_tls_x509_verify = 1
-#
+
# Libvirt assumes the server-key.pem file is unencrypted by default.
# To use an encrypted server-key.pem file, the password to decrypt
# the PEM file is required. This can be provided by creating a secret
@@ -71,6 +71,7 @@
#
#vnc_listen = "0.0.0.0"
+
# Enable this option to have VNC served over an automatically created
# unix socket. This prevents unprivileged access from users on the
# host machine, though most VNC clients do not support it.
@@ -81,6 +82,7 @@
#
#vnc_auto_unix_socket = 1
+
# Enable use of TLS encryption on the VNC server. This requires
# a VNC client which supports the VeNCrypt protocol extension.
# Examples include vinagre, virt-viewer, virt-manager and vencrypt
@@ -222,6 +224,7 @@
#
#spice_sasl = 1
+
# The default SASL configuration file is located in /etc/sasl2/
# When running libvirtd unprivileged, it may be desirable to
# override the configs in this location. Set this parameter to
@@ -229,6 +232,7 @@
#
#spice_sasl_dir = "/some/directory/sasl2"
+
# Enable use of TLS encryption on the chardev TCP transports.
#
# It is necessary to setup CA and issue a server certificate
@@ -468,6 +472,7 @@
#remote_display_port_min = 5900
#remote_display_port_max = 65535
+
# VNC WebSocket port policies, same rules apply as with remote display
# ports. VNC WebSockets use similar display <-> port mappings, with
# the exception being that ports start from 5700 instead of 5900.
@@ -475,6 +480,7 @@
#remote_websocket_port_min = 5700
#remote_websocket_port_max = 65535
+
# The default security driver is SELinux. If SELinux is disabled
# on the host, then the security driver will automatically disable
# itself. If you wish to disable QEMU SELinux security driver while
@@ -492,15 +498,18 @@
#
#security_driver = "selinux"
+
# If set to non-zero, then the default security labeling
# will make guests confined. If set to zero, then guests
# will be unconfined by default. Defaults to 1.
#security_default_confined = 1
+
# If set to non-zero, then attempts to create unconfined
# guests will be blocked. Defaults to 0.
#security_require_confined = 1
+
# The user for QEMU processes run by the system instance. It can be
# specified as a user name or as a user id. The qemu driver will try to
# parse this value first as a name and then, if the name doesn't exist,
@@ -518,20 +527,24 @@
#
#user = "@QEMU_USER@"
+
# The group for QEMU processes run by the system instance. It can be
# specified in a similar way to user.
#group = "@QEMU_GROUP@"
+
# Whether libvirt should dynamically change file ownership
# to match the configured user/group above. Defaults to 1.
# Set to 0 to disable file ownership changes.
#dynamic_ownership = 1
+
# Whether libvirt should remember and restore the original
# ownership over files it is relabeling. Defaults to 1, set
# to 0 to disable the feature.
#remember_owner = 1
+
# What cgroup controllers to make use of with QEMU guests
#
# - 'cpu' - use for scheduler tunables
@@ -553,6 +566,7 @@
#
#cgroup_controllers = [ "cpu", "devices", "memory", "blkio", "cpuset", "cpuacct" ]
+
# This is the basic set of devices allowed / required by
# all virtual machines.
#
@@ -612,12 +626,14 @@
#dump_image_format = "raw"
#snapshot_image_format = "raw"
+
# When a domain is configured to be auto-dumped when libvirtd receives a
# watchdog event from qemu guest, libvirtd will save dump files in directory
# specified by auto_dump_path. Default value is /var/lib/libvirt/qemu/dump
#
#auto_dump_path = "/var/lib/libvirt/qemu/dump"
+
# When a domain is configured to be auto-dumped, enabling this flag
# has the same effect as using the VIR_DUMP_BYPASS_CACHE flag with the
# virDomainCoreDump API. That is, the system will avoid using the
@@ -626,6 +642,7 @@
#
#auto_dump_bypass_cache = 0
+
# When a domain is configured to be auto-started, enabling this flag
# has the same effect as using the VIR_DOMAIN_START_BYPASS_CACHE flag
# with the virDomainCreateWithFlags API. That is, the system will
@@ -634,6 +651,7 @@
#
#auto_start_bypass_cache = 0
+
# If provided by the host and a hugetlbfs mount point is configured,
# a guest may request huge page backing. When this mount point is
# unspecified here, determination of a host mount point in /proc/mounts
@@ -682,6 +700,7 @@
#max_processes = 0
#max_files = 0
+
# If max_threads_per_process is set to a positive integer, libvirt
# will use it to set the maximum number of threads that can be
# created by a qemu process. Some VM configurations can result in
@@ -692,6 +711,7 @@
#
#max_threads_per_process = 0
+
# If max_core is set to a non-zero integer, then QEMU will be
# permitted to create core dumps when it crashes, provided its
# RAM size is smaller than the limit set.
@@ -716,6 +736,7 @@
#
#max_core = "unlimited"
+
# Determine if guest RAM is included in QEMU core dumps. By
# default guest RAM will be excluded if a new enough QEMU is
# present and host kernel supports it. Setting this to '1' will
@@ -726,6 +747,7 @@
#
#dump_guest_core = 1
+
# mac_filter enables MAC addressed based filtering on bridge ports.
# This currently requires ebtables to be installed.
#
@@ -755,6 +777,7 @@
#
#max_queued = 0
+
###################################################################
# Keepalive protocol:
# This allows qemu driver to detect broken connections to remote
@@ -778,7 +801,6 @@
#keepalive_count = 5
-
# Use seccomp syscall filtering sandbox in QEMU.
# 1 == filter enabled, 0 == filter disabled
#
@@ -813,7 +835,6 @@
#migration_port_max = 49215
-
# Timestamp QEMU's log messages (if QEMU supports it)
#
# Defaults to 1.
@@ -853,6 +874,7 @@
# "/usr/share/AAVMF/AAVMF32_CODE.fd:/usr/share/AAVMF/AAVMF32_VARS.fd"
#]
+
# The backend to use for handling stdout/stderr output from
# QEMU processes.
#
@@ -868,6 +890,7 @@
#
#stdio_handler = "logd"
+
# QEMU gluster libgfapi log level, debug levels are 0-9, with 9 being the
# most verbose, and 0 representing no debugging output.
#
@@ -888,6 +911,7 @@
#
#gluster_debug_level = 9
+
# virtiofsd debug
#
# Whether to enable the debugging output of the virtiofsd daemon.
@@ -895,6 +919,7 @@
#
#virtiofsd_debug = 1
+
# To enhance security, QEMU driver is capable of creating private namespaces
# for each domain started. Well, so far only "mount" namespace is supported. If
# enabled it means qemu process is unable to see all the devices on the system,
@@ -903,24 +928,29 @@
# by default.
#namespaces = [ "mount" ]
+
# This directory is used for memoryBacking source if configured as file.
# NOTE: big files will be stored here
#memory_backing_dir = "/var/lib/libvirt/qemu/ram"
+
# Path to the SCSI persistent reservations helper. This helper is
# used whenever <reservations/> are enabled for SCSI LUN devices.
# If this is not an absolute path, the program will be searched for
# in $PATH as well as a few additional directories.
#pr_helper = "qemu-pr-helper"
+
# Path to the SLIRP networking helper.
#slirp_helper = "/usr/bin/slirp-helper"
+
# Path to the dbus-daemon
# If this is not an absolute path, the program will be searched for
# in $PATH.
#dbus_daemon = "dbus-daemon"
+
# User for the swtpm TPM Emulator
#
# Default is 'tss'; this is the same user that tcsd (TrouSerS) installs
@@ -929,6 +959,7 @@
#swtpm_user = "tss"
#swtpm_group = "tss"
+
# For debugging and testing purposes it's sometimes useful to be able to disable
# libvirt behaviour based on the capabilities of the qemu process. This option
# allows to do so. DO _NOT_ use in production and beaware that the behaviour
@@ -936,6 +967,7 @@
#
#capability_filters = [ "capname" ]
+
# 'deprecation_behavior' setting controls how the qemu process behaves towards
# deprecated commands and arguments used by libvirt.
#
@@ -967,6 +999,7 @@
#
#deprecation_behavior = "none"
+
# If this is set then QEMU and its threads will run in a separate scheduling
# group meaning no other process will share Hyper Threads of a single core with
# QEMU. Each QEMU has its own group.
@@ -983,6 +1016,7 @@
# scheduling group
#sched_core = "none"
+
# Using nbdkit to access remote disk sources
#
# If this is set then libvirt will use nbdkit to access remote disk sources
@@ -994,6 +1028,7 @@
#
#storage_use_nbdkit = @USE_NBDKIT_DEFAULT@
+
# libvirt will normally prevent migration if the storage backing the VM is not
# on a shared filesystems. Sometimes, however, the storage *is* shared despite
# not being detected as such: for example, this is the case when one of the
--
2.50.1

View File

@ -0,0 +1,75 @@
From c9c9405687b78713b913c09113697fcadec1cdba Mon Sep 17 00:00:00 2001
Message-ID: <c9c9405687b78713b913c09113697fcadec1cdba.1741876175.git.jdenemar@redhat.com>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Wed, 26 Feb 2025 11:04:52 +0100
Subject: [PATCH] qemu: snapshot: error out early when reverting snapshot for
VM with non-file disk
Before this patch the code would start the revert process by destroying
the VM and preparing to revert where it would fail with following error:
error: unsupported configuration: source for disk 'sdb' is not a regular file; refusing to generate external snapshot name
and leaving user with offline VM even if it was running.
Make the check before we start the revert process to not destroy VMs.
Resolves: https://issues.redhat.com/browse/RHEL-30971
Resolves: https://issues.redhat.com/browse/RHEL-79928
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 278b8334eb26aa9495f6d37e4f72471cbc8739a6)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
src/qemu/qemu_snapshot.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 3a8510c69e..16d3aaf6e7 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -2190,6 +2190,8 @@ qemuSnapshotRevertValidate(virDomainObj *vm,
virDomainSnapshotDef *snapdef,
unsigned int flags)
{
+ size_t i;
+
if (!vm->persistent &&
snapdef->state != VIR_DOMAIN_SNAPSHOT_RUNNING &&
snapdef->state != VIR_DOMAIN_SNAPSHOT_PAUSED &&
@@ -2217,6 +2219,22 @@ qemuSnapshotRevertValidate(virDomainObj *vm,
}
}
+ /* Reverting to external snapshot creates overlay files for every disk and
+ * it would fail for non-file based disks.
+ * See qemuSnapshotRevertExternalPrepare for more details. */
+ if (virDomainSnapshotIsExternal(snap)) {
+ for (i = 0; i < snap->def->dom->ndisks; i++) {
+ virDomainDiskDef *disk = snap->def->dom->disks[i];
+
+ if (disk->src->type != VIR_STORAGE_TYPE_FILE) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("source disk for '%1$s' is not a regular file, reverting to snapshot is not supported"),
+ disk->dst);
+ return -1;
+ }
+ }
+ }
+
return 0;
}
@@ -2368,6 +2386,9 @@ qemuSnapshotRevertExternalPrepare(virDomainObj *vm,
if (virDomainMomentDefPostParse(&tmpsnapdef->parent) < 0)
return -1;
+ /* Force default location to be external in order to create overlay files
+ * for every disk. In qemuSnapshotRevertValidate we make sure that each
+ * disk is regular file otherwise this would fail. */
if (virDomainSnapshotAlignDisks(tmpsnapdef, domdef,
VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL,
false, true) < 0) {
--
2.48.1

View File

@ -0,0 +1,108 @@
From d50549c9b0e601bc3a6ae5ee97d1ff2f75645f57 Mon Sep 17 00:00:00 2001
Message-ID: <d50549c9b0e601bc3a6ae5ee97d1ff2f75645f57.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 17 Feb 2025 16:58:27 +0000
Subject: [PATCH] qemu: support MSDM ACPI table type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The MSDM ACPI table is a replacement for the SLIC table type, now
sometimes used by Microsoft for Windows Licensing checks:
https://learn.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653305(v=vs.85)
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/748
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 288f90feb32e38dfd246cbfb68f38caca43cef70)
Resolves: https://issues.redhat.com/browse/RHEL-81041
---
docs/formatdomain.rst | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_validate.c | 2 +-
tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args | 1 +
tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml | 1 +
tests/qemuxmlconfdata/acpi-table-many.xml | 1 +
6 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index c144851b62..961d20a41d 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -500,7 +500,7 @@ These options apply to any form of booting of the guest OS.
* ``msdm``: a single ACPI table with header and data, providing
Microsoft Data Management information. The ACPI table signature
in the header will be forced to ``MSDM``
- (:since:`Since 11.2.0`).
+ (:since:`Since 11.2.0 (QEMU)`).
Each type may be used only once, except for ``raw`` which can
appear multiple times.
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9fe191d3b9..b7d61edd19 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -133,7 +133,7 @@ VIR_ENUM_IMPL(qemuACPITableSIG,
"", /* raw */
"", /* rawset */
"SLIC",
- "");
+ "MSDM");
const char *
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 378f502ea7..f814ee8c0d 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -731,10 +731,10 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
switch (def->os.acpiTables[i]->type) {
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_MSDM:
break;
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
- case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_MSDM:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("ACPI table type '%1$s' is not supported"),
virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
diff --git a/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args b/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args
index 4d5d02cb3c..2b0b433258 100644
--- a/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args
@@ -30,6 +30,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-acpitable file=/var/lib/libvirt/acpi/exm2.dat \
-acpitable file=/var/lib/libvirt/acpi/exm3.dat \
-acpitable sig=SLIC,file=/var/lib/libvirt/acpi/slic.dat \
+-acpitable sig=MSDM,file=/var/lib/libvirt/acpi/msdm.dat \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
diff --git a/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml b/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml
index b7f7e18d28..084bb4cda3 100644
--- a/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml
+++ b/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml
@@ -11,6 +11,7 @@
<table type='raw'>/var/lib/libvirt/acpi/exm2.dat</table>
<table type='raw'>/var/lib/libvirt/acpi/exm3.dat</table>
<table type='slic'>/var/lib/libvirt/acpi/slic.dat</table>
+ <table type='msdm'>/var/lib/libvirt/acpi/msdm.dat</table>
</acpi>
<boot dev='hd'/>
</os>
diff --git a/tests/qemuxmlconfdata/acpi-table-many.xml b/tests/qemuxmlconfdata/acpi-table-many.xml
index cc75011990..890078d4c3 100644
--- a/tests/qemuxmlconfdata/acpi-table-many.xml
+++ b/tests/qemuxmlconfdata/acpi-table-many.xml
@@ -12,6 +12,7 @@
<table type='raw'>/var/lib/libvirt/acpi/exm2.dat</table>
<table type='raw'>/var/lib/libvirt/acpi/exm3.dat</table>
<table type='slic'>/var/lib/libvirt/acpi/slic.dat</table>
+ <table type='msdm'>/var/lib/libvirt/acpi/msdm.dat</table>
</acpi>
</os>
<features>
--
2.49.0

View File

@ -0,0 +1,218 @@
From b83e3e1644dc33a41fa4ccd62407aeca218bbd4c Mon Sep 17 00:00:00 2001
Message-ID: <b83e3e1644dc33a41fa4ccd62407aeca218bbd4c.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 26 Feb 2025 19:10:42 +0000
Subject: [PATCH] qemu: support 'raw' ACPI table type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This allows passing a single ACPI table of any type through to QEMU with
the signture autodetected from the header.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit fe0cf62e0f8a6c4bbc2f297f46761f41691e3193)
Resolves: https://issues.redhat.com/browse/RHEL-81041
---
docs/formatdomain.rst | 2 +-
src/qemu/qemu_command.c | 6 ++-
src/qemu/qemu_validate.c | 2 +-
.../acpi-table-many.x86_64-latest.args | 36 ++++++++++++++++
.../acpi-table-many.x86_64-latest.xml | 41 +++++++++++++++++++
tests/qemuxmlconfdata/acpi-table-many.xml | 33 +++++++++++++++
tests/qemuxmlconftest.c | 1 +
7 files changed, 117 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/acpi-table-many.xml
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index b6e162235c..ff06efb69f 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -489,7 +489,7 @@ These options apply to any form of booting of the guest OS.
file:
* ``raw``: a single ACPI table with header and data, with ACPI
- signature auto-detected from header (:since:`Since 11.2.0`).
+ signature auto-detected from header (:since:`Since 11.2.0 (QEMU)`).
* ``rawset``: concatenation of multiple ACPI tables with header
and data, each with any ACPI signature, auto-detected from header
(:since:`Since 11.2.0`).
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 94fb7fc4c2..adf7b21b14 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6011,9 +6011,11 @@ qemuBuildBootCommandLine(virCommand *cmd,
virCommandAddArgList(cmd, "-dtb", def->os.dtb, NULL);
for (i = 0; i < def->os.nacpiTables; i++) {
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
+ const char *sig = qemuACPITableSIGTypeToString(def->os.acpiTables[i]->type);
virCommandAddArg(cmd, "-acpitable");
- virBufferAsprintf(&buf, "sig=%s,file=",
- qemuACPITableSIGTypeToString(def->os.acpiTables[i]->type));
+ if (*sig != '\0')
+ virBufferAsprintf(&buf, "sig=%s,", sig);
+ virBufferAddLit(&buf, "file=");
virQEMUBuildBufferEscapeComma(&buf, def->os.acpiTables[i]->path);
virCommandAddArgBuffer(cmd, &buf);
}
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 8ef0257d73..b088e54dd0 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -729,10 +729,10 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
for (i = 0; i < def->os.nacpiTables; i++) {
switch (def->os.acpiTables[i]->type) {
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
break;
- case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("ACPI table type '%1$s' is not supported"),
diff --git a/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args b/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.args
new file mode 100644
index 0000000000..4d5d02cb3c
--- /dev/null
+++ b/tests/qemuxmlconfdata/acpi-table-many.x86_64-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-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=on \
+-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 \
+-acpitable file=/var/lib/libvirt/acpi/exm1.dat \
+-acpitable file=/var/lib/libvirt/acpi/exm2.dat \
+-acpitable file=/var/lib/libvirt/acpi/exm3.dat \
+-acpitable sig=SLIC,file=/var/lib/libvirt/acpi/slic.dat \
+-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml b/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml
new file mode 100644
index 0000000000..b7f7e18d28
--- /dev/null
+++ b/tests/qemuxmlconfdata/acpi-table-many.x86_64-latest.xml
@@ -0,0 +1,41 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <acpi>
+ <table type='raw'>/var/lib/libvirt/acpi/exm1.dat</table>
+ <table type='raw'>/var/lib/libvirt/acpi/exm2.dat</table>
+ <table type='raw'>/var/lib/libvirt/acpi/exm3.dat</table>
+ <table type='slic'>/var/lib/libvirt/acpi/slic.dat</table>
+ </acpi>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/acpi-table-many.xml b/tests/qemuxmlconfdata/acpi-table-many.xml
new file mode 100644
index 0000000000..cc75011990
--- /dev/null
+++ b/tests/qemuxmlconfdata/acpi-table-many.xml
@@ -0,0 +1,33 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ <acpi>
+ <table type='raw'>/var/lib/libvirt/acpi/exm1.dat</table>
+ <table type='raw'>/var/lib/libvirt/acpi/exm2.dat</table>
+ <table type='raw'>/var/lib/libvirt/acpi/exm3.dat</table>
+ <table type='slic'>/var/lib/libvirt/acpi/slic.dat</table>
+ </acpi>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 3947f508a2..2007944c29 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2767,6 +2767,7 @@ mymain(void)
DO_TEST_CAPS_LATEST_PARSE_ERROR("usb-too-long-port-path-invalid");
DO_TEST_CAPS_LATEST("acpi-table");
+ DO_TEST_CAPS_LATEST("acpi-table-many");
DO_TEST_CAPS_LATEST("intel-iommu");
DO_TEST_CAPS_LATEST("intel-iommu-caching-mode");
--
2.49.0

View File

@ -0,0 +1,44 @@
From bedbe8dd400e242ad346910bc2bdbfb1e6969fdf Mon Sep 17 00:00:00 2001
Message-ID: <bedbe8dd400e242ad346910bc2bdbfb1e6969fdf.1744876588.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 10 Apr 2025 16:18:29 +0200
Subject: [PATCH] qemuDomainBlockCopyCommon: Don't revoke access to file twice
on failure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If the copy job fails to start up when calling the 'blockdev-mirror'
command the code would call qemuDomainStorageSourceChainAccessRevoke()
twice; once right after the monitor call and the second time in the
'endjob' section.
Remove the one directly after the monitor call and let the common
cleanup handle it.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 68a83cac64b90b7069e6213d70a2faadb552cb80)
https://issues.redhat.com/browse/RHEL-7357
---
src/qemu/qemu_driver.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4c6eff9286..8a354a606a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14413,10 +14413,8 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
virDomainAuditDisk(vm, NULL, mirror, "mirror", ret >= 0);
qemuDomainObjExitMonitor(vm);
- if (ret < 0) {
- qemuDomainStorageSourceChainAccessRevoke(driver, vm, mirror);
+ if (ret < 0)
goto endjob;
- }
/* Update vm in place to match changes. */
need_unlink = false;
--
2.49.0

View File

@ -0,0 +1,100 @@
From 19e552685d72cf3c8064c56ee9bce5859303da25 Mon Sep 17 00:00:00 2001
Message-ID: <19e552685d72cf3c8064c56ee9bce5859303da25.1749039441.git.jdenemar@redhat.com>
From: Collin Walling <walling@linux.ibm.com>
Date: Mon, 16 Dec 2024 18:03:52 -0500
Subject: [PATCH] qemuMonitorJSONGetCPUModelExpansion: refactor parsing
functions
Refactor the CPU Model parsing functions within
qemuMonitorJSONGetCPUModelExpansion. The new functions,
qemuMonitorJSONParseCPUModelExpansionData and
qemuMonitorJSONParseCPUModelExpansion invoke the functions they
replace and leave room for a subsequent patch to handle parsing the
(optional) deprecated_props field resulting from the command.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 60e407deb5cd88e5f1564d1c9145e374001cf34f)
JIRA: https://issues.redhat.com/browse/RHEL-89415
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
src/qemu/qemu_monitor_json.c | 46 ++++++++++++++++++++++++++++++------
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index be5d3be7e6..5df32922fb 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5125,6 +5125,37 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name,
}
+static int
+qemuMonitorJSONParseCPUModelExpansionData(virJSONValue *data,
+ bool fail_no_props,
+ virJSONValue **cpu_model,
+ virJSONValue **cpu_props,
+ const char **cpu_name)
+{
+ if (qemuMonitorJSONParseCPUModelData(data, "query-cpu-model-expansion",
+ fail_no_props, cpu_model, cpu_props,
+ cpu_name) < 0)
+ return -1;
+
+ return 0;
+}
+
+
+static int
+qemuMonitorJSONParseCPUModelExpansion(const char *cpu_name,
+ virJSONValue *cpu_props,
+ qemuMonitorCPUModelInfo **model_info)
+{
+ g_autoptr(qemuMonitorCPUModelInfo) expanded_model = NULL;
+
+ if (qemuMonitorJSONParseCPUModel(cpu_name, cpu_props, &expanded_model) < 0)
+ return -1;
+
+ *model_info = g_steal_pointer(&expanded_model);
+ return 0;
+}
+
+
static int
qemuMonitorJSONQueryCPUModelExpansionOne(qemuMonitor *mon,
qemuMonitorCPUModelExpansionType type,
@@ -5195,9 +5226,9 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon,
if ((rc = qemuMonitorJSONQueryCPUModelExpansionOne(mon, type, &model, &data)) <= 0)
return rc;
- if (qemuMonitorJSONParseCPUModelData(data, "query-cpu-model-expansion",
- fail_no_props, &cpu_model, &cpu_props,
- &cpu_name) < 0)
+ if (qemuMonitorJSONParseCPUModelExpansionData(data, fail_no_props,
+ &cpu_model, &cpu_props,
+ &cpu_name) < 0)
return -1;
/* QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC_FULL requests "full" expansion
@@ -5213,13 +5244,14 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon,
if ((rc = qemuMonitorJSONQueryCPUModelExpansionOne(mon, type, &fullModel, &fullData)) <= 0)
return rc;
- if (qemuMonitorJSONParseCPUModelData(fullData, "query-cpu-model-expansion",
- fail_no_props, &cpu_model, &cpu_props,
- &cpu_name) < 0)
+ if (qemuMonitorJSONParseCPUModelExpansionData(fullData, fail_no_props,
+ &cpu_model, &cpu_props,
+ &cpu_name) < 0)
return -1;
}
- return qemuMonitorJSONParseCPUModel(cpu_name, cpu_props, model_info);
+ return qemuMonitorJSONParseCPUModelExpansion(cpu_name, cpu_props,
+ model_info);
}
--
2.49.0

View File

@ -0,0 +1,67 @@
From 6e265f4f5faa468497e9bbdd86701d17480fcd38 Mon Sep 17 00:00:00 2001
Message-ID: <6e265f4f5faa468497e9bbdd86701d17480fcd38.1750259242.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Fri, 28 Feb 2025 14:00:23 +0100
Subject: [PATCH] qemuPrepareNVRAMFile: Fix NVRAM image conversion check
In case when user provides custom paths (those not covered by the JSON
firmware descriptor files or the default locations) for the
loader and nvram template no auto-detection will be performed and user's
config will be taken at face value. Historically when 'templateFormat'
didn't exist we assumed that the 'format' field covers both.
Thus if 'templateFormat' is VIR_STORAGE_FILE_NONE we need to skip the
check forbidding image format conversion for 'file' backed to avoid
breaking legacy configs with manual/non-detected format assuming that
user picked the correct format.
Add a comment to the declaration of 'nvramTemplateFormat' noting the
above for future reference.
Resolves: https://issues.redhat.com/browse/RHEL-81731
Fixes: 2aa644a2fc8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit e088895a6246ac3b7f160e1895f2940c4b13b0cc)
https://issues.redhat.com/browse/RHEL-97758
---
src/conf/domain_conf.h | 7 +++++++
src/qemu/qemu_process.c | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 961b7b056c..20be6f7c05 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2361,6 +2361,13 @@ struct _virDomainLoaderDef {
virStorageSource *nvram;
bool newStyleNVRAM;
char *nvramTemplate; /* user override of path to master nvram */
+ /* Historically it was assumed that the format of the template and the
+ * actual nvram image are identical, which is no longer true.
+ *
+ * Note: if 'nvramTemplate' comes from the user and is not overriden by
+ * auto-detection nvramTemplateFormat may be VIR_STORAGE_FILE_NONE. Code
+ * shall assume that the template format matches if it isn't provided.
+ */
virStorageFileFormat nvramTemplateFormat;
};
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 64683ecfe0..a78aa8569d 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4727,7 +4727,10 @@ qemuPrepareNVRAMFile(virQEMUDriver *driver,
return -1;
}
- if (loader->nvram->format != loader->nvramTemplateFormat) {
+ /* If 'nvramTemplateFormat' is empty it means that it's a user-provided
+ * template which we couldn't verify. Assume the user knows what they're doing */
+ if (loader->nvramTemplateFormat != VIR_STORAGE_FILE_NONE &&
+ loader->nvram->format != loader->nvramTemplateFormat) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("conversion of the nvram template to another target format is not supported"));
return -1;
--
2.49.0

View File

@ -0,0 +1,62 @@
From 5337b43f308c025977311d700b2bd89dfc848b0c Mon Sep 17 00:00:00 2001
Message-ID: <5337b43f308c025977311d700b2bd89dfc848b0c.1742990721.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 11 Mar 2025 09:01:12 +0100
Subject: [PATCH] qemuValidateDomainDeviceDefNetwork: Require shared memory for
all vhost-user interfaces
Currently we produce only a warning into the log if a non-passt
vhost-user interface is configured with shared memory.
Since we do make it fatal with all other vhost-user types, fix the check
to trigger also for normal-vhost-user interfaces.
Since passt-based vhost-user interfaces are checked separately the check
will no longer be required.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 0d20632179e1a61903f30986215bef53b0f912f6)
https://issues.redhat.com/browse/RHEL-84133
---
src/qemu/qemu_validate.c | 9 +++------
.../net-vhostuser-passt-no-shmem.x86_64-latest.err | 2 +-
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index f814ee8c0d..1c61038f93 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1828,12 +1828,6 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
return -1;
}
- if (net->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER &&
- net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) {
- if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "interface type=\"vhostuser\" backend type=\"passt\"") < 0)
- return -1;
- }
-
if (net->type == VIR_DOMAIN_NET_TYPE_VDPA) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_VHOST_VDPA)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -1857,6 +1851,9 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
_("'reconnect' attribute is not supported when source mode='server' for <interface type='vhostuser'>"));
return -1;
}
+
+ if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "interface") < 0)
+ return -1;
}
if (!virDomainNetIsVirtioModel(net)) {
diff --git a/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.err b/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.err
index 274af5c722..babde17518 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.err
+++ b/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.err
@@ -1 +1 @@
-unsupported configuration: 'interface type="vhostuser" backend type="passt"' requires shared memory
+unsupported configuration: 'interface' requires shared memory
--
2.49.0

View File

@ -0,0 +1,163 @@
From 8c10ceadcb2c32217b90277ee73f1eb990c67cbc Mon Sep 17 00:00:00 2001
Message-ID: <8c10ceadcb2c32217b90277ee73f1eb990c67cbc.1747908717.git.jdenemar@redhat.com>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 25 Feb 2025 15:23:07 +0100
Subject: [PATCH] qemu_agent: Add qemuAgentGetLoadAvg()
With qemu guest agent 9.3 we are able to get the load averages with a
new command.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 1669d91eade46b930ebb44e4b9d398ea8c2064e7)
https://issues.redhat.com/browse/RHEL-88447
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
src/qemu/qemu_agent.c | 46 +++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 6 +++++
tests/qemuagenttest.c | 53 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 43fca86f10..16a6eaa998 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -2568,3 +2568,49 @@ int qemuAgentGetDisks(qemuAgent *agent,
g_free(*disks);
return -1;
}
+
+
+int
+qemuAgentGetLoadAvg(qemuAgent *agent,
+ double *load1m,
+ double *load5m,
+ double *load15m,
+ bool report_unsupported)
+{
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
+ virJSONValue *data = NULL;
+ int rc;
+
+ if (!(cmd = qemuAgentMakeCommand("guest-get-load", NULL)))
+ return -1;
+
+ if ((rc = qemuAgentCommandFull(agent, cmd, &reply, agent->timeout,
+ report_unsupported)) < 0)
+ return rc;
+
+ if (!(data = virJSONValueObjectGetObject(reply, "return"))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("qemu agent didn't return an array of loads"));
+ return -1;
+ }
+
+#define GET_NUMBER_PARAM(param_) \
+ do { \
+ if (param_ && \
+ virJSONValueObjectGetNumberDouble(data, #param_, param_) < 0) { \
+ virReportError(VIR_ERR_INTERNAL_ERROR, \
+ _("parameter '%1$s' is missing in reply of guest-get-load"), \
+ #param_); \
+ return -1; \
+ } \
+ } while (0)
+
+ GET_NUMBER_PARAM(load1m);
+ GET_NUMBER_PARAM(load5m);
+ GET_NUMBER_PARAM(load15m);
+
+#undef GET_NUMBER_PARAM
+
+ return 0;
+}
diff --git a/src/qemu/qemu_agent.h b/src/qemu/qemu_agent.h
index f98586e8f8..cd17a98d39 100644
--- a/src/qemu/qemu_agent.h
+++ b/src/qemu/qemu_agent.h
@@ -195,3 +195,9 @@ int qemuAgentSSHRemoveAuthorizedKeys(qemuAgent *agent,
int qemuAgentGetDisks(qemuAgent *mon,
qemuAgentDiskInfo ***disks,
bool report_unsupported);
+
+int qemuAgentGetLoadAvg(qemuAgent *agent,
+ double *load1m,
+ double *load5m,
+ double *load15m,
+ bool report_unsupported);
diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
index 3287880241..566571cf11 100644
--- a/tests/qemuagenttest.c
+++ b/tests/qemuagenttest.c
@@ -1356,6 +1356,58 @@ testQemuAgentTimezone(const void *data)
virTypedParamsFree(params, nparams);
return ret;
}
+
+
+static const char testQemuAgentGetLoadAvgResponse[] =
+ "{"
+ " \"return\": {"
+ " \"load15m\": 0.03564453125,"
+ " \"load5m\": 0.064453125,"
+ " \"load1m\": 0.00390625"
+ " }"
+ "}";
+
+static int
+testQemuAgentGetLoadAvg(const void *data)
+{
+ virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
+ g_autoptr(qemuMonitorTest) test = qemuMonitorTestNewAgent(xmlopt);
+ double load1m = 0;
+ double load5m = 0;
+ double load15m = 0;
+
+ if (!test)
+ return -1;
+
+ if (qemuMonitorTestAddAgentSyncResponse(test) < 0)
+ return -1;
+
+ if (qemuMonitorTestAddItem(test, "guest-get-load",
+ testQemuAgentGetLoadAvgResponse) < 0)
+ return -1;
+
+ if (qemuAgentGetLoadAvg(qemuMonitorTestGetAgent(test),
+ &load1m, &load5m, &load15m, true) < 0)
+ return -1;
+
+#define VALIDATE_LOAD(value_, expected_) \
+ do { \
+ if (value_ != expected_) { \
+ virReportError(VIR_ERR_INTERNAL_ERROR, \
+ "Expected " #value_ " '%.11f', got '%.11f'", \
+ expected_, value_); \
+ return -1; \
+ } \
+ } while (0)
+
+ VALIDATE_LOAD(load1m, 0.00390625);
+ VALIDATE_LOAD(load5m, 0.064453125);
+ VALIDATE_LOAD(load15m, 0.03564453125);
+
+ return 0;
+}
+
+
static int
mymain(void)
{
@@ -1392,6 +1444,7 @@ mymain(void)
DO_TEST(Timezone);
DO_TEST(SSHKeys);
DO_TEST(GetDisks);
+ DO_TEST(GetLoadAvg);
DO_TEST(Timeout); /* Timeout should always be called last */
--
2.49.0

View File

@ -0,0 +1,409 @@
From 6d104057ac63fed07c493e2a73694503ac0ef0f1 Mon Sep 17 00:00:00 2001
Message-ID: <6d104057ac63fed07c493e2a73694503ac0ef0f1.1747908717.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 7 May 2025 14:32:52 +0200
Subject: [PATCH] qemu_capabilities: Fetch caps for virtio-mem-ccw too
While with upstream QEMU it's impossible to have virtio-mem-ccw and not
have virtio-mem-pci, in RHEL the QEMU's build system is patched to make
that possible. But this breaks our assumption when fetching
capabilities.
Well, just do what we are already doing in this situation (e.g.
"virtio-blk-pci"/"virtio-blk-ccw" & virQEMUCapsDevicePropsVirtioBlk, or
"virtio-scsi-pci"/"virtio-net-ccw" & virQEMUCapsDevicePropsVirtioSCSI):
fetch the same set of props for both devices.
Resolves: https://issues.redhat.com/browse/RHEL-87532
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 6ff8d08777ebbcb9a1e11534c3a3341fbf0343e8)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Conflicts:
tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies: Context,
becuase v11.3.0-28-g670aae6cda is not backported.
---
src/qemu/qemu_capabilities.c | 4 +
.../caps_10.0.0_s390x.replies | 202 +++++++++++++++---
2 files changed, 182 insertions(+), 24 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1a9cf72482..b507027667 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1546,6 +1546,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVhostUserFS[] =
{ "bootindex", QEMU_CAPS_VHOST_USER_FS_BOOTINDEX, NULL },
};
+/* This is used also for QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW */
static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioMemPCI[] = {
{ "prealloc", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_PREALLOC, NULL },
{ "dynamic-memslots", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS, NULL },
@@ -1714,6 +1715,9 @@ static virQEMUCapsDeviceTypeProps virQEMUCapsDeviceProps[] = {
{ "virtio-mem-pci", virQEMUCapsDevicePropsVirtioMemPCI,
G_N_ELEMENTS(virQEMUCapsDevicePropsVirtioMemPCI),
QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI },
+ { "virtio-mem-ccw", virQEMUCapsDevicePropsVirtioMemPCI,
+ G_N_ELEMENTS(virQEMUCapsDevicePropsVirtioMemPCI),
+ QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW },
{ "virtio-iommu-pci", virQEMUCapsDevicePropsVirtioIOMMU,
G_N_ELEMENTS(virQEMUCapsDevicePropsVirtioIOMMU),
QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI },
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies
index 05b13b2d2b..18f098153d 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies
@@ -29500,11 +29500,165 @@
{
"execute": "device-list-properties",
"arguments": {
- "typename": "virtio-iommu-pci"
+ "typename": "virtio-mem-ccw"
},
"id": "libvirt-30"
}
+{
+ "return": [
+ {
+ "name": "dev_id",
+ "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab",
+ "type": "str"
+ },
+ {
+ "name": "devno",
+ "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab",
+ "type": "str"
+ },
+ {
+ "name": "subch_id",
+ "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab",
+ "type": "str"
+ },
+ {
+ "default-value": 2,
+ "name": "max_revision",
+ "type": "uint32"
+ },
+ {
+ "default-value": true,
+ "name": "ioeventfd",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": 0,
+ "name": "memaddr",
+ "type": "uint64"
+ },
+ {
+ "default-value": true,
+ "name": "indirect_desc",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": false,
+ "name": "iommu_platform",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "memdev",
+ "type": "link<memory-backend>"
+ },
+ {
+ "default-value": true,
+ "name": "event_idx",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": true,
+ "name": "x-early-migration",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": 0,
+ "name": "node",
+ "type": "uint32"
+ },
+ {
+ "name": "requested-size",
+ "type": "size"
+ },
+ {
+ "default-value": true,
+ "name": "any_layout",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": false,
+ "name": "x-disable-legacy-check",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": true,
+ "name": "queue_reset",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": true,
+ "name": "notify_on_empty",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": false,
+ "name": "packed",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "block-size",
+ "type": "size"
+ },
+ {
+ "default-value": false,
+ "name": "prealloc",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": true,
+ "name": "use-started",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": false,
+ "name": "in_order",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "size",
+ "type": "size"
+ },
+ {
+ "default-value": true,
+ "name": "use-disabled-flag",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "default-value": true,
+ "name": "dynamic-memslots",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "virtio-backend",
+ "type": "child<virtio-mem>"
+ }
+ ],
+ "id": "libvirt-30"
+}
+
+{
+ "execute": "device-list-properties",
+ "arguments": {
+ "typename": "virtio-iommu-pci"
+ },
+ "id": "libvirt-31"
+}
+
{
"return": [
{
@@ -29774,7 +29928,7 @@
"type": "child<virtio-iommu-device>"
}
],
- "id": "libvirt-30"
+ "id": "libvirt-31"
}
{
@@ -29782,7 +29936,7 @@
"arguments": {
"typename": "virtio-blk-ccw"
},
- "id": "libvirt-31"
+ "id": "libvirt-32"
}
{
@@ -30065,7 +30219,7 @@
"type": "bool"
}
],
- "id": "libvirt-31"
+ "id": "libvirt-32"
}
{
@@ -30073,7 +30227,7 @@
"arguments": {
"typename": "memory-backend-file"
},
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
@@ -30163,7 +30317,7 @@
"type": "bool"
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
@@ -30171,7 +30325,7 @@
"arguments": {
"typename": "memory-backend-memfd"
},
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
@@ -30250,12 +30404,12 @@
"type": "int"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"execute": "query-machines",
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
@@ -30530,7 +30684,7 @@
"default-ram-id": "s390.ram"
}
],
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
@@ -30538,7 +30692,7 @@
"arguments": {
"typename": "none-machine"
},
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
@@ -30653,12 +30807,12 @@
"type": "bool"
}
],
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
"execute": "query-cpu-definitions",
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
@@ -31368,32 +31522,32 @@
"deprecated": false
}
],
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
"execute": "query-tpm-models",
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"return": [],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"execute": "query-tpm-types",
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
{
"return": [],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
{
"execute": "query-command-line-options",
- "id": "libvirt-39"
+ "id": "libvirt-40"
}
{
@@ -32646,12 +32800,12 @@
"option": "drive"
}
],
- "id": "libvirt-39"
+ "id": "libvirt-40"
}
{
"execute": "query-migrate-capabilities",
- "id": "libvirt-40"
+ "id": "libvirt-41"
}
{
@@ -32745,7 +32899,7 @@
"capability": "mapped-ram"
}
],
- "id": "libvirt-40"
+ "id": "libvirt-41"
}
{
@@ -32756,7 +32910,7 @@
"name": "host"
}
},
- "id": "libvirt-41"
+ "id": "libvirt-42"
}
{
@@ -32828,7 +32982,7 @@
}
}
},
- "id": "libvirt-41"
+ "id": "libvirt-42"
}
{
--
2.49.0

View File

@ -0,0 +1,95 @@
From 637590711a1e9aaf304e8a6c8ec57adcb0272cca Mon Sep 17 00:00:00 2001
Message-ID: <637590711a1e9aaf304e8a6c8ec57adcb0272cca.1749039441.git.jdenemar@redhat.com>
From: Collin Walling <walling@linux.ibm.com>
Date: Mon, 16 Dec 2024 18:03:56 -0500
Subject: [PATCH] qemu_capabilities: filter deprecated features if requested
If flag VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES
is passed to qemuConnectGetDomainCapabilities, then the domain's CPU
model features will be updated to set any deprecated features to the
'disabled' policy.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit cd1e837c22182dcadfe17b469c931f9fc9745a46)
JIRA: https://issues.redhat.com/browse/RHEL-89415
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
src/qemu/qemu_capabilities.c | 20 ++++++++++++++++++++
src/qemu/qemu_capabilities.h | 3 +++
src/qemu/qemu_driver.c | 8 +++++++-
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b17c582b5e..6bff55f58e 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3340,6 +3340,26 @@ virQEMUCapsGetCPUFeatures(virQEMUCaps *qemuCaps,
}
+void
+virQEMUCapsUpdateCPUDeprecatedFeatures(virQEMUCaps *qemuCaps,
+ virDomainVirtType virtType,
+ virCPUDef *cpu)
+{
+ qemuMonitorCPUModelInfo *modelInfo;
+ size_t i;
+
+ modelInfo = virQEMUCapsGetCPUModelInfo(qemuCaps, virtType);
+
+ if (!modelInfo || !modelInfo->deprecated_props)
+ return;
+
+ for (i = 0; i < g_strv_length(modelInfo->deprecated_props); i++) {
+ virCPUDefUpdateFeature(cpu, modelInfo->deprecated_props[i],
+ VIR_CPU_FEATURE_DISABLE);
+ }
+}
+
+
struct tpmTypeToCaps {
int type;
virQEMUCapsFlags caps;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index d2bccc0e2a..8de392bf0f 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -768,6 +768,9 @@ int virQEMUCapsGetCPUFeatures(virQEMUCaps *qemuCaps,
virDomainVirtType virtType,
bool migratable,
char ***features);
+void virQEMUCapsUpdateCPUDeprecatedFeatures(virQEMUCaps *qemuCaps,
+ virDomainVirtType virtType,
+ virCPUDef *cpu);
virDomainVirtType virQEMUCapsGetVirtType(virQEMUCaps *qemuCaps);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b374b1978c..13e2838f19 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16544,7 +16544,8 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
virDomainVirtType virttype;
g_autoptr(virDomainCaps) domCaps = NULL;
- virCheckFlags(0, NULL);
+ virCheckFlags(VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES,
+ NULL);
if (virConnectGetDomainCapabilitiesEnsureACL(conn) < 0)
return NULL;
@@ -16563,6 +16564,11 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
arch, virttype)))
return NULL;
+ if (flags & VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES) {
+ virQEMUCapsUpdateCPUDeprecatedFeatures(qemuCaps, virttype,
+ domCaps->cpu.hostModel);
+ }
+
return virDomainCapsFormat(domCaps);
}
--
2.49.0

View File

@ -0,0 +1,933 @@
From 3620d993bb09b10d6e6e9e44a4a5fdf13a6d3da5 Mon Sep 17 00:00:00 2001
Message-ID: <3620d993bb09b10d6e6e9e44a4a5fdf13a6d3da5.1749039441.git.jdenemar@redhat.com>
From: Collin Walling <walling@linux.ibm.com>
Date: Mon, 16 Dec 2024 18:03:54 -0500
Subject: [PATCH] qemu_capabilities: query deprecated features for host-model
Add QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS for detecting
if query-cpu-model-expansion can report deprecated CPU model properties.
QEMU introduced this capability in 9.1 release. Add flag and deprecated
features to the capabilities test data for QEMU 9.1 and 9.2 replies/XML
since it can now be accounted for.
When probing for the host CPU, perform a full CPU model expansion to
retrieve the list of features deprecated across the entire architecture.
The list and count are stored in the host's CPU model info within the
QEMU capabilities. Other info resulting from this query (e.g. model
name, etc) is ignored.
The new capabilities flag is used to fence off the extra query for
architectures/QEMU binaries that do not report deprecated CPU model
features.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 51c098347d7f2af9b4386ac0adc4431997d06f3d)
JIRA: https://issues.redhat.com/browse/RHEL-89415
Conflicts:
src/qemu/qemu_capabilities.*
(contextual conflict due to different amount of caps in downstream)
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
src/qemu/qemu_capabilities.c | 40 +-
src/qemu/qemu_capabilities.h | 3 +-
.../caps_9.1.0_s390x.replies | 348 +++++++++++++++++-
.../qemucapabilitiesdata/caps_9.1.0_s390x.xml | 7 +
.../caps_9.2.0_s390x.replies | 348 +++++++++++++++++-
.../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 7 +
6 files changed, 747 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b1faea3ac7..b17c582b5e 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -721,10 +721,11 @@ VIR_ENUM_IMPL(virQEMUCaps,
"chardev-reconnect-miliseconds", /* QEMU_CAPS_CHARDEV_RECONNECT_MILISECONDS */
"virtio-ccw.loadparm", /* QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM */
"netdev-stream-reconnect-miliseconds", /* QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS */
- "blockdev-set-active", /* QEMU_CAPS_BLOCKDEV_SET_ACTIVE */
+ "query-cpu-model-expansion.deprecated-props", /* QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS */
/* 470 */
"virtio-mem-ccw", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW */
+ "blockdev-set-active", /* QEMU_CAPS_BLOCKDEV_SET_ACTIVE */
);
@@ -1601,6 +1602,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
{ "screendump/arg-type/device", QEMU_CAPS_SCREENDUMP_DEVICE },
{ "screendump/arg-type/format/^png", QEMU_CAPS_SCREENSHOT_FORMAT_PNG },
{ "set-numa-node/arg-type/+hmat-lb", QEMU_CAPS_NUMA_HMAT },
+ { "query-cpu-model-expansion/ret-type/deprecated-props", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS },
};
typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
@@ -3160,6 +3162,38 @@ virQEMUCapsProbeHypervCapabilities(virQEMUCaps *qemuCaps,
}
+/**
+ * virQEMUCapsProbeFullDeprecatedProperties
+ * @mon: QEMU monitor
+ * @cpu: CPU definition to be expanded
+ * @props: the array to be filled with deprecated features
+ *
+ * Performs a full CPU model expansion to retrieve an array of deprecated
+ * properties. If the expansion succeeds, then data previously stored in
+ * @props is freed.
+ *
+ * Returns: -1 if the expansion failed; otherwise 0.
+ */
+static int
+virQEMUCapsProbeFullDeprecatedProperties(qemuMonitor *mon,
+ virCPUDef *cpu,
+ GStrv *props)
+{
+ g_autoptr(qemuMonitorCPUModelInfo) propsInfo = NULL;
+
+ if (qemuMonitorGetCPUModelExpansion(mon, QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL,
+ cpu, true, false, false, &propsInfo) < 0)
+ return -1;
+
+ if (propsInfo && propsInfo->deprecated_props) {
+ g_free(*props);
+ *props = g_steal_pointer(&propsInfo->deprecated_props);
+ }
+
+ return 0;
+}
+
+
static int
virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
virQEMUCapsAccel *accel,
@@ -3241,6 +3275,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps,
modelInfo->migratability = true;
}
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS) &&
+ virQEMUCapsProbeFullDeprecatedProperties(mon, cpu, &modelInfo->deprecated_props) < 0)
+ return -1;
+
if (virQEMUCapsTypeIsAccelerated(virtType) &&
(ARCH_IS_X86(qemuCaps->arch) || ARCH_IS_ARM(qemuCaps->arch))) {
g_autoptr(qemuMonitorCPUModelInfo) fullQEMU = NULL;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 6467a09796..d2bccc0e2a 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -700,10 +700,11 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_CHARDEV_RECONNECT_MILISECONDS, /* 'reconnect-ms' option for chardevs supported */
QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM, /* loadparm available on CCW device for multi device boot */
QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS, /* 'reconnect-ms' option for netdev stream supported */
- QEMU_CAPS_BLOCKDEV_SET_ACTIVE, /* blockdev-set-active QMP command supported */
+ QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS, /* query-cpu-model-expansion may report deprecated CPU properties */
/* 470 */
QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW, /* -device virtio-mem-ccw */
+ QEMU_CAPS_BLOCKDEV_SET_ACTIVE, /* blockdev-set-active QMP command supported */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies
index 2d4ab8ed75..0a523ba47e 100644
--- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies
@@ -32252,6 +32252,89 @@
"id": "libvirt-40"
}
+{
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "host"
+ }
+ },
+ "id": "libvirt-41"
+}
+
+{
+ "return": {
+ "deprecated-props": [
+ "bpb",
+ "te",
+ "cte",
+ "csske"
+ ],
+ "model": {
+ "name": "gen16a-base",
+ "props": {
+ "nnpa": true,
+ "aen": true,
+ "cmmnt": true,
+ "vxpdeh": true,
+ "aefsi": true,
+ "diag318": true,
+ "csske": true,
+ "mepoch": true,
+ "msa9": true,
+ "msa8": true,
+ "msa7": true,
+ "msa6": true,
+ "msa5": true,
+ "msa4": true,
+ "msa3": true,
+ "msa2": true,
+ "msa1": true,
+ "sthyi": true,
+ "edat": true,
+ "ri": true,
+ "deflate": true,
+ "edat2": true,
+ "etoken": true,
+ "vx": true,
+ "ipter": true,
+ "pai": true,
+ "paie": true,
+ "mepochptff": true,
+ "ap": true,
+ "vxeh": true,
+ "vxpd": true,
+ "esop": true,
+ "msa9_pckmo": true,
+ "vxeh2": true,
+ "esort": true,
+ "appv": true,
+ "apqi": true,
+ "apft": true,
+ "els": true,
+ "iep": true,
+ "appvi": true,
+ "apqci": true,
+ "cte": true,
+ "ais": true,
+ "bpb": true,
+ "ctop": true,
+ "gs": true,
+ "ppa15": true,
+ "zpci": true,
+ "rdp": true,
+ "sea_esop2": true,
+ "beareh": true,
+ "te": true,
+ "cmm": true,
+ "vxpdeh2": true
+ }
+ }
+ },
+ "id": "libvirt-41"
+}
+
{
"execute": "qmp_capabilities",
"id": "libvirt-1"
@@ -36262,10 +36345,271 @@
}
{
- "execute": "query-machines",
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "max"
+ }
+ },
"id": "libvirt-4"
}
+{
+ "return": {
+ "deprecated-props": [
+ "bpb",
+ "te",
+ "cte",
+ "csske"
+ ],
+ "model": {
+ "name": "gen15a-base",
+ "props": {
+ "pfmfi": false,
+ "exrl": true,
+ "stfle45": true,
+ "kmctr-etdea-192": false,
+ "kmctr-etdea-128": false,
+ "nnpa": false,
+ "cmma": false,
+ "dateh2": false,
+ "gen13ptff": false,
+ "aen": true,
+ "kmo-etdea-192": false,
+ "kmf-etdea-192": false,
+ "kmc-etdea-192": false,
+ "kmac-tdea-192": false,
+ "kimd-sha-512": true,
+ "dateh": true,
+ "km-aes-256": false,
+ "km-aes-192": false,
+ "kmctr-aes-256": false,
+ "kma-gcm-eaes-192": false,
+ "kmo-tdea-192": false,
+ "kmf-tdea-192": false,
+ "kmctr-tdea-192": false,
+ "kmctr-tdea-128": false,
+ "km-etdea-192": false,
+ "kmc-tdea-192": false,
+ "cmmnt": false,
+ "iacc2": true,
+ "parseh": false,
+ "klmd-sha-512": true,
+ "kma-gcm-eaes-128": false,
+ "csst": true,
+ "pcc-xts-aes-256": false,
+ "pcc-xts-aes-128": false,
+ "pckmo-aes-128": false,
+ "idter": false,
+ "idtes": true,
+ "prno-trng-qrtcr": false,
+ "pcc-cmac-eaes-128": false,
+ "vxpdeh": false,
+ "aefsi": true,
+ "pckmo-etdea-192": false,
+ "pckmo-etdea-128": false,
+ "diag318": false,
+ "pcc-cmac-eaes-256": false,
+ "msa-base": true,
+ "pcc-cmac-etdea-192": false,
+ "hpma2": false,
+ "kmctr-eaes-256": false,
+ "csske": false,
+ "csst2": true,
+ "mepoch": false,
+ "msa9": false,
+ "msa6": false,
+ "msa1": false,
+ "kmctr-aes-192": false,
+ "pckmo-aes-256": false,
+ "sthyi": false,
+ "stckf": true,
+ "stfle": true,
+ "edat": false,
+ "etf3": true,
+ "etf2": true,
+ "hfpm": false,
+ "ri": false,
+ "pcc-xts-eaes-256": false,
+ "deflate": false,
+ "km-xts-eaes-256": false,
+ "km-xts-eaes-128": false,
+ "edat2": false,
+ "hfpue": false,
+ "kmo-aes-192": false,
+ "kmf-aes-192": false,
+ "km-eaes-192": false,
+ "kmc-aes-192": false,
+ "unpack": false,
+ "dfp": false,
+ "kmo-aes-128": false,
+ "kmf-aes-128": false,
+ "km-eaes-128": false,
+ "kmctr-dea": false,
+ "mvcos": true,
+ "etoken": false,
+ "pcc-cmac-tdea-192": false,
+ "km-dea": false,
+ "sprogp": true,
+ "sigpif": false,
+ "kmac-eaes-128": false,
+ "ldisphp": true,
+ "pckmo-aes-192": false,
+ "ipter": false,
+ "vx": true,
+ "pai": false,
+ "kimd-ghash": false,
+ "emon": false,
+ "kimd-sha-1": false,
+ "cei": false,
+ "cmpsceh": false,
+ "kmctr-eaes-192": false,
+ "kmctr-eaes-128": false,
+ "ginste": true,
+ "km-xts-aes-256": false,
+ "kmac-eaes-256": false,
+ "kmo-eaes-128": false,
+ "kmf-eaes-128": false,
+ "kmc-eaes-128": false,
+ "kmac-aes-128": false,
+ "paie": false,
+ "dfppc": false,
+ "dfpzc": false,
+ "dfphp": false,
+ "kmo-eaes-256": false,
+ "kmf-eaes-256": false,
+ "kmc-eaes-256": false,
+ "kmac-aes-256": false,
+ "kmac-etdea-192": false,
+ "kmac-etdea-128": false,
+ "kmo-dea": false,
+ "kmf-dea": false,
+ "km-edea": false,
+ "kmc-dea": false,
+ "stfle49": true,
+ "klmd-sha-1": false,
+ "mepochptff": false,
+ "opc": false,
+ "ap": false,
+ "asnlxr": false,
+ "gpereh": false,
+ "minste2": true,
+ "pcc-cmac-dea": false,
+ "vxpd": false,
+ "vxeh": true,
+ "esop": true,
+ "ectg": true,
+ "ib": false,
+ "km-tdea-192": false,
+ "km-tdea-128": false,
+ "msa9_pckmo": false,
+ "siif": false,
+ "kma-gcm-aes-256": false,
+ "kma-gcm-aes-192": false,
+ "kma-gcm-aes-128": false,
+ "pcc-cmac-aes-256": false,
+ "tsi": false,
+ "vxeh2": true,
+ "tpei": false,
+ "esort": false,
+ "esan3": true,
+ "fpe": true,
+ "ibs": false,
+ "pcc-xts-eaes-128": false,
+ "kmac-eaes-192": false,
+ "zarch": true,
+ "kmo-edea": false,
+ "kmf-edea": false,
+ "kmc-edea": false,
+ "kmac-dea": false,
+ "appv": false,
+ "apqi": false,
+ "apft": false,
+ "stfle53": true,
+ "ppno-sha-512-drng": false,
+ "pcc-cmac-tdea-128": false,
+ "kmo-aes-256": false,
+ "kmf-aes-256": false,
+ "km-eaes-256": false,
+ "kmc-aes-256": false,
+ "els": false,
+ "sief2": false,
+ "eimm": true,
+ "pcc-cmac-etdea-128": false,
+ "iep": true,
+ "irbm": false,
+ "km-xts-aes-128": false,
+ "srs": true,
+ "appvi": false,
+ "apqci": false,
+ "kmo-tdea-128": false,
+ "kmf-tdea-128": false,
+ "km-etdea-128": false,
+ "kmc-tdea-128": false,
+ "kss": false,
+ "cte": false,
+ "kmac-edea": false,
+ "prno-trng": true,
+ "kma-gcm-eaes-256": false,
+ "ais": true,
+ "fpseh": true,
+ "ltlbc": true,
+ "ldisp": true,
+ "kmo-etdea-128": false,
+ "kmf-etdea-128": false,
+ "kmc-etdea-128": false,
+ "kmac-tdea-128": false,
+ "pcc-cmac-edea": false,
+ "bpb": false,
+ "kmctr-edea": false,
+ "64bscao": false,
+ "ctop": false,
+ "kmo-eaes-192": false,
+ "kmf-eaes-192": false,
+ "kmc-eaes-192": false,
+ "kmac-aes-192": false,
+ "gs": false,
+ "sema": false,
+ "etf3eh": true,
+ "etf2eh": true,
+ "eec": false,
+ "pcc-cmac-eaes-192": false,
+ "ppa15": false,
+ "kmc-prng": false,
+ "zpci": true,
+ "rdp": false,
+ "nonqks": false,
+ "sea_esop2": true,
+ "minste3": true,
+ "beareh": false,
+ "pfpo": false,
+ "te": false,
+ "msa8-base": true,
+ "msa4-base": true,
+ "msa3-base": true,
+ "msa5-base": true,
+ "pcc-cmac-aes-192": false,
+ "cmm": false,
+ "tods": false,
+ "pcc-cmac-aes-128": false,
+ "plo": true,
+ "pckmo-edea": false,
+ "gsls": false,
+ "kmctr-aes-128": false,
+ "skey": false,
+ "vxpdeh2": false
+ }
+ }
+ },
+ "id": "libvirt-4"
+}
+
+{
+ "execute": "query-machines",
+ "id": "libvirt-5"
+}
+
{
"return": [
{
@@ -36568,5 +36912,5 @@
"default-ram-id": "s390.ram"
}
],
- "id": "libvirt-4"
+ "id": "libvirt-5"
}
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
index 5e8db88e52..b3265dcc18 100644
--- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
@@ -133,6 +133,7 @@
<flag name='virtio-sound'/>
<flag name='netdev.user'/>
<flag name='snapshot-internal-qmp'/>
+ <flag name='query-cpu-model-expansion.deprecated-props'/>
<version>9001000</version>
<microcodeVersion>39100246</microcodeVersion>
<package>v9.1.0</package>
@@ -356,6 +357,12 @@
<property name='msa3-base' type='boolean' value='true'/>
<property name='msa5-base' type='boolean' value='true'/>
<property name='tods' type='boolean' value='false'/>
+ <deprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </deprecatedFeatures>
</hostCPU>
<cpu type='tcg' name='z13' typename='z13-s390x-cpu' usable='no'>
<blocker name='ppno-sha-512-drng'/>
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies
index 91c9a049bf..9a58acaf08 100644
--- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies
@@ -32411,6 +32411,89 @@
"id": "libvirt-40"
}
+{
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "host"
+ }
+ },
+ "id": "libvirt-41"
+}
+
+{
+ "return": {
+ "deprecated-props": [
+ "bpb",
+ "te",
+ "cte",
+ "csske"
+ ],
+ "model": {
+ "name": "gen16a-base",
+ "props": {
+ "nnpa": true,
+ "aen": true,
+ "cmmnt": true,
+ "vxpdeh": true,
+ "aefsi": true,
+ "diag318": true,
+ "csske": true,
+ "mepoch": true,
+ "msa9": true,
+ "msa8": true,
+ "msa7": true,
+ "msa6": true,
+ "msa5": true,
+ "msa4": true,
+ "msa3": true,
+ "msa2": true,
+ "msa1": true,
+ "sthyi": true,
+ "edat": true,
+ "ri": true,
+ "deflate": true,
+ "edat2": true,
+ "etoken": true,
+ "vx": true,
+ "ipter": true,
+ "pai": true,
+ "paie": true,
+ "mepochptff": true,
+ "ap": true,
+ "vxeh": true,
+ "vxpd": true,
+ "esop": true,
+ "msa9_pckmo": true,
+ "vxeh2": true,
+ "esort": true,
+ "appv": true,
+ "apqi": true,
+ "apft": true,
+ "els": true,
+ "iep": true,
+ "appvi": true,
+ "apqci": true,
+ "cte": true,
+ "ais": true,
+ "bpb": true,
+ "ctop": true,
+ "gs": true,
+ "ppa15": true,
+ "zpci": true,
+ "rdp": true,
+ "sea_esop2": true,
+ "beareh": true,
+ "te": true,
+ "cmm": true,
+ "vxpdeh2": true
+ }
+ }
+ },
+ "id": "libvirt-41"
+}
+
{
"execute": "qmp_capabilities",
"id": "libvirt-1"
@@ -36421,10 +36504,271 @@
}
{
- "execute": "query-machines",
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "max"
+ }
+ },
"id": "libvirt-4"
}
+{
+ "return": {
+ "deprecated-props": [
+ "bpb",
+ "te",
+ "cte",
+ "csske"
+ ],
+ "model": {
+ "name": "gen15a-base",
+ "props": {
+ "pfmfi": false,
+ "exrl": true,
+ "stfle45": true,
+ "kmctr-etdea-192": false,
+ "kmctr-etdea-128": false,
+ "nnpa": false,
+ "cmma": false,
+ "dateh2": false,
+ "gen13ptff": false,
+ "aen": true,
+ "kmo-etdea-192": false,
+ "kmf-etdea-192": false,
+ "kmc-etdea-192": false,
+ "kmac-tdea-192": false,
+ "kimd-sha-512": true,
+ "dateh": true,
+ "km-aes-256": false,
+ "km-aes-192": false,
+ "kmctr-aes-256": false,
+ "kma-gcm-eaes-192": false,
+ "kmo-tdea-192": false,
+ "kmf-tdea-192": false,
+ "kmctr-tdea-192": false,
+ "kmctr-tdea-128": false,
+ "km-etdea-192": false,
+ "kmc-tdea-192": false,
+ "cmmnt": false,
+ "iacc2": true,
+ "parseh": false,
+ "klmd-sha-512": true,
+ "kma-gcm-eaes-128": false,
+ "csst": true,
+ "pcc-xts-aes-256": false,
+ "pcc-xts-aes-128": false,
+ "pckmo-aes-128": false,
+ "idter": false,
+ "idtes": true,
+ "prno-trng-qrtcr": false,
+ "pcc-cmac-eaes-128": false,
+ "vxpdeh": false,
+ "aefsi": true,
+ "pckmo-etdea-192": false,
+ "pckmo-etdea-128": false,
+ "diag318": false,
+ "pcc-cmac-eaes-256": false,
+ "msa-base": true,
+ "pcc-cmac-etdea-192": false,
+ "hpma2": false,
+ "kmctr-eaes-256": false,
+ "csske": false,
+ "csst2": true,
+ "mepoch": false,
+ "msa9": false,
+ "msa6": false,
+ "msa1": false,
+ "kmctr-aes-192": false,
+ "pckmo-aes-256": false,
+ "sthyi": false,
+ "stckf": true,
+ "stfle": true,
+ "edat": false,
+ "etf3": true,
+ "etf2": true,
+ "hfpm": false,
+ "ri": false,
+ "pcc-xts-eaes-256": false,
+ "deflate": false,
+ "km-xts-eaes-256": false,
+ "km-xts-eaes-128": false,
+ "edat2": false,
+ "hfpue": false,
+ "kmo-aes-192": false,
+ "kmf-aes-192": false,
+ "km-eaes-192": false,
+ "kmc-aes-192": false,
+ "unpack": false,
+ "dfp": false,
+ "kmo-aes-128": false,
+ "kmf-aes-128": false,
+ "km-eaes-128": false,
+ "kmctr-dea": false,
+ "mvcos": true,
+ "etoken": false,
+ "pcc-cmac-tdea-192": false,
+ "km-dea": false,
+ "sprogp": true,
+ "sigpif": false,
+ "kmac-eaes-128": false,
+ "ldisphp": true,
+ "pckmo-aes-192": false,
+ "ipter": false,
+ "vx": true,
+ "pai": false,
+ "kimd-ghash": false,
+ "emon": false,
+ "kimd-sha-1": false,
+ "cei": false,
+ "cmpsceh": false,
+ "kmctr-eaes-192": false,
+ "kmctr-eaes-128": false,
+ "ginste": true,
+ "km-xts-aes-256": false,
+ "kmac-eaes-256": false,
+ "kmo-eaes-128": false,
+ "kmf-eaes-128": false,
+ "kmc-eaes-128": false,
+ "kmac-aes-128": false,
+ "paie": false,
+ "dfppc": false,
+ "dfpzc": false,
+ "dfphp": false,
+ "kmo-eaes-256": false,
+ "kmf-eaes-256": false,
+ "kmc-eaes-256": false,
+ "kmac-aes-256": false,
+ "kmac-etdea-192": false,
+ "kmac-etdea-128": false,
+ "kmo-dea": false,
+ "kmf-dea": false,
+ "km-edea": false,
+ "kmc-dea": false,
+ "stfle49": true,
+ "klmd-sha-1": false,
+ "mepochptff": false,
+ "opc": false,
+ "ap": false,
+ "asnlxr": false,
+ "gpereh": false,
+ "minste2": true,
+ "pcc-cmac-dea": false,
+ "vxpd": false,
+ "vxeh": true,
+ "esop": true,
+ "ectg": true,
+ "ib": false,
+ "km-tdea-192": false,
+ "km-tdea-128": false,
+ "msa9_pckmo": false,
+ "siif": false,
+ "kma-gcm-aes-256": false,
+ "kma-gcm-aes-192": false,
+ "kma-gcm-aes-128": false,
+ "pcc-cmac-aes-256": false,
+ "tsi": false,
+ "vxeh2": true,
+ "tpei": false,
+ "esort": false,
+ "esan3": true,
+ "fpe": true,
+ "ibs": false,
+ "pcc-xts-eaes-128": false,
+ "kmac-eaes-192": false,
+ "zarch": true,
+ "kmo-edea": false,
+ "kmf-edea": false,
+ "kmc-edea": false,
+ "kmac-dea": false,
+ "appv": false,
+ "apqi": false,
+ "apft": false,
+ "stfle53": true,
+ "ppno-sha-512-drng": false,
+ "pcc-cmac-tdea-128": false,
+ "kmo-aes-256": false,
+ "kmf-aes-256": false,
+ "km-eaes-256": false,
+ "kmc-aes-256": false,
+ "els": false,
+ "sief2": false,
+ "eimm": true,
+ "pcc-cmac-etdea-128": false,
+ "iep": true,
+ "irbm": false,
+ "km-xts-aes-128": false,
+ "srs": true,
+ "appvi": false,
+ "apqci": false,
+ "kmo-tdea-128": false,
+ "kmf-tdea-128": false,
+ "km-etdea-128": false,
+ "kmc-tdea-128": false,
+ "kss": false,
+ "cte": false,
+ "kmac-edea": false,
+ "prno-trng": true,
+ "kma-gcm-eaes-256": false,
+ "ais": true,
+ "fpseh": true,
+ "ltlbc": true,
+ "ldisp": true,
+ "kmo-etdea-128": false,
+ "kmf-etdea-128": false,
+ "kmc-etdea-128": false,
+ "kmac-tdea-128": false,
+ "pcc-cmac-edea": false,
+ "bpb": false,
+ "kmctr-edea": false,
+ "64bscao": false,
+ "ctop": false,
+ "kmo-eaes-192": false,
+ "kmf-eaes-192": false,
+ "kmc-eaes-192": false,
+ "kmac-aes-192": false,
+ "gs": false,
+ "sema": false,
+ "etf3eh": true,
+ "etf2eh": true,
+ "eec": false,
+ "pcc-cmac-eaes-192": false,
+ "ppa15": false,
+ "kmc-prng": false,
+ "zpci": true,
+ "rdp": false,
+ "nonqks": false,
+ "sea_esop2": true,
+ "minste3": true,
+ "beareh": false,
+ "pfpo": false,
+ "te": false,
+ "msa8-base": true,
+ "msa4-base": true,
+ "msa3-base": true,
+ "msa5-base": true,
+ "pcc-cmac-aes-192": false,
+ "cmm": false,
+ "tods": false,
+ "pcc-cmac-aes-128": false,
+ "plo": true,
+ "pckmo-edea": false,
+ "gsls": false,
+ "kmctr-aes-128": false,
+ "skey": false,
+ "vxpdeh2": false
+ }
+ }
+ },
+ "id": "libvirt-4"
+}
+
+{
+ "execute": "query-machines",
+ "id": "libvirt-5"
+}
+
{
"return": [
{
@@ -36737,5 +37081,5 @@
"default-ram-id": "s390.ram"
}
],
- "id": "libvirt-4"
+ "id": "libvirt-5"
}
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
index 79a149d187..c3a9b62ec0 100644
--- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
@@ -136,6 +136,7 @@
<flag name='chardev-reconnect-miliseconds'/>
<flag name='virtio-ccw.loadparm'/>
<flag name='netdev-stream-reconnect-miliseconds'/>
+ <flag name='query-cpu-model-expansion.deprecated-props'/>
<version>9001050</version>
<microcodeVersion>39100247</microcodeVersion>
<package>v9.1.0-1348-g11b8920ed2</package>
@@ -360,6 +361,12 @@
<property name='msa3-base' type='boolean' value='true'/>
<property name='msa5-base' type='boolean' value='true'/>
<property name='tods' type='boolean' value='false'/>
+ <deprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </deprecatedFeatures>
</hostCPU>
<cpu type='tcg' name='z13' typename='z13-s390x-cpu' usable='no'>
<blocker name='ppno-sha-512-drng'/>
--
2.49.0

View File

@ -0,0 +1,76 @@
From 4cf058f2a32fac160803b45c818d798ff268b172 Mon Sep 17 00:00:00 2001
Message-ID: <4cf058f2a32fac160803b45c818d798ff268b172.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 15 Jan 2025 10:46:16 +0100
Subject: [PATCH] qemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW
This capability tracks whether QEMU supports virtio-mem-ccw
device. Introduced in QEMU commit v9.2.0-492-gaa910c20ec only
upcoming release of QEMU supports the device.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit a46e33a92597ed03147e7f6a0c674cda55a0ec52)
Conflicts:
src/qemu/qemu_capabilities.c: Upstream has more caps added meanwhile.
src/qemu/qemu_capabilities.h: Ditto.
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_capabilities.c | 4 ++++
src/qemu/qemu_capabilities.h | 3 +++
tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml | 1 +
3 files changed, 8 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 65e19965dd..1a9cf72482 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -722,6 +722,9 @@ VIR_ENUM_IMPL(virQEMUCaps,
"virtio-ccw.loadparm", /* QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM */
"netdev-stream-reconnect-miliseconds", /* QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS */
"blockdev-set-active", /* QEMU_CAPS_BLOCKDEV_SET_ACTIVE */
+
+ /* 470 */
+ "virtio-mem-ccw", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW */
);
@@ -1411,6 +1414,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "virtio-sound-device", QEMU_CAPS_DEVICE_VIRTIO_SOUND },
{ "sev-snp-guest", QEMU_CAPS_SEV_SNP_GUEST },
{ "acpi-erst", QEMU_CAPS_DEVICE_ACPI_ERST },
+ { "virtio-mem-ccw", QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW },
};
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e93e6a01cc..6467a09796 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -702,6 +702,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS, /* 'reconnect-ms' option for netdev stream supported */
QEMU_CAPS_BLOCKDEV_SET_ACTIVE, /* blockdev-set-active QMP command supported */
+ /* 470 */
+ QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW, /* -device virtio-mem-ccw */
+
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
index 5c5ab096d1..82cabd13b2 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
@@ -139,6 +139,7 @@
<flag name='chardev-reconnect-miliseconds'/>
<flag name='virtio-ccw.loadparm'/>
<flag name='netdev-stream-reconnect-miliseconds'/>
+ <flag name='virtio-mem-ccw'/>
<version>9002050</version>
<microcodeVersion>39100285</microcodeVersion>
<package>v9.2.0-1203-gd6430c17d7</package>
--
2.49.0

View File

@ -0,0 +1,95 @@
From 782c337fb48b56a50ed85cbfe1dc3a8a1342ac08 Mon Sep 17 00:00:00 2001
Message-ID: <782c337fb48b56a50ed85cbfe1dc3a8a1342ac08.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 13 Jan 2025 15:48:03 +0100
Subject: [PATCH] qemu_command: Use qemuBuildVirtioDevProps() to build cmd line
for virtio-mem and virtio-pmem
Both, virtio-mem and virtio-pmem devices follow traditional QEMU
naming convention: their suffix determines what bus they live on.
For instance, virtio-mem-pci, virtio-mem-ccw, virtio-pmem-pci.
We already have a function that constructs device name following
this convention: qemuBuildVirtioDevGetConfigDev().
While there's no virtio-pmem-ccw device yet, the function can
still be used.
Another advantage of using the function is - it'll be easier in
future when we want to configure various virtio aspects of memory
devices (like ats, iommu_platform, etc.).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit 89d56c41ac16452eb5f6f27eb87658277b270f83)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_command.c | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b7d61edd19..fb70c79a94 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -967,6 +967,23 @@ qemuBuildVirtioDevGetConfigDev(const virDomainDeviceDef *device,
break;
}
+ case VIR_DOMAIN_DEVICE_MEMORY:
+ switch (device->data.memory->model) {
+ case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM:
+ *baseName = "virtio-pmem";
+ break;
+ case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM:
+ *baseName = "virtio-mem";
+ break;
+ case VIR_DOMAIN_MEMORY_MODEL_DIMM:
+ case VIR_DOMAIN_MEMORY_MODEL_NVDIMM:
+ case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
+ case VIR_DOMAIN_MEMORY_MODEL_NONE:
+ case VIR_DOMAIN_MEMORY_MODEL_LAST:
+ break;
+ }
+ break;
+
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_WATCHDOG:
case VIR_DOMAIN_DEVICE_GRAPHICS:
@@ -979,7 +996,6 @@ qemuBuildVirtioDevGetConfigDev(const virDomainDeviceDef *device,
case VIR_DOMAIN_DEVICE_SHMEM:
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
- case VIR_DOMAIN_DEVICE_MEMORY:
case VIR_DOMAIN_DEVICE_IOMMU:
case VIR_DOMAIN_DEVICE_AUDIO:
case VIR_DOMAIN_DEVICE_PSTORE:
@@ -3487,12 +3503,16 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg,
break;
case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM:
- device = "virtio-pmem-pci";
+ /* Deliberately not setting @device. */
+ if (!(props = qemuBuildVirtioDevProps(VIR_DOMAIN_DEVICE_MEMORY, mem, priv->qemuCaps)))
+ return NULL;
address = mem->target.virtio_pmem.address;
break;
case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM:
- device = "virtio-mem-pci";
+ /* Deliberately not setting @device. */
+ if (!(props = qemuBuildVirtioDevProps(VIR_DOMAIN_DEVICE_MEMORY, mem, priv->qemuCaps)))
+ return NULL;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_PREALLOC) &&
qemuBuildMemoryGetPagesize(cfg, def, mem, NULL, NULL, NULL, &prealloc) < 0)
@@ -3514,7 +3534,7 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg,
}
if (virJSONValueObjectAdd(&props,
- "s:driver", device,
+ "S:driver", device,
"k:node", mem->targetNode,
"P:label-size", labelsize * 1024,
"P:block-size", blocksize * 1024,
--
2.49.0

View File

@ -0,0 +1,48 @@
From 82f30944276f1cbb997ee42bad66c37cc059067e Mon Sep 17 00:00:00 2001
Message-ID: <82f30944276f1cbb997ee42bad66c37cc059067e.1744876588.git.jdenemar@redhat.com>
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Tue, 18 Mar 2025 14:48:50 +0100
Subject: [PATCH] qemu_domain_address: fix CCW virtio-mem hotplug
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since commit f23f8ff91a virtio-mem supports also CCW. When hotplugging a
virtio-mem device with a CCW address results in a PCI device getting
attached. The method qemuDomainAssignMemoryDeviceSlot is only
considering PCI as address type and overwriting the CCW address. Adding
support for address type CCW.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 9ef080d6d94643fffc413127bff2b2b008a11b27)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_domain_address.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 970ae3949d..b73ac9ebf1 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -3073,6 +3073,7 @@ qemuDomainAssignMemoryDeviceSlot(virDomainObj *vm,
virDomainMemoryDef *mem)
{
g_autoptr(virBitmap) slotmap = NULL;
+ bool releaseaddr = false;
virDomainDeviceDef dev = {.type = VIR_DOMAIN_DEVICE_MEMORY, .data.memory = mem};
switch (mem->model) {
@@ -3086,7 +3087,7 @@ qemuDomainAssignMemoryDeviceSlot(virDomainObj *vm,
case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM:
case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM:
- return qemuDomainEnsurePCIAddress(vm, &dev);
+ return qemuDomainEnsureVirtioAddress(&releaseaddr, vm, &dev);
break;
case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
--
2.49.0

View File

@ -0,0 +1,50 @@
From b0282d5149f90b155a38881f92e3263bd23d9878 Mon Sep 17 00:00:00 2001
Message-ID: <b0282d5149f90b155a38881f92e3263bd23d9878.1741876175.git.jdenemar@redhat.com>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Wed, 31 Jan 2024 17:14:28 +0100
Subject: [PATCH] qemu_snapshot: allow reverting to external disk only snapshot
When snapshot is created with disk-only flag it is always external
snapshot without memory state. Historically when there was not support
to revert external snapshots this produced error message.
error: Failed to revert snapshot s1
error: internal error: Invalid target domain state 'disk-snapshot'. Refusing snapshot reversion
Now we can simply consider this as reverting to offline snapshot as the
possible damage to file system is already done at the point of snapshot
creation.
Resolves: https://issues.redhat.com/browse/RHEL-21549
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 443ae4adec3a94a575ea2acaa112188e721c7dfe)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
src/qemu/qemu_snapshot.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index b1f4ebb995..3a8510c69e 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -2884,6 +2884,7 @@ qemuSnapshotRevert(virDomainObj *vm,
case VIR_DOMAIN_SNAPSHOT_SHUTDOWN:
case VIR_DOMAIN_SNAPSHOT_SHUTOFF:
case VIR_DOMAIN_SNAPSHOT_CRASHED:
+ case VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT:
ret = qemuSnapshotRevertInactive(vm, snapshot, snap,
driver, cfg,
&inactiveConfig,
@@ -2895,8 +2896,6 @@ qemuSnapshotRevert(virDomainObj *vm,
_("qemu doesn't support reversion of snapshot taken in PMSUSPENDED state"));
goto endjob;
- case VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT:
- /* Rejected earlier as an external snapshot */
case VIR_DOMAIN_SNAPSHOT_NOSTATE:
case VIR_DOMAIN_SNAPSHOT_BLOCKED:
case VIR_DOMAIN_SNAPSHOT_LAST:
--
2.48.1

View File

@ -0,0 +1,242 @@
From 09dc3f583b342ef35b1ead29ff5d09d76140590c Mon Sep 17 00:00:00 2001
Message-ID: <09dc3f583b342ef35b1ead29ff5d09d76140590c.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Tue, 14 Jan 2025 12:16:06 +0100
Subject: [PATCH] qemuxmlconftest: Drop s390-default-cpu-...ccw-virtio-2.7 test
cases
In its upstream commit [1], qemu dropped s390-2.7 machine type,
then in commit [2] the s390-2.8 machine type was dropped. But as
Thomas Huth pointed out, any machine type that's older than 6
years is subject to removal [3]. This means, any machine type
older than 4.1 is going to be removed eventually.
We have two test cases that assumes existence of 2.7 machine type.
While they could be switched to 4.1 machine type, we also have
another test case that already check 4.2 machine type.
Therefore, just drop the 2.7 ones.
1: https://gitlab.com/qemu-project/qemu/-/commit/3199c7ee76089fb6844f6b2bed1f5d3d99a7527c
2: https://gitlab.com/qemu-project/qemu/-/commit/66924fe36977d9d9e45ba3e0b6e851ee170507f6
3: https://gitlab.com/qemu-project/qemu/-/commit/ce80c4fa6ff0f5c379bba7db74d04593e9fb12f2
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit 4933dfcce02baa941da6dd9e5b111d36d63ef900)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
...t-cpu-kvm-ccw-virtio-2.7.s390x-latest.args | 32 -------------------
...lt-cpu-kvm-ccw-virtio-2.7.s390x-latest.xml | 25 ---------------
.../s390-default-cpu-kvm-ccw-virtio-2.7.xml | 16 ----------
...t-cpu-tcg-ccw-virtio-2.7.s390x-latest.args | 32 -------------------
...lt-cpu-tcg-ccw-virtio-2.7.s390x-latest.xml | 27 ----------------
.../s390-default-cpu-tcg-ccw-virtio-2.7.xml | 16 ----------
tests/qemuxmlconftest.c | 2 --
7 files changed, 150 deletions(-)
delete mode 100644 tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.args
delete mode 100644 tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.xml
delete mode 100644 tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.xml
delete mode 100644 tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.args
delete mode 100644 tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.xml
delete mode 100644 tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.xml
diff --git a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.args b/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.args
deleted file mode 100644
index 0d44697425..0000000000
--- a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.args
+++ /dev/null
@@ -1,32 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-test \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \
-/usr/bin/qemu-system-s390x \
--name guest=test,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \
--machine s390-ccw-virtio-2.7,usb=off,dump-guest-core=off,memory-backend=s390.ram \
--accel kvm \
--cpu host \
--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 \
--audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.xml b/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.xml
deleted file mode 100644
index ae39e6277d..0000000000
--- a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.s390x-latest.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<domain type='kvm'>
- <name>test</name>
- <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
- <memory unit='KiB'>262144</memory>
- <currentMemory unit='KiB'>262144</currentMemory>
- <vcpu placement='static'>1</vcpu>
- <os>
- <type arch='s390x' machine='s390-ccw-virtio-2.7'>hvm</type>
- <boot dev='hd'/>
- </os>
- <cpu mode='host-passthrough' check='none'/>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-s390x</emulator>
- <controller type='pci' index='0' model='pci-root'/>
- <audio id='1' type='none'/>
- <memballoon model='virtio'>
- <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
- </memballoon>
- <panic model='s390'/>
- </devices>
-</domain>
diff --git a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.xml b/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.xml
deleted file mode 100644
index a3c1804f57..0000000000
--- a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-2.7.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<domain type='kvm'>
- <name>test</name>
- <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
- <memory>262144</memory>
- <currentMemory>262144</currentMemory>
- <os>
- <type arch='s390x' machine='s390-ccw-virtio-2.7'>hvm</type>
- </os>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-s390x</emulator>
- </devices>
-</domain>
diff --git a/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.args b/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.args
deleted file mode 100644
index 06b3f5733e..0000000000
--- a/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.args
+++ /dev/null
@@ -1,32 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-test \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \
-/usr/bin/qemu-system-s390x \
--name guest=test,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \
--machine s390-ccw-virtio-2.7,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 \
--audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.xml b/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.xml
deleted file mode 100644
index f4f9e724a9..0000000000
--- a/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.s390x-latest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<domain type='qemu'>
- <name>test</name>
- <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
- <memory unit='KiB'>262144</memory>
- <currentMemory unit='KiB'>262144</currentMemory>
- <vcpu placement='static'>1</vcpu>
- <os>
- <type arch='s390x' machine='s390-ccw-virtio-2.7'>hvm</type>
- <boot dev='hd'/>
- </os>
- <cpu mode='custom' match='exact' check='none'>
- <model fallback='forbid'>qemu</model>
- </cpu>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-s390x</emulator>
- <controller type='pci' index='0' model='pci-root'/>
- <audio id='1' type='none'/>
- <memballoon model='virtio'>
- <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
- </memballoon>
- <panic model='s390'/>
- </devices>
-</domain>
diff --git a/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.xml b/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.xml
deleted file mode 100644
index 3451e9d81f..0000000000
--- a/tests/qemuxmlconfdata/s390-default-cpu-tcg-ccw-virtio-2.7.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<domain type='qemu'>
- <name>test</name>
- <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
- <memory>262144</memory>
- <currentMemory>262144</currentMemory>
- <os>
- <type arch='s390x' machine='s390-ccw-virtio-2.7'>hvm</type>
- </os>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-s390x</emulator>
- </devices>
-</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 2007944c29..00a7677ea7 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2925,8 +2925,6 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-3.1", "ppc64");
DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-4.2", "ppc64");
DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-4.2", "ppc64");
- DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-kvm-ccw-virtio-2.7", "s390x");
- DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-tcg-ccw-virtio-2.7", "s390x");
DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-kvm-ccw-virtio-4.2", "s390x");
DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-tcg-ccw-virtio-4.2", "s390x");
DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-kvm-pc-4.2", "x86_64");
--
2.49.0

View File

@ -0,0 +1,144 @@
From c8df999c2129645b26c043a81b051b330c05ba46 Mon Sep 17 00:00:00 2001
Message-ID: <c8df999c2129645b26c043a81b051b330c05ba46.1742990721.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 11 Mar 2025 09:01:03 +0100
Subject: [PATCH] qemuxmlconftest: Include shared memory 'net-vhostuser' test
cases
The vhost-user protocol requires shared memory support to work properly.
Our test XMLs didn't have it configured as for interface the check if
shared memory is present only produces a warning instead of a proper
error.
Upcoming patches will be moving the check to become fatal so the test
cases need to be fixed first.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 779a975355dcb34898abaefdf8968c214a66ebf1)
https://issues.redhat.com/browse/RHEL-84133
---
tests/qemuxmlconfdata/net-vhostuser-fail.x86_64-latest.xml | 3 +++
tests/qemuxmlconfdata/net-vhostuser-fail.xml | 3 +++
tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.args | 2 +-
tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.xml | 3 +++
tests/qemuxmlconfdata/net-vhostuser-multiq.xml | 3 +++
tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.args | 2 +-
tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.xml | 3 +++
tests/qemuxmlconfdata/net-vhostuser.xml | 3 +++
8 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/tests/qemuxmlconfdata/net-vhostuser-fail.x86_64-latest.xml b/tests/qemuxmlconfdata/net-vhostuser-fail.x86_64-latest.xml
index 60e591001d..ce1ebf9462 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-fail.x86_64-latest.xml
+++ b/tests/qemuxmlconfdata/net-vhostuser-fail.x86_64-latest.xml
@@ -3,6 +3,9 @@
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
+ <memoryBacking>
+ <access mode='shared'/>
+ </memoryBacking>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
diff --git a/tests/qemuxmlconfdata/net-vhostuser-fail.xml b/tests/qemuxmlconfdata/net-vhostuser-fail.xml
index d50589af6f..b6b0b977d5 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-fail.xml
+++ b/tests/qemuxmlconfdata/net-vhostuser-fail.xml
@@ -3,6 +3,9 @@
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
+ <memoryBacking>
+ <access mode='shared'/>
+ </memoryBacking>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
diff --git a/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.args b/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.args
index 922758a034..4ea3d4eebd 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-file","id":"pc.ram","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.xml b/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.xml
index 5c2cf70a4b..93524c2864 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.xml
+++ b/tests/qemuxmlconfdata/net-vhostuser-multiq.x86_64-latest.xml
@@ -3,6 +3,9 @@
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
+ <memoryBacking>
+ <access mode='shared'/>
+ </memoryBacking>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
diff --git a/tests/qemuxmlconfdata/net-vhostuser-multiq.xml b/tests/qemuxmlconfdata/net-vhostuser-multiq.xml
index ed492ea41a..fa324c9d17 100644
--- a/tests/qemuxmlconfdata/net-vhostuser-multiq.xml
+++ b/tests/qemuxmlconfdata/net-vhostuser-multiq.xml
@@ -3,6 +3,9 @@
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
+ <memoryBacking>
+ <access mode='shared'/>
+ </memoryBacking>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
diff --git a/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.args b/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.args
index bc1de8c8ed..f5925c77fe 100644
--- a/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-file","id":"pc.ram","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.xml b/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.xml
index c77d46147e..44bebef2c8 100644
--- a/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.xml
+++ b/tests/qemuxmlconfdata/net-vhostuser.x86_64-latest.xml
@@ -3,6 +3,9 @@
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
+ <memoryBacking>
+ <access mode='shared'/>
+ </memoryBacking>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
diff --git a/tests/qemuxmlconfdata/net-vhostuser.xml b/tests/qemuxmlconfdata/net-vhostuser.xml
index e55a30a54f..91d1abc027 100644
--- a/tests/qemuxmlconfdata/net-vhostuser.xml
+++ b/tests/qemuxmlconfdata/net-vhostuser.xml
@@ -3,6 +3,9 @@
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
+ <memoryBacking>
+ <access mode='shared'/>
+ </memoryBacking>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
--
2.49.0

View File

@ -0,0 +1,215 @@
From e0b10b2446247933187b1ecb718e6405e08c7e57 Mon Sep 17 00:00:00 2001
Message-ID: <e0b10b2446247933187b1ecb718e6405e08c7e57.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Tue, 28 Jan 2025 08:54:36 +0100
Subject: [PATCH] qemuxmlconftest: Introduce
memory-hotplug-virtio-mem-ccw-s390x.xml
This is similar to emuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml
except the explicit placement of virtio-mem onto a PCI bus is removed.
This results in virtio-mem being placed onto CCW "bus" this demonstrating
previous commits working as expected.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit f23f8ff91a35ac6939f75f1cae1c5ced9ba4a02c)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
...lug-virtio-mem-ccw-s390x.s390x-latest.args | 39 ++++++++++++
...plug-virtio-mem-ccw-s390x.s390x-latest.xml | 60 +++++++++++++++++++
.../memory-hotplug-virtio-mem-ccw-s390x.xml | 57 ++++++++++++++++++
tests/qemuxmlconftest.c | 1 +
4 files changed, 157 insertions(+)
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.args
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.xml
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.xml
diff --git a/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.args b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.args
new file mode 100644
index 0000000000..a6bbef5ce7
--- /dev/null
+++ b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.args
@@ -0,0 +1,39 @@
+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 \
+-accel kvm \
+-cpu gen16a-base \
+-m size=2095104k,maxmem=1099511627776k \
+-overcommit mem-lock=off \
+-smp 2,sockets=2,cores=1,threads=1 \
+-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":2145386496}' \
+-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
+-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 \
+-object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
+-device '{"driver":"virtio-mem-ccw","node":0,"block-size":2097152,"requested-size":536870912,"memdev":"memvirtiomem0","id":"virtiomem0","devno":"fe.0.0002"}' \
+-object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
+-device '{"driver":"virtio-mem-ccw","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"memaddr":5637144576,"dynamic-memslots":true,"id":"virtiomem1","devno":"fe.0.0003"}' \
+-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \
+-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0000","drive":"libvirt-1-storage","id":"virtio-disk0","bootindex":1}' \
+-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 \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.xml b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.xml
new file mode 100644
index 0000000000..fe18b1ec7b
--- /dev/null
+++ b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.s390x-latest.xml
@@ -0,0 +1,60 @@
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>8388608</memory>
+ <currentMemory unit='KiB'>8388608</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>gen16a-base</model>
+ <numa>
+ <cell id='0' cpus='0-1' memory='2095104' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <panic model='s390'/>
+ <memory model='virtio-mem'>
+ <target>
+ <size unit='KiB'>1048576</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>524288</requested>
+ </target>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
+ </memory>
+ <memory model='virtio-mem'>
+ <source>
+ <nodemask>1-3</nodemask>
+ <pagesize unit='KiB'>2048</pagesize>
+ </source>
+ <target dynamicMemslots='yes'>
+ <size unit='KiB'>2097152</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>1048576</requested>
+ <address base='0x150000000'/>
+ </target>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0003'/>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.xml b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.xml
new file mode 100644
index 0000000000..4f9f90d1e2
--- /dev/null
+++ b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-ccw-s390x.xml
@@ -0,0 +1,57 @@
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>8388608</memory>
+ <currentMemory unit='KiB'>8388608</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>gen16a-base</model>
+ <numa>
+ <cell id='0' cpus='0-1' memory='2095104' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <memory model='virtio-mem'>
+ <target>
+ <size unit='KiB'>1048576</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>524288</requested>
+ </target>
+ </memory>
+ <memory model='virtio-mem'>
+ <source>
+ <nodemask>1-3</nodemask>
+ <pagesize unit='KiB'>2048</pagesize>
+ </source>
+ <target dynamicMemslots='yes'>
+ <size unit='KiB'>2097152</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>1048576</requested>
+ <address base='0x150000000'/>
+ </target>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 14f159b833..e88aa6da92 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2716,6 +2716,7 @@ mymain(void)
* than other memory devices because of how they handle <labelsize/> */
DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-overlap");
DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-virtio-mem-pci-s390x", "s390x");
+ DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-virtio-mem-ccw-s390x", "s390x");
DO_TEST_CAPS_ARCH_LATEST("machine-aeskeywrap-on-caps", "s390x");
DO_TEST_CAPS_ARCH_LATEST("machine-aeskeywrap-on-cap", "s390x");
--
2.49.0

View File

@ -0,0 +1,228 @@
From 800b0cb9c899ff14ddfb1b8528048a780a4a5949 Mon Sep 17 00:00:00 2001
Message-ID: <800b0cb9c899ff14ddfb1b8528048a780a4a5949.1744876588.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 15 Jan 2025 10:45:31 +0100
Subject: [PATCH] qemuxmlconftest: Introduce
memory-hotplug-virtio-mem-pci-s390x.xml
As of v9.2.0-1413-gd77ae821e8 QEMU supports virtio-mem-pci on
s390 too. Let's add a test case for that.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit 621373d8a850c3882f6b62777f549285a5c0ab97)
Resolves: https://issues.redhat.com/browse/RHEL-72976
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
...lug-virtio-mem-pci-s390x.s390x-latest.args | 41 +++++++++++
...plug-virtio-mem-pci-s390x.s390x-latest.xml | 71 +++++++++++++++++++
.../memory-hotplug-virtio-mem-pci-s390x.xml | 59 +++++++++++++++
tests/qemuxmlconftest.c | 1 +
4 files changed, 172 insertions(+)
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.args
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.xml
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml
diff --git a/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.args b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.args
new file mode 100644
index 0000000000..9704d7d5e9
--- /dev/null
+++ b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.args
@@ -0,0 +1,41 @@
+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 \
+-accel kvm \
+-cpu gen16a-base \
+-m size=2095104k,maxmem=1099511627776k \
+-overcommit mem-lock=off \
+-smp 2,sockets=2,cores=1,threads=1 \
+-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":2145386496}' \
+-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
+-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":"zpci","uid":1,"fid":0,"target":"pci.1","id":"zpci1"}' \
+-device '{"driver":"pci-bridge","chassis_nr":1,"id":"pci.1","bus":"pci.0","addr":"0x1"}' \
+-object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
+-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":536870912,"memdev":"memvirtiomem0","id":"virtiomem0","bus":"pci.0","addr":"0x2"}' \
+-object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
+-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"memaddr":5637144576,"dynamic-memslots":true,"id":"virtiomem1","bus":"pci.1","addr":"0x1"}' \
+-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \
+-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0000","drive":"libvirt-1-storage","id":"virtio-disk0","bootindex":1}' \
+-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 \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.xml b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.xml
new file mode 100644
index 0000000000..336c6e5aac
--- /dev/null
+++ b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.s390x-latest.xml
@@ -0,0 +1,71 @@
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>8388608</memory>
+ <currentMemory unit='KiB'>8388608</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>gen16a-base</model>
+ <numa>
+ <cell id='0' cpus='0-1' memory='2095104' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='pci' index='1' model='pci-bridge'>
+ <model name='pci-bridge'/>
+ <target chassisNr='1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'>
+ <zpci uid='0x0001' fid='0x00000000'/>
+ </address>
+ </controller>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <panic model='s390'/>
+ <memory model='virtio-mem'>
+ <target>
+ <size unit='KiB'>1048576</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>524288</requested>
+ </target>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'>
+ <zpci uid='0x0002' fid='0x00000001'/>
+ </address>
+ </memory>
+ <memory model='virtio-mem'>
+ <source>
+ <nodemask>1-3</nodemask>
+ <pagesize unit='KiB'>2048</pagesize>
+ </source>
+ <target dynamicMemslots='yes'>
+ <size unit='KiB'>2097152</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>1048576</requested>
+ <address base='0x150000000'/>
+ </target>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'>
+ <zpci uid='0x0003' fid='0x00000002'/>
+ </address>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml
new file mode 100644
index 0000000000..747877042a
--- /dev/null
+++ b/tests/qemuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml
@@ -0,0 +1,59 @@
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>8388608</memory>
+ <currentMemory unit='KiB'>8388608</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>gen16a-base</model>
+ <numa>
+ <cell id='0' cpus='0-1' memory='2095104' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <memory model='virtio-mem'>
+ <target>
+ <size unit='KiB'>1048576</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>524288</requested>
+ </target>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </memory>
+ <memory model='virtio-mem'>
+ <source>
+ <nodemask>1-3</nodemask>
+ <pagesize unit='KiB'>2048</pagesize>
+ </source>
+ <target dynamicMemslots='yes'>
+ <size unit='KiB'>2097152</size>
+ <node>0</node>
+ <block unit='KiB'>2048</block>
+ <requested unit='KiB'>1048576</requested>
+ <address base='0x150000000'/>
+ </target>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 00a7677ea7..14f159b833 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2715,6 +2715,7 @@ mymain(void)
* virDomainMemoryDefCheckConflict() works for NVDIMMs which are special
* than other memory devices because of how they handle <labelsize/> */
DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-overlap");
+ DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-virtio-mem-pci-s390x", "s390x");
DO_TEST_CAPS_ARCH_LATEST("machine-aeskeywrap-on-caps", "s390x");
DO_TEST_CAPS_ARCH_LATEST("machine-aeskeywrap-on-cap", "s390x");
--
2.49.0

View File

@ -0,0 +1,534 @@
From 0261587fd9afe1c83d7d2e2d0666c1613aece94e Mon Sep 17 00:00:00 2001
Message-ID: <0261587fd9afe1c83d7d2e2d0666c1613aece94e.1749039441.git.jdenemar@redhat.com>
From: Thomas Huth <thuth@redhat.com>
Date: Mon, 12 May 2025 14:48:12 +0200
Subject: [PATCH] redhat: Restore hunks in
tests/qemucapabilitiesdata/caps_10.0.0_s390x.*
These hunks were ommitted from the backport in commit dd7b0824364c
("tests: add capabilities for QEMU 10.0.0 on s390x"). Now that we've
backported the corresponding feature to RHEL 9, we have to restore the
hunks to make the tests working again.
JIRA: https://issues.redhat.com/browse/RHEL-89415
Upstream Status: RHEL-only
(Hunks taken from commit 652b2eeaa91ebde76b951593e4f77ec3)
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.../caps_10.0.0_s390x.replies | 447 +++++++++++++++++-
.../caps_10.0.0_s390x.xml | 13 +
2 files changed, 458 insertions(+), 2 deletions(-)
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies
index 18f098153d..385c163441 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies
@@ -32985,6 +32985,173 @@
"id": "libvirt-42"
}
+{
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "host"
+ }
+ },
+ "id": "libvirt-43"
+}
+
+{
+ "return": {
+ "deprecated-props": [
+ "bpb",
+ "te",
+ "cte",
+ "csske"
+ ],
+ "model": {
+ "name": "gen16a-base",
+ "props": {
+ "pfmfi": false,
+ "exrl": true,
+ "stfle45": true,
+ "nnpa": true,
+ "cmma": false,
+ "dateh2": true,
+ "gen17ptff": false,
+ "aen": true,
+ "gen13ptff": true,
+ "dateh": true,
+ "ccf": false,
+ "cmmnt": true,
+ "iacc2": true,
+ "parseh": true,
+ "csst": true,
+ "idter": false,
+ "idtes": true,
+ "msa": true,
+ "vxpdeh": true,
+ "aefsi": true,
+ "diag318": true,
+ "hpma2": false,
+ "csst2": true,
+ "csske": true,
+ "mepoch": true,
+ "msa9": true,
+ "msa8": true,
+ "msa7": true,
+ "msa6": true,
+ "msa5": true,
+ "msa4": true,
+ "msa3": true,
+ "msa2": true,
+ "msa1": true,
+ "msa13_pckmo": false,
+ "msa11_pckmo": false,
+ "msa10_pckmo": false,
+ "sthyi": true,
+ "stckf": true,
+ "stfle": true,
+ "etf3": true,
+ "etf2": true,
+ "edat": true,
+ "hfpm": true,
+ "ri": true,
+ "minste4": false,
+ "deflate": true,
+ "msa13": false,
+ "msa12": false,
+ "msa11": false,
+ "msa10": false,
+ "edat2": true,
+ "hfpue": true,
+ "unpack": false,
+ "dfp": true,
+ "vxpdeh3": false,
+ "mvcos": true,
+ "etoken": true,
+ "sprogp": true,
+ "sigpif": false,
+ "ldisphp": true,
+ "vx": true,
+ "ipter": true,
+ "pai": true,
+ "emon": true,
+ "cei": false,
+ "cmpsceh": true,
+ "ginste": true,
+ "paie": true,
+ "dfppc": true,
+ "dfpzc": true,
+ "dfphp": true,
+ "stfle49": true,
+ "mepochptff": true,
+ "opc": true,
+ "ap": true,
+ "asnlxr": true,
+ "gpereh": false,
+ "sif": false,
+ "minste2": true,
+ "vxeh": true,
+ "vxpd": true,
+ "esop": true,
+ "ectg": true,
+ "ib": false,
+ "msa9_pckmo": true,
+ "siif": false,
+ "vxeh3": false,
+ "vxeh2": true,
+ "tsi": true,
+ "tpei": false,
+ "esan3": true,
+ "esort": true,
+ "fpe": true,
+ "ibs": false,
+ "zarch": true,
+ "appv": true,
+ "apqi": true,
+ "apft": true,
+ "stfle53": true,
+ "els": true,
+ "sief2": false,
+ "eimm": true,
+ "iep": true,
+ "irbm": false,
+ "srs": true,
+ "ineff_nc_tx": false,
+ "appvi": true,
+ "apqci": true,
+ "kss": false,
+ "cte": true,
+ "ais": true,
+ "fpseh": true,
+ "ltlbc": true,
+ "ldisp": true,
+ "bpb": true,
+ "64bscao": false,
+ "ctop": true,
+ "gs": true,
+ "sema": true,
+ "etf3eh": true,
+ "etf2eh": true,
+ "eec": true,
+ "ppa15": true,
+ "zpci": true,
+ "rdp": true,
+ "nonqks": true,
+ "sea_esop2": true,
+ "minste3": true,
+ "plo_ext": false,
+ "beareh": true,
+ "pfpo": true,
+ "te": true,
+ "cmm": true,
+ "tods": true,
+ "plo": true,
+ "gsls": false,
+ "skey": false,
+ "vxpdeh2": true
+ }
+ }
+ },
+ "id": "libvirt-43"
+}
+
{
"execute": "qmp_capabilities",
"id": "libvirt-1"
@@ -37433,10 +37600,286 @@
}
{
- "execute": "query-machines",
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "max"
+ }
+ },
"id": "libvirt-4"
}
+{
+ "return": {
+ "deprecated-props": [
+ "bpb",
+ "te",
+ "cte",
+ "csske"
+ ],
+ "model": {
+ "name": "gen15a-base",
+ "props": {
+ "pfmfi": false,
+ "exrl": true,
+ "stfle45": true,
+ "kmctr-etdea-192": false,
+ "kmctr-etdea-128": false,
+ "nnpa": false,
+ "cmma": false,
+ "dateh2": false,
+ "gen17ptff": false,
+ "gen13ptff": false,
+ "aen": true,
+ "kmo-etdea-192": false,
+ "kmf-etdea-192": false,
+ "kmc-etdea-192": false,
+ "kmac-tdea-192": false,
+ "kimd-sha-512": true,
+ "dateh": true,
+ "km-aes-256": false,
+ "km-aes-192": false,
+ "kmctr-aes-256": false,
+ "ccf": false,
+ "kma-gcm-eaes-192": false,
+ "kmo-tdea-192": false,
+ "kmf-tdea-192": false,
+ "kmctr-tdea-192": false,
+ "kmctr-tdea-128": false,
+ "km-etdea-192": false,
+ "kmc-tdea-192": false,
+ "cmmnt": false,
+ "iacc2": true,
+ "parseh": false,
+ "klmd-sha-512": true,
+ "kma-gcm-eaes-128": false,
+ "csst": true,
+ "pcc-xts-aes-256": false,
+ "pcc-xts-aes-128": false,
+ "pckmo-aes-128": false,
+ "idter": false,
+ "idtes": true,
+ "prno-trng-qrtcr": false,
+ "pcc-cmac-eaes-128": false,
+ "vxpdeh": false,
+ "aefsi": true,
+ "pckmo-etdea-192": false,
+ "pckmo-etdea-128": false,
+ "diag318": false,
+ "pcc-cmac-eaes-256": false,
+ "msa-base": true,
+ "pcc-cmac-etdea-192": false,
+ "hpma2": false,
+ "kmctr-eaes-256": false,
+ "csske": false,
+ "csst2": true,
+ "mepoch": false,
+ "msa9": false,
+ "msa6": false,
+ "msa1": false,
+ "kmctr-aes-192": false,
+ "msa13_pckmo": false,
+ "msa11_pckmo": false,
+ "msa10_pckmo": false,
+ "pckmo-aes-256": false,
+ "sthyi": false,
+ "stckf": true,
+ "stfle": true,
+ "edat": false,
+ "etf3": true,
+ "etf2": true,
+ "hfpm": false,
+ "ri": false,
+ "minste4": false,
+ "pcc-xts-eaes-256": false,
+ "deflate": false,
+ "msa13": false,
+ "msa12": false,
+ "msa11": false,
+ "msa10": false,
+ "km-xts-eaes-256": false,
+ "km-xts-eaes-128": false,
+ "edat2": false,
+ "hfpue": false,
+ "kmo-aes-192": false,
+ "kmf-aes-192": false,
+ "km-eaes-192": false,
+ "kmc-aes-192": false,
+ "unpack": false,
+ "dfp": false,
+ "kmo-aes-128": false,
+ "kmf-aes-128": false,
+ "km-eaes-128": false,
+ "kmctr-dea": false,
+ "vxpdeh3": false,
+ "mvcos": true,
+ "etoken": false,
+ "pcc-cmac-tdea-192": false,
+ "km-dea": false,
+ "sprogp": true,
+ "sigpif": false,
+ "kmac-eaes-128": false,
+ "ldisphp": true,
+ "pckmo-aes-192": false,
+ "ipter": false,
+ "vx": true,
+ "pai": false,
+ "kimd-ghash": false,
+ "emon": false,
+ "kimd-sha-1": false,
+ "cei": false,
+ "cmpsceh": false,
+ "kmctr-eaes-192": false,
+ "kmctr-eaes-128": false,
+ "ginste": true,
+ "km-xts-aes-256": false,
+ "kmac-eaes-256": false,
+ "kmo-eaes-128": false,
+ "kmf-eaes-128": false,
+ "kmc-eaes-128": false,
+ "kmac-aes-128": false,
+ "paie": false,
+ "dfppc": false,
+ "dfpzc": false,
+ "dfphp": false,
+ "kmo-eaes-256": false,
+ "kmf-eaes-256": false,
+ "kmc-eaes-256": false,
+ "kmac-aes-256": false,
+ "kmac-etdea-192": false,
+ "kmac-etdea-128": false,
+ "kmo-dea": false,
+ "kmf-dea": false,
+ "km-edea": false,
+ "kmc-dea": false,
+ "stfle49": true,
+ "klmd-sha-1": false,
+ "mepochptff": false,
+ "opc": false,
+ "ap": false,
+ "asnlxr": false,
+ "gpereh": false,
+ "sif": false,
+ "minste2": true,
+ "pcc-cmac-dea": false,
+ "vxpd": false,
+ "vxeh": true,
+ "esop": true,
+ "ectg": true,
+ "ib": false,
+ "km-tdea-192": false,
+ "km-tdea-128": false,
+ "msa9_pckmo": false,
+ "siif": false,
+ "kma-gcm-aes-256": false,
+ "kma-gcm-aes-192": false,
+ "kma-gcm-aes-128": false,
+ "pcc-cmac-aes-256": false,
+ "vxeh3": false,
+ "tsi": false,
+ "vxeh2": true,
+ "tpei": false,
+ "esort": false,
+ "esan3": true,
+ "fpe": true,
+ "ibs": false,
+ "pcc-xts-eaes-128": false,
+ "kmac-eaes-192": false,
+ "zarch": true,
+ "kmo-edea": false,
+ "kmf-edea": false,
+ "kmc-edea": false,
+ "kmac-dea": false,
+ "appv": false,
+ "apqi": false,
+ "apft": false,
+ "stfle53": true,
+ "ppno-sha-512-drng": false,
+ "pcc-cmac-tdea-128": false,
+ "kmo-aes-256": false,
+ "kmf-aes-256": false,
+ "km-eaes-256": false,
+ "kmc-aes-256": false,
+ "els": false,
+ "sief2": false,
+ "eimm": true,
+ "pcc-cmac-etdea-128": false,
+ "iep": true,
+ "irbm": false,
+ "km-xts-aes-128": false,
+ "srs": true,
+ "appvi": false,
+ "ineff_nc_tx": false,
+ "apqci": false,
+ "kmo-tdea-128": false,
+ "kmf-tdea-128": false,
+ "km-etdea-128": false,
+ "kmc-tdea-128": false,
+ "kss": false,
+ "cte": false,
+ "kmac-edea": false,
+ "prno-trng": true,
+ "kma-gcm-eaes-256": false,
+ "ais": true,
+ "fpseh": true,
+ "ltlbc": true,
+ "ldisp": true,
+ "kmo-etdea-128": false,
+ "kmf-etdea-128": false,
+ "kmc-etdea-128": false,
+ "kmac-tdea-128": false,
+ "pcc-cmac-edea": false,
+ "bpb": false,
+ "kmctr-edea": false,
+ "64bscao": false,
+ "ctop": false,
+ "kmo-eaes-192": false,
+ "kmf-eaes-192": false,
+ "kmc-eaes-192": false,
+ "kmac-aes-192": false,
+ "gs": false,
+ "sema": false,
+ "etf3eh": true,
+ "etf2eh": true,
+ "eec": false,
+ "pcc-cmac-eaes-192": false,
+ "ppa15": false,
+ "kmc-prng": false,
+ "zpci": true,
+ "rdp": false,
+ "nonqks": false,
+ "sea_esop2": true,
+ "minste3": true,
+ "plo_ext": false,
+ "beareh": false,
+ "pfpo": false,
+ "te": false,
+ "msa8-base": true,
+ "msa4-base": true,
+ "msa3-base": true,
+ "msa5-base": true,
+ "pcc-cmac-aes-192": false,
+ "cmm": false,
+ "tods": false,
+ "pcc-cmac-aes-128": false,
+ "plo": true,
+ "pckmo-edea": false,
+ "gsls": false,
+ "kmctr-aes-128": false,
+ "skey": false,
+ "vxpdeh2": false
+ }
+ }
+ },
+ "id": "libvirt-4"
+}
+
+{
+ "execute": "query-machines",
+ "id": "libvirt-5"
+}
+
{
"return": [
{
@@ -37709,5 +38152,5 @@
"default-ram-id": "s390.ram"
}
],
- "id": "libvirt-4"
+ "id": "libvirt-5"
}
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
index 82cabd13b2..1d7d415e5b 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
@@ -139,6 +139,7 @@
<flag name='chardev-reconnect-miliseconds'/>
<flag name='virtio-ccw.loadparm'/>
<flag name='netdev-stream-reconnect-miliseconds'/>
+ <flag name='query-cpu-model-expansion.deprecated-props'/>
<flag name='virtio-mem-ccw'/>
<version>9002050</version>
<microcodeVersion>39100285</microcodeVersion>
@@ -200,6 +201,12 @@
<property name='te' type='boolean' value='true'/>
<property name='cmm' type='boolean' value='true'/>
<property name='vxpdeh2' type='boolean' value='true'/>
+ <deprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </deprecatedFeatures>
</hostCPU>
<cpu type='kvm' name='z13' typename='z13-s390x-cpu' usable='yes'/>
<cpu type='kvm' name='z990.3' typename='z990.3-s390x-cpu' usable='yes'/>
@@ -398,6 +405,12 @@
<property name='msa3-base' type='boolean' value='true'/>
<property name='msa5-base' type='boolean' value='true'/>
<property name='tods' type='boolean' value='false'/>
+ <deprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </deprecatedFeatures>
</hostCPU>
<cpu type='tcg' name='z13' typename='z13-s390x-cpu' usable='no'>
<blocker name='ppno-sha-512-drng'/>
--
2.49.0

View File

@ -0,0 +1,56 @@
From 44fc545f45e2e0077fbdc9d45bf8743d115fca35 Mon Sep 17 00:00:00 2001
Message-ID: <44fc545f45e2e0077fbdc9d45bf8743d115fca35.1741876175.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 29 Jan 2025 15:37:46 +0000
Subject: [PATCH] remote: add sysusers file to create 'libvirt' group
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We previously added a sysusers file, but missed the 'libvirt' group.
This group is referenced in the polkit rules, so we should be
registering that too. It must be done in a separate sysusers file,
however, since it is common to all daemons.
Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 18f0160994af80dfac2dcaf46097922e443b283b)
https://issues.redhat.com/browse/RHEL-81749
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
libvirt.spec.in | 1 +
src/remote/libvirt.sysusers.conf | 1 +
src/remote/meson.build | 7 +++++++
3 files changed, 9 insertions(+)
create mode 100644 src/remote/libvirt.sysusers.conf
diff --git a/src/remote/libvirt.sysusers.conf b/src/remote/libvirt.sysusers.conf
new file mode 100644
index 0000000000..50c6716cce
--- /dev/null
+++ b/src/remote/libvirt.sysusers.conf
@@ -0,0 +1 @@
+g libvirt -
diff --git a/src/remote/meson.build b/src/remote/meson.build
index 831acaaa01..a96eaa1047 100644
--- a/src/remote/meson.build
+++ b/src/remote/meson.build
@@ -307,6 +307,13 @@ if conf.has('WITH_REMOTE')
)
endif
+ # Install the sysuser config for the daemon polkit rules
+ install_data(
+ 'libvirt.sysusers.conf',
+ install_dir: sysusersdir,
+ rename: [ 'libvirt.conf' ],
+ )
+
virt_helpers += {
'name': 'virt-ssh-helper',
'sources': [
--
2.48.1

View File

@ -0,0 +1,202 @@
From 3c4c4271c77ffe624cae83f3cfec15bf0196b774 Mon Sep 17 00:00:00 2001
Message-ID: <3c4c4271c77ffe624cae83f3cfec15bf0196b774.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 16 Dec 2024 16:37:52 +0000
Subject: [PATCH] rpc: remove logind support for virNetDaemon
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The virNetDaemon code now only concerns itself with preventing auto
shutdown of the local daemon. Logind is now handled by the new
virInhibitor object, for QEMU, LXC and LibXL. This fixes two notable
bugs
* Running virtual networks would prevent system shutdown
* Loaded ephemeral secrets would prevent system shutdown
Fixes 9e3cc0ff5e81ed2056a6a528893fd2cb5609d70b
Fixes 37800af9a400385801da6d73654249fdb51a93d8
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 8575724aef4f48f3d66cb7beb4c61014992e31eb)
Resolves: https://issues.redhat.com/browse/RHEL-83064
---
src/libxl/libxl_driver.c | 2 +-
src/lxc/lxc_driver.c | 2 +-
src/qemu/qemu_driver.c | 2 +-
src/rpc/virnetdaemon.c | 78 ----------------------------------------
4 files changed, 3 insertions(+), 81 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index ecd6ea9fa8..2a4f31f93c 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -707,7 +707,7 @@ libxlStateInitialize(bool privileged,
goto error;
libxl_driver->inhibitor = virInhibitorNew(
- VIR_INHIBITOR_WHAT_NONE,
+ VIR_INHIBITOR_WHAT_SHUTDOWN,
_("Libvirt Xen"),
_("Xen virtual machines are running"),
VIR_INHIBITOR_MODE_DELAY,
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 9ee771c62a..72b950ac8a 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1488,7 +1488,7 @@ lxcStateInitialize(bool privileged,
goto cleanup;
lxc_driver->inhibitor = virInhibitorNew(
- VIR_INHIBITOR_WHAT_NONE,
+ VIR_INHIBITOR_WHAT_SHUTDOWN,
_("Libvirt LXC"),
_("LXC containers are running"),
VIR_INHIBITOR_MODE_DELAY,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5b911d5221..f8f3d2c725 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -673,7 +673,7 @@ qemuStateInitialize(bool privileged,
}
qemu_driver->inhibitor = virInhibitorNew(
- VIR_INHIBITOR_WHAT_NONE,
+ VIR_INHIBITOR_WHAT_SHUTDOWN,
_("Libvirt QEMU"),
_("QEMU/KVM virtual machines are running"),
VIR_INHIBITOR_MODE_DELAY,
diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index 9795418126..e4c6261536 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -31,7 +31,6 @@
#include "virutil.h"
#include "virfile.h"
#include "virnetserver.h"
-#include "virgdbus.h"
#include "virhash.h"
#include "virprocess.h"
#include "virsystemd.h"
@@ -80,7 +79,6 @@ struct _virNetDaemon {
int autoShutdownTimerID;
bool autoShutdownTimerActive;
size_t autoShutdownInhibitions;
- int autoShutdownInhibitFd;
};
@@ -109,7 +107,6 @@ virNetDaemonDispose(void *obj)
virEventRemoveHandle(dmn->sigwatch);
#endif /* !WIN32 */
- VIR_FORCE_CLOSE(dmn->autoShutdownInhibitFd);
g_free(dmn->stateStopThread);
g_clear_pointer(&dmn->servers, g_hash_table_unref);
@@ -150,7 +147,6 @@ virNetDaemonNew(void)
#endif /* !WIN32 */
dmn->privileged = geteuid() == 0;
- dmn->autoShutdownInhibitFd = -1;
virProcessActivateMaxFiles();
@@ -491,66 +487,6 @@ virNetDaemonAutoShutdown(virNetDaemon *dmn,
}
-#ifdef G_OS_UNIX
-/* As per: https://www.freedesktop.org/wiki/Software/systemd/inhibit */
-static void
-virNetDaemonCallInhibit(virNetDaemon *dmn,
- const char *what,
- const char *who,
- const char *why,
- const char *mode)
-{
- g_autoptr(GVariant) reply = NULL;
- g_autoptr(GUnixFDList) replyFD = NULL;
- g_autoptr(GVariant) message = NULL;
- GDBusConnection *systemBus;
- int fd;
- int rc;
-
- VIR_DEBUG("dmn=%p what=%s who=%s why=%s mode=%s",
- dmn, NULLSTR(what), NULLSTR(who), NULLSTR(why), NULLSTR(mode));
-
- if (virSystemdHasLogind() < 0)
- return;
-
- if (!(systemBus = virGDBusGetSystemBus()))
- return;
-
- message = g_variant_new("(ssss)", what, who, why, mode);
-
- rc = virGDBusCallMethodWithFD(systemBus,
- &reply,
- G_VARIANT_TYPE("(h)"),
- &replyFD,
- NULL,
- "org.freedesktop.login1",
- "/org/freedesktop/login1",
- "org.freedesktop.login1.Manager",
- "Inhibit",
- message,
- NULL);
-
- if (rc < 0)
- return;
-
- if (g_unix_fd_list_get_length(replyFD) <= 0)
- return;
-
- fd = g_unix_fd_list_get(replyFD, 0, NULL);
- if (fd < 0)
- return;
-
- if (dmn->autoShutdownInhibitions) {
- dmn->autoShutdownInhibitFd = fd;
- VIR_DEBUG("Got inhibit FD %d", fd);
- } else {
- /* We stopped the last VM since we made the inhibit call */
- VIR_DEBUG("Closing inhibit FD %d", fd);
- VIR_FORCE_CLOSE(fd);
- }
-}
-#endif
-
void
virNetDaemonAddShutdownInhibition(virNetDaemon *dmn)
{
@@ -559,15 +495,6 @@ virNetDaemonAddShutdownInhibition(virNetDaemon *dmn)
dmn->autoShutdownInhibitions++;
VIR_DEBUG("dmn=%p inhibitions=%zu", dmn, dmn->autoShutdownInhibitions);
-
-#ifdef G_OS_UNIX
- if (dmn->autoShutdownInhibitions == 1)
- virNetDaemonCallInhibit(dmn,
- "shutdown",
- _("Libvirt"),
- _("Virtual machines need to be saved"),
- "delay");
-#endif
}
@@ -579,11 +506,6 @@ virNetDaemonRemoveShutdownInhibition(virNetDaemon *dmn)
dmn->autoShutdownInhibitions--;
VIR_DEBUG("dmn=%p inhibitions=%zu", dmn, dmn->autoShutdownInhibitions);
-
- if (dmn->autoShutdownInhibitions == 0) {
- VIR_DEBUG("Closing inhibit FD %d", dmn->autoShutdownInhibitFd);
- VIR_FORCE_CLOSE(dmn->autoShutdownInhibitFd);
- }
}
--
2.49.0

View File

@ -0,0 +1,549 @@
From 079d7a5d0a1dd198f96749d415295d8340476902 Mon Sep 17 00:00:00 2001
Message-ID: <079d7a5d0a1dd198f96749d415295d8340476902.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 16 Dec 2024 16:28:48 +0000
Subject: [PATCH] src: convert drivers over to new virInhibitor APIs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This initial conversion of the drivers switches them over to use
the virInhibitor APIs in local daemon only mode. Communication to
logind is still handled by the virNetDaemon class logic.
This mostly just replaces upto 3 fields in the driver state
with a single new virInhibitor object, but otherwise should not
change functionality besides replacing atomics with mutex protected
APIs.
The exception is the LXC driver which has been trying to inhibit
shutdown shutdown but silently failing to, since nothing ever
remembered to set the 'inhibitCallback' pointer in the driver
state struct.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 48f0b6dfa12563f0006d2de4b0f85599e20f9449)
Resolves: https://issues.redhat.com/browse/RHEL-83064
---
src/libxl/libxl_conf.h | 9 +++----
src/libxl/libxl_domain.c | 6 ++---
src/libxl/libxl_driver.c | 15 +++++++----
src/lxc/lxc_conf.h | 9 +++----
src/lxc/lxc_driver.c | 13 +++++++--
src/lxc/lxc_process.c | 9 +++----
src/network/bridge_driver.c | 20 +++++++-------
src/network/bridge_driver_conf.h | 9 +++----
src/qemu/qemu_conf.h | 9 +++----
src/qemu/qemu_driver.c | 12 ++++++---
src/qemu/qemu_process.c | 9 +++----
src/secret/secret_driver.c | 46 +++++++++++++-------------------
12 files changed, 80 insertions(+), 86 deletions(-)
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 7087b41079..0edcde079d 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -35,6 +35,7 @@
#include "virfirmware.h"
#include "libxl_capabilities.h"
#include "libxl_logger.h"
+#include "virinhibitor.h"
#define LIBXL_DRIVER_EXTERNAL_NAME "Xen"
/*
@@ -117,12 +118,8 @@ struct _libxlDriverPrivate {
/* pid file FD, ensures two copies of the driver can't use the same root */
int lockFD;
- /* Atomic inc/dec only */
- unsigned int nactive;
-
- /* Immutable pointers. Caller must provide locking */
- virStateInhibitCallback inhibitCallback;
- void *inhibitOpaque;
+ /* Immutable pointer, self-locking APIs */
+ virInhibitor *inhibitor;
/* Immutable pointer, self-locking APIs */
virDomainObjList *domains;
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 711e22b8df..6805160923 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -873,8 +873,7 @@ libxlDomainCleanup(libxlDriverPrivate *driver,
priv->deathW = NULL;
}
- if (g_atomic_int_dec_and_test(&driver->nactive) && driver->inhibitCallback)
- driver->inhibitCallback(false, driver->inhibitOpaque);
+ virInhibitorRelease(driver->inhibitor);
/* Release auto-allocated graphics ports */
for (i = 0; i < vm->def->ngraphics; i++) {
@@ -1418,8 +1417,7 @@ libxlDomainStart(libxlDriverPrivate *driver,
return -1;
}
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED,
restore_fd < 0 ?
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index b670e697c6..ecd6ea9fa8 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -437,8 +437,7 @@ libxlReconnectDomain(virDomainObj *vm,
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
VIR_DOMAIN_RUNNING_UNKNOWN);
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
/* Enable domain death events */
libxl_evenable_domain_death(cfg->ctx, vm->def->id, 0, &priv->deathW);
@@ -514,6 +513,7 @@ libxlStateCleanup(void)
virObjectUnref(libxl_driver->domainEventState);
virSysinfoDefFree(libxl_driver->hostsysinfo);
+ virInhibitorFree(libxl_driver->inhibitor);
if (libxl_driver->lockFD != -1)
virPidFileRelease(libxl_driver->config->stateDir, "driver", libxl_driver->lockFD);
@@ -675,9 +675,6 @@ libxlStateInitialize(bool privileged,
return VIR_DRV_STATE_INIT_ERROR;
}
- libxl_driver->inhibitCallback = callback;
- libxl_driver->inhibitOpaque = opaque;
-
/* Allocate bitmap for vnc port reservation */
if (!(libxl_driver->reservedGraphicsPorts =
virPortAllocatorRangeNew(_("VNC"),
@@ -709,6 +706,14 @@ libxlStateInitialize(bool privileged,
if (libxlDriverConfigLoadFile(cfg, driverConf) < 0)
goto error;
+ libxl_driver->inhibitor = virInhibitorNew(
+ VIR_INHIBITOR_WHAT_NONE,
+ _("Libvirt Xen"),
+ _("Xen virtual machines are running"),
+ VIR_INHIBITOR_MODE_DELAY,
+ callback,
+ opaque);
+
/* Register the callbacks providing access to libvirt's event loop */
libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->ctx);
diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
index c0967ac63b..73c60c7ebf 100644
--- a/src/lxc/lxc_conf.h
+++ b/src/lxc/lxc_conf.h
@@ -30,6 +30,7 @@
#include "virsysinfo.h"
#include "virclosecallbacks.h"
#include "virhostdev.h"
+#include "virinhibitor.h"
#define LXC_DRIVER_NAME "LXC"
@@ -76,12 +77,8 @@ struct _virLXCDriver {
/* Immutable pointer, lockless APIs */
virSysinfoDef *hostsysinfo;
- /* Atomic inc/dec only */
- unsigned int nactive;
-
- /* Immutable pointers. Caller must provide locking */
- virStateInhibitCallback inhibitCallback;
- void *inhibitOpaque;
+ /* Immutable pointer, self-locking APIs */
+ virInhibitor *inhibitor;
/* Immutable pointer, self-locking APIs */
virDomainObjList *domains;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 9609d7d10c..9ee771c62a 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1433,8 +1433,8 @@ static virDrvStateInitResult
lxcStateInitialize(bool privileged,
const char *root,
bool monolithic G_GNUC_UNUSED,
- virStateInhibitCallback callback G_GNUC_UNUSED,
- void *opaque G_GNUC_UNUSED)
+ virStateInhibitCallback callback,
+ void *opaque)
{
virLXCDriverConfig *cfg = NULL;
bool autostart = true;
@@ -1487,6 +1487,14 @@ lxcStateInitialize(bool privileged,
if (virLXCLoadDriverConfig(cfg, SYSCONFDIR "/libvirt/lxc.conf") < 0)
goto cleanup;
+ lxc_driver->inhibitor = virInhibitorNew(
+ VIR_INHIBITOR_WHAT_NONE,
+ _("Libvirt LXC"),
+ _("LXC containers are running"),
+ VIR_INHIBITOR_MODE_DELAY,
+ callback,
+ opaque);
+
if (!(lxc_driver->securityManager = lxcSecurityInit(cfg)))
goto cleanup;
@@ -1591,6 +1599,7 @@ static int lxcStateCleanup(void)
virObjectUnref(lxc_driver->caps);
virObjectUnref(lxc_driver->securityManager);
virObjectUnref(lxc_driver->xmlopt);
+ virInhibitorFree(lxc_driver->inhibitor);
if (lxc_driver->lockFD != -1)
virPidFileRelease(lxc_driver->config->stateDir, "driver", lxc_driver->lockFD);
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index cd8bcfc282..c2982244f0 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -203,8 +203,7 @@ static void virLXCProcessCleanup(virLXCDriver *driver,
vm->pid = 0;
vm->def->id = -1;
- if (g_atomic_int_dec_and_test(&driver->nactive) && driver->inhibitCallback)
- driver->inhibitCallback(false, driver->inhibitOpaque);
+ virInhibitorRelease(driver->inhibitor);
virLXCDomainReAttachHostDevices(driver, vm->def);
@@ -1466,8 +1465,7 @@ int virLXCProcessStart(virLXCDriver * driver,
if (virCommandHandshakeNotify(cmd) < 0)
goto cleanup;
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
/* The first synchronization point is when the controller creates CGroups. */
if (lxcContainerWaitForContinue(handshakefds[0]) < 0) {
@@ -1665,8 +1663,7 @@ virLXCProcessReconnectDomain(virDomainObj *vm,
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
VIR_DOMAIN_RUNNING_UNKNOWN);
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
if (!(priv->monitor = virLXCProcessConnectMonitor(driver, vm)))
goto error;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index e700a614a9..ce793c12ef 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -504,8 +504,7 @@ networkUpdateState(virNetworkObj *obj,
if (virNetworkObjIsActive(obj)) {
virNetworkObjPortForEach(obj, networkUpdatePort, obj);
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
}
/* Try and read dnsmasq pids of both active and inactive networks, just in
@@ -644,9 +643,6 @@ networkStateInitialize(bool privileged,
goto error;
}
- network_driver->inhibitCallback = callback;
- network_driver->inhibitOpaque = opaque;
-
network_driver->privileged = privileged;
if (!(network_driver->xmlopt = networkDnsmasqCreateXMLConf()))
@@ -655,6 +651,14 @@ networkStateInitialize(bool privileged,
if (!(network_driver->config = cfg = virNetworkDriverConfigNew(privileged)))
goto error;
+ network_driver->inhibitor = virInhibitorNew(
+ VIR_INHIBITOR_WHAT_NONE,
+ _("Libvirt Network"),
+ _("Virtual networks are active"),
+ VIR_INHIBITOR_MODE_DELAY,
+ callback,
+ opaque);
+
if ((network_driver->lockFD =
virPidFileAcquire(cfg->stateDir, "driver", getpid())) < 0)
goto error;
@@ -2432,8 +2436,7 @@ networkStartNetwork(virNetworkDriverState *driver,
obj, network_driver->xmlopt) < 0)
goto cleanup;
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
virNetworkObjSetActive(obj, true);
VIR_INFO("Network '%s' started up", def->name);
@@ -2509,8 +2512,7 @@ networkShutdownNetwork(virNetworkDriverState *driver,
virNetworkObjSetActive(obj, false);
- if (g_atomic_int_dec_and_test(&driver->nactive) && driver->inhibitCallback)
- driver->inhibitCallback(false, driver->inhibitOpaque);
+ virInhibitorRelease(driver->inhibitor);
virNetworkObjUnsetDefTransient(obj);
return ret;
diff --git a/src/network/bridge_driver_conf.h b/src/network/bridge_driver_conf.h
index 1beed01efb..2a2e2bc16d 100644
--- a/src/network/bridge_driver_conf.h
+++ b/src/network/bridge_driver_conf.h
@@ -27,6 +27,7 @@
#include "virnetworkobj.h"
#include "object_event.h"
#include "virfirewall.h"
+#include "virinhibitor.h"
typedef struct _virNetworkDriverConfig virNetworkDriverConfig;
struct _virNetworkDriverConfig {
@@ -49,12 +50,8 @@ typedef struct _virNetworkDriverState virNetworkDriverState;
struct _virNetworkDriverState {
virMutex lock;
- /* Atomic inc/dec only */
- unsigned int nactive;
-
- /* Immutable pointers. Caller must provide locking */
- virStateInhibitCallback inhibitCallback;
- void *inhibitOpaque;
+ /* Immutable pointer, self-locking APIs */
+ virInhibitor *inhibitor;
/* Read-only */
bool privileged;
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 23a900193e..42cdb6f883 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -42,6 +42,7 @@
#include "virfile.h"
#include "virfilecache.h"
#include "virfirmware.h"
+#include "virinhibitor.h"
#define QEMU_DRIVER_NAME "QEMU"
@@ -257,16 +258,12 @@ struct _virQEMUDriver {
/* Atomic increment only */
int lastvmid;
- /* Atomic inc/dec only */
- unsigned int nactive;
-
/* Immutable values */
bool privileged;
char *embeddedRoot;
- /* Immutable pointers. Caller must provide locking */
- virStateInhibitCallback inhibitCallback;
- void *inhibitOpaque;
+ /* Immutable pointer, self-locking APIs */
+ virInhibitor *inhibitor;
/* Immutable pointer, self-locking APIs */
virDomainObjList *domains;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 379f9fb74f..5b911d5221 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -573,9 +573,6 @@ qemuStateInitialize(bool privileged,
return VIR_DRV_STATE_INIT_ERROR;
}
- qemu_driver->inhibitCallback = callback;
- qemu_driver->inhibitOpaque = opaque;
-
qemu_driver->privileged = privileged;
qemu_driver->hostarch = virArchFromHost();
if (root != NULL)
@@ -675,6 +672,14 @@ qemuStateInitialize(bool privileged,
goto error;
}
+ qemu_driver->inhibitor = virInhibitorNew(
+ VIR_INHIBITOR_WHAT_NONE,
+ _("Libvirt QEMU"),
+ _("QEMU/KVM virtual machines are running"),
+ VIR_INHIBITOR_MODE_DELAY,
+ callback,
+ opaque);
+
if ((qemu_driver->lockFD =
virPidFileAcquire(cfg->stateDir, "driver", getpid())) < 0)
goto error;
@@ -1065,6 +1070,7 @@ qemuStateCleanup(void)
ebtablesContextFree(qemu_driver->ebtables);
virObjectUnref(qemu_driver->domains);
virObjectUnref(qemu_driver->nbdkitCapsCache);
+ virInhibitorFree(qemu_driver->inhibitor);
if (qemu_driver->lockFD != -1)
virPidFileRelease(qemu_driver->config->stateDir, "driver", qemu_driver->lockFD);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7285fd5ce9..722e982b9e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5853,8 +5853,7 @@ qemuProcessInit(virQEMUDriver *driver,
qemuDomainSetFakeReboot(vm, false);
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_STARTING_UP);
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
/* Run an early hook to set-up missing devices */
if (qemuProcessStartHook(driver, vm,
@@ -8885,8 +8884,7 @@ void qemuProcessStop(virQEMUDriver *driver,
if (priv->eventThread)
g_object_unref(g_steal_pointer(&priv->eventThread));
- if (g_atomic_int_dec_and_test(&driver->nactive) && driver->inhibitCallback)
- driver->inhibitCallback(false, driver->inhibitOpaque);
+ virInhibitorRelease(driver->inhibitor);
/* Clear network bandwidth */
virDomainClearNetBandwidth(vm->def);
@@ -9644,8 +9642,7 @@ qemuProcessReconnect(void *opaque)
goto error;
}
- if (g_atomic_int_add(&driver->nactive, 1) == 0 && driver->inhibitCallback)
- driver->inhibitCallback(true, driver->inhibitOpaque);
+ virInhibitorHold(driver->inhibitor);
cleanup:
if (jobStarted)
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index a2d6b879d0..04c3ca49f1 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -41,6 +41,7 @@
#include "viraccessapicheck.h"
#include "secret_event.h"
#include "virutil.h"
+#include "virinhibitor.h"
#define VIR_FROM_THIS VIR_FROM_SECRET
@@ -67,9 +68,8 @@ struct _virSecretDriverState {
/* Immutable pointer, self-locking APIs */
virObjectEventState *secretEventState;
- /* Immutable pointers. Caller must provide locking */
- virStateInhibitCallback inhibitCallback;
- void *inhibitOpaque;
+ /* Immutable pointer, self-locking APIs */
+ virInhibitor *inhibitor;
};
static virSecretDriverState *driver;
@@ -90,23 +90,6 @@ secretObjFromSecret(virSecretPtr secret)
}
-static bool
-secretNumOfEphemeralSecretsHelper(virConnectPtr conn G_GNUC_UNUSED,
- virSecretDef *def)
-{
- return def->isephemeral;
-}
-
-
-static int
-secretNumOfEphemeralSecrets(void)
-{
- return virSecretObjListNumOfSecrets(driver->secrets,
- secretNumOfEphemeralSecretsHelper,
- NULL);
-}
-
-
/* Driver functions */
static int
@@ -271,6 +254,10 @@ secretDefineXML(virConnectPtr conn,
objDef->uuid,
objDef->usage_type,
objDef->usage_id);
+
+ if (objDef->isephemeral)
+ virInhibitorHold(driver->inhibitor);
+
goto cleanup;
restore_backup:
@@ -288,8 +275,6 @@ secretDefineXML(virConnectPtr conn,
virSecretDefFree(def);
virSecretObjEndAPI(&obj);
- if (secretNumOfEphemeralSecrets() > 0)
- driver->inhibitCallback(true, driver->inhibitOpaque);
virObjectEventStateQueue(driver->secretEventState, event);
@@ -440,6 +425,9 @@ secretUndefine(virSecretPtr secret)
VIR_SECRET_EVENT_UNDEFINED,
0);
+ if (def->isephemeral)
+ virInhibitorRelease(driver->inhibitor);
+
virSecretObjDeleteData(obj);
virSecretObjListRemove(driver->secrets, obj);
@@ -450,9 +438,6 @@ secretUndefine(virSecretPtr secret)
cleanup:
virSecretObjEndAPI(&obj);
- if (secretNumOfEphemeralSecrets() == 0)
- driver->inhibitCallback(false, driver->inhibitOpaque);
-
virObjectEventStateQueue(driver->secretEventState, event);
return ret;
@@ -469,6 +454,7 @@ secretStateCleanupLocked(void)
VIR_FREE(driver->configDir);
virObjectUnref(driver->secretEventState);
+ virInhibitorFree(driver->inhibitor);
if (driver->lockFD != -1)
virPidFileRelease(driver->stateDir, "driver", driver->lockFD);
@@ -502,8 +488,6 @@ secretStateInitialize(bool privileged,
driver->lockFD = -1;
driver->secretEventState = virObjectEventStateNew();
driver->privileged = privileged;
- driver->inhibitCallback = callback;
- driver->inhibitOpaque = opaque;
if (root) {
driver->embeddedRoot = g_strdup(root);
@@ -535,6 +519,14 @@ secretStateInitialize(bool privileged,
goto error;
}
+ driver->inhibitor = virInhibitorNew(
+ VIR_INHIBITOR_WHAT_NONE,
+ _("Libvirt Secret"),
+ _("Ephemeral secrets are loaded"),
+ VIR_INHIBITOR_MODE_DELAY,
+ callback,
+ opaque);
+
if ((driver->lockFD =
virPidFileAcquire(driver->stateDir, "driver", getpid())) < 0)
goto error;
--
2.49.0

View File

@ -0,0 +1,167 @@
From 27c5b0f2d04b700ef763ae1299143bca638c6d91 Mon Sep 17 00:00:00 2001
Message-ID: <27c5b0f2d04b700ef763ae1299143bca638c6d91.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 26 Feb 2025 18:39:18 +0000
Subject: [PATCH] src: introduce 'raw' and 'rawset' ACPI table types
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The QEMU driver has only accepted type=slic even though QEMU is able to
accept individual tables of any type, without needing to specify a
signature. Introduce type=raw to address this usage scenario. Contrary
to other types, this one may appear multiple times.
The Xen driver has mistakenly accepted type=slic and use it to set the
Xen acpi_firmware setting, which performs a simple passthrough of
multiple concatenated data table. Introduce type=rawset to address
this usage scenario.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 513ef8f028e8b0acbad2c38b8db6507bd96484cc)
Resolves: https://issues.redhat.com/browse/RHEL-81041
---
docs/formatdomain.rst | 19 ++++++++++++++++---
src/conf/domain_conf.c | 5 ++++-
src/conf/domain_conf.h | 2 ++
src/conf/schemas/domaincommon.rng | 6 +++++-
src/libxl/libxl_domain.c | 7 +++++++
src/qemu/qemu_command.c | 2 ++
src/qemu/qemu_validate.c | 7 +++++++
7 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index c077c09a39..b6e162235c 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -484,9 +484,22 @@ These options apply to any form of booting of the guest OS.
...
``acpi``
- The ``table`` element contains a fully-qualified path to the ACPI table. The
- ``type`` attribute contains the ACPI table type (currently only ``slic`` is
- supported) :since:`Since 1.3.5 (QEMU)` :since:`Since 5.9.0 (Xen)`
+ The ``table`` element contains a fully-qualified path to the ACPI table,
+ with the ``type`` attribute dictating what data must be present in the
+ file:
+
+ * ``raw``: a single ACPI table with header and data, with ACPI
+ signature auto-detected from header (:since:`Since 11.2.0`).
+ * ``rawset``: concatenation of multiple ACPI tables with header
+ and data, each with any ACPI signature, auto-detected from header
+ (:since:`Since 11.2.0`).
+ * ``slic``: a single ACPI table with header and data, providing
+ software licensing information. The ACPI table signature in the
+ header will be forced to ``SLIC`` (:since:`Since 1.3.5 (QEMU)`,
+ mis-interpreted as ``rawset`` :since:`Since 5.9.0 (Xen)`).
+
+ Each type may be used only once, except for ``raw`` which can
+ appear multiple times.
SMBIOS System Information
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b0628da279..2ee0403c86 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1458,6 +1458,8 @@ VIR_ENUM_IMPL(virDomainOsDefFirmwareFeature,
VIR_ENUM_IMPL(virDomainOsACPITable,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST,
+ "raw",
+ "rawset",
"slic",
);
@@ -17891,7 +17893,8 @@ virDomainDefParseBootAcpiOptions(virDomainDef *def,
goto error;
for (j = 0; j < i; j++) {
- if (tables[j]->type == type) {
+ if (tables[j]->type == type &&
+ type != VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW) {
virReportError(VIR_ERR_XML_ERROR,
_("ACPI table type '%1$s' may only appear once"),
virDomainOsACPITableTypeToString(type));
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f52b80caec..bc3f42888e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2463,6 +2463,8 @@ typedef enum {
VIR_ENUM_DECL(virDomainOsDefFirmwareFeature);
typedef enum {
+ VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW,
+ VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index d433e95d8b..99bcc90d4f 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -7188,7 +7188,11 @@
<zeroOrMore>
<element name="table">
<attribute name="type">
- <value>slic</value>
+ <choice>
+ <value>raw</value>
+ <value>rawset</value>
+ <value>slic</value>
+ </choice>
</attribute>
<ref name="absFilePath"/>
</element>
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index efd01840de..e564d9e5fe 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -336,6 +336,13 @@ libxlDomainDefValidate(const virDomainDef *def,
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
break;
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("ACPI table type '%1$s' is not supported"),
+ virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
+ return -1;
+
default:
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
virReportEnumRangeError(virDomainOsACPITable,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 756dd2168b..94fb7fc4c2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -130,6 +130,8 @@ VIR_ENUM_IMPL(qemuNumaPolicy,
VIR_ENUM_DECL(qemuACPITableSIG);
VIR_ENUM_IMPL(qemuACPITableSIG,
VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST,
+ "", /* raw */
+ "", /* rawset */
"SLIC");
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index e500a5d314..8ef0257d73 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -732,6 +732,13 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
break;
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("ACPI table type '%1$s' is not supported"),
+ virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
+ return -1;
+
default:
case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
virReportEnumRangeError(virDomainOsACPITable,
--
2.49.0

View File

@ -0,0 +1,94 @@
From 39e946bdfdd15667379debea04d91fac43bde541 Mon Sep 17 00:00:00 2001
Message-ID: <39e946bdfdd15667379debea04d91fac43bde541.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 17 Feb 2025 16:39:29 +0000
Subject: [PATCH] src: validate permitted ACPI table types in libxl/qemu
drivers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This forces us to update the drivers when defining new table types
to avoid incorrectly accepting them by default.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 3d94587655696509f34492f75c2a31a7a93eb2f9)
Resolves: https://issues.redhat.com/browse/RHEL-81041
---
src/libxl/libxl_domain.c | 19 +++++++++++++++++++
src/qemu/qemu_validate.c | 15 +++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 6805160923..efd01840de 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -306,6 +306,7 @@ libxlDomainDefValidate(const virDomainDef *def,
libxlDriverPrivate *driver = opaque;
g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
bool reqSecureBoot = false;
+ size_t i;
if (!virCapabilitiesDomainSupported(cfg->caps, def->os.type,
def->os.arch,
@@ -330,6 +331,24 @@ libxlDomainDefValidate(const virDomainDef *def,
return -1;
}
+ for (i = 0; i < def->os.nacpiTables; i++) {
+ switch (def->os.acpiTables[i]->type) {
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
+ break;
+
+ default:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
+ virReportEnumRangeError(virDomainOsACPITable,
+ def->os.acpiTables[i]->type);
+ return -1;
+ }
+ }
+ if (def->os.nacpiTables > 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Only a single ACPI table is supported"));
+ return -1;
+ }
+
if (def->nsounds > 0) {
virDomainSoundDef *snd = def->sounds[0];
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 289a3f94cc..e500a5d314 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -686,6 +686,8 @@ static int
qemuValidateDomainDefBoot(const virDomainDef *def,
virQEMUCaps *qemuCaps)
{
+ size_t i;
+
if (def->os.bootloader || def->os.bootloaderArgs) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("bootloader is not supported by QEMU"));
@@ -725,6 +727,19 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
return -1;
}
+ for (i = 0; i < def->os.nacpiTables; i++) {
+ switch (def->os.acpiTables[i]->type) {
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
+ break;
+
+ default:
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
+ virReportEnumRangeError(virDomainOsACPITable,
+ def->os.acpiTables[i]->type);
+ return -1;
+ }
+ }
+
return 0;
}
--
2.49.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
From ceeaa000473ddb72db453f7e38943b961ca16c22 Mon Sep 17 00:00:00 2001
Message-ID: <ceeaa000473ddb72db453f7e38943b961ca16c22.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 8 Jan 2025 17:37:03 +0000
Subject: [PATCH] util: don't attempt to acquire logind inhibitor if not
requested
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When VIR_INHIBITOR_WHAT_NONE is passed to virInhibitorNew, it is
an indication that daemon shutdown should be inhibited, but no
OS level inhibitors acquired. This is done by the virtnetworkd
daemon, for example, to prevent shutdown while running virtual
machines are present, without blocking / delaying OS shutdown.
Unfortunately the code forgot to skip the DBus call in this case,
resulting in errors being logged.
Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit caa10431cdd1aa476637ff721f1947c4e0b53da1)
Resolves: https://issues.redhat.com/browse/RHEL-83064
---
src/util/virinhibitor.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/util/virinhibitor.c b/src/util/virinhibitor.c
index 647bdc9fbb..a95021de5a 100644
--- a/src/util/virinhibitor.c
+++ b/src/util/virinhibitor.c
@@ -152,7 +152,7 @@ virInhibitor *virInhibitorNew(virInhibitorWhat what,
virInhibitor *inhibitor = g_new0(virInhibitor, 1);
inhibitor->fd = -1;
- inhibitor->what = virInhibitorWhatFormat(what);
+ inhibitor->what = what ? virInhibitorWhatFormat(what) : NULL;
inhibitor->who = g_strdup(who);
inhibitor->why = g_strdup(why);
inhibitor->mode = virInhibitorModeTypeToString(mode);
@@ -171,7 +171,8 @@ void virInhibitorHold(virInhibitor *inhibitor)
inhibitor->action(true, inhibitor->actionData);
}
#ifdef G_OS_UNIX
- if (virInhibitorAcquire(
+ if (inhibitor->what &&
+ virInhibitorAcquire(
inhibitor->what, inhibitor->who, inhibitor->why,
inhibitor->mode, &inhibitor->fd) < 0) {
VIR_ERROR(_("Failed to acquire inhibitor: %1$s"),
--
2.49.0

View File

@ -0,0 +1,46 @@
From 593bba2d87b7e2bcfedd544d7d48eba936b7a212 Mon Sep 17 00:00:00 2001
Message-ID: <593bba2d87b7e2bcfedd544d7d48eba936b7a212.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Tue, 7 Jan 2025 15:21:18 +0000
Subject: [PATCH] util: fix off-by-1 in inhibitor constants
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The inhibitor constant values were off-by-1, so when converted into
string format, we picked the wrong names
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit fc3a60d9d7b29283a0b2d57bb06d15fb597a5003)
Resolves: https://issues.redhat.com/browse/RHEL-83064
---
src/util/virinhibitor.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/util/virinhibitor.h b/src/util/virinhibitor.h
index 0a1c445d41..49cf32fbeb 100644
--- a/src/util/virinhibitor.h
+++ b/src/util/virinhibitor.h
@@ -26,13 +26,13 @@ typedef struct _virInhibitor virInhibitor;
typedef enum {
VIR_INHIBITOR_WHAT_NONE = 0,
- VIR_INHIBITOR_WHAT_SLEEP = (1 << 1),
- VIR_INHIBITOR_WHAT_SHUTDOWN = (1 << 2),
- VIR_INHIBITOR_WHAT_IDLE = (1 << 3),
- VIR_INHIBITOR_WHAT_POWER_KEY = (1 << 4),
- VIR_INHIBITOR_WHAT_SUSPEND_KEY = (1 << 5),
- VIR_INHIBITOR_WHAT_HIBERNATE_KEY = (1 << 6),
- VIR_INHIBITOR_WHAT_LID_SWITCH = (1 << 7),
+ VIR_INHIBITOR_WHAT_SLEEP = (1 << 0),
+ VIR_INHIBITOR_WHAT_SHUTDOWN = (1 << 1),
+ VIR_INHIBITOR_WHAT_IDLE = (1 << 2),
+ VIR_INHIBITOR_WHAT_POWER_KEY = (1 << 3),
+ VIR_INHIBITOR_WHAT_SUSPEND_KEY = (1 << 4),
+ VIR_INHIBITOR_WHAT_HIBERNATE_KEY = (1 << 5),
+ VIR_INHIBITOR_WHAT_LID_SWITCH = (1 << 6),
} virInhibitorWhat;
typedef enum {
--
2.49.0

View File

@ -0,0 +1,375 @@
From 4c1429d270836f0e6ab04b052f1184d72d21193c Mon Sep 17 00:00:00 2001
Message-ID: <4c1429d270836f0e6ab04b052f1184d72d21193c.1742990721.git.jdenemar@redhat.com>
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 16 Dec 2024 15:19:34 +0000
Subject: [PATCH] util: introduce object for holding a system inhibitor lock
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The system inhibitor locks are currently handled by code in the
virNetDaemon class. The driver code invokes a callback provided
by the daemon when it wants to start or end inhibition.
When the first inhibition is started, the daemon will call out
to logind to apply it system wide.
This has many flaws
* A single message is registered with logind regardless of
what driver holds the inhibition
* An inhibition of daemon shutdown can't be acquired
without also inhibiting system shutdown
* Config of the inhibitions cannot be tailored by the
driver
The new virInhibitor object addresses these:
* The object directly manages an inhibition with logind
privately to the driver, enabling custom messages to
be set.
* It is possible to acquire an inhibition locally to the
daemon without forwarding it to logind.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit d2e5aa4f4e1501149c9e3095d38ebc04c9a4ba31)
Resolves: https://issues.redhat.com/browse/RHEL-83064
---
po/POTFILES | 1 +
src/libvirt_private.syms | 7 ++
src/util/meson.build | 1 +
src/util/virinhibitor.c | 214 +++++++++++++++++++++++++++++++++++++++
src/util/virinhibitor.h | 58 +++++++++++
5 files changed, 281 insertions(+)
create mode 100644 src/util/virinhibitor.c
create mode 100644 src/util/virinhibitor.h
diff --git a/po/POTFILES b/po/POTFILES
index 3514aa3dca..c71e439fe3 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -293,6 +293,7 @@ src/util/virhostcpu.c
src/util/virhostmem.c
src/util/virhostuptime.c
src/util/viridentity.c
+src/util/virinhibitor.c
src/util/virinitctl.c
src/util/viriscsi.c
src/util/virjson.c
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 7d404fdbf5..727ab52cfe 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2605,6 +2605,13 @@ virIdentitySetUserName;
virIdentitySetX509DName;
+# util/virinhibitor.h
+virInhibitorFree;
+virInhibitorHold;
+virInhibitorNew;
+virInhibitorRelease;
+
+
# util/virinitctl.h
virInitctlFifos;
virInitctlSetRunLevel;
diff --git a/src/util/meson.build b/src/util/meson.build
index 30f71b0227..69ef49139a 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -45,6 +45,7 @@ util_sources = [
'virhostmem.c',
'virhostuptime.c',
'viridentity.c',
+ 'virinhibitor.c',
'virinitctl.c',
'viriscsi.c',
'virjson.c',
diff --git a/src/util/virinhibitor.c b/src/util/virinhibitor.c
new file mode 100644
index 0000000000..647bdc9fbb
--- /dev/null
+++ b/src/util/virinhibitor.c
@@ -0,0 +1,214 @@
+/*
+ * virinhibitor.c: helper APIs for inhibiting host actions
+ *
+ * Copyright (C) 2024 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+
+#include "virinhibitor.h"
+#include "virgdbus.h"
+#include "virsystemd.h"
+#include "virfile.h"
+#include "virlog.h"
+#include "virenum.h"
+
+#define VIR_FROM_THIS VIR_FROM_NONE
+
+VIR_LOG_INIT("util.inhibitor");
+
+struct _virInhibitor {
+ GMutex lock;
+ size_t count;
+ int fd;
+
+ char *what;
+ char *who;
+ char *why;
+ const char *mode;
+
+ virInhibitorAction action;
+ void *actionData;
+};
+
+VIR_ENUM_DECL(virInhibitorMode);
+
+VIR_ENUM_IMPL(virInhibitorMode,
+ VIR_INHIBITOR_MODE_LAST,
+ "block", "delay");
+
+#ifdef G_OS_UNIX
+/* As per: https://www.freedesktop.org/wiki/Software/systemd/inhibit */
+static int
+virInhibitorAcquire(const char *what,
+ const char *who,
+ const char *why,
+ const char *mode,
+ int *inhibitorFD)
+{
+ g_autoptr(GVariant) reply = NULL;
+ g_autoptr(GUnixFDList) replyFD = NULL;
+ g_autoptr(GVariant) message = NULL;
+ GDBusConnection *systemBus;
+ int fd;
+ int rc;
+
+ VIR_DEBUG("what=%s who=%s why=%s mode=%s",
+ NULLSTR(what), NULLSTR(who), NULLSTR(why), NULLSTR(mode));
+
+ if (!(systemBus = virGDBusGetSystemBus())) {
+ VIR_DEBUG("system dbus not available, skipping system inhibitor");
+ return 0;
+ }
+
+ if (virSystemdHasLogind() < 0) {
+ VIR_DEBUG("logind not available, skipping system inhibitor");
+ return 0;
+ }
+
+ message = g_variant_new("(ssss)", what, who, why, mode);
+
+ rc = virGDBusCallMethodWithFD(systemBus,
+ &reply,
+ G_VARIANT_TYPE("(h)"),
+ &replyFD,
+ NULL,
+ "org.freedesktop.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager",
+ "Inhibit",
+ message,
+ NULL);
+
+ if (rc < 0)
+ return -1;
+
+ if (g_unix_fd_list_get_length(replyFD) <= 0) {
+ VIR_DEBUG("Missing inhibitor FD in logind reply");
+ return -1;
+ }
+
+ fd = g_unix_fd_list_get(replyFD, 0, NULL);
+ if (fd < 0) {
+ VIR_DEBUG("Unable to get inhibitor FD from logind reply");
+ return -1;
+ }
+
+ *inhibitorFD = fd;
+ VIR_DEBUG("Got inhibitor FD %d", fd);
+ return 0;
+}
+#endif
+
+
+static char *
+virInhibitorWhatFormat(virInhibitorWhat what)
+{
+ const char *whatstr[] = {
+ "sleep",
+ "shutdown",
+ "idle",
+ "handle-power-key",
+ "handle-suspend-key",
+ "handle-hibernate-key",
+ "handle-lid-switch",
+ };
+ GString *str = g_string_new("");
+ size_t i;
+
+ for (i = 0; i < G_N_ELEMENTS(whatstr); i++) {
+ if (what & (1 << i)) {
+ if (str->len)
+ g_string_append(str, ":");
+ g_string_append(str, whatstr[i]);
+ }
+ }
+
+ return g_string_free(str, FALSE);
+}
+
+
+virInhibitor *virInhibitorNew(virInhibitorWhat what,
+ const char *who,
+ const char *why,
+ virInhibitorMode mode,
+ virInhibitorAction action,
+ void *actionData)
+{
+ virInhibitor *inhibitor = g_new0(virInhibitor, 1);
+
+ inhibitor->fd = -1;
+ inhibitor->what = virInhibitorWhatFormat(what);
+ inhibitor->who = g_strdup(who);
+ inhibitor->why = g_strdup(why);
+ inhibitor->mode = virInhibitorModeTypeToString(mode);
+ inhibitor->action = action;
+ inhibitor->actionData = actionData;
+
+ return inhibitor;
+}
+
+void virInhibitorHold(virInhibitor *inhibitor)
+{
+ g_mutex_lock(&inhibitor->lock);
+
+ if (inhibitor->count == 0) {
+ if (inhibitor->action) {
+ inhibitor->action(true, inhibitor->actionData);
+ }
+#ifdef G_OS_UNIX
+ if (virInhibitorAcquire(
+ inhibitor->what, inhibitor->who, inhibitor->why,
+ inhibitor->mode, &inhibitor->fd) < 0) {
+ VIR_ERROR(_("Failed to acquire inhibitor: %1$s"),
+ virGetLastErrorMessage());
+ virResetLastError();
+ }
+#else
+ VIR_DEBUG("No inhibitor implementation on non-UNIX platforms");
+#endif
+ }
+ inhibitor->count++;
+ g_mutex_unlock(&inhibitor->lock);
+}
+
+
+void virInhibitorRelease(virInhibitor *inhibitor)
+{
+ g_mutex_lock(&inhibitor->lock);
+ inhibitor->count--;
+ if (inhibitor->count == 0) {
+ VIR_FORCE_CLOSE(inhibitor->fd);
+ if (inhibitor->action) {
+ inhibitor->action(false, inhibitor->actionData);
+ }
+ }
+ g_mutex_unlock(&inhibitor->lock);
+}
+
+
+void virInhibitorFree(virInhibitor *inhibitor)
+{
+ if (!inhibitor)
+ return;
+
+ g_free(inhibitor->what);
+ g_free(inhibitor->who);
+ g_free(inhibitor->why);
+ VIR_FORCE_CLOSE(inhibitor->fd);
+ g_free(inhibitor);
+}
diff --git a/src/util/virinhibitor.h b/src/util/virinhibitor.h
new file mode 100644
index 0000000000..0a1c445d41
--- /dev/null
+++ b/src/util/virinhibitor.h
@@ -0,0 +1,58 @@
+/*
+ * virinhibitor.h: helper APIs for inhibiting host actions
+ *
+ * Copyright (C) 2024 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "internal.h"
+
+typedef struct _virInhibitor virInhibitor;
+
+typedef enum {
+ VIR_INHIBITOR_WHAT_NONE = 0,
+ VIR_INHIBITOR_WHAT_SLEEP = (1 << 1),
+ VIR_INHIBITOR_WHAT_SHUTDOWN = (1 << 2),
+ VIR_INHIBITOR_WHAT_IDLE = (1 << 3),
+ VIR_INHIBITOR_WHAT_POWER_KEY = (1 << 4),
+ VIR_INHIBITOR_WHAT_SUSPEND_KEY = (1 << 5),
+ VIR_INHIBITOR_WHAT_HIBERNATE_KEY = (1 << 6),
+ VIR_INHIBITOR_WHAT_LID_SWITCH = (1 << 7),
+} virInhibitorWhat;
+
+typedef enum {
+ VIR_INHIBITOR_MODE_BLOCK,
+ VIR_INHIBITOR_MODE_DELAY,
+
+ VIR_INHIBITOR_MODE_LAST
+} virInhibitorMode;
+
+typedef void (*virInhibitorAction)(bool inhibited,
+ void *opaque);
+
+virInhibitor *virInhibitorNew(virInhibitorWhat what,
+ const char *who,
+ const char *why,
+ virInhibitorMode mode,
+ virInhibitorAction action,
+ void *actionData);
+
+void virInhibitorHold(virInhibitor *inhibitor);
+void virInhibitorRelease(virInhibitor *inhibitor);
+
+void virInhibitorFree(virInhibitor *inhibitor);
--
2.49.0

View File

@ -0,0 +1,47 @@
From 26445297c5b24bd539ec52525b748f86e82dcc52 Mon Sep 17 00:00:00 2001
Message-ID: <26445297c5b24bd539ec52525b748f86e82dcc52.1744876587.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 7 Apr 2025 14:33:01 +0200
Subject: [PATCH] virNodeGetInfo: Improve description of the case when fake
data is reported
virNodeGetInfo due to the rigid desing of the filled struct can't
faithfully represent all topologies. Improve the description when that
happens and outline the fallback topology.
The function docs already state that users ought to use
virConnectGetCapabilities() instead.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 6654cf472c7a8c3e0294012b7c249fc427207759)
https://issues.redhat.com/browse/RHEL-86197
---
src/libvirt-host.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index 318a664d24..b9c717be11 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -414,10 +414,13 @@ virConnectGetMaxVcpus(virConnectPtr conn,
* speed that the first CPU in the machine is currently running at. This speed
* may vary across CPUs and changes continually as the host OS throttles.
*
- * The nodes/sockets/cores/threads data is potentially inaccurate as
- * it assumes a symmetric installation. If one NUMA node has more
- * sockets populated that another NUMA node this information will be
- * wrong. It is also not able to report about CPU dies.
+ * The virNodeInfo structure is not extensible thus only supports global
+ * nodes/sockets/cores/threads (sockets/cores/threads is per NUMA node)
+ * topology information. If the host CPU has any further groupings (e.g.
+ * dies, clusters, etc) or the NUMA topology is non-symmetrical the structure
+ * can't faithfully represent the system. In such cases a fake topology
+ * (nodes = 1, sockets = 1, cores = number of host cpus, threads = 1) which
+ * only correctly represents the total host CPU count is reported.
*
* Applications are recommended to use the virConnectGetCapabilities()
* call instead, which provides all the information except CPU frequency,
--
2.49.0

View File

@ -0,0 +1,71 @@
From 4452c8f1b0a9e953615d15d02ada49c1834c72d5 Mon Sep 17 00:00:00 2001
Message-ID: <4452c8f1b0a9e953615d15d02ada49c1834c72d5.1747908717.git.jdenemar@redhat.com>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 25 Feb 2025 15:22:35 +0100
Subject: [PATCH] virsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD
Resolves: https://issues.redhat.com/browse/RHEL-71883
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 71e75ce09203aa2489803426ae368d1693ee925b)
https://issues.redhat.com/browse/RHEL-88447
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
docs/manpages/virsh.rst | 8 +++++++-
tools/virsh-domain.c | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index aea920b7a7..2bb1313a48 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -2927,7 +2927,7 @@ Success is always reported in this case.
You can limit the types of information that are returned by specifying one or
more flags. Available information types flags are *--user*, *--os*,
-*--timezone*, *--hostname*, *--filesystem*, *--disk* and *--interface*.
+*--timezone*, *--hostname*, *--filesystem*, *--disk*, *--interface* and *--load*.
If an explicitly requested information type is not supported by the guest agent
at that point, the processes will provide an exit code of 1.
@@ -3006,6 +3006,12 @@ returned:
* ``if.<num>.addr.<num1>.addr`` - the IP address of addr <num1>
* ``if.<num>.addr.<num1>.prefix`` - the prefix of IP address of addr <num1>
+*--load* returns:
+* ``load.1m`` - average load in guest for last 1 minute
+* ``load.5m`` - average load in guest for last 5 minutes
+* ``load.15m`` - average load in guest for last 15 minutes
+
+
guestvcpus
----------
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index e4923284af..0f30a65fd9 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -13066,6 +13066,10 @@ static const vshCmdOptDef opts_guestinfo[] = {
.type = VSH_OT_BOOL,
.help = N_("report interface information"),
},
+ {.name = "load",
+ .type = VSH_OT_BOOL,
+ .help = N_("report load averages information"),
+ },
{.name = NULL}
};
@@ -13093,6 +13097,8 @@ cmdGuestInfo(vshControl *ctl, const vshCmd *cmd)
types |= VIR_DOMAIN_GUEST_INFO_DISKS;
if (vshCommandOptBool(cmd, "interface"))
types |= VIR_DOMAIN_GUEST_INFO_INTERFACES;
+ if (vshCommandOptBool(cmd, "load"))
+ types |= VIR_DOMAIN_GUEST_INFO_LOAD;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
--
2.49.0

View File

@ -0,0 +1,160 @@
From 1d5f1c125cbe567b5586ff661e6b030f7f7f4151 Mon Sep 17 00:00:00 2001
Message-ID: <1d5f1c125cbe567b5586ff661e6b030f7f7f4151.1747908718.git.jdenemar@redhat.com>
From: David Judkovics <djudkovi(a)linux.ibm.com>
Date: Thu, 20 Mar 2025 01:28:24 -0400
Subject: [PATCH] virsh: Introduce new hypervisor-cpu-models command
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add new virsh command 'hypervisor-cpu-models'. Command pulls from the
existing domcapabilities XML and uses xpath to parse CPU model strings.
By default, only models reported as usable by the hypervisor on the
host system are printed. User may specify "--all" to also print
models which are not supported on the host.
Signed-off-by: David Judkovics <djudkovi@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 65eeaf12d0780d20fcd7b76479d892c50f56a78c)
https://issues.redhat.com/browse/RHEL-11435
Signed-off-by: Boris Fiuczynski <bfiuczyn@redhat.com>
---
docs/manpages/virsh.rst | 25 ++++++++++++++
tools/virsh-host.c | 75 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 2bb1313a48..4d86caecd6 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -1032,6 +1032,31 @@ listed in the XML description. If *--migratable* is specified, features that
block migration will not be included in the resulting CPU.
+hypervisor-cpu-models
+---------------------
+
+**Syntax:**
+
+::
+
+ hypervisor-cpu-models [--virttype virttype] [--emulator emulator]
+ [--arch arch] [--machine machine] [--all]
+
+Print the list of CPU models known by the hypervisor for the specified architecture.
+It is not guaranteed that a listed CPU will run on the host. To determine CPU
+model compatibility with the host, see ``virsh hypervisor-cpu-baseline`` and
+``virsh hypervisor-cpu-compare``.
+
+The *virttype* option specifies the virtualization type (usable in the 'type'
+attribute of the <domain> top level element from the domain XML). *emulator*
+specifies the path to the emulator, *arch* specifies the CPU architecture, and
+*machine* specifies the machine type.
+
+By default, only the models that are claimed to be "usable" by the hypervisor
+on the host are reported. The option *--all* will report every CPU model known
+to the hypervisor, including ones that are not supported on the hypervisor (e.g.
+newer generation models).
+
DOMAIN COMMANDS
===============
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 2fe64e415f..eac782f2d4 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -1751,6 +1751,75 @@ cmdHypervisorCPUBaseline(vshControl *ctl,
}
+/*
+ * "hypervisor-cpu-models" command
+ */
+static const vshCmdInfo info_hypervisor_cpu_models = {
+ .help = N_("Hypervisor reported CPU models"),
+ .desc = N_("Get the CPU models reported by the hypervisor."),
+};
+
+static const vshCmdOptDef opts_hypervisor_cpu_models[] = {
+ {.name = "virttype",
+ .type = VSH_OT_STRING,
+ .completer = virshDomainVirtTypeCompleter,
+ .help = N_("virtualization type (/domain/@type)"),
+ },
+ {.name = "emulator",
+ .type = VSH_OT_STRING,
+ .help = N_("path to emulator binary (/domain/devices/emulator)"),
+ },
+ {.name = "arch",
+ .type = VSH_OT_STRING,
+ .completer = virshArchCompleter,
+ .help = N_("CPU architecture (/domain/os/type/@arch)"),
+ },
+ {.name = "machine",
+ .type = VSH_OT_STRING,
+ .help = N_("machine type (/domain/os/type/@machine)"),
+ },
+ {.name = "all",
+ .type = VSH_OT_BOOL,
+ .help = N_("include all CPU models known to the hypervisor for the architecture")
+ },
+ {.name = NULL}
+};
+
+static bool
+cmdHypervisorCPUModelNames(vshControl *ctl,
+ const vshCmd *cmd)
+{
+ g_autofree char *caps_xml = NULL;
+ const char *virttype = NULL;
+ const char *emulator = NULL;
+ const char *arch = NULL;
+ const char *machine = NULL;
+ const char *xpath = NULL;
+ virshControl *priv = ctl->privData;
+
+ if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
+ vshCommandOptString(ctl, cmd, "emulator", &emulator) < 0 ||
+ vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
+ vshCommandOptString(ctl, cmd, "machine", &machine) < 0)
+ return false;
+
+ if (vshCommandOptBool(cmd, "all"))
+ xpath = "//cpu//model[@usable]/text()";
+ else
+ xpath = "//cpu//model[@usable='yes']/text()";
+
+ caps_xml = virConnectGetDomainCapabilities(priv->conn, emulator, arch,
+ machine, virttype, 0);
+
+ if (!caps_xml) {
+ vshError(ctl, "%s", _("failed to get hypervisor CPU model names"));
+ return false;
+ }
+
+ return virshDumpXML(ctl, caps_xml, "domcapabilities", xpath, false);
+}
+
+
const vshCmdDef hostAndHypervisorCmds[] = {
{.name = "allocpages",
.handler = cmdAllocpages,
@@ -1818,6 +1887,12 @@ const vshCmdDef hostAndHypervisorCmds[] = {
.info = &info_hypervisor_cpu_compare,
.flags = 0
},
+ {.name = "hypervisor-cpu-models",
+ .handler = cmdHypervisorCPUModelNames,
+ .opts = opts_hypervisor_cpu_models,
+ .info = &info_hypervisor_cpu_models,
+ .flags = 0
+ },
{.name = "maxvcpus",
.handler = cmdMaxvcpus,
.opts = opts_maxvcpus,
--
2.49.0

View File

@ -0,0 +1,79 @@
From 4983d6caf2064c48003a5d092c2d30a1132080ac Mon Sep 17 00:00:00 2001
Message-ID: <4983d6caf2064c48003a5d092c2d30a1132080ac.1749039441.git.jdenemar@redhat.com>
From: Collin Walling <walling@linux.ibm.com>
Date: Mon, 16 Dec 2024 18:03:57 -0500
Subject: [PATCH] virsh: add --disable-deprecated-features flag to
domcapabilities
Add a new flag, --disable-deprecated-features, to the domcapabilities
command. This will modify the output to show the 'host-model' CPU
with features flagged as deprecated paired with the 'disable' policy.
virsh domcapabilities --disable-deprecated-features
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 15d45964e453e04f1761e527266af45554f58fcc)
JIRA: https://issues.redhat.com/browse/RHEL-89415
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
docs/manpages/virsh.rst | 6 ++++++
tools/virsh-host.c | 9 ++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 4d86caecd6..b75e00beb6 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -583,6 +583,7 @@ domcapabilities
domcapabilities [virttype] [emulatorbin] [arch] [machine]
[--xpath EXPRESSION] [--wrap]
+ [--disable-deprecated-features]
Print an XML document describing the domain capabilities for the
@@ -624,6 +625,11 @@ a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
+The **--disable-deprecated-features** argument will modify the contents
+of host-model CPU XML, updating the features list with any features
+flagged as deprecated for the CPU model by the hypervisor. These
+features will be paired with the "disable" policy.
+
pool-capabilities
-----------------
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index eac782f2d4..9a2b689620 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -114,6 +114,10 @@ static const vshCmdOptDef opts_domcapabilities[] = {
.type = VSH_OT_BOOL,
.help = N_("wrap xpath results in an common root element"),
},
+ {.name = "disable-deprecated-features",
+ .type = VSH_OT_BOOL,
+ .help = N_("report host CPU model with deprecated features disabled"),
+ },
{.name = NULL}
};
@@ -126,10 +130,13 @@ cmdDomCapabilities(vshControl *ctl, const vshCmd *cmd)
const char *arch = NULL;
const char *machine = NULL;
const char *xpath = NULL;
- const unsigned int flags = 0; /* No flags so far */
+ unsigned int flags = 0;
bool wrap = vshCommandOptBool(cmd, "wrap");
virshControl *priv = ctl->privData;
+ if (vshCommandOptBool(cmd, "disable-deprecated-features"))
+ flags |= VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES;
+
if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
vshCommandOptString(ctl, cmd, "emulatorbin", &emulatorbin) < 0 ||
vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
--
2.49.0

View File

@ -289,7 +289,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 10.10.0
Release: 7%{?dist}%{?extra_release}
Release: 15%{?dist}%{?extra_release}
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
URL: https://libvirt.org/
@ -380,6 +380,77 @@ Patch80: libvirt-qemu-fail-validation-if-a-domain-def-has-vhostuser-passt-but-no
Patch81: libvirt-docs-improve-type-user-docs-to-higlight-differences-between-SLIRP-and-passt.patch
Patch82: libvirt-docs-document-using-passt-backend-with-interface-type-vhostuser.patch
Patch83: libvirt-utils-Canonicalize-paths-before-comparing-them.patch
Patch84: libvirt-remote-add-sysusers-file-to-create-libvirt-group.patch
Patch85: libvirt-qemu-Avoid-crash-in-qemuDomainCheckCPU-with-unknown-host-CPU.patch
Patch86: libvirt-qemu_snapshot-allow-reverting-to-external-disk-only-snapshot.patch
Patch87: libvirt-qemu-snapshot-error-out-early-when-reverting-snapshot-for-VM-with-non-file-disk.patch
Patch88: libvirt-util-introduce-object-for-holding-a-system-inhibitor-lock.patch
Patch89: libvirt-src-convert-drivers-over-to-new-virInhibitor-APIs.patch
Patch90: libvirt-rpc-remove-logind-support-for-virNetDaemon.patch
Patch91: libvirt-util-fix-off-by-1-in-inhibitor-constants.patch
Patch92: libvirt-util-don-t-attempt-to-acquire-logind-inhibitor-if-not-requested.patch
Patch93: libvirt-network-Free-inhibitor-in-networkStateCleanup.patch
Patch94: libvirt-conf-introduce-support-for-multiple-ACPI-tables.patch
Patch95: libvirt-src-validate-permitted-ACPI-table-types-in-libxl-qemu-drivers.patch
Patch96: libvirt-src-introduce-raw-and-rawset-ACPI-table-types.patch
Patch97: libvirt-qemu-support-raw-ACPI-table-type.patch
Patch98: libvirt-libxl-support-rawset-ACPI-table-type.patch
Patch99: libvirt-conf-support-MSDM-ACPI-table-type.patch
Patch100: libvirt-qemu-support-MSDM-ACPI-table-type.patch
Patch101: libvirt-qemuxmlconftest-Include-shared-memory-net-vhostuser-test-cases.patch
Patch102: libvirt-qemuValidateDomainDeviceDefNetwork-Require-shared-memory-for-all-vhost-user-interfaces.patch
Patch103: libvirt-qemu-process-Remove-un-updated-qemuProcessStartWarnShmem.patch
Patch104: libvirt-esxConnectListAllDomains-Don-t-propagate-failure-to-lookup-a-single-domain.patch
Patch105: libvirt-conf-parse-interface-source-dev-for-all-interface-types-with-backend-type-passt.patch
Patch106: libvirt-libvirt-host-Clarify-fix-description-of-the-CPU-frequency-field.patch
Patch107: libvirt-virNodeGetInfo-Improve-description-of-the-case-when-fake-data-is-reported.patch
Patch108: libvirt-manpages-virsh-Use-disclaimer-from-virNodeGetInfo-for-virsh-nodeinfo.patch
Patch109: libvirt-esx-Accept-empty-path-URI-component-same-way-as.patch
Patch110: libvirt-qemu-Rename-outgoingMigration-parameter-in-various-TPM-functions.patch
Patch111: libvirt-qemu-Properly-propagate-migration-state-to-TPM-cleanup-code.patch
Patch112: libvirt-qemuDomainBlockCopyCommon-Don-t-revoke-access-to-file-twice-on-failure.patch
Patch113: libvirt-qemuxmlconftest-Drop-s390-default-cpu-.ccw-virtio-2.7-test-cases.patch
Patch114: libvirt-tests-add-capabilities-for-QEMU-10.0.0-on-s390x.patch
Patch115: libvirt-qemu-Do-NOT-autoadd-NUMA-node-for-s390.patch
Patch116: libvirt-qemu_command-Use-qemuBuildVirtioDevProps-to-build-cmd-line-for-virtio-mem-and-virtio-pmem.patch
Patch117: libvirt-qemuxmlconftest-Introduce-memory-hotplug-virtio-mem-pci-s390x.xml.patch
Patch118: libvirt-qemu_caps-Introduce-QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW.patch
Patch119: libvirt-qemu-Validate-virtio-mem-ccw.patch
Patch120: libvirt-qemu-Allow-virtio-mem-on-CCW.patch
Patch121: libvirt-qemuxmlconftest-Introduce-memory-hotplug-virtio-mem-ccw-s390x.xml.patch
Patch122: libvirt-qemu_domain_address-fix-CCW-virtio-mem-hotplug.patch
Patch123: libvirt-Add-load-average-information-type-into-virDomainGetGuestInfo.patch
Patch124: libvirt-qemu_agent-Add-qemuAgentGetLoadAvg.patch
Patch125: libvirt-qemu-Add-support-for-VIR_DOMAIN_GUEST_INFO_LOAD.patch
Patch126: libvirt-virsh-Add-support-for-VIR_DOMAIN_GUEST_INFO_LOAD.patch
Patch127: libvirt-qemu_capabilities-Fetch-caps-for-virtio-mem-ccw-too.patch
Patch128: libvirt-cpu_map-Add-avx10-CPU-features.patch
Patch129: libvirt-cpu_map-Add-GraniteRapids-v2-CPU-model.patch
Patch130: libvirt-cpu_map-Add-sha512-sm3-and-sm4-CPU-features.patch
Patch131: libvirt-virsh-Introduce-new-hypervisor-cpu-models-command.patch
Patch132: libvirt-qemu-remove-nonsensical-sanity-check-in-processNetdevStreamDisconnectedEvent.patch
Patch133: libvirt-qemu-make-processNetDevStreamDisconnectedEvent-reusable.patch
Patch134: libvirt-qemu-respond-to-NETDEV_VHOST_USER_DISCONNECTED-event.patch
Patch135: libvirt-qemu-put-vhost-user-code-that-s-special-for-passt-in-a-helper-function.patch
Patch136: libvirt-qemu-make-passt-vhostuser-reconnect-behave-identically-to-passt-user.patch
Patch137: libvirt-qemuMonitorJSONGetCPUModelExpansion-refactor-parsing-functions.patch
Patch138: libvirt-qemu-parse-deprecated-props-from-query-cpu-model-expansion-response.patch
Patch139: libvirt-qemu_capabilities-query-deprecated-features-for-host-model.patch
Patch140: libvirt-libvirt-domain-introduce-VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES.patch
Patch141: libvirt-qemu_capabilities-filter-deprecated-features-if-requested.patch
Patch142: libvirt-virsh-add-disable-deprecated-features-flag-to-domcapabilities.patch
Patch143: libvirt-conf-add-deprecated_features-attribute.patch
Patch144: libvirt-redhat-Restore-hunks-in-tests-qemucapabilitiesdata-caps_10.0.0_s390x.patch
Patch145: libvirt-qemuPrepareNVRAMFile-Fix-NVRAM-image-conversion-check.patch
Patch146: libvirt-qemu-introduce-QEMU_CAPS_AMD_IOMMU.patch
Patch147: libvirt-qemu-introduce-QEMU_CAPS_PCI_ID.patch
Patch148: libvirt-docs-formatdomain-document-intel-only-IOMMU-attributes.patch
Patch149: libvirt-qemu-add-IOMMU-model-amd.patch
Patch150: libvirt-conf-add-passthrough-and-xtsup-attributes-for-IOMMU.patch
Patch151: libvirt-esx-Allow-specifying-different-CA-bundle-for-remote-connections.patch
Patch152: libvirt-qemu-fix-order-of-VNC-TLS-config-entries.patch
Patch153: libvirt-qemu-sanitize-blank-lines-in-config-file.patch
Patch154: libvirt-qemu-add-ability-to-set-TLS-priority-string-with-QEMU.patch
Requires: libvirt-daemon = %{version}-%{release}
@ -2137,6 +2208,7 @@ exit 0
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
%{_sysusersdir}/libvirt.conf
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
%attr(0755, root, root) %{_bindir}/virt-ssh-helper
@ -2704,6 +2776,93 @@ exit 0
%endif
%changelog
* Mon Aug 18 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-15
- qemu: fix order of VNC TLS config entries (RHEL-106276)
- qemu: sanitize blank lines in config file (RHEL-106276)
- qemu: add ability to set TLS priority string with QEMU (RHEL-106276)
* Thu Jul 17 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-14
- qemu: introduce QEMU_CAPS_AMD_IOMMU (RHEL-50560)
- qemu: introduce QEMU_CAPS_PCI_ID (RHEL-50560)
- docs: formatdomain: document intel-only IOMMU attributes (RHEL-50560)
- qemu: add IOMMU model amd (RHEL-50560)
- conf: add passthrough and xtsup attributes for IOMMU (RHEL-50560)
- esx: Allow specifying different CA bundle for remote connections (RHEL-97440)
* Wed Jun 18 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-13
- qemuPrepareNVRAMFile: Fix NVRAM image conversion check (RHEL-97758)
* Wed Jun 4 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-12
- qemuMonitorJSONGetCPUModelExpansion: refactor parsing functions (RHEL-89415)
- qemu: parse deprecated-props from query-cpu-model-expansion response (RHEL-89415)
- qemu_capabilities: query deprecated features for host-model (RHEL-89415)
- libvirt-domain: introduce VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES (RHEL-89415)
- qemu_capabilities: filter deprecated features if requested (RHEL-89415)
- virsh: add --disable-deprecated-features flag to domcapabilities (RHEL-89415)
- conf: add deprecated_features attribute (RHEL-89415)
- redhat: Restore hunks in tests/qemucapabilitiesdata/caps_10.0.0_s390x.* (RHEL-89415)
* Thu May 22 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-11
- Add load average information type into virDomainGetGuestInfo (RHEL-88447)
- qemu_agent: Add qemuAgentGetLoadAvg() (RHEL-88447)
- qemu: Add support for VIR_DOMAIN_GUEST_INFO_LOAD (RHEL-88447)
- virsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD (RHEL-88447)
- qemu_capabilities: Fetch caps for virtio-mem-ccw too (RHEL-87532)
- cpu_map: Add avx10* CPU features (RHEL-87796)
- cpu_map: Add GraniteRapids-v2 CPU model (RHEL-87796)
- cpu_map: Add sha512, sm3, and sm4 CPU features (RHEL-87796)
- virsh: Introduce new hypervisor-cpu-models command (RHEL-11435)
- qemu: remove nonsensical sanity check in processNetdevStreamDisconnectedEvent() (RHEL-80169)
- qemu: make processNetDevStreamDisconnectedEvent() reusable (RHEL-80169)
- qemu: respond to NETDEV_VHOST_USER_DISCONNECTED event (RHEL-80169)
- qemu: put vhost-user code that's special for passt in a helper function (RHEL-80169)
- qemu: make passt+vhostuser reconnect behave identically to passt+user (RHEL-80169)
* Thu Apr 17 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-10
- esxConnectListAllDomains: Don't propagate failure to lookup a single domain (RHEL-80606)
- conf: parse interface/source/@dev for all interface types (with backend type='passt') (RHEL-82539)
- libvirt-host: Clarify/fix description of the CPU frequency field (RHEL-86197)
- virNodeGetInfo: Improve description of the case when fake data is reported (RHEL-86197)
- manpages: virsh: Use disclaimer from 'virNodeGetInfo()' for 'virsh nodeinfo' (RHEL-86197)
- esx: Accept empty "path" URI component same way as "/" (RHEL-86459)
- qemu: Rename outgoingMigration parameter in various TPM functions (RHEL-86800)
- qemu: Properly propagate migration state to TPM cleanup code (RHEL-86800)
- qemuDomainBlockCopyCommon: Don't revoke access to file twice on failure (RHEL-7357)
- qemuxmlconftest: Drop s390-default-cpu-...ccw-virtio-2.7 test cases (RHEL-72976)
- tests: add capabilities for QEMU 10.0.0 on s390x (RHEL-72976)
- qemu: Do NOT autoadd NUMA node for s390 (RHEL-72976)
- qemu_command: Use qemuBuildVirtioDevProps() to build cmd line for virtio-mem and virtio-pmem (RHEL-72976)
- qemuxmlconftest: Introduce memory-hotplug-virtio-mem-pci-s390x.xml (RHEL-72976)
- qemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW (RHEL-72976)
- qemu: Validate virtio-mem-ccw (RHEL-72976)
- qemu: Allow virtio-mem on CCW (RHEL-72976)
- qemuxmlconftest: Introduce memory-hotplug-virtio-mem-ccw-s390x.xml (RHEL-72976)
- qemu_domain_address: fix CCW virtio-mem hotplug (RHEL-72976)
* Wed Mar 26 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-9
- util: introduce object for holding a system inhibitor lock (RHEL-83064)
- src: convert drivers over to new virInhibitor APIs (RHEL-83064)
- rpc: remove logind support for virNetDaemon (RHEL-83064)
- util: fix off-by-1 in inhibitor constants (RHEL-83064)
- util: don't attempt to acquire logind inhibitor if not requested (RHEL-83064)
- network: Free inhibitor in networkStateCleanup() (RHEL-83064)
- conf: introduce support for multiple ACPI tables (RHEL-81041)
- src: validate permitted ACPI table types in libxl/qemu drivers (RHEL-81041)
- src: introduce 'raw' and 'rawset' ACPI table types (RHEL-81041)
- qemu: support 'raw' ACPI table type (RHEL-81041)
- libxl: support 'rawset' ACPI table type (RHEL-81041)
- conf: support MSDM ACPI table type (RHEL-81041)
- qemu: support MSDM ACPI table type (RHEL-81041)
- qemuxmlconftest: Include shared memory 'net-vhostuser' test cases (RHEL-84133)
- qemuValidateDomainDeviceDefNetwork: Require shared memory for all vhost-user interfaces (RHEL-84133)
- qemu: process: Remove un-updated 'qemuProcessStartWarnShmem' (RHEL-84133)
* Thu Mar 13 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-8
- remote: add sysusers file to create 'libvirt' group (RHEL-81749)
- qemu: Avoid crash in qemuDomainCheckCPU with unknown host CPU (RHEL-81747)
- qemu_snapshot: allow reverting to external disk only snapshot (RHEL-21549)
- qemu: snapshot: error out early when reverting snapshot for VM with non-file disk (RHEL-30971)
* Mon Feb 17 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-7
- qemu_migration: Refactor qemuMigrationSrcRestoreDomainState (RHEL-79168)
- qemu_migration: Do not automatically resume domain after I/O error (RHEL-79168)