From 7f85f27f9f14683fb784ffd9aecb545d7d39194d Mon Sep 17 00:00:00 2001 Message-Id: <7f85f27f9f14683fb784ffd9aecb545d7d39194d@dist-git> From: Martin Kletzander Date: Mon, 19 Jun 2017 15:40:17 +0200 Subject: [PATCH] qemu: Pass the number of heads even with -vga qxl When added in multiple previous commits, it was used only with -device qxl(-vga), but for some QEMUs (< 1.6) we need to add this functionality when using -vga qxl as well. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1283207 Signed-off-by: Martin Kletzander (cherry picked from commit d23410449fc9f91ceeeacb19d915a6db2f17f3be) Signed-off-by: Martin Kletzander Signed-off-by: Jiri Denemark Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 7 ++++ .../qemuxml2argv-video-vga-qxl-heads.args | 30 ++++++++++++++ .../qemuxml2argv-video-vga-qxl-heads.xml | 47 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 4 files changed, 87 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 88223babeb..a4184b7378 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4585,6 +4585,7 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd, unsigned int vram = video->vram; unsigned int vram64 = video->vram64; unsigned int vgamem = video->vgamem; + unsigned int heads = video->heads; if (ram) { virCommandAddArg(cmd, "-global"); @@ -4608,6 +4609,12 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd, virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", dev, vgamem / 1024); } + if (heads && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_MAX_OUTPUTS)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.max_outputs=%u", + dev, heads); + } } if (video->vram && diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args new file mode 100644 index 0000000000..411a2eedbc --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args @@ -0,0 +1,30 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 214 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-vga qxl \ +-global qxl-vga.ram_size=67108864 \ +-global qxl-vga.vram_size=67108864 \ +-global qxl-vga.max_outputs=1 \ +-device qxl,id=video1,ram_size=67108864,vram_size=33554432,max_outputs=3,\ +bus=pci.0,addr=0x4 \ +-device qxl,id=video2,ram_size=67108864,vram_size=67108864,max_outputs=7,\ +bus=pci.0,addr=0x5 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml new file mode 100644 index 0000000000..d878ddcd6d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml @@ -0,0 +1,47 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + +
+ + +
+ + + + +