From 6d104057ac63fed07c493e2a73694503ac0ef0f1 Mon Sep 17 00:00:00 2001 Message-ID: <6d104057ac63fed07c493e2a73694503ac0ef0f1.1747908717.git.jdenemar@redhat.com> From: Michal Privoznik 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 Reviewed-by: Peter Krempa (cherry picked from commit 6ff8d08777ebbcb9a1e11534c3a3341fbf0343e8) Signed-off-by: Michal Privoznik 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" + }, + { + "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" + } + ], + "id": "libvirt-30" +} + +{ + "execute": "device-list-properties", + "arguments": { + "typename": "virtio-iommu-pci" + }, + "id": "libvirt-31" +} + { "return": [ { @@ -29774,7 +29928,7 @@ "type": "child" } ], - "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