]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Error on accel3d with non-virtio
authorCole Robinson <crobinso@redhat.com>
Thu, 19 May 2016 23:58:05 +0000 (19:58 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 23 Jun 2016 13:29:18 +0000 (09:29 -0400)
We should be raising an error if accel3d is present for any
non-virtio video as well, incase someone tries it for say 'qxl'

src/qemu/qemu_command.c

index 6944129b865d3270e6112eeb06910aab64b9b3c7..f3c26f95697002b5c11f4f26784ba5f0a575d9b9 100644 (file)
@@ -4066,18 +4066,20 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
 
     virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
 
-    if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
-        if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
-            if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                               "%s", _("virtio-gpu 3d acceleration is not supported"));
-                goto error;
-            }
-
-            virBufferAsprintf(&buf, ",virgl=%s",
-                              virTristateSwitchTypeToString(video->accel->accel3d));
+    if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
+        if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO ||
+            !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("%s 3d acceleration is not supported"),
+                           virDomainVideoTypeToString(video->type));
+            goto error;
         }
-    } else if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
+
+        virBufferAsprintf(&buf, ",virgl=%s",
+                          virTristateSwitchTypeToString(video->accel->accel3d));
+    }
+
+    if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
         if (video->vram > (UINT_MAX / 1024)) {
             virReportError(VIR_ERR_OVERFLOW,
                            _("value for 'vram' must be less than '%u'"),