]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add support for virtio-vga/gpu's max_outputs= parameter
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 23 Aug 2017 12:06:41 +0000 (14:06 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 29 Aug 2017 09:17:16 +0000 (11:17 +0200)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449712

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args
tests/qemuxml2argvtest.c

index 53b79ac9763cb8aa980dd204b1bac6bf6341a91e..9a27987d4aae6c2249513a99544522cde4f515eb 100644 (file)
@@ -4484,6 +4484,11 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
             if (video->heads)
                 virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
         }
+    } else if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
+        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS)) {
+            if (video->heads)
+                virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
+        }
     } else if (video->vram &&
         ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA &&
           virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
index 1aa38bbeec2e3c663bd2e3442de631ff004f1178..b526ac95956d5d43355821f85d5f623e36bab338 100644 (file)
@@ -22,5 +22,5 @@ server,nowait \
 -drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\
 id=drive-ide0-0-0,cache=none \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--device virtio-vga,id=video0,bus=pci.0,addr=0x2 \
+-device virtio-vga,id=video0,max_outputs=1,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 39f8d66c04e1d7f313075bcebbfa111363d57430..0c0bd16f948e3282d411016850cda666f1cd6235 100644 (file)
@@ -1883,7 +1883,8 @@ mymain(void)
     DO_TEST("video-virtio-vga",
             QEMU_CAPS_DEVICE_VIRTIO_GPU,
             QEMU_CAPS_DEVICE_VIRTIO_VGA,
-            QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+            QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+            QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS);
     DO_TEST_PARSE_ERROR("video-invalid", NONE);
 
     DO_TEST("virtio-rng-default",