- 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) Resolves: RHEL-72976, RHEL-7357, RHEL-80606, RHEL-82539, RHEL-86197 Resolves: RHEL-86459, RHEL-86800
87 lines
3.9 KiB
Diff
87 lines
3.9 KiB
Diff
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
|