|
|
9119d9 |
From 1442e803c97a4e528a6319f097d82968ed46f965 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <1442e803c97a4e528a6319f097d82968ed46f965@dist-git>
|
|
|
9119d9 |
From: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
Date: Tue, 25 Nov 2014 10:53:00 +0100
|
|
|
9119d9 |
Subject: [PATCH] QXL: fix setting ram and vram values for QEMU QXL device
|
|
|
9119d9 |
|
|
|
9119d9 |
QEMU has two different type of QXL display device. The first "qxl-vga"
|
|
|
9119d9 |
is for primary video device and second "qxl" is for secondary video
|
|
|
9119d9 |
device.
|
|
|
9119d9 |
|
|
|
9119d9 |
There are also two different ways how to specify those devices on qemu
|
|
|
9119d9 |
command line, the first one and obsolete is using "-vga" option and the
|
|
|
9119d9 |
current new one is using "-device" option. The "-vga" could be used only
|
|
|
9119d9 |
to setup primary video device, so the "-vga qxl" equal to
|
|
|
9119d9 |
"-device qxl-vga". Unfortunately the "-vga qxl" doesn't support setting
|
|
|
9119d9 |
additional parameters for the device and "-global" option must be used
|
|
|
9119d9 |
for this purpose. It's mandatory to use "-global qxl-vga...." to set the
|
|
|
9119d9 |
parameters of primary video device previously defined with "-vga qxl".
|
|
|
9119d9 |
|
|
|
9119d9 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
(cherry picked from commit c32cfc6d3ff53e6493928ac4bc14a19cd162bc4b)
|
|
|
9119d9 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_command.c | 15 +++++++++++++--
|
|
|
9119d9 |
.../qemuxml2argv-graphics-spice-compression.args | 2 +-
|
|
|
9119d9 |
.../qemuxml2argv-graphics-spice-sasl.args | 4 ++--
|
|
|
9119d9 |
tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args | 4 ++--
|
|
|
9119d9 |
tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args | 2 +-
|
|
|
9119d9 |
tests/qemuxml2argvdata/qemuxml2argv-q35.args | 2 +-
|
|
|
9119d9 |
6 files changed, 20 insertions(+), 9 deletions(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
|
9119d9 |
index 8d73f89..c75d3b0 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_command.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_command.c
|
|
|
9119d9 |
@@ -9107,11 +9107,22 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|
|
9119d9 |
|
|
|
9119d9 |
virCommandAddArgList(cmd, "-vga", vgastr, NULL);
|
|
|
9119d9 |
|
|
|
9119d9 |
+ /* If we cannot use --device option to specify the video device
|
|
|
9119d9 |
+ * in QEMU we will fallback to the old --vga option. To get the
|
|
|
9119d9 |
+ * correct device name for the --vga option the 'qemuVideo' is
|
|
|
9119d9 |
+ * used, but to set some device attributes we need to use the
|
|
|
9119d9 |
+ * --global option and for that we need to specify the device
|
|
|
9119d9 |
+ * name the same as for --device option and for that we need to
|
|
|
9119d9 |
+ * use 'qemuDeviceVideo'.
|
|
|
9119d9 |
+ *
|
|
|
9119d9 |
+ * See 'Graphics Devices' section in docs/qdev-device-use.txt in
|
|
|
9119d9 |
+ * QEMU repository.
|
|
|
9119d9 |
+ */
|
|
|
9119d9 |
+ const char *dev = qemuDeviceVideoTypeToString(primaryVideoType);
|
|
|
9119d9 |
+
|
|
|
9119d9 |
if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
|
|
|
9119d9 |
(def->videos[0]->vram || def->videos[0]->ram) &&
|
|
|
9119d9 |
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
|
9119d9 |
- const char *dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA)
|
|
|
9119d9 |
- ? "qxl-vga" : "qxl");
|
|
|
9119d9 |
unsigned int ram = def->videos[0]->ram;
|
|
|
9119d9 |
unsigned int vram = def->videos[0]->vram;
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args
|
|
|
9119d9 |
index cdc916c..e08ee20 100644
|
|
|
9119d9 |
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args
|
|
|
9119d9 |
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args
|
|
|
9119d9 |
@@ -6,6 +6,6 @@ x509-dir=/etc/pki/libvirt-spice,\
|
|
|
9119d9 |
image-compression=auto_glz,jpeg-wan-compression=auto,\
|
|
|
9119d9 |
zlib-glz-wan-compression=auto,\
|
|
|
9119d9 |
playback-compression=on,streaming-video=filter -vga \
|
|
|
9119d9 |
-qxl -global qxl.ram_size=67108864 -global qxl.vram_size=33554432 \
|
|
|
9119d9 |
+qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \
|
|
|
9119d9 |
-device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \
|
|
|
9119d9 |
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
|
|
9119d9 |
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args
|
|
|
9119d9 |
index 0c9df16..4f7f09b 100644
|
|
|
9119d9 |
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args
|
|
|
9119d9 |
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args
|
|
|
9119d9 |
@@ -5,5 +5,5 @@ SASL_CONF_PATH=/root/.sasl2 QEMU_AUDIO_DRV=spice \
|
|
|
9119d9 |
/dev/HostVG/QEMUGuest1 \
|
|
|
9119d9 |
-spice port=5903,tls-port=5904,sasl,addr=127.0.0.1,\
|
|
|
9119d9 |
x509-dir=/etc/pki/libvirt-spice,tls-channel=default \
|
|
|
9119d9 |
--vga qxl -global qxl.ram_size=67108864 -global \
|
|
|
9119d9 |
-qxl.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
|
|
9119d9 |
+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \
|
|
|
9119d9 |
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
|
|
9119d9 |
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
|
|
|
9119d9 |
index 704cec7..97755c3 100644
|
|
|
9119d9 |
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
|
|
|
9119d9 |
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
|
|
|
9119d9 |
@@ -7,7 +7,7 @@ plaintext-channel=inputs,\
|
|
|
9119d9 |
image-compression=auto_glz,jpeg-wan-compression=auto,\
|
|
|
9119d9 |
zlib-glz-wan-compression=auto,\
|
|
|
9119d9 |
playback-compression=on,streaming-video=filter,disable-copy-paste,\
|
|
|
9119d9 |
-disable-agent-file-xfer -vga qxl -global qxl.ram_size=67108864 \
|
|
|
9119d9 |
--global qxl.vram_size=33554432 \
|
|
|
9119d9 |
+disable-agent-file-xfer -vga qxl -global qxl-vga.ram_size=67108864 \
|
|
|
9119d9 |
+-global qxl-vga.vram_size=33554432 \
|
|
|
9119d9 |
-device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \
|
|
|
9119d9 |
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
|
|
9119d9 |
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args
|
|
|
9119d9 |
index c8045a4..cd2ccca 100644
|
|
|
9119d9 |
--- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args
|
|
|
9119d9 |
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args
|
|
|
9119d9 |
@@ -6,4 +6,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
|
|
9119d9 |
-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
|
|
|
9119d9 |
-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \
|
|
|
9119d9 |
-device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \
|
|
|
9119d9 |
--vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=33554432
|
|
|
9119d9 |
+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432
|
|
|
9119d9 |
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args
|
|
|
9119d9 |
index 08bd96e..888aa6b 100644
|
|
|
9119d9 |
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args
|
|
|
9119d9 |
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args
|
|
|
9119d9 |
@@ -5,4 +5,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
|
|
9119d9 |
-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
|
|
|
9119d9 |
-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \
|
|
|
9119d9 |
-device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \
|
|
|
9119d9 |
--vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=33554432
|
|
|
9119d9 |
+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.3
|
|
|
9119d9 |
|