mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +03:00
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 <mkletzan@redhat.com>
This commit is contained in:
parent
e13e8808f9
commit
d23410449f
@ -4590,6 +4590,7 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd,
|
|||||||
unsigned int vram = video->vram;
|
unsigned int vram = video->vram;
|
||||||
unsigned int vram64 = video->vram64;
|
unsigned int vram64 = video->vram64;
|
||||||
unsigned int vgamem = video->vgamem;
|
unsigned int vgamem = video->vgamem;
|
||||||
|
unsigned int heads = video->heads;
|
||||||
|
|
||||||
if (ram) {
|
if (ram) {
|
||||||
virCommandAddArg(cmd, "-global");
|
virCommandAddArg(cmd, "-global");
|
||||||
@ -4613,6 +4614,12 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd,
|
|||||||
virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u",
|
virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u",
|
||||||
dev, vgamem / 1024);
|
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 &&
|
if (video->vram &&
|
||||||
|
30
tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args
Normal file
30
tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args
Normal file
@ -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
|
47
tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml
Normal file
47
tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<domain type='qemu'>
|
||||||
|
<name>QEMUGuest1</name>
|
||||||
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
<memory unit='KiB'>219136</memory>
|
||||||
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
|
<vcpu placement='static'>1</vcpu>
|
||||||
|
<os>
|
||||||
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
<boot dev='hd'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/qemu-system-i686</emulator>
|
||||||
|
<disk type='block' device='disk'>
|
||||||
|
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||||
|
<target dev='hda' bus='ide'/>
|
||||||
|
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||||
|
</disk>
|
||||||
|
<controller type='usb' index='0'>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
|
</controller>
|
||||||
|
<controller type='ide' index='0'>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||||
|
</controller>
|
||||||
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
|
<input type='mouse' bus='ps2'/>
|
||||||
|
<input type='keyboard' bus='ps2'/>
|
||||||
|
<video>
|
||||||
|
<model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='3'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||||
|
</video>
|
||||||
|
<video>
|
||||||
|
<model type='qxl' ram='65536' vram='65536' vgamem='8192' heads='7'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
|
||||||
|
</video>
|
||||||
|
<video>
|
||||||
|
<model type='qxl' ram='65536' vram='65536' vgamem='8192' heads='1' primary='yes'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||||
|
</video>
|
||||||
|
<memballoon model='virtio'>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||||
|
</memballoon>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
@ -1735,6 +1735,9 @@ mymain(void)
|
|||||||
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
||||||
QEMU_CAPS_DEVICE_QXL,
|
QEMU_CAPS_DEVICE_QXL,
|
||||||
QEMU_CAPS_QXL_MAX_OUTPUTS);
|
QEMU_CAPS_QXL_MAX_OUTPUTS);
|
||||||
|
DO_TEST("video-vga-qxl-heads",
|
||||||
|
QEMU_CAPS_DEVICE_QXL,
|
||||||
|
QEMU_CAPS_QXL_MAX_OUTPUTS);
|
||||||
DO_TEST("video-qxl-noheads",
|
DO_TEST("video-qxl-noheads",
|
||||||
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
||||||
QEMU_CAPS_DEVICE_QXL,
|
QEMU_CAPS_DEVICE_QXL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user