]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_capabilities: Fetch caps for virtio-mem-ccw too
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 7 May 2025 12:32:52 +0000 (14:32 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 9 May 2025 06:43:30 +0000 (08:43 +0200)
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-87528
Resolves: https://issues.redhat.com/browse/RHEL-87532

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_capabilities.c
tests/qemucapabilitiesdata/caps_10.0.0_s390x.replies

index a804335c85b8849cf4b6043694ff441a88bb52cd..c24584bf75fd272386827d12bbba441ab5dc58ef 100644 (file)
@@ -1551,6 +1551,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 },
@@ -1716,6 +1717,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 },
index d941bc41c7f2402f1e019d3621c927cc144ba5aa..1fe6526a3ff46e8fe9feee79ed4996ac3ecd0822 100644 (file)
 {
   "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": [
     {
       "type": "child<virtio-iommu-device>"
     }
   ],
-  "id": "libvirt-30"
+  "id": "libvirt-31"
 }
 
 {
   "arguments": {
     "typename": "virtio-blk-ccw"
   },
-  "id": "libvirt-31"
+  "id": "libvirt-32"
 }
 
 {
       "type": "bool"
     }
   ],
-  "id": "libvirt-31"
+  "id": "libvirt-32"
 }
 
 {
   "arguments": {
     "typename": "memory-backend-file"
   },
-  "id": "libvirt-32"
+  "id": "libvirt-33"
 }
 
 {
       "type": "bool"
     }
   ],
-  "id": "libvirt-32"
+  "id": "libvirt-33"
 }
 
 {
   "arguments": {
     "typename": "memory-backend-memfd"
   },
-  "id": "libvirt-33"
+  "id": "libvirt-34"
 }
 
 {
       "type": "int"
     }
   ],
-  "id": "libvirt-33"
+  "id": "libvirt-34"
 }
 
 {
   "execute": "query-machines",
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
       "default-ram-id": "s390.ram"
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
   "arguments": {
     "typename": "none-machine"
   },
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
       "type": "bool"
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "execute": "query-cpu-definitions",
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
       "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"
 }
 
 {
       "option": "drive"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
   "execute": "query-migrate-capabilities",
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
       "capability": "mapped-ram"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
       "name": "host"
     }
   },
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
       }
     }
   },
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
       "name": "host"
     }
   },
-  "id": "libvirt-42"
+  "id": "libvirt-43"
 }
 
 {
       }
     }
   },
-  "id": "libvirt-42"
+  "id": "libvirt-43"
 }
 
 {