]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Introduce a new capability for virtio-gpu-ccw
authorFarhan Ali <alifm@linux.vnet.ibm.com>
Fri, 23 Mar 2018 17:22:38 +0000 (13:22 -0400)
committerJán Tomko <jtomko@redhat.com>
Fri, 23 Mar 2018 18:40:20 +0000 (19:40 +0100)
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@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml
tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml
tests/qemuxml2argvdata/video-virtio-gpu-ccw.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/video-virtio-gpu-ccw.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c

index d5a5a3be62819c9b8d9fd2945532b2e5713f93b5..aaa04cbf0c6dede69ad017bdc0a5d54b60ff637b 100644 (file)
@@ -460,6 +460,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "pl011",
               "machine.pseries.max-cpu-compat",
               "dump-completed",
+              "virtio-gpu-ccw",
     );
 
 
@@ -1695,6 +1696,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[] = {
@@ -1948,6 +1950,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 },
 };
 
 
index c2ec2be19311d7c1958ec1650536a2e5f04e2c79..b4852e5e5ffa70b64921e1c6262da17385539b7b 100644 (file)
@@ -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;
index 860904b1e016feabc817e3f1b912752d1ae01ad3..2de256009e11e1923e7a85d432012bb1d7f2eb54 100644 (file)
   "id": "libvirt-33"
 }
 
+{
+  "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": [
     {
       "cpu-max": 248
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
       "migration-safe": true
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
     "emulator"
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
       "option": "drive"
     }
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
       "capability": "x-multifd"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
       }
     }
   },
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
-  "id": "libvirt-42",
+  "id": "libvirt-43",
   "error": {
     "class": "GenericError",
     "desc": "Property '.migratable' not found"
index 17abac91024ae2999cedd0dd700cb7c7e38e5f47..46ae5e23094620d2c5157bcdbb6f2f441de5ebb8 100644 (file)
   <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'>
index f2699d49efb22d69944d06ae86f37e9ab9a4d9e8..c4e44c6d0ff5ea324106dd3fdbb3109b30c871f3 100644 (file)
   "id": "libvirt-33"
 }
 
+{
+  "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": [
     {
       "alias": "s390-ccw-virtio"
     }
   ],
-  "id": "libvirt-34"
+  "id": "libvirt-35"
 }
 
 {
       "migration-safe": true
     }
   ],
-  "id": "libvirt-35"
+  "id": "libvirt-36"
 }
 
 {
   "return": [
   ],
-  "id": "libvirt-36"
+  "id": "libvirt-37"
 }
 
 {
   "return": [
     "emulator"
   ],
-  "id": "libvirt-37"
+  "id": "libvirt-38"
 }
 
 {
       "option": "drive"
     }
   ],
-  "id": "libvirt-38"
+  "id": "libvirt-39"
 }
 
 {
       "capability": "dirty-bitmaps"
     }
   ],
-  "id": "libvirt-39"
+  "id": "libvirt-40"
 }
 
 {
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }
 
 {
-  "id": "libvirt-41",
+  "id": "libvirt-42",
   "error": {
     "class": "GenericError",
     "desc": "The CPU definition 'max' is unknown."
index 355ccc1852963f6a12ad6fc56a42913e13b92a97..d6d8885f7754d86115265a35ac4ee09fc83b1d83 100644 (file)
   <flag name='disk-share-rw'/>
   <flag name='iscsi.password-secret'/>
   <flag name='dump-completed'/>
+  <flag name='virtio-gpu-ccw'/>
   <version>2011090</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemuxml2argvdata/video-virtio-gpu-ccw.xml b/tests/qemuxml2argvdata/video-virtio-gpu-ccw.xml
new file mode 100644 (file)
index 0000000..b327595
--- /dev/null
@@ -0,0 +1,35 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1803</uuid>
+  <memory>219136</memory>
+  <currentMemory>219136</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>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>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='virtio'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0'/>
+    </disk>
+    <memballoon model='virtio'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x1'/>
+    </memballoon>
+    <graphics type='vnc'/>
+    <video>
+      <model type='virtio' heads='1' primary='yes'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
+    </video>
+    <video>
+      <model type='virtio' heads='1'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0003'/>
+    </video>
+    <panic model='s390'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/video-virtio-gpu-ccw.xml b/tests/qemuxml2xmloutdata/video-virtio-gpu-ccw.xml
new file mode 100644 (file)
index 0000000..d34be84
--- /dev/null
@@ -0,0 +1,39 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1803</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+    <boot dev='hd'/>
+  </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>
+    <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>
+    <graphics type='vnc' port='-1' autoport='yes'>
+      <listen type='address'/>
+    </graphics>
+    <video>
+      <model type='virtio' heads='1' primary='yes'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
+    </video>
+    <video>
+      <model type='virtio' heads='1'/>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0003'/>
+    </video>
+    <memballoon model='virtio'>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </memballoon>
+    <panic model='s390'/>
+  </devices>
+</domain>
index f808608b6e05d93c6b9d279db818ec1634902e78..7657377bdc300ffeddc724b8934cc8c43f74e4a6 100644 (file)
@@ -1180,6 +1180,13 @@ mymain(void)
     DO_TEST("video-qxl-heads", NONE);
     DO_TEST("video-qxl-noheads", NONE);
     DO_TEST("video-virtio-gpu-secondary", NONE);
+    DO_TEST("video-virtio-gpu-ccw",
+            QEMU_CAPS_VIRTIO_CCW,
+            QEMU_CAPS_DEVICE_VIRTIO_GPU,
+            QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+            QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS,
+            QEMU_CAPS_VNC,
+            QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW);
 
     DO_TEST("intel-iommu",
             QEMU_CAPS_DEVICE_INTEL_IOMMU);