File libvirt-qemu-Detect-VGA_QXL-capability-correctly.patch of Package libvirt
From c1cc2822ddc0a3a966980d913f7ba2647d36969b Mon Sep 17 00:00:00 2001
Message-Id: <c1cc2822ddc0a3a966980d913f7ba2647d36969b.1373271639.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 6 Mar 2013 15:03:56 -0700
Subject: [PATCH] qemu: Detect VGA_QXL capability correctly
https://bugzilla.redhat.com/show_bug.cgi?id=896604
Since 4c993d8a we failed to set this important capability, which
allows starting a domain with QXL video card. We set DEVICE_QXL
capability bit instead, which is not necessary wrong. Anyway, if
qemu supports the new '-device qxl' it supports older '-vga qxl'
as well. The latter is used for the primary (the first) qxl video
card, the former for other video cards.
(cherry picked from commit 632c60eddeb6053ddbf2059c2dae21b522051047)
Conflicts:
src/qemu/qemu_capabilities.c - context of which function contains the code
tests/qemuhelptest.c - match fact that RHEL has spice backported
---
src/qemu/qemu_capabilities.c | 3 +++
tests/qemuhelptest.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 46e429f..65ce0a3 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1525,6 +1525,9 @@ qemuCapsParseDeviceStr(qemuCapsPtr caps, const char *str)
/* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */
if (qemuCapsGet(caps, QEMU_CAPS_CHARDEV_SPICEVMC))
qemuCapsClear(caps, QEMU_CAPS_DEVICE_SPICEVMC);
+ /* If qemu supports newer -device qxl it supports -vga qxl as well */
+ if (qemuCapsGet(caps, QEMU_CAPS_DEVICE_QXL))
+ qemuCapsSet(caps, QEMU_CAPS_VGA_QXL);
return 0;
}
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 6fdc1b5..270ed16 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -471,6 +471,7 @@ mymain(void)
QEMU_CAPS_NESTING,
QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_SMBIOS_TYPE,
+ QEMU_CAPS_VGA_QXL,
QEMU_CAPS_SPICE,
QEMU_CAPS_VGA_NONE,
QEMU_CAPS_MIGRATE_QEMU_FD,
--
1.8.2.1