]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: detect multi-head qxl via more than version check
authorEric Blake <eblake@redhat.com>
Thu, 14 Mar 2013 00:41:22 +0000 (18:41 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 14 Mar 2013 15:38:20 +0000 (09:38 -0600)
Multi-head QXL support is so useful that distros have started to
backport it to qemu earlier than 1.2.  After discussion with
Alon Levy, we determined that the existence of the qxl-vga.surfaces
property is a reliable indicator of whether '-device qxl-vga' works,
or whether we have to stick to the older '-vga qxl'.  I'm leaving
in the existing check for QEMU_CAPS_DEVICE_VIDEO_PRIMARY tied to
qemu 1.2 and newer (in case qemu is built without qxl support),
but for those distros that backport qxl, this additional capability
check will allow the correct command line for both RHEL 6.3 (which
lacks the feature) and RHEL 6.4 (where qemu still claims to be
version 0.12.2.x, but has backported multi-head qxl).

* src/qemu/qemu_capabilities.c (virQEMUCapsObjectPropsQxlVga): New
property test.
(virQEMUCapsExtractDeviceStr): Probe for backport of new
capability to qemu earlier than 1.2.
* tests/qemuhelpdata/qemu-kvm-1.2.0-device: Update test.
* tests/qemuhelpdata/qemu-1.2.0-device: Likewise.
* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device:
Likewise.

src/qemu/qemu_capabilities.c
tests/qemuhelpdata/qemu-1.2.0-device
tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device
tests/qemuhelpdata/qemu-kvm-1.2.0-device

index 79cfdb3c8dcd648b0ece2ff24a2246ee6ec20439..17747c187cd8e87d28153ad6626626cff7db7522 100644 (file)
@@ -1383,6 +1383,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbHost[] = {
     { "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX },
 };
 
+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = {
+    { "surfaces", QEMU_CAPS_DEVICE_VIDEO_PRIMARY },
+};
+
 struct virQEMUCapsObjectTypeProps {
     const char *type;
     struct virQEMUCapsStringFlags *props;
@@ -1416,6 +1420,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbRedir) },
     { "usb-host", virQEMUCapsObjectPropsUsbHost,
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbHost) },
+    { "qxl-vga", virQEMUCapsObjectPropsQxlVga,
+      ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) },
 };
 
 
@@ -1613,6 +1619,7 @@ virQEMUCapsExtractDeviceStr(const char *qemu,
                          "-device", "usb-redir,?",
                          "-device", "ide-drive,?",
                          "-device", "usb-host,?",
+                         "-device", "qxl-vga,?",
                          NULL);
     /* qemu -help goes to stdout, but qemu -device ? goes to stderr.  */
     virCommandSetErrorBuffer(cmd, &output);
index 5613e00a154badcd62ff3b631b013281a9e42426..027d99a2d1d2418ac88cca81bbd18a61fc3342ee 100644 (file)
@@ -208,3 +208,19 @@ usb-host.bootindex=int32
 usb-host.pipeline=on/off
 usb-host.port=string
 usb-host.full-path=on/off
+qxl-vga.ram_size=uint32
+qxl-vga.vram_size=uint32
+qxl-vga.revision=uint32
+qxl-vga.debug=uint32
+qxl-vga.guestdebug=uint32
+qxl-vga.cmdlog=uint32
+qxl-vga.ram_size_mb=uint32
+qxl-vga.vram_size_mb=uint32
+qxl-vga.vram64_size_mb=uint32
+qxl-vga.vgamem_mb=uint32
+qxl-vga.surfaces=int32
+qxl-vga.addr=pci-devfn
+qxl-vga.romfile=string
+qxl-vga.rombar=uint32
+qxl-vga.multifunction=on/off
+qxl-vga.command_serr_enable=on/off
index ee0fd78bfdd99c0ad66a12e9e9fdc37c0ed16981..5eab5392452e645f6406902657d7f39b98d6d0d4 100644 (file)
@@ -118,3 +118,13 @@ virtio-net-pci.addr=pci-devfn
 virtio-net-pci.romfile=string
 virtio-net-pci.rombar=uint32
 virtio-net-pci.multifunction=on/off
+qxl-vga.ram_size=uint32
+qxl-vga.vram_size=uint32
+qxl-vga.revision=uint32
+qxl-vga.debug=uint32
+qxl-vga.guestdebug=uint32
+qxl-vga.cmdlog=uint32
+qxl-vga.addr=pci-devfn
+qxl-vga.romfile=string
+qxl-vga.rombar=uint32
+qxl-vga.multifunction=on/off
index 879a04959e50c3c1e18cfa8702ef19a1364acff7..ebc27f07158b9eba830746c61dc440ad4f083151 100644 (file)
@@ -220,3 +220,19 @@ usb-host.bootindex=int32
 usb-host.pipeline=on/off
 usb-host.port=string
 usb-host.full-path=on/off
+qxl-vga.ram_size=uint32
+qxl-vga.vram_size=uint32
+qxl-vga.revision=uint32
+qxl-vga.debug=uint32
+qxl-vga.guestdebug=uint32
+qxl-vga.cmdlog=uint32
+qxl-vga.ram_size_mb=uint32
+qxl-vga.vram_size_mb=uint32
+qxl-vga.vram64_size_mb=uint32
+qxl-vga.vgamem_mb=uint32
+qxl-vga.surfaces=int32
+qxl-vga.addr=pci-devfn
+qxl-vga.romfile=string
+qxl-vga.rombar=uint32
+qxl-vga.multifunction=on/off
+qxl-vga.command_serr_enable=on/off