[libvirt] [PATCH v2 1/7] qemu: Introduce a new capability for virtio-gpu-ccw

Farhan Ali alifm at linux.vnet.ibm.com
Mon Mar 19 18:35:29 UTC 2018


QEMU on S390 (since v2.11) can support virtio-gpu-ccw device.
Let's introduce a new qemu capability for the device.

Signed-off-by: Farhan Ali <alifm at linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy at linux.vnet.ibm.com>
---
 src/qemu/qemu_capabilities.c                       |  5 ++
 src/qemu/qemu_capabilities.h                       |  1 +
 .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 83 +++++++++++++++++++---
 tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |  3 +-
 4 files changed, 82 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3eb5ed6..256595e 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -459,6 +459,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "pl011",
               "machine.pseries.max-cpu-compat",
               "dump-completed",
+              "virtio-gpu-ccw",
     );
 
 
@@ -1694,6 +1695,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
     { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE },
     { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL },
     { "pl011", QEMU_CAPS_DEVICE_PL011 },
+    { "virtio-gpu-ccw", QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
@@ -1947,6 +1949,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
     { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge,
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge),
       QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
+    { "virtio-gpu-ccw", virQEMUCapsObjectPropsVirtioGpu,
+      ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu),
+      QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
 };
 
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index c2ec2be..b4852e5 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -444,6 +444,7 @@ typedef enum {
     QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */
     QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */
     QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */
+    QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW, /* -device virtio-gpu-ccw */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
index 860904b..2de2560 100644
--- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
@@ -3459,6 +3459,71 @@
 {
   "return": [
     {
+      "name": "notify_on_empty",
+      "description": "on/off",
+      "type": "bool"
+    },
+    {
+      "name": "ioeventfd",
+      "description": "on/off",
+      "type": "bool"
+    },
+    {
+      "name": "any_layout",
+      "description": "on/off",
+      "type": "bool"
+    },
+    {
+      "name": "devno",
+      "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab",
+      "type": "str"
+    },
+    {
+      "name": "indirect_desc",
+      "description": "on/off",
+      "type": "bool"
+    },
+    {
+      "name": "event_idx",
+      "description": "on/off",
+      "type": "bool"
+    },
+    {
+      "name": "virtio-backend",
+      "type": "child<virtio-gpu-device>"
+    },
+    {
+      "name": "yres",
+      "type": "uint32"
+    },
+    {
+      "name": "xres",
+      "type": "uint32"
+    },
+    {
+      "name": "iommu_platform",
+      "description": "on/off",
+      "type": "bool"
+    },
+    {
+      "name": "max_outputs",
+      "type": "uint32"
+    },
+    {
+      "name": "max_hostmem",
+      "type": "size"
+    },
+    {
+      "name": "max_revision",
+      "type": "uint32"
+    }
+  ],
+  "id": "libvirt-34"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": true,
       "name": "s390-ccw-virtio-2.7",
       "cpu-max": 248
@@ -3506,7 +3571,7 @@
       "cpu-max": 248
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
@@ -4040,20 +4105,20 @@
       "migration-safe": true
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
     "emulator"
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
@@ -5174,7 +5239,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
@@ -5232,7 +5297,7 @@
       "capability": "x-multifd"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
@@ -15100,7 +15165,7 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
@@ -15139,11 +15204,11 @@
       }
     }
   },
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
-  "id": "libvirt-42",
+  "id": "libvirt-43",
   "error": {
     "class": "GenericError",
     "desc": "Property '.migratable' not found"
diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
index 17abac9..46ae5e2 100644
--- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
@@ -146,9 +146,10 @@
   <flag name='disk-share-rw'/>
   <flag name='iscsi.password-secret'/>
   <flag name='dump-completed'/>
+  <flag name='virtio-gpu-ccw'/>
   <version>2011000</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>340897</microcodeVersion>
+  <microcodeVersion>342058</microcodeVersion>
   <package></package>
   <arch>s390x</arch>
   <hostCPU type='kvm' model='z14-base' migratability='no'>
-- 
2.7.4




More information about the libvir-list mailing list