From: Frediano Ziglio Date: Fri, 17 Jul 2015 08:29:44 +0000 (+0100) Subject: qemu: Use heads parameter for QXL driver X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7b401c3bdacdf8367a0070e625d73eafb802045d;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git qemu: Use heads parameter for QXL driver Allows to specify maximum number of head to QXL driver. Actually can be a compatiblity problem as heads in the XML configuration was set by default to '1'. Signed-off-by: Frediano Ziglio --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index d8cb32d77..0769316fe 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -288,6 +288,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "vhost-user-multiqueue", /* 190 */ "migration-event", + "qxl-vga.max_outputs", ); @@ -1651,6 +1652,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = { { "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM }, + { "max_outputs", QEMU_CAPS_QXL_VGA_MAX_OUTPUTS }, }; struct virQEMUCapsObjectTypeProps { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index f77bd06ec..88116afc4 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -231,6 +231,7 @@ typedef enum { QEMU_CAPS_CPU_AARCH64_OFF = 189, /* -cpu ...,aarch64=off */ QEMU_CAPS_VHOSTUSER_MULTIQUEUE = 190, /* vhost-user with -netdev queues= */ QEMU_CAPS_MIGRATION_EVENT = 191, /* MIGRATION event */ + QEMU_CAPS_QXL_VGA_MAX_OUTPUTS = 192, /* qxl-vga.max_outputs */ QEMU_CAPS_LAST, /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 42906a898..34a0574be 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5684,6 +5684,11 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, /* QEMU accepts mebibytes for vgamem_mb. */ virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_MAX_OUTPUTS) && + video->heads > 0) { + virBufferAsprintf(&buf, ",max_outputs=%u", video->heads); + } } else if (video->vram && ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args new file mode 100644 index 000000000..bb477a9b4 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.args @@ -0,0 +1,7 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 \ +-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\ +,max_outputs=3,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0\ +,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml new file mode 100644 index 000000000..9426efc91 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-max-outputs.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 1048576 + 1048576 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + +
+ + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9b30d978..4cd6892fe 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1441,6 +1441,9 @@ mymain(void) DO_TEST("video-qxl-device-vgamem", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_QXL_VGA_VGAMEM); + DO_TEST("video-qxl-device-max-outputs", QEMU_CAPS_DEVICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_QXL_VGA_VGAMEM, QEMU_CAPS_QXL_VGA_MAX_OUTPUTS); DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL); DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);