[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v2 2/4] qxl: fix setting ram and vram values for qemu qxl device



QEMU has two different type of QXL display device. The first "qxl-vga"
is for primary video device and second "qxl" is for secondary video
device.

There are also two different ways how to specify those devices on qemu
command line, the first one and obsolete is using "-vga" option and the
current new one is using "-device" option. The "-vga" could be used only
to setup primary video device, so the "-vga qxl" equal to
"-device qxl-vga". Unfortunately the "-vga qxl" doesn't support setting
additional parameters for the device and "-global" option must be used
for this purpose. It's mandatory to use "-global qxl-vga...." to set the
parameters of primary video device previously defined with "-vga qxl".

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098

Signed-off-by: Pavel Hrdina <phrdina redhat com>
---
 src/qemu/qemu_command.c                                             | 4 ++--
 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args        | 4 ++--
 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args             | 4 ++--
 tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args              | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-q35.args                        | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index fa7c365..d6154a4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9329,11 +9329,11 @@ qemuBuildCommandLine(virConnectPtr conn,
 
                 virCommandAddArgList(cmd, "-vga", vgastr, NULL);
 
+                const char *dev = qemuDeviceVideoTypeToString(primaryVideoType);
+
                 if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
                     (def->videos[0]->vram || def->videos[0]->ram) &&
                     virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
-                    const char *dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA)
-                                       ? "qxl-vga" : "qxl");
                     unsigned int ram = def->videos[0]->ram;
                     unsigned int vram = def->videos[0]->vram;
 
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args
index 59f064b..ac8e316 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args
@@ -6,6 +6,6 @@ x509-dir=/etc/pki/libvirt-spice,\
 image-compression=auto_glz,jpeg-wan-compression=auto,\
 zlib-glz-wan-compression=auto,\
 playback-compression=on,streaming-video=filter -vga \
-qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368 \
+qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368 \
 -device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args
index 8847bce..3a73588 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args
@@ -5,5 +5,5 @@ SASL_CONF_PATH=/root/.sasl2 QEMU_AUDIO_DRV=spice \
 /dev/HostVG/QEMUGuest1 \
 -spice port=5903,tls-port=5904,sasl,addr=127.0.0.1,\
 x509-dir=/etc/pki/libvirt-spice,tls-channel=default \
--vga qxl -global qxl.ram_size=67108864 -global \
-qxl.vram_size=18874368 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
index 8430d9c..f2c2dcc 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
@@ -7,7 +7,7 @@ plaintext-channel=inputs,\
 image-compression=auto_glz,jpeg-wan-compression=auto,\
 zlib-glz-wan-compression=auto,\
 playback-compression=on,streaming-video=filter,disable-copy-paste,\
-disable-agent-file-xfer -vga qxl -global qxl.ram_size=67108864 \
--global qxl.vram_size=18874368 \
+disable-agent-file-xfer -vga qxl -global qxl-vga.ram_size=67108864 \
+-global qxl-vga.vram_size=18874368 \
 -device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args
index 6855cd2..ad72d15 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args
@@ -6,4 +6,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
 -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
 -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \
 -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \
--vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368
+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args
index 8cc5874..24545fd 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args
@@ -5,4 +5,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
 -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
 -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \
 -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \
--vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368
+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368
-- 
2.0.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]