[libvirt] [PATCH 00/11] cleanups and improvements for video device code

Pavel Hrdina (11): tests: fix some QXL capability combinations that doesn't make sense qemu_capabilities: join capabilities for qxl and qxl-vga devices qemu_capabilities: mark QEMU_CAPS_VGA_QXL capability as deprecated qemu_domain: move video validation out of qemu_command qemu_process: move video validation out of qemu_command qemu_capabilities: rename QEMU_CAPS_VIRTIO_GPU_VIRGL qemu_command: separate code for video device via -vga attribute qemu_command: cleanup qemuBuildVideoCommandLine qemu_capabilities: check for existence of virtio-vga qemu_command: properly detect which model to use for video device qemu_command: add support to use virtio as secondary video device docs/formatdomain.html.in | 3 +- src/qemu/qemu_capabilities.c | 23 +- src/qemu/qemu_capabilities.h | 15 +- src/qemu/qemu_command.c | 335 +++++++++------------ src/qemu/qemu_domain.c | 70 +++++ src/qemu/qemu_domain.h | 3 + src/qemu/qemu_domain_address.c | 6 - src/qemu/qemu_process.c | 54 +++- .../qemu_2.6.0-gicv2-virt.aarch64.xml | 1 - .../qemu_2.6.0-gicv3-virt.aarch64.xml | 1 - tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 - tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml | 1 - .../qemucapabilitiesdata/caps_1.2.2.x86_64.replies | 70 +---- tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_1.3.1.x86_64.replies | 76 +---- tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_1.4.2.x86_64.replies | 74 +---- tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 74 +---- tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 74 +---- tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 74 +---- tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 74 +---- tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 107 ++----- tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 6 +- .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 117 +++---- tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 6 +- .../caps_2.6.0-gicv2.aarch64.replies | 43 ++- .../caps_2.6.0-gicv2.aarch64.xml | 1 - .../caps_2.6.0-gicv3.aarch64.replies | 43 ++- .../caps_2.6.0-gicv3.aarch64.xml | 1 - .../caps_2.6.0.ppc64le.replies | 43 ++- tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 2 +- .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 117 +++---- tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 6 +- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 122 +++----- tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 6 +- tests/qemuhelptest.c | 4 - .../qemuxml2argv-pcie-root-port.args | 5 +- .../qemuxml2argv-pcie-switch-downstream-port.args | 5 +- .../qemuxml2argv-pcie-switch-upstream-port.args | 5 +- .../qemuxml2argv-pcihole64-q35.args | 5 +- .../qemuxml2argv-q35-usb2-multi.args | 5 +- .../qemuxml2argv-q35-usb2-reorder.args | 5 +- tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args | 5 +- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 5 +- .../qemuxml2argv-video-virtio-gpu-device.args | 2 +- .../qemuxml2argv-video-virtio-gpu-sec.args | 25 ++ .../qemuxml2argv-video-virtio-gpu-sec.xml | 36 +++ .../qemuxml2argv-video-virtio-gpu-spice-gl.args | 2 +- .../qemuxml2argv-video-virtio-gpu-virgl.args | 2 +- .../qemuxml2argv-video-virtio-vga.args | 24 ++ ...evice.xml => qemuxml2argv-video-virtio-vga.xml} | 11 +- tests/qemuxml2argvtest.c | 152 +++++----- tests/qemuxml2xmltest.c | 18 +- 58 files changed, 778 insertions(+), 1215 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args rename tests/qemuxml2argvdata/{qemuxml2argv-video-qxl-sec-nodevice.xml => qemuxml2argv-video-virtio-vga.xml} (77%) -- 2.10.0

If one of QEMU_CAPS_DEVICE_QXL_VGA or QEMU_CAPS_DEVICE_QXL is set the other one will always be set as well because both devices are tied together in QEMU. The change of args files is caused by the presence of capability QEMU_CAPS_DEVICE_VIDEO_PRIMARY which means it's safe to use "-device qxl-vga" instead of "-vga qxl". Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .../qemuxml2argv-pcie-root-port.args | 5 ++- .../qemuxml2argv-pcie-switch-downstream-port.args | 5 ++- .../qemuxml2argv-pcie-switch-upstream-port.args | 5 ++- .../qemuxml2argv-pcihole64-q35.args | 5 ++- .../qemuxml2argv-q35-usb2-multi.args | 5 ++- .../qemuxml2argv-q35-usb2-reorder.args | 5 ++- tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args | 5 ++- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 5 ++- tests/qemuxml2argvtest.c | 42 +++++++++++++++------- tests/qemuxml2xmltest.c | 23 +++++++----- 10 files changed, 59 insertions(+), 46 deletions(-) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args index 35c2664..27d5164 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args @@ -22,6 +22,5 @@ QEMU_AUDIO_DRV=none \ -device ioh3420,port=0x1a,chassis=40,id=pci.4,bus=pcie.0,addr=0x3 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args index 500b366..3b3e80d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args @@ -30,6 +30,5 @@ QEMU_AUDIO_DRV=none \ -device xio3130-downstream,port=0x6,chassis=12,id=pci.12,bus=pci.4,addr=0x6 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args index 24d5f37..93d16b8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args @@ -24,6 +24,5 @@ QEMU_AUDIO_DRV=none \ -device x3130-upstream,id=pci.6,bus=pci.4,addr=0x0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args index ad28dde..ee9f699 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args @@ -21,6 +21,5 @@ QEMU_AUDIO_DRV=none \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args index d465c69..01d296d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args @@ -35,6 +35,5 @@ addr=0x1 \ -device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pci.2,addr=0x1.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args index 87d2ce7..1548845 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args @@ -35,6 +35,5 @@ multifunction=on,addr=0x1a \ addr=0x1 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args index 1d44e7a..733a4dc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args @@ -25,6 +25,5 @@ addr=0x1d \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 1d44e7a..733a4dc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args @@ -25,6 +25,5 @@ addr=0x1d \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4b9ecb8..dbb86c9 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -997,6 +997,7 @@ mymain(void) DO_TEST("graphics-spice", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", @@ -1006,6 +1007,7 @@ mymain(void) DO_TEST("graphics-spice-sasl", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); VIR_FREE(driver.config->spiceSASLdir); driver.config->spiceSASL = 0; @@ -1017,12 +1019,14 @@ mymain(void) DO_TEST("graphics-spice-compression", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA); + QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, @@ -1576,10 +1580,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_VGAMEM); DO_TEST("video-qxl-nodevice", QEMU_CAPS_VGA_QXL); DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-qxl-device-vgamem", - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_QXL_VGA_VGAMEM); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_QXL_VGA_VGAMEM, QEMU_CAPS_QXL_VGAMEM); DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA_QXL); DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); @@ -1682,7 +1688,8 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("q35-dmi-bad-address1", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1706,28 +1713,32 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1744,7 +1755,8 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("440fx-wrong-root", NONE); DO_TEST_PARSE_ERROR("pcie-root-port-too-many", @@ -1753,7 +1765,8 @@ mymain(void) QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1762,7 +1775,8 @@ mymain(void) QEMU_CAPS_DEVICE_X3130_UPSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1771,7 +1785,8 @@ mymain(void) QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1856,7 +1871,8 @@ mymain(void) QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE); DO_TEST("arm-vexpressa9-nodevs", diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index fb05c85..e2c4d0e 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -675,45 +675,49 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_PXB); DO_TEST("pcie-expander-bus", @@ -782,7 +786,8 @@ mymain(void) DO_TEST("pcihole64-q35", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE); DO_TEST("panic", NONE); -- 2.10.0

s/doesn't/don't On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
If one of QEMU_CAPS_DEVICE_QXL_VGA or QEMU_CAPS_DEVICE_QXL is set the other one will always be set as well because both devices are tied together in QEMU.
And subsequent patches are about to make this a whole lot clearer, but in order to do so, we need to make sure the test output displays the combination of both properly especially with the capability QEMU_CAPS_DEVICE_VIDEO_PRIMARY
The change of args files is caused by the presence of capability QEMU_CAPS_DEVICE_VIDEO_PRIMARY which means it's safe to use "-device qxl-vga" instead of "-vga qxl".
IOW: The fallout for doing so when the *VIDEO_PRIMARY capability is set is that the command line generated changes. [Text added to make sure I understand] I note it only seems to change the .args output for q35 and pcie. Even though graphics-spice* tests added the cap, their output didn't change. I assume because the *VIDEO_PRIMARY wasn't set, but figured I'd ask. I guess I'm just making sure it's nothing specific to q35/pcie... I know the world is about to change some more ;-) Does anything need to change on formatdomain.html.in? I know this is a qemu specific change, but I'm thinking more in terms of describing how to use the type param for qga, qxl (primary/secondary)...
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .../qemuxml2argv-pcie-root-port.args | 5 ++- .../qemuxml2argv-pcie-switch-downstream-port.args | 5 ++- .../qemuxml2argv-pcie-switch-upstream-port.args | 5 ++- .../qemuxml2argv-pcihole64-q35.args | 5 ++- .../qemuxml2argv-q35-usb2-multi.args | 5 ++- .../qemuxml2argv-q35-usb2-reorder.args | 5 ++- tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args | 5 ++- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 5 ++- tests/qemuxml2argvtest.c | 42 +++++++++++++++------- tests/qemuxml2xmltest.c | 23 +++++++----- 10 files changed, 59 insertions(+), 46 deletions(-)
ACK in principle... Now that I've read all the patches - I see that the absolute key in the VIDEO_PRIMARY capability - totally changes how the command line is built especially since we're not falling into that else condition which forces the specific (and I assume) sub-optimal video model usage. John
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args index 35c2664..27d5164 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args @@ -22,6 +22,5 @@ QEMU_AUDIO_DRV=none \ -device ioh3420,port=0x1a,chassis=40,id=pci.4,bus=pcie.0,addr=0x3 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args index 500b366..3b3e80d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args @@ -30,6 +30,5 @@ QEMU_AUDIO_DRV=none \ -device xio3130-downstream,port=0x6,chassis=12,id=pci.12,bus=pci.4,addr=0x6 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args index 24d5f37..93d16b8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args @@ -24,6 +24,5 @@ QEMU_AUDIO_DRV=none \ -device x3130-upstream,id=pci.6,bus=pci.4,addr=0x0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args index ad28dde..ee9f699 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args @@ -21,6 +21,5 @@ QEMU_AUDIO_DRV=none \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args index d465c69..01d296d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args @@ -35,6 +35,5 @@ addr=0x1 \ -device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pci.2,addr=0x1.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args index 87d2ce7..1548845 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args @@ -35,6 +35,5 @@ multifunction=on,addr=0x1a \ addr=0x1 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args index 1d44e7a..733a4dc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args @@ -25,6 +25,5 @@ addr=0x1d \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 1d44e7a..733a4dc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args @@ -25,6 +25,5 @@ addr=0x1d \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4b9ecb8..dbb86c9 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -997,6 +997,7 @@ mymain(void) DO_TEST("graphics-spice", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", @@ -1006,6 +1007,7 @@ mymain(void) DO_TEST("graphics-spice-sasl", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); VIR_FREE(driver.config->spiceSASLdir); driver.config->spiceSASL = 0; @@ -1017,12 +1019,14 @@ mymain(void) DO_TEST("graphics-spice-compression", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA); + QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, @@ -1576,10 +1580,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_VGAMEM); DO_TEST("video-qxl-nodevice", QEMU_CAPS_VGA_QXL); DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-qxl-device-vgamem", - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_QXL_VGA_VGAMEM); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_QXL_VGA_VGAMEM, QEMU_CAPS_QXL_VGAMEM); DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA_QXL); DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); @@ -1682,7 +1688,8 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("q35-dmi-bad-address1", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1706,28 +1713,32 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1744,7 +1755,8 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("440fx-wrong-root", NONE);
DO_TEST_PARSE_ERROR("pcie-root-port-too-many", @@ -1753,7 +1765,8 @@ mymain(void) QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL);
DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1762,7 +1775,8 @@ mymain(void) QEMU_CAPS_DEVICE_X3130_UPSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1771,7 +1785,8 @@ mymain(void) QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL);
DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1856,7 +1871,8 @@ mymain(void) QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE);
DO_TEST("arm-vexpressa9-nodevs", diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index fb05c85..e2c4d0e 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -675,45 +675,49 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL);
DO_TEST("pcie-root", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_PXB); DO_TEST("pcie-expander-bus", @@ -782,7 +786,8 @@ mymain(void) DO_TEST("pcihole64-q35", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE);
DO_TEST("panic", NONE);

On Sat, Oct 08, 2016 at 09:52:24AM -0400, John Ferlan wrote:
s/doesn't/don't
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
If one of QEMU_CAPS_DEVICE_QXL_VGA or QEMU_CAPS_DEVICE_QXL is set the other one will always be set as well because both devices are tied together in QEMU.
And subsequent patches are about to make this a whole lot clearer, but in order to do so, we need to make sure the test output displays the combination of both properly especially with the capability QEMU_CAPS_DEVICE_VIDEO_PRIMARY
The change of args files is caused by the presence of capability QEMU_CAPS_DEVICE_VIDEO_PRIMARY which means it's safe to use "-device qxl-vga" instead of "-vga qxl".
IOW: The fallout for doing so when the *VIDEO_PRIMARY capability is set is that the command line generated changes.
Yes, this capability exists only to use -vga instead of -device because there was a bug in qemu that the mouse cursor was missing while using "-device qxl-vga", see commit e3f2686b.
[Text added to make sure I understand]
I note it only seems to change the .args output for q35 and pcie. Even though graphics-spice* tests added the cap, their output didn't change. I assume because the *VIDEO_PRIMARY wasn't set, but figured I'd ask.
I guess I'm just making sure it's nothing specific to q35/pcie...
No it's not related to q35/pcie, it's just coincident that those tests are affected. The reason is that there was only QEMU_CAPS_VGA_QXL set. Since we support qemu with "-device" option those tests capabilities was invalid and in real world QEMU_CAPS_DEVICE_QXL_VGA and QEMU_CAPS_DEVICE_QXL would be set as well. I'll add it to the commit message to make it clear.
I know the world is about to change some more ;-)
Does anything need to change on formatdomain.html.in? I know this is a qemu specific change, but I'm thinking more in terms of describing how to use the type param for qga, qxl (primary/secondary)...
No this is only internal change. Pavel
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .../qemuxml2argv-pcie-root-port.args | 5 ++- .../qemuxml2argv-pcie-switch-downstream-port.args | 5 ++- .../qemuxml2argv-pcie-switch-upstream-port.args | 5 ++- .../qemuxml2argv-pcihole64-q35.args | 5 ++- .../qemuxml2argv-q35-usb2-multi.args | 5 ++- .../qemuxml2argv-q35-usb2-reorder.args | 5 ++- tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args | 5 ++- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 5 ++- tests/qemuxml2argvtest.c | 42 +++++++++++++++------- tests/qemuxml2xmltest.c | 23 +++++++----- 10 files changed, 59 insertions(+), 46 deletions(-)
ACK in principle... Now that I've read all the patches - I see that the absolute key in the VIDEO_PRIMARY capability - totally changes how the command line is built especially since we're not falling into that else condition which forces the specific (and I assume) sub-optimal video model usage.
John
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args index 35c2664..27d5164 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args @@ -22,6 +22,5 @@ QEMU_AUDIO_DRV=none \ -device ioh3420,port=0x1a,chassis=40,id=pci.4,bus=pcie.0,addr=0x3 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args index 500b366..3b3e80d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args @@ -30,6 +30,5 @@ QEMU_AUDIO_DRV=none \ -device xio3130-downstream,port=0x6,chassis=12,id=pci.12,bus=pci.4,addr=0x6 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args index 24d5f37..93d16b8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args @@ -24,6 +24,5 @@ QEMU_AUDIO_DRV=none \ -device x3130-upstream,id=pci.6,bus=pci.4,addr=0x0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args index ad28dde..ee9f699 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args @@ -21,6 +21,5 @@ QEMU_AUDIO_DRV=none \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args index d465c69..01d296d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args @@ -35,6 +35,5 @@ addr=0x1 \ -device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pci.2,addr=0x1.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args index 87d2ce7..1548845 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args @@ -35,6 +35,5 @@ multifunction=on,addr=0x1a \ addr=0x1 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args index 1d44e7a..733a4dc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args @@ -25,6 +25,5 @@ addr=0x1d \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 1d44e7a..733a4dc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args @@ -25,6 +25,5 @@ addr=0x1d \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,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-vga.ram_size=67108864 \ --global qxl-vga.vram_size=33554432 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,\ +addr=0x1 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4b9ecb8..dbb86c9 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -997,6 +997,7 @@ mymain(void) DO_TEST("graphics-spice", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", @@ -1006,6 +1007,7 @@ mymain(void) DO_TEST("graphics-spice-sasl", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); VIR_FREE(driver.config->spiceSASLdir); driver.config->spiceSASL = 0; @@ -1017,12 +1019,14 @@ mymain(void) DO_TEST("graphics-spice-compression", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA); + QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, @@ -1576,10 +1580,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_VGAMEM); DO_TEST("video-qxl-nodevice", QEMU_CAPS_VGA_QXL); DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-qxl-device-vgamem", - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_QXL_VGA_VGAMEM); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_QXL_VGA_VGAMEM, QEMU_CAPS_QXL_VGAMEM); DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA_QXL); DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); @@ -1682,7 +1688,8 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("q35-dmi-bad-address1", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1706,28 +1713,32 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1744,7 +1755,8 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("440fx-wrong-root", NONE);
DO_TEST_PARSE_ERROR("pcie-root-port-too-many", @@ -1753,7 +1765,8 @@ mymain(void) QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL);
DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1762,7 +1775,8 @@ mymain(void) QEMU_CAPS_DEVICE_X3130_UPSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1771,7 +1785,8 @@ mymain(void) QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL);
DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1856,7 +1871,8 @@ mymain(void) QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE);
DO_TEST("arm-vexpressa9-nodevs", diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index fb05c85..e2c4d0e 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -675,45 +675,49 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL);
DO_TEST("pcie-root", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_PXB); DO_TEST("pcie-expander-bus", @@ -782,7 +786,8 @@ mymain(void) DO_TEST("pcihole64-q35", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE);
DO_TEST("panic", NONE);
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

This patch simplifies QEMU capabilities for QXL video device. QEMU exposes this device as *qxl-vga* and *qxl* and they are both the same device with the same set of parameters, the only difference is that *qxl-vga* includes VGA compatibility. Based on QEMU code they are tied together so it's safe to check only for presence of only one of them. This patch also removes an invalid test case "video-qxl-sec-nodevice" where there is only *qxl-vga* device and *qxl* device is not present. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 12 +-- src/qemu/qemu_capabilities.h | 8 +- src/qemu/qemu_command.c | 21 ++-- src/qemu/qemu_process.c | 4 +- .../qemu_2.6.0-gicv2-virt.aarch64.xml | 1 - .../qemu_2.6.0-gicv3-virt.aarch64.xml | 1 - tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 - tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml | 1 - .../qemucapabilitiesdata/caps_1.2.2.x86_64.replies | 92 +++--------------- tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.3.1.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.4.2.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 103 +++----------------- tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 103 +++----------------- tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 4 - .../caps_2.6.0-gicv2.aarch64.replies | 8 -- .../caps_2.6.0-gicv2.aarch64.xml | 1 - .../caps_2.6.0-gicv3.aarch64.replies | 8 -- .../caps_2.6.0-gicv3.aarch64.xml | 1 - .../caps_2.6.0.ppc64le.replies | 8 -- tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 - .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 103 +++----------------- tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 108 +++------------------ tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 4 - tests/qemuhelptest.c | 2 - .../qemuxml2argv-video-qxl-sec-nodevice.xml | 32 ------ tests/qemuxml2argvtest.c | 51 ++++------ tests/qemuxml2xmltest.c | 18 ++-- 40 files changed, 185 insertions(+), 1116 deletions(-) delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index cc8ec58..bed4cbc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1527,7 +1527,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-scsi-device", QEMU_CAPS_VIRTIO_SCSI }, { "megasas", QEMU_CAPS_SCSI_MEGASAS }, { "spicevmc", QEMU_CAPS_DEVICE_SPICEVMC }, - { "qxl-vga", QEMU_CAPS_DEVICE_QXL_VGA }, { "qxl", QEMU_CAPS_DEVICE_QXL }, { "sga", QEMU_CAPS_SGA }, { "scsi-block", QEMU_CAPS_SCSI_BLOCK }, @@ -1678,12 +1677,6 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { { "max_outputs", QEMU_CAPS_QXL_MAX_OUTPUTS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = { - { "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM }, - { "vram64_size_mb", QEMU_CAPS_QXL_VGA_VRAM64 }, - { "max_outputs", QEMU_CAPS_QXL_VGA_MAX_OUTPUTS }, -}; - static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = { { "virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL }, }; @@ -1752,8 +1745,6 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga) }, { "qxl", virQEMUCapsObjectPropsQxl, ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, - { "qxl-vga", virQEMUCapsObjectPropsQxlVga, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) }, { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, { "ICH9-LPC", virQEMUCapsObjectPropsICH9, @@ -3637,7 +3628,6 @@ virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps) virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_NONE); virQEMUCapsSet(qemuCaps, QEMU_CAPS_DRIVE_AIO); virQEMUCapsSet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC); - virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA); virQEMUCapsSet(qemuCaps, QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_SHUTDOWN); virQEMUCapsSet(qemuCaps, QEMU_CAPS_DRIVE_CACHE_UNSAFE); @@ -4489,7 +4479,7 @@ virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr qemuCaps, VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_CIRRUS); if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_VMVGA); - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA)) + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_QXL); if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_VIRTIO); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ba0ef48..750fbb6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -128,7 +128,7 @@ typedef enum { QEMU_CAPS_CHARDEV_SPICEVMC, /* newer -chardev spicevmc */ QEMU_CAPS_DEVICE_SPICEVMC, /* older -device spicevmc*/ QEMU_CAPS_VIRTIO_TX_ALG, /* -device virtio-net-pci,tx=string */ - QEMU_CAPS_DEVICE_QXL_VGA, /* primary qxl device named qxl-vga? */ + X_QEMU_CAPS_DEVICE_QXL_VGA, /* primary qxl device named qxl-vga? */ /* 60 */ QEMU_CAPS_PCI_MULTIFUNCTION, /* -device multifunction=on|off */ @@ -302,7 +302,7 @@ typedef enum { QEMU_CAPS_VGA_VGAMEM, /* -device VGA.vgamem_mb */ QEMU_CAPS_VMWARE_SVGA_VGAMEM, /* -device vmware-svga.vgamem_mb */ QEMU_CAPS_QXL_VGAMEM, /* -device qxl.vgamem_mb */ - QEMU_CAPS_QXL_VGA_VGAMEM, /* -device qxl-vga.vgamem_mb */ + X_QEMU_CAPS_QXL_VGA_VGAMEM, /* -device qxl-vga.vgamem_mb */ QEMU_CAPS_DEVICE_PC_DIMM, /* pc-dimm device */ /* 185 */ @@ -349,7 +349,7 @@ typedef enum { QEMU_CAPS_QXL_VRAM64, /* -device qxl.vram64_size_mb */ /* 215 */ - QEMU_CAPS_QXL_VGA_VRAM64, /* -device qxl-vga.vram64_size_mb */ + X_QEMU_CAPS_QXL_VGA_VRAM64, /* -device qxl-vga.vram64_size_mb */ QEMU_CAPS_CHARDEV_LOGFILE, /* -chardev logfile=xxxx */ QEMU_CAPS_NAME_DEBUG_THREADS, /* Is -name debug-threads= available */ QEMU_CAPS_OBJECT_SECRET, /* -object secret */ @@ -364,7 +364,7 @@ typedef enum { /* 225 */ QEMU_CAPS_QXL_MAX_OUTPUTS, /* -device qxl,max-outputs= */ - QEMU_CAPS_QXL_VGA_MAX_OUTPUTS, /* -device qxl-vga,max-outputs= */ + X_QEMU_CAPS_QXL_VGA_MAX_OUTPUTS, /* -device qxl-vga,max-outputs= */ QEMU_CAPS_SPICE_UNIX, /* -spice unix */ QEMU_CAPS_DRIVE_DETECT_ZEROES, /* -drive detect-zeroes= */ QEMU_CAPS_OBJECT_TLS_CREDS_X509, /* -object tls-creds-x509 */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 529bcb1..12c6301 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4372,26 +4372,17 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } - if ((video->primary && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VRAM64)) || - (!video->primary && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64))) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { /* QEMU accepts mebibytes for vram64_size_mb. */ virBufferAsprintf(&buf, ",vram64_size_mb=%u", video->vram64 / 1024); } - if ((video->primary && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || - (!video->primary && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM))) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { /* QEMU accepts mebibytes for vgamem_mb. */ virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); } - if ((video->primary && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_MAX_OUTPUTS)) || - (!video->primary && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_MAX_OUTPUTS))) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_MAX_OUTPUTS)) { if (video->heads) virBufferAsprintf(&buf, ",max_outputs=%u", video->heads); } @@ -4446,7 +4437,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA)) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)))) { for (i = 0; i < def->nvideos; i++) { @@ -4524,13 +4515,13 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, dev, vram * 1024); } if (vram64 && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VRAM64)) { + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "%s.vram64_size_mb=%u", dev, vram64 / 1024); } if (vgamem && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) { + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", dev, vgamem / 1024); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 31c8453..6ddcc1f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2567,12 +2567,12 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver, break; case VIR_DOMAIN_VIDEO_TYPE_QXL: if (i == 0) { - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM) && + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QXL_VGAMEM) && qemuMonitorUpdateVideoMemorySize(priv->mon, video, "qxl-vga") < 0) goto error; - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QXL_VGA_VRAM64) && + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QXL_VRAM64) && qemuMonitorUpdateVideoVram64Size(priv->mon, video, "qxl-vga") < 0) goto error; diff --git a/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml index 796c3af..76aee83 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml @@ -79,7 +79,6 @@ <video supported='yes'> <enum name='modelType'> <value>vga</value> - <value>qxl</value> <value>virtio</value> </enum> </video> diff --git a/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml index 5a5f82c..104c29f 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml @@ -79,7 +79,6 @@ <video supported='yes'> <enum name='modelType'> <value>vga</value> - <value>qxl</value> <value>virtio</value> </enum> </video> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml index 90b57ff..ca511f4 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml @@ -79,7 +79,6 @@ <video supported='yes'> <enum name='modelType'> <value>vga</value> - <value>qxl</value> <value>virtio</value> </enum> </video> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml index 962be6f..a75764c 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml @@ -51,7 +51,6 @@ <video supported='yes'> <enum name='modelType'> <value>vga</value> - <value>qxl</value> <value>virtio</value> </enum> </video> diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies index 521578e..6d356db 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies @@ -1593,73 +1593,7 @@ } { - "return": [ - { - "name": "command_serr_enable", - "type": "on/off" - }, - { - "name": "multifunction", - "type": "on/off" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "string" - }, - { - "name": "addr", - "type": "pci-devfn" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-32" -} - -{ - "id": "libvirt-33", + "id": "libvirt-32", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1667,7 +1601,7 @@ } { - "id": "libvirt-34", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1709,11 +1643,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-34" } { - "id": "libvirt-36", + "id": "libvirt-35", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1721,7 +1655,7 @@ } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1755,7 +1689,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -1796,7 +1730,7 @@ "name": "none" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -1868,7 +1802,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -1876,11 +1810,11 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-40" } { - "id": "libvirt-42", + "id": "libvirt-41", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1888,7 +1822,7 @@ } { - "id": "libvirt-43", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1896,7 +1830,7 @@ } { - "id": "libvirt-44", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1910,5 +1844,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-45" + "id": "libvirt-44" } diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml index 565151f..e460975 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml @@ -30,7 +30,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -103,7 +102,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> @@ -111,7 +109,6 @@ <flag name='e1000'/> <flag name='virtio-net'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='device-tray-moved-event'/> <flag name='display'/> <version>1002002</version> diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies index 110858b..69bf0c2 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies @@ -1793,77 +1793,7 @@ } { - "return": [ - { - "name": "command_serr_enable", - "type": "on/off" - }, - { - "name": "multifunction", - "type": "on/off" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "string" - }, - { - "name": "addr", - "type": "pci-devfn" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "id": "libvirt-34", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1871,7 +1801,7 @@ } { - "id": "libvirt-35", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1913,11 +1843,11 @@ "type": "on/off" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1925,7 +1855,7 @@ } { - "id": "libvirt-38", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1979,7 +1909,7 @@ "type": "on/off" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -2027,7 +1957,7 @@ "name": "none" } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -2105,7 +2035,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -2113,11 +2043,11 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { - "id": "libvirt-43", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2125,7 +2055,7 @@ } { - "id": "libvirt-44", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2133,7 +2063,7 @@ } { - "id": "libvirt-45", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -2147,5 +2077,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml index 2d4be61..4f7cbff 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -119,7 +118,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pci-serial'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> @@ -128,7 +126,6 @@ <flag name='e1000'/> <flag name='virtio-net'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='device-tray-moved-event'/> <flag name='nec-usb-xhci-ports'/> <flag name='display'/> diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies index d910b5c..a69846a 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies @@ -1840,77 +1840,7 @@ } { - "return": [ - { - "name": "command_serr_enable", - "type": "on/off" - }, - { - "name": "multifunction", - "type": "on/off" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "string" - }, - { - "name": "addr", - "type": "pci-devfn" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "id": "libvirt-34", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1918,7 +1848,7 @@ } { - "id": "libvirt-35", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1960,11 +1890,11 @@ "type": "on/off" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1972,7 +1902,7 @@ } { - "id": "libvirt-38", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -2026,7 +1956,7 @@ "type": "on/off" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -2077,7 +2007,7 @@ "name": "none" } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -2155,7 +2085,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -2163,11 +2093,11 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { - "id": "libvirt-43", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2175,7 +2105,7 @@ } { - "id": "libvirt-44", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2183,7 +2113,7 @@ } { - "id": "libvirt-45", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -2197,5 +2127,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml index 18076a5..ca61182 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -120,7 +119,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pci-serial'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> @@ -129,7 +127,6 @@ <flag name='e1000'/> <flag name='virtio-net'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='device-tray-moved-event'/> <flag name='nec-usb-xhci-ports'/> <flag name='display'/> diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies index d6314f0..2c835ad 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies @@ -1943,77 +1943,7 @@ } { - "return": [ - { - "name": "command_serr_enable", - "type": "on/off" - }, - { - "name": "multifunction", - "type": "on/off" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "string" - }, - { - "name": "addr", - "type": "pci-devfn" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "id": "libvirt-34", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -2021,7 +1951,7 @@ } { - "id": "libvirt-35", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -2063,11 +1993,11 @@ "type": "on/off" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2077,7 +2007,7 @@ { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -2127,7 +2057,7 @@ "type": "on/off" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -2200,7 +2130,7 @@ "cpu-max": 1 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -2278,7 +2208,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -2286,19 +2216,19 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -2999,7 +2929,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -3009,5 +2939,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml index 0d048da..471244d 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -130,7 +129,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pci-serial'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> @@ -139,7 +137,6 @@ <flag name='e1000'/> <flag name='virtio-net'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='device-tray-moved-event'/> <flag name='nec-usb-xhci-ports'/> <flag name='display'/> diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies index 7412ba5..91481bb 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies @@ -1988,77 +1988,7 @@ } { - "return": [ - { - "name": "command_serr_enable", - "type": "on/off" - }, - { - "name": "multifunction", - "type": "on/off" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "string" - }, - { - "name": "addr", - "type": "pci-devfn" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "id": "libvirt-34", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -2066,7 +1996,7 @@ } { - "id": "libvirt-35", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -2108,11 +2038,11 @@ "type": "on/off" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2122,7 +2052,7 @@ { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -2172,7 +2102,7 @@ "type": "on/off" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -2253,7 +2183,7 @@ "cpu-max": 1 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -2331,7 +2261,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -2339,19 +2269,19 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -2954,7 +2884,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -2976,5 +2906,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml index a6d4561..db0d0a0 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -135,7 +134,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pci-serial'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> @@ -144,7 +142,6 @@ <flag name='e1000'/> <flag name='virtio-net'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='device-tray-moved-event'/> <flag name='nec-usb-xhci-ports'/> <flag name='display'/> diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies index 50e4042..bde8c20 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies @@ -2005,77 +2005,7 @@ } { - "return": [ - { - "name": "command_serr_enable", - "type": "on/off" - }, - { - "name": "multifunction", - "type": "on/off" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "string" - }, - { - "name": "addr", - "type": "pci-devfn" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "id": "libvirt-34", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -2083,7 +2013,7 @@ } { - "id": "libvirt-35", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -2125,11 +2055,11 @@ "type": "on/off" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2139,7 +2069,7 @@ { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -2189,7 +2119,7 @@ "type": "on/off" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -2278,7 +2208,7 @@ "cpu-max": 1 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -2356,7 +2286,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -2364,19 +2294,19 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -3169,7 +3099,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -3191,5 +3121,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml index f756a41..55005e2 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -137,7 +136,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pci-serial'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> @@ -146,7 +144,6 @@ <flag name='e1000'/> <flag name='virtio-net'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='device-tray-moved-event'/> <flag name='nec-usb-xhci-ports'/> <flag name='display'/> diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies index 1c853ca..344497c 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies @@ -2360,77 +2360,7 @@ } { - "return": [ - { - "name": "command_serr_enable", - "type": "on/off" - }, - { - "name": "multifunction", - "type": "on/off" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "str" - }, - { - "name": "addr", - "type": "pci-devfn" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "id": "libvirt-34", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -2488,7 +2418,7 @@ "type": "pci-devfn" } ], - "id": "libvirt-35" + "id": "libvirt-34" } { @@ -2538,11 +2468,11 @@ "type": "uint32" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2552,7 +2482,7 @@ { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -2606,7 +2536,7 @@ "type": "on/off" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -2711,7 +2641,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -2792,7 +2722,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -2800,21 +2730,21 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -3674,7 +3604,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -3696,5 +3626,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml index a77ad9e..3e80717 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -147,7 +146,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> <flag name='ioh3420'/> @@ -158,7 +156,6 @@ <flag name='virtio-net'/> <flag name='vserport-change-event'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='debug-threads'/> <flag name='device-tray-moved-event'/> <flag name='nec-usb-xhci-ports'/> diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies index 16588e8..95a3fc8 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies @@ -2725,83 +2725,6 @@ { "return": [ { - "name": "command_serr_enable", - "description": "on/off", - "type": "bool" - }, - { - "name": "multifunction", - "description": "on/off", - "type": "bool" - }, - { - "name": "rombar", - "type": "uint32" - }, - { - "name": "romfile", - "type": "str" - }, - { - "name": "addr", - "description": "Slot and optional function number, example: 06.0 or 06", - "type": "int32" - }, - { - "name": "max_outputs", - "type": "uint16" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "cmdlog", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "return": [ - { "name": "any_layout", "description": "on/off", "type": "bool" @@ -2877,7 +2800,7 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-33" } { @@ -2954,7 +2877,7 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-34" } { @@ -3039,11 +2962,11 @@ "type": "uint32" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3086,7 +3009,7 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -3156,7 +3079,7 @@ "type": "bool" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -3285,7 +3208,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -3375,7 +3298,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -3383,21 +3306,21 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -4405,7 +4328,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -4435,5 +4358,5 @@ "capability": "events" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml index db778ef..4dfef61 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -147,7 +146,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> @@ -170,7 +168,6 @@ <flag name='vserport-change-event'/> <flag name='virtio-balloon-pci.deflate-on-oom'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='debug-threads'/> <flag name='pxb'/> <flag name='device-tray-moved-event'/> @@ -178,7 +175,6 @@ <flag name='virtio-scsi-pci.iothread'/> <flag name='name-guest'/> <flag name='qxl.max_outputs'/> - <flag name='qxl-vga.max_outputs'/> <flag name='spice-unix'/> <flag name='drive-detect-zeroes'/> <flag name='display'/> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies index d25b82b..2deb044 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies @@ -2838,83 +2838,6 @@ { "return": [ { - "name": "rombar", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "command_serr_enable", - "description": "on/off", - "type": "bool" - }, - { - "name": "multifunction", - "description": "on/off", - "type": "bool" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "romfile", - "type": "str" - }, - { - "name": "addr", - "description": "Slot and optional function number, example: 06.0 or 06", - "type": "int32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "max_outputs", - "type": "uint16" - }, - { - "name": "cmdlog", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "return": [ - { "name": "disable-modern", "description": "on/off", "type": "bool" @@ -3015,7 +2938,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-33" } { @@ -3092,7 +3015,7 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-34" } { @@ -3192,11 +3115,11 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3239,7 +3162,7 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -3309,7 +3232,7 @@ "type": "uint32" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -3446,7 +3369,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -3536,7 +3459,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -3544,21 +3467,21 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -4603,7 +4526,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -4637,5 +4560,5 @@ "capability": "x-postcopy-ram" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml index fc915ad..ce5a472 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -147,7 +146,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='aes-key-wrap'/> @@ -174,7 +172,6 @@ <flag name='vserport-change-event'/> <flag name='virtio-balloon-pci.deflate-on-oom'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='debug-threads'/> <flag name='pxb'/> <flag name='device-tray-moved-event'/> @@ -182,7 +179,6 @@ <flag name='virtio-scsi-pci.iothread'/> <flag name='name-guest'/> <flag name='qxl.max_outputs'/> - <flag name='qxl-vga.max_outputs'/> <flag name='spice-unix'/> <flag name='drive-detect-zeroes'/> <flag name='tls-creds-x509'/> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies index 9e22177..f6107a0 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies @@ -3298,14 +3298,6 @@ } { - "id": "libvirt-33", - "error": { - "class": "DeviceNotFound", - "desc": "Device 'qxl-vga' not found" - } -} - -{ "return": [ { "name": "disable-modern", diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml index fd14665..fe8c0fd 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml @@ -25,7 +25,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='virtio-blk-pci.event_idx'/> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies index c92815a..609e38b 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies @@ -3298,14 +3298,6 @@ } { - "id": "libvirt-33", - "error": { - "class": "DeviceNotFound", - "desc": "Device 'qxl-vga' not found" - } -} - -{ "return": [ { "name": "disable-modern", diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml index eb708f8..0abe0d3 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml @@ -25,7 +25,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='virtio-blk-pci.event_idx'/> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies index 372dfd5..7051e31 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies @@ -3445,14 +3445,6 @@ } { - "id": "libvirt-33", - "error": { - "class": "DeviceNotFound", - "desc": "Device 'qxl-vga' not found" - } -} - -{ "return": [ { "name": "disable-modern", diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml index 482b384..60f5392 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml @@ -23,7 +23,6 @@ <flag name='drive-aio'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='virtio-blk-pci.event_idx'/> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies index 68e64d8..74e48b0 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies @@ -2920,83 +2920,6 @@ { "return": [ { - "name": "rombar", - "type": "uint32" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "command_serr_enable", - "description": "on/off", - "type": "bool" - }, - { - "name": "multifunction", - "description": "on/off", - "type": "bool" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "romfile", - "type": "str" - }, - { - "name": "addr", - "description": "Slot and optional function number, example: 06.0 or 06", - "type": "int32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint32" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "max_outputs", - "type": "uint16" - }, - { - "name": "cmdlog", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "return": [ - { "name": "disable-modern", "description": "on/off", "type": "bool" @@ -3097,7 +3020,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-33" } { @@ -3174,7 +3097,7 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-34" } { @@ -3274,11 +3197,11 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3321,7 +3244,7 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -3391,7 +3314,7 @@ "type": "uint32" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -3504,7 +3427,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -3594,7 +3517,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -3602,21 +3525,21 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -4710,7 +4633,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -4744,5 +4667,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml index 60f1fcf..9d0eae1 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -147,7 +146,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='aes-key-wrap'/> @@ -177,7 +175,6 @@ <flag name='mptsas1068'/> <flag name='spice-gl'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='chardev-logfile'/> <flag name='debug-threads'/> <flag name='secret'/> @@ -188,7 +185,6 @@ <flag name='virtio-scsi-pci.iothread'/> <flag name='name-guest'/> <flag name='qxl.max_outputs'/> - <flag name='qxl-vga.max_outputs'/> <flag name='spice-unix'/> <flag name='drive-detect-zeroes'/> <flag name='tls-creds-x509'/> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies index ce8dee9..6514dd1 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies @@ -3089,88 +3089,6 @@ { "return": [ { - "name": "rombar", - "type": "uint32" - }, - { - "name": "x-pcie-lnksta-dllla", - "description": "on/off", - "type": "bool" - }, - { - "name": "ram_size_mb", - "type": "uint32" - }, - { - "name": "command_serr_enable", - "description": "on/off", - "type": "bool" - }, - { - "name": "multifunction", - "description": "on/off", - "type": "bool" - }, - { - "name": "vgamem_mb", - "type": "uint32" - }, - { - "name": "romfile", - "type": "str" - }, - { - "name": "addr", - "description": "Slot and optional function number, example: 06.0 or 06", - "type": "int32" - }, - { - "name": "debug", - "type": "uint32" - }, - { - "name": "vram_size_mb", - "type": "uint32" - }, - { - "name": "revision", - "type": "uint32" - }, - { - "name": "ram_size", - "type": "uint32" - }, - { - "name": "vram64_size_mb", - "type": "uint32" - }, - { - "name": "guestdebug", - "type": "uint32" - }, - { - "name": "vram_size", - "type": "uint64" - }, - { - "name": "surfaces", - "type": "int32" - }, - { - "name": "max_outputs", - "type": "uint16" - }, - { - "name": "cmdlog", - "type": "uint32" - } - ], - "id": "libvirt-33" -} - -{ - "return": [ - { "name": "disable-modern", "type": "bool" }, @@ -3275,7 +3193,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-33" } { @@ -3361,7 +3279,7 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-34" } { @@ -3465,11 +3383,11 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-35" } { - "id": "libvirt-37", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3512,7 +3430,7 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-37" } { @@ -3587,7 +3505,7 @@ "type": "uint32" } ], - "id": "libvirt-39" + "id": "libvirt-38" } { @@ -3736,7 +3654,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-39" } { @@ -3829,7 +3747,7 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-40" } { @@ -3837,21 +3755,21 @@ "enabled": false, "present": true }, - "id": "libvirt-42" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-43" } { @@ -4949,7 +4867,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-44" } { @@ -4983,5 +4901,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-46" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml index 98f3762..1b8d9c8 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -32,7 +32,6 @@ <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> - <flag name='device-qxl-vga'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> @@ -147,7 +146,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> - <flag name='qxl-vga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='aes-key-wrap'/> @@ -177,7 +175,6 @@ <flag name='mptsas1068'/> <flag name='spice-gl'/> <flag name='qxl.vram64_size_mb'/> - <flag name='qxl-vga.vram64_size_mb'/> <flag name='chardev-logfile'/> <flag name='debug-threads'/> <flag name='secret'/> @@ -188,7 +185,6 @@ <flag name='virtio-scsi-pci.iothread'/> <flag name='name-guest'/> <flag name='qxl.max_outputs'/> - <flag name='qxl-vga.max_outputs'/> <flag name='spice-unix'/> <flag name='drive-detect-zeroes'/> <flag name='tls-creds-x509'/> diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 2fc030e..bba30bb 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -295,7 +295,6 @@ mymain(void) QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_VIRTIO_TX_ALG, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_VIRTIO_IOEVENTFD, QEMU_CAPS_SGA, @@ -368,7 +367,6 @@ mymain(void) QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_VIRTIO_TX_ALG, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_VIRTIO_IOEVENTFD, QEMU_CAPS_SGA, diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml deleted file mode 100644 index 0868f39..0000000 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml +++ /dev/null @@ -1,32 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu>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</emulator> - <disk type='file' device='disk'> - <driver name='qemu' type='qcow2' cache='none'/> - <source file='/var/lib/libvirt/images/QEMUGuest1'/> - <target dev='hda' bus='ide'/> - <address type='drive' controller='0' bus='0' target='0' unit='0'/> - </disk> - <controller type='ide' index='0'/> - <video> - <model type='qxl' heads='1'/> - </video> - <video> - <model type='qxl' heads='1'/> - </video> - <memballoon model='virtio'/> - </devices> -</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index dbb86c9..bfab4c7 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -997,7 +997,6 @@ mymain(void) DO_TEST("graphics-spice", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", @@ -1007,7 +1006,6 @@ mymain(void) DO_TEST("graphics-spice-sasl", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); VIR_FREE(driver.config->spiceSASLdir); driver.config->spiceSASL = 0; @@ -1019,18 +1017,15 @@ mymain(void) DO_TEST("graphics-spice-compression", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-usb-redir", QEMU_CAPS_SPICE, @@ -1041,7 +1036,6 @@ mymain(void) DO_TEST("graphics-spice-agent-file-xfer", QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-socket", @@ -1123,7 +1117,7 @@ mymain(void) DO_TEST("serial-spiceport", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEPORT); DO_TEST("serial-spiceport-nospice", NONE); @@ -1571,7 +1565,7 @@ mymain(void) DO_TEST("video-device-pciaddr-default", QEMU_CAPS_KVM, QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("video-vga-nodevice", NONE); DO_TEST("video-vga-device", QEMU_CAPS_DEVICE_VGA, @@ -1579,34 +1573,29 @@ mymain(void) DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_VGAMEM); DO_TEST("video-qxl-nodevice", QEMU_CAPS_VGA_QXL); - DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE_QXL_VGA, + DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-qxl-device-vgamem", - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_QXL_VGA_VGAMEM, QEMU_CAPS_QXL_VGAMEM); - DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA_QXL); - DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_QXL_VGAMEM); + DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-qxl-sec-device-vgamem", - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_QXL_VGA_VGAMEM, + QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_QXL_VGAMEM); DO_TEST("video-qxl-heads", QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, - QEMU_CAPS_QXL_MAX_OUTPUTS, - QEMU_CAPS_QXL_VGA_MAX_OUTPUTS); + QEMU_CAPS_QXL_MAX_OUTPUTS); DO_TEST("video-qxl-noheads", QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, - QEMU_CAPS_QXL_MAX_OUTPUTS, - QEMU_CAPS_QXL_VGA_MAX_OUTPUTS); + QEMU_CAPS_QXL_MAX_OUTPUTS); DO_TEST("video-virtio-gpu-device", QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); @@ -1689,7 +1678,7 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("q35-dmi-bad-address1", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1714,7 +1703,7 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1722,7 +1711,7 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1730,7 +1719,7 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1738,7 +1727,7 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1756,7 +1745,7 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("440fx-wrong-root", NONE); DO_TEST_PARSE_ERROR("pcie-root-port-too-many", @@ -1766,7 +1755,7 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1776,7 +1765,7 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -1786,7 +1775,7 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1872,7 +1861,7 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE); DO_TEST("arm-vexpressa9-nodevs", diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e2c4d0e..85bdf3a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -676,7 +676,7 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -684,40 +684,40 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_PXB); DO_TEST("pcie-expander-bus", @@ -787,7 +787,7 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE); DO_TEST("panic", NONE); -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
This patch simplifies QEMU capabilities for QXL video device. QEMU exposes this device as *qxl-vga* and *qxl* and they are both the same device with the same set of parameters, the only difference is that *qxl-vga* includes VGA compatibility.
Based on QEMU code they are tied together so it's safe to check only for presence of only one of them.
This patch also removes an invalid test case "video-qxl-sec-nodevice" where there is only *qxl-vga* device and *qxl* device is not present.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 12 +-- src/qemu/qemu_capabilities.h | 8 +- src/qemu/qemu_command.c | 21 ++-- src/qemu/qemu_process.c | 4 +- .../qemu_2.6.0-gicv2-virt.aarch64.xml | 1 - .../qemu_2.6.0-gicv3-virt.aarch64.xml | 1 - tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 - tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml | 1 - .../qemucapabilitiesdata/caps_1.2.2.x86_64.replies | 92 +++--------------- tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.3.1.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.4.2.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 96 +++--------------- tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 3 - .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 103 +++----------------- tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 103 +++----------------- tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 4 - .../caps_2.6.0-gicv2.aarch64.replies | 8 -- .../caps_2.6.0-gicv2.aarch64.xml | 1 - .../caps_2.6.0-gicv3.aarch64.replies | 8 -- .../caps_2.6.0-gicv3.aarch64.xml | 1 - .../caps_2.6.0.ppc64le.replies | 8 -- tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 - .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 103 +++----------------- tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 4 - .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 108 +++------------------ tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 4 - tests/qemuhelptest.c | 2 - .../qemuxml2argv-video-qxl-sec-nodevice.xml | 32 ------ tests/qemuxml2argvtest.c | 51 ++++------ tests/qemuxml2xmltest.c | 18 ++-- 40 files changed, 185 insertions(+), 1116 deletions(-) delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml
Changes seem reasonable, ACK John

If QEMU in question supports QMP, this capability is set if QEMU_CAPS_DEVICE_QXL was set based on existence of "-device qxl". If libvirt needs to parse *help*, because there is no QMP support, it checks for existence of "-vga qxl", but it also parses output of "-device ?" and sets QEMU_CAPS_DEVICE_QXL too. Now that libvirt supports only QEMU that has "-device" implemented it's safe to drop this capability and stop using it. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 5 ----- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_command.c | 2 +- tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 - tests/qemuhelptest.c | 2 -- tests/qemuxml2argvtest.c | 24 +++--------------------- tests/qemuxml2xmltest.c | 13 ++++--------- 17 files changed, 9 insertions(+), 50 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bed4cbc..ae83317 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1175,8 +1175,6 @@ virQEMUCapsComputeCmdFlags(const char *help, virQEMUCapsSet(qemuCaps, QEMU_CAPS_DISPLAY); if ((p = strstr(help, "-vga")) && !strstr(help, "-std-vga")) { const char *nl = strstr(p, "\n"); - if (strstr(p, "|qxl")) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_QXL); if ((p = strstr(p, "|none")) && p < nl) virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_NONE); } @@ -2641,9 +2639,6 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, /* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC)) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC); - /* If qemu supports newer -device qxl it supports -vga qxl as well */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_QXL); return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 750fbb6..2effcb7 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -110,7 +110,7 @@ typedef enum { QEMU_CAPS_SMBIOS_TYPE, /* Is -smbios type= available */ /* 45 */ - QEMU_CAPS_VGA_QXL, /* The 'qxl' arg for '-vga' */ + X_QEMU_CAPS_VGA_QXL, /* The 'qxl' arg for '-vga' */ QEMU_CAPS_SPICE, /* Is -spice avail */ QEMU_CAPS_VGA_NONE, /* The 'none' arg for '-vga' */ X_QEMU_CAPS_MIGRATE_QEMU_FD, /* -incoming fd:n */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 12c6301..15cbc23 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4455,7 +4455,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, /* nothing - vga has no effect on Xen pvfb */ } else { if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL) && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_QXL)) { + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("This QEMU does not support QXL graphics adapters")); return -1; diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml index e460975..0d792be 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml @@ -19,7 +19,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml index 4f7cbff..97b9858 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml index ca61182..60dea6f 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml index 471244d..cc4ffef 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml index db0d0a0..8e0e697 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml index 55005e2..40acf62 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml index 3e80717..a8a79af 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml index 4dfef61..8d53988 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml index ce5a472..a4f5663 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml index 9d0eae1..50506ba 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml index 1b8d9c8..b0b4ab1 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -20,7 +20,6 @@ <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> - <flag name='vga-qxl'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index bba30bb..c7355e3 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -285,7 +285,6 @@ mymain(void) QEMU_CAPS_FSDEV, QEMU_CAPS_NAME_PROCESS, QEMU_CAPS_SMBIOS_TYPE, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_VGA_NONE, QEMU_CAPS_BOOTINDEX, @@ -357,7 +356,6 @@ mymain(void) QEMU_CAPS_FSDEV, QEMU_CAPS_NAME_PROCESS, QEMU_CAPS_SMBIOS_TYPE, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_VGA_NONE, QEMU_CAPS_BOOTINDEX, diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index bfab4c7..78bfb92 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -771,7 +771,7 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_REDIR, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_FILE); @@ -995,7 +995,6 @@ mymain(void) DO_TEST("nographics-vga", QEMU_CAPS_VGA_NONE); DO_TEST("graphics-spice", - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); @@ -1004,27 +1003,23 @@ mymain(void) driver.config->spiceSASL = 1; ignore_value(VIR_STRDUP(driver.config->spiceSASLdir, "/root/.sasl2")); DO_TEST("graphics-spice-sasl", - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); VIR_FREE(driver.config->spiceSASLdir); driver.config->spiceSASL = 0; DO_TEST("graphics-spice-agentmouse", - QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_NODEFCONFIG); DO_TEST("graphics-spice-compression", - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-qxl-vga", - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-usb-redir", @@ -1034,7 +1029,6 @@ mymain(void) QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, QEMU_CAPS_CHARDEV_SPICEVMC); DO_TEST("graphics-spice-agent-file-xfer", - QEMU_CAPS_VGA_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); @@ -1572,7 +1566,7 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_VGAMEM); - DO_TEST("video-qxl-nodevice", QEMU_CAPS_VGA_QXL); + DO_TEST("video-qxl-nodevice", QEMU_CAPS_DEVICE_QXL); DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); @@ -1588,12 +1582,10 @@ mymain(void) QEMU_CAPS_QXL_VGAMEM); DO_TEST("video-qxl-heads", QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_QXL_MAX_OUTPUTS); DO_TEST("video-qxl-noheads", QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_QXL_MAX_OUTPUTS); DO_TEST("video-virtio-gpu-device", @@ -1677,7 +1669,6 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("q35-dmi-bad-address1", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1702,7 +1693,6 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1710,7 +1700,6 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1718,7 +1707,6 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1726,7 +1714,6 @@ mymain(void) QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1744,7 +1731,6 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("440fx-wrong-root", NONE); @@ -1754,7 +1740,6 @@ mymain(void) QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", @@ -1764,7 +1749,6 @@ mymain(void) QEMU_CAPS_DEVICE_X3130_UPSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1774,7 +1758,6 @@ mymain(void) QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", @@ -1860,7 +1843,6 @@ mymain(void) QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 85bdf3a..089fd09 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -675,7 +675,6 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -683,40 +682,37 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-multi", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("q35-usb2-reorder", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); DO_TEST("pcie-switch-downstream-port", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); DO_TEST("pci-expander-bus", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_PXB); @@ -786,7 +782,6 @@ mymain(void) DO_TEST("pcihole64-q35", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_Q35_PCI_HOLE64_SIZE); -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
If QEMU in question supports QMP, this capability is set if QEMU_CAPS_DEVICE_QXL was set based on existence of "-device qxl". If libvirt needs to parse *help*, because there is no QMP support, it checks for existence of "-vga qxl", but it also parses output of "-device ?" and sets QEMU_CAPS_DEVICE_QXL too.
Now that libvirt supports only QEMU that has "-device" implemented it's safe to drop this capability and stop using it.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 5 ----- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_command.c | 2 +- tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 - tests/qemuhelptest.c | 2 -- tests/qemuxml2argvtest.c | 24 +++--------------------- tests/qemuxml2xmltest.c | 13 ++++--------- 17 files changed, 9 insertions(+), 50 deletions(-)
ACK John FWIW: There is one more QEMU_CAPS_VGA_NONE listed on the bite sized tasks wiki... Could use the opportunity to add a patch for that too...

All definition validation that don't depend on qemu capabilities and was allowed previously as valid definition should be placed into qemuDomainDefValidate. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 58 ------------------------------------------ src/qemu/qemu_domain.c | 57 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain_address.c | 6 ----- 3 files changed, 57 insertions(+), 64 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 15cbc23..761968b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4312,12 +4312,6 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, model = "virtio-gpu-pci"; } } else { - if (video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("non-primary video device must be type of 'qxl'")); - goto error; - } - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("only one video card is currently supported")); @@ -4329,12 +4323,6 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); - if (video->accel && video->accel->accel2d == VIR_TRISTATE_SWITCH_ON) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("qemu does not support the accel2d setting")); - goto error; - } - if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) { if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { @@ -4349,19 +4337,6 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, } if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { - if (video->vram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'vram' must be less than '%u'"), - UINT_MAX / 1024); - goto error; - } - if (video->ram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'ram' must be less than '%u'"), - UINT_MAX / 1024); - goto error; - } - if (video->ram) { /* QEMU accepts bytes for ram_size. */ virBufferAsprintf(&buf, ",ram_size=%u", video->ram * 1024); @@ -4392,13 +4367,6 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, (video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { - if (video->vram < 1024) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("value for 'vram' must be at least 1 MiB " - "(1024 KiB)")); - goto error; - } - virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vram / 1024); } @@ -4491,19 +4459,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, unsigned int vram64 = def->videos[0]->vram64; unsigned int vgamem = def->videos[0]->vgamem; - if (vram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'vram' must be less than '%u'"), - UINT_MAX / 1024); - return -1; - } - if (ram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'ram' must be less than '%u'"), - UINT_MAX / 1024); - return -1; - } - if (ram) { virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "%s.ram_size=%u", @@ -4535,13 +4490,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { unsigned int vram = def->videos[0]->vram; - if (vram < 1024) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("value for 'vgamem' must be at " - "least 1 MiB (1024 KiB)")); - return -1; - } - virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", dev, vram / 1024); @@ -4550,12 +4498,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, for (i = 1; i < def->nvideos; i++) { char *str; - if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is only valid as primary video card"), - virDomainVideoTypeToString(def->videos[0]->type)); - return -1; - } virCommandAddArg(cmd, "-device"); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9b1a32e..2b7e6d4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2395,6 +2395,60 @@ qemuDomainDefPostParse(virDomainDefPtr def, static int +qemuDomainDefValidateVideo(const virDomainDef *def) +{ + size_t i; + virDomainVideoDefPtr video; + + for (i = 0; i < def->nvideos; i++) { + video = def->videos[i]; + + if (!video->primary && + video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type '%s' is only valid as primary " + "video device"), + virDomainVideoTypeToString(video->type)); + return -1; + } + + if (video->accel && video->accel->accel2d == VIR_TRISTATE_SWITCH_ON) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu does not support the accel2d setting")); + return -1; + } + + if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (video->vram > (UINT_MAX / 1024)) { + virReportError(VIR_ERR_OVERFLOW, + _("value for 'vram' must be less than '%u'"), + UINT_MAX / 1024); + return -1; + } + if (video->ram > (UINT_MAX / 1024)) { + virReportError(VIR_ERR_OVERFLOW, + _("value for 'ram' must be less than '%u'"), + UINT_MAX / 1024); + return -1; + } + } + + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VGA || + video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA) { + if (video->vram && video->vram < 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("value for 'vram' must be at least " + "1 MiB (1024 KiB)")); + return -1; + } + } + } + + return 0; +} + + +static int qemuDomainDefValidate(const virDomainDef *def, virCapsPtr caps, void *opaque) @@ -2455,6 +2509,9 @@ qemuDomainDefValidate(const virDomainDef *def, } } + if (qemuDomainDefValidateVideo(def) < 0) + goto cleanup; + ret = 0; cleanup: diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index bb16738..dc67d51 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1242,13 +1242,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, goto error; } - /* Further non-primary video cards which have to be qxl type */ for (i = 1; i < def->nvideos; i++) { - if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("non-primary video device must be type of 'qxl'")); - goto error; - } if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info)) continue; if (virDomainPCIAddressReserveNextSlot(addrs, &def->videos[i]->info, -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
All definition validation that don't depend on qemu capabilities and
s/don't/doesn't/
was allowed previously as valid definition should be placed into qemuDomainDefValidate.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 58 ------------------------------------------ src/qemu/qemu_domain.c | 57 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain_address.c | 6 ----- 3 files changed, 57 insertions(+), 64 deletions(-)
ACK, John

Runtime validation that depend on qemu capabilities should be moved into qemuProcessStartValidateXML. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 33 +------------------- src/qemu/qemu_process.c | 50 ++++++++++++++++++++++++++++++- tests/qemuxml2argvtest.c | 78 +++++++++++++++++++++++++++++------------------- 3 files changed, 98 insertions(+), 63 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 761968b..d283c67 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4312,26 +4312,12 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, model = "virtio-gpu-pci"; } } else { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("only one video card is currently supported")); - goto error; - } - model = "qxl"; } virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) { - if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("%s 3d acceleration is not supported"), - virDomainVideoTypeToString(video->type)); - goto error; - } - virBufferAsprintf(&buf, ",virgl=%s", virTristateSwitchTypeToString(video->accel->accel3d)); } @@ -4397,17 +4383,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, primaryVideoType = def->videos[0]->type; - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY) && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)))) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { for (i = 0; i < def->nvideos; i++) { char *str; virCommandAddArg(cmd, "-device"); @@ -4422,13 +4398,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { /* nothing - vga has no effect on Xen pvfb */ } else { - if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL) && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU does not support QXL graphics adapters")); - return -1; - } - const char *vgastr = qemuVideoTypeToString(primaryVideoType); if (!vgastr || STREQ(vgastr, "")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6ddcc1f..eb3add9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4448,6 +4448,48 @@ qemuProcessStartValidateGraphics(virDomainObjPtr vm) static int +qemuProcessStartValidateVideo(virDomainObjPtr vm, + virQEMUCapsPtr qemuCaps) +{ + size_t i; + virDomainVideoDefPtr video; + + for (i = 0; i < vm->def->nvideos; i++) { + video = vm->def->videos[i]; + + if ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("this QEMU does not support '%s' video device"), + virDomainVideoTypeToString(video->type)); + return -1; + } + + if (video->accel) { + if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && + (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s 3d acceleration is not supported"), + virDomainVideoTypeToString(video->type)); + return -1; + } + } + } + + return 0; +} + + +static int qemuProcessStartValidateXML(virQEMUDriverPtr driver, virDomainObjPtr vm, virQEMUCapsPtr qemuCaps, @@ -4517,11 +4559,17 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, if (qemuProcessStartValidateXML(driver, vm, qemuCaps, caps, flags) < 0) return -1; + if (qemuProcessStartValidateGraphics(vm) < 0) + return -1; + + if (qemuProcessStartValidateVideo(vm, qemuCaps) < 0) + return -1; + VIR_DEBUG("Checking for any possible (non-fatal) issues"); qemuProcessStartWarnShmem(vm); - return qemuProcessStartValidateGraphics(vm); + return 0; } diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 78bfb92..1e910f3 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -748,7 +748,8 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DRIVE_AIO, QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_SPICE, - QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB); + QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("eoi-disabled", NONE); DO_TEST("eoi-enabled", NONE); DO_TEST("pv-spinlock-disabled", NONE); @@ -963,32 +964,39 @@ mymain(void) QEMU_CAPS_KVM, QEMU_CAPS_DRIVE_SERIAL); - DO_TEST("graphics-vnc", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET); - DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY); - DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = true; - DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = false; - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncSASL = 1; VIR_FREE(driver.config->vncSASLdir); ignore_value(VIR_STRDUP(driver.config->vncSASLdir, "/root/.sasl2")); - DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncTLS = 1; driver.config->vncTLSx509verify = 1; - DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncSASL = driver.config->vncTLSx509verify = driver.config->vncTLS = 0; VIR_FREE(driver.config->vncSASLdir); VIR_FREE(driver.config->vncTLSx509certdir); - DO_TEST("graphics-sdl", QEMU_CAPS_SDL); - DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL); + DO_TEST("graphics-sdl", QEMU_CAPS_SDL, QEMU_CAPS_DEVICE_VGA); + DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("nographics", NONE); DO_TEST("nographics-display", QEMU_CAPS_DISPLAY); @@ -999,7 +1007,7 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", - QEMU_CAPS_SPICE); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceSASL = 1; ignore_value(VIR_STRDUP(driver.config->spiceSASLdir, "/root/.sasl2")); DO_TEST("graphics-spice-sasl", @@ -1011,14 +1019,16 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_NODEFCONFIG); + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-compression", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VGA); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); @@ -1027,21 +1037,24 @@ mymain(void) QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, - QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-agent-file-xfer", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-auto-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = true; DO_TEST("graphics-spice-auto-socket-cfg", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = false; DO_TEST("input-usbmouse", NONE); @@ -1184,10 +1197,12 @@ mymain(void) QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_SCLP_S390); DO_TEST("channel-spicevmc", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-spicevmc-old", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-virtio-default", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); @@ -1561,7 +1576,7 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("video-vga-nodevice", NONE); + DO_TEST("video-vga-nodevice", QEMU_CAPS_DEVICE_VGA); DO_TEST("video-vga-device", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE_VGA, @@ -1652,11 +1667,14 @@ mymain(void) DO_TEST_PARSE_ERROR("pci-slot-invalid", NONE); DO_TEST_PARSE_ERROR("pci-function-invalid", NONE); - DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autofill-addr", NONE); + DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autofill-addr", QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-many", - QEMU_CAPS_DEVICE_PCI_BRIDGE); + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-bridge-many-disks", QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("pcie-root", @@ -2131,7 +2149,7 @@ mymain(void) DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC, - QEMU_CAPS_NAME_GUEST); + QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS); DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET); -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Runtime validation that depend on qemu capabilities should be moved into qemuProcessStartValidateXML.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 33 +------------------- src/qemu/qemu_process.c | 50 ++++++++++++++++++++++++++++++- tests/qemuxml2argvtest.c | 78 +++++++++++++++++++++++++++++------------------- 3 files changed, 98 insertions(+), 63 deletions(-)
Could the qemuxml2argvtest.c to add QEMU_CAPS_DEVICE_CIRRUS_VGA move to earlier? Perhaps there is a relationship, but it's not clear from the commit message...
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 761968b..d283c67 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4312,26 +4312,12 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, model = "virtio-gpu-pci"; } } else { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("only one video card is currently supported")); - goto error; - } -
Just checking - does the removal of this end up as part of the (now) singular video loop in qemuProcessStartValidateVideo? Same for the removed check in qemuBuildVideoCommandLine? It wasn't "clear" the first pass through reading...
model = "qxl"; }
virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) { - if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("%s 3d acceleration is not supported"), - virDomainVideoTypeToString(video->type)); - goto error; - } - virBufferAsprintf(&buf, ",virgl=%s", virTristateSwitchTypeToString(video->accel->accel3d)); } @@ -4397,17 +4383,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
primaryVideoType = def->videos[0]->type;
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY) && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)))) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { for (i = 0; i < def->nvideos; i++) { char *str; virCommandAddArg(cmd, "-device"); @@ -4422,13 +4398,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { /* nothing - vga has no effect on Xen pvfb */ } else { - if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL) && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU does not support QXL graphics adapters")); - return -1; - } -
... Is it safe to assume there can only be one video card here?
const char *vgastr = qemuVideoTypeToString(primaryVideoType); if (!vgastr || STREQ(vgastr, "")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6ddcc1f..eb3add9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4448,6 +4448,48 @@ qemuProcessStartValidateGraphics(virDomainObjPtr vm)
static int +qemuProcessStartValidateVideo(virDomainObjPtr vm, + virQEMUCapsPtr qemuCaps) +{ + size_t i; + virDomainVideoDefPtr video; + + for (i = 0; i < vm->def->nvideos; i++) { + video = vm->def->videos[i]; + + if ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("this QEMU does not support '%s' video device"), + virDomainVideoTypeToString(video->type)); + return -1; + }
This is a different check to the moved qemuBuildVideoCommandLine code. 1. The video->types were only checked if DEVICE_VIDEO_PRIMARY was set. IOW: This is adding checks and failure scenario that weren't being checked previously in the event that cap isn't set. 2. If DEVICE_VIDEO_PRIMARY, then only if the primary (video[0]) was one of the types would the corresponding cap be checked. This change will check each video[N] and each cap. Since qemuDomainDefValidateVideo would have been called before this and that video[0] == video->primary, then we know video[1]..video[n] can only be VIDEO_TYPE_QXL (so far), so I think this check can be augmented to match that. For sure the non primary video checks need the QEMU_CAPS_DEVICE_QXL because that is what was removed from qemuBuildDeviceVideoStr. I think this is close, just needs a tweak. Unless you have it as "innate knowledge" that videos[0] == video->primary, it can be trying to look at code that sometimes keys off of video->primary while other code keys off videos[0] is primary.
+ + if (video->accel) { + if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && + (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s 3d acceleration is not supported"), + virDomainVideoTypeToString(video->type)); + return -1; + } + } + } + + return 0; +} + + +static int qemuProcessStartValidateXML(virQEMUDriverPtr driver, virDomainObjPtr vm, virQEMUCapsPtr qemuCaps, @@ -4517,11 +4559,17 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, if (qemuProcessStartValidateXML(driver, vm, qemuCaps, caps, flags) < 0) return -1;
+ if (qemuProcessStartValidateGraphics(vm) < 0) + return -1;
This is a separate "bug fix" due to 'df73f1db8' adding code in that "non-fatal" issues section (whether it's a merge thing or not, I don't recall). But it should be separate.
+ + if (qemuProcessStartValidateVideo(vm, qemuCaps) < 0) + return -1; + VIR_DEBUG("Checking for any possible (non-fatal) issues");
qemuProcessStartWarnShmem(vm);
- return qemuProcessStartValidateGraphics(vm); + return 0; }
As noted earlier, I think the rest of this should be separate. John
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 78bfb92..1e910f3 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -748,7 +748,8 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DRIVE_AIO, QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_SPICE, - QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB); + QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("eoi-disabled", NONE); DO_TEST("eoi-enabled", NONE); DO_TEST("pv-spinlock-disabled", NONE); @@ -963,32 +964,39 @@ mymain(void) QEMU_CAPS_KVM, QEMU_CAPS_DRIVE_SERIAL);
- DO_TEST("graphics-vnc", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET); - DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY); - DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = true; - DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = false; - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
driver.config->vncSASL = 1; VIR_FREE(driver.config->vncSASLdir); ignore_value(VIR_STRDUP(driver.config->vncSASLdir, "/root/.sasl2")); - DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncTLS = 1; driver.config->vncTLSx509verify = 1; - DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncSASL = driver.config->vncTLSx509verify = driver.config->vncTLS = 0; VIR_FREE(driver.config->vncSASLdir); VIR_FREE(driver.config->vncTLSx509certdir);
- DO_TEST("graphics-sdl", QEMU_CAPS_SDL); - DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL); + DO_TEST("graphics-sdl", QEMU_CAPS_SDL, QEMU_CAPS_DEVICE_VGA); + DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("nographics", NONE); DO_TEST("nographics-display", QEMU_CAPS_DISPLAY); @@ -999,7 +1007,7 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", - QEMU_CAPS_SPICE); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceSASL = 1; ignore_value(VIR_STRDUP(driver.config->spiceSASLdir, "/root/.sasl2")); DO_TEST("graphics-spice-sasl", @@ -1011,14 +1019,16 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_NODEFCONFIG); + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-compression", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VGA); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); @@ -1027,21 +1037,24 @@ mymain(void) QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, - QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-agent-file-xfer", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-auto-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = true; DO_TEST("graphics-spice-auto-socket-cfg", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = false;
DO_TEST("input-usbmouse", NONE); @@ -1184,10 +1197,12 @@ mymain(void) QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_SCLP_S390); DO_TEST("channel-spicevmc", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-spicevmc-old", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-virtio-default", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); @@ -1561,7 +1576,7 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("video-vga-nodevice", NONE); + DO_TEST("video-vga-nodevice", QEMU_CAPS_DEVICE_VGA); DO_TEST("video-vga-device", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE_VGA, @@ -1652,11 +1667,14 @@ mymain(void) DO_TEST_PARSE_ERROR("pci-slot-invalid", NONE); DO_TEST_PARSE_ERROR("pci-function-invalid", NONE);
- DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autofill-addr", NONE); + DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autofill-addr", QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-many", - QEMU_CAPS_DEVICE_PCI_BRIDGE); + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-bridge-many-disks", QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("pcie-root", @@ -2131,7 +2149,7 @@ mymain(void)
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC, - QEMU_CAPS_NAME_GUEST); + QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);

On Sat, Oct 08, 2016 at 09:58:15AM -0400, John Ferlan wrote:
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Runtime validation that depend on qemu capabilities should be moved into qemuProcessStartValidateXML.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 33 +------------------- src/qemu/qemu_process.c | 50 ++++++++++++++++++++++++++++++- tests/qemuxml2argvtest.c | 78 +++++++++++++++++++++++++++++------------------- 3 files changed, 98 insertions(+), 63 deletions(-)
Could the qemuxml2argvtest.c to add QEMU_CAPS_DEVICE_CIRRUS_VGA move to earlier? Perhaps there is a relationship, but it's not clear from the commit message...
The changes to qemuxml2argvtest.c can be moved to separate patch, the only relationship is that the movement of validation code depends on the changes to qemuxml2argvtest.c because this patch adds the validation for secondary video devices too.
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 761968b..d283c67 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4312,26 +4312,12 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, model = "virtio-gpu-pci"; } } else { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("only one video card is currently supported")); - goto error; - } -
Just checking - does the removal of this end up as part of the (now) singular video loop in qemuProcessStartValidateVideo? Same for the removed check in qemuBuildVideoCommandLine?
It wasn't "clear" the first pass through reading...
That exact error message is replaced by different error message: "this QEMU does not support '%s' video device" Currently only QXL can be used as secondary video device so if QXL device is not supported by QEMU it also implicates that only one video card is supported.
model = "qxl"; }
virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) { - if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("%s 3d acceleration is not supported"), - virDomainVideoTypeToString(video->type)); - goto error; - } - virBufferAsprintf(&buf, ",virgl=%s", virTristateSwitchTypeToString(video->accel->accel3d)); } @@ -4397,17 +4383,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
primaryVideoType = def->videos[0]->type;
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY) && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)))) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { for (i = 0; i < def->nvideos; i++) { char *str; virCommandAddArg(cmd, "-device"); @@ -4422,13 +4398,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { /* nothing - vga has no effect on Xen pvfb */ } else { - if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL) && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU does not support QXL graphics adapters")); - return -1; - } -
... Is it safe to assume there can only be one video card here?
Where did you get the assumption from?
const char *vgastr = qemuVideoTypeToString(primaryVideoType); if (!vgastr || STREQ(vgastr, "")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6ddcc1f..eb3add9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4448,6 +4448,48 @@ qemuProcessStartValidateGraphics(virDomainObjPtr vm)
static int +qemuProcessStartValidateVideo(virDomainObjPtr vm, + virQEMUCapsPtr qemuCaps) +{ + size_t i; + virDomainVideoDefPtr video; + + for (i = 0; i < vm->def->nvideos; i++) { + video = vm->def->videos[i]; + + if ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("this QEMU does not support '%s' video device"), + virDomainVideoTypeToString(video->type)); + return -1; + }
This is a different check to the moved qemuBuildVideoCommandLine code.
1. The video->types were only checked if DEVICE_VIDEO_PRIMARY was set. IOW: This is adding checks and failure scenario that weren't being checked previously in the event that cap isn't set.
Yes that's true.
2. If DEVICE_VIDEO_PRIMARY, then only if the primary (video[0]) was one of the types would the corresponding cap be checked. This change will check each video[N] and each cap.
This is also true.
Since qemuDomainDefValidateVideo would have been called before this and that video[0] == video->primary, then we know video[1]..video[n] can only be VIDEO_TYPE_QXL (so far), so I think this check can be augmented to match that.
This is already done by qemuDomainDefValidateVideo(). qemuProcessStartValidateXML()->virDomainDefValidate() ->qemuDomainDefValidate()->qemuDomainDefValidateVideo()
For sure the non primary video checks need the QEMU_CAPS_DEVICE_QXL because that is what was removed from qemuBuildDeviceVideoStr.
I think this is close, just needs a tweak. Unless you have it as "innate knowledge" that videos[0] == video->primary, it can be trying to look at
Check the code at src/conf/domain_conf.c:17317 ... if (VIR_INSERT_ELEMENT_INPLACE(def->videos, ... This ensures that there is only one primary video device and that the primary video device is always first.
code that sometimes keys off of video->primary while other code keys off videos[0] is primary.
+ + if (video->accel) { + if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && + (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s 3d acceleration is not supported"), + virDomainVideoTypeToString(video->type)); + return -1; + } + } + } + + return 0; +} + + +static int qemuProcessStartValidateXML(virQEMUDriverPtr driver, virDomainObjPtr vm, virQEMUCapsPtr qemuCaps, @@ -4517,11 +4559,17 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, if (qemuProcessStartValidateXML(driver, vm, qemuCaps, caps, flags) < 0) return -1;
+ if (qemuProcessStartValidateGraphics(vm) < 0) + return -1;
This is a separate "bug fix" due to 'df73f1db8' adding code in that "non-fatal" issues section (whether it's a merge thing or not, I don't recall). But it should be separate.
At least I tried to hide this change in this patch. I'll create a separate patch for this. Pavel
+ + if (qemuProcessStartValidateVideo(vm, qemuCaps) < 0) + return -1; + VIR_DEBUG("Checking for any possible (non-fatal) issues");
qemuProcessStartWarnShmem(vm);
- return qemuProcessStartValidateGraphics(vm); + return 0; }
As noted earlier, I think the rest of this should be separate.
John
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 78bfb92..1e910f3 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -748,7 +748,8 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DRIVE_AIO, QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_SPICE, - QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB); + QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("eoi-disabled", NONE); DO_TEST("eoi-enabled", NONE); DO_TEST("pv-spinlock-disabled", NONE); @@ -963,32 +964,39 @@ mymain(void) QEMU_CAPS_KVM, QEMU_CAPS_DRIVE_SERIAL);
- DO_TEST("graphics-vnc", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET); - DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY); - DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = true; - DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = false; - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
driver.config->vncSASL = 1; VIR_FREE(driver.config->vncSASLdir); ignore_value(VIR_STRDUP(driver.config->vncSASLdir, "/root/.sasl2")); - DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncTLS = 1; driver.config->vncTLSx509verify = 1; - DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncSASL = driver.config->vncTLSx509verify = driver.config->vncTLS = 0; VIR_FREE(driver.config->vncSASLdir); VIR_FREE(driver.config->vncTLSx509certdir);
- DO_TEST("graphics-sdl", QEMU_CAPS_SDL); - DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL); + DO_TEST("graphics-sdl", QEMU_CAPS_SDL, QEMU_CAPS_DEVICE_VGA); + DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("nographics", NONE); DO_TEST("nographics-display", QEMU_CAPS_DISPLAY); @@ -999,7 +1007,7 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", - QEMU_CAPS_SPICE); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceSASL = 1; ignore_value(VIR_STRDUP(driver.config->spiceSASLdir, "/root/.sasl2")); DO_TEST("graphics-spice-sasl", @@ -1011,14 +1019,16 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_NODEFCONFIG); + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-compression", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VGA); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); @@ -1027,21 +1037,24 @@ mymain(void) QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, - QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-agent-file-xfer", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-auto-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = true; DO_TEST("graphics-spice-auto-socket-cfg", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = false;
DO_TEST("input-usbmouse", NONE); @@ -1184,10 +1197,12 @@ mymain(void) QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_SCLP_S390); DO_TEST("channel-spicevmc", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-spicevmc-old", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-virtio-default", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); @@ -1561,7 +1576,7 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("video-vga-nodevice", NONE); + DO_TEST("video-vga-nodevice", QEMU_CAPS_DEVICE_VGA); DO_TEST("video-vga-device", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE_VGA, @@ -1652,11 +1667,14 @@ mymain(void) DO_TEST_PARSE_ERROR("pci-slot-invalid", NONE); DO_TEST_PARSE_ERROR("pci-function-invalid", NONE);
- DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autofill-addr", NONE); + DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autofill-addr", QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-many", - QEMU_CAPS_DEVICE_PCI_BRIDGE); + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-bridge-many-disks", QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("pcie-root", @@ -2131,7 +2149,7 @@ mymain(void)
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC, - QEMU_CAPS_NAME_GUEST); + QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 10/10/2016 05:44 AM, Pavel Hrdina wrote:
On Sat, Oct 08, 2016 at 09:58:15AM -0400, John Ferlan wrote:
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Runtime validation that depend on qemu capabilities should be moved into qemuProcessStartValidateXML.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 33 +------------------- src/qemu/qemu_process.c | 50 ++++++++++++++++++++++++++++++- tests/qemuxml2argvtest.c | 78 +++++++++++++++++++++++++++++------------------- 3 files changed, 98 insertions(+), 63 deletions(-)
Could the qemuxml2argvtest.c to add QEMU_CAPS_DEVICE_CIRRUS_VGA move to earlier? Perhaps there is a relationship, but it's not clear from the commit message...
The changes to qemuxml2argvtest.c can be moved to separate patch, the only relationship is that the movement of validation code depends on the changes to qemuxml2argvtest.c because this patch adds the validation for secondary video devices too.
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 761968b..d283c67 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4312,26 +4312,12 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, model = "virtio-gpu-pci"; } } else { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("only one video card is currently supported")); - goto error; - } -
Just checking - does the removal of this end up as part of the (now) singular video loop in qemuProcessStartValidateVideo? Same for the removed check in qemuBuildVideoCommandLine?
It wasn't "clear" the first pass through reading...
That exact error message is replaced by different error message:
"this QEMU does not support '%s' video device"
Currently only QXL can be used as secondary video device so if QXL device is not supported by QEMU it also implicates that only one video card is supported.
model = "qxl"; }
virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) { - if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("%s 3d acceleration is not supported"), - virDomainVideoTypeToString(video->type)); - goto error; - } - virBufferAsprintf(&buf, ",virgl=%s", virTristateSwitchTypeToString(video->accel->accel3d)); } @@ -4397,17 +4383,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
primaryVideoType = def->videos[0]->type;
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY) && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)))) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { for (i = 0; i < def->nvideos; i++) { char *str; virCommandAddArg(cmd, "-device"); @@ -4422,13 +4398,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { /* nothing - vga has no effect on Xen pvfb */ } else { - if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL) && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU does not support QXL graphics adapters")); - return -1; - } -
... Is it safe to assume there can only be one video card here?
Where did you get the assumption from?
Probably written before I found the gem in domain_conf about primary being [0] and I never got back to the line in my followup pass. I was "attempting to" match the removed code with the new code. I guess I didn't find this as clean as it appears to be. In hindsight it seems to be a shortcut. Probably helps to have the history of when the PRIMARY capability was added...
const char *vgastr = qemuVideoTypeToString(primaryVideoType); if (!vgastr || STREQ(vgastr, "")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6ddcc1f..eb3add9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4448,6 +4448,48 @@ qemuProcessStartValidateGraphics(virDomainObjPtr vm)
static int +qemuProcessStartValidateVideo(virDomainObjPtr vm, + virQEMUCapsPtr qemuCaps) +{ + size_t i; + virDomainVideoDefPtr video; + + for (i = 0; i < vm->def->nvideos; i++) { + video = vm->def->videos[i]; + + if ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("this QEMU does not support '%s' video device"), + virDomainVideoTypeToString(video->type)); + return -1; + }
This is a different check to the moved qemuBuildVideoCommandLine code.
1. The video->types were only checked if DEVICE_VIDEO_PRIMARY was set. IOW: This is adding checks and failure scenario that weren't being checked previously in the event that cap isn't set.
Yes that's true.
And even though we have other checks to ensure QXL is the only one used for non primary, we are adding checks VGA, CIRRUS_VGA, and VMWARE_SVGA for every non primary until we find QXL....
2. If DEVICE_VIDEO_PRIMARY, then only if the primary (video[0]) was one of the types would the corresponding cap be checked. This change will check each video[N] and each cap.
This is also true.
Since qemuDomainDefValidateVideo would have been called before this and that video[0] == video->primary, then we know video[1]..video[n] can only be VIDEO_TYPE_QXL (so far), so I think this check can be augmented to match that.
This is already done by qemuDomainDefValidateVideo().
qemuProcessStartValidateXML()->virDomainDefValidate() ->qemuDomainDefValidate()->qemuDomainDefValidateVideo()
I think I was going for - the primary can/should make all those checks and the secondary really only needs to make the QXL check. Again there's this whole PRIMARY cap which plays a role and it really isn't just code motion here.
For sure the non primary video checks need the QEMU_CAPS_DEVICE_QXL because that is what was removed from qemuBuildDeviceVideoStr.
I think this is close, just needs a tweak. Unless you have it as "innate knowledge" that videos[0] == video->primary, it can be trying to look at
Check the code at src/conf/domain_conf.c:17317
... if (VIR_INSERT_ELEMENT_INPLACE(def->videos, ...
This ensures that there is only one primary video device and that the primary video device is always first.
Right - exactly what I found (eventually). I think it's confusing to see "videos[0]" used in some cases and video->primary used in other cases until you find that INPLACE line and realize it's putting it @ 0. John
code that sometimes keys off of video->primary while other code keys off videos[0] is primary.
+ + if (video->accel) { + if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && + (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s 3d acceleration is not supported"), + virDomainVideoTypeToString(video->type)); + return -1; + } + } + } + + return 0; +} + + +static int qemuProcessStartValidateXML(virQEMUDriverPtr driver, virDomainObjPtr vm, virQEMUCapsPtr qemuCaps, @@ -4517,11 +4559,17 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, if (qemuProcessStartValidateXML(driver, vm, qemuCaps, caps, flags) < 0) return -1;
+ if (qemuProcessStartValidateGraphics(vm) < 0) + return -1;
This is a separate "bug fix" due to 'df73f1db8' adding code in that "non-fatal" issues section (whether it's a merge thing or not, I don't recall). But it should be separate.
At least I tried to hide this change in this patch. I'll create a separate patch for this.
Pavel
+ + if (qemuProcessStartValidateVideo(vm, qemuCaps) < 0) + return -1; + VIR_DEBUG("Checking for any possible (non-fatal) issues");
qemuProcessStartWarnShmem(vm);
- return qemuProcessStartValidateGraphics(vm); + return 0; }
As noted earlier, I think the rest of this should be separate.
John
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 78bfb92..1e910f3 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -748,7 +748,8 @@ mymain(void) QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DRIVE_AIO, QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_SPICE, - QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB); + QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("eoi-disabled", NONE); DO_TEST("eoi-enabled", NONE); DO_TEST("pv-spinlock-disabled", NONE); @@ -963,32 +964,39 @@ mymain(void) QEMU_CAPS_KVM, QEMU_CAPS_DRIVE_SERIAL);
- DO_TEST("graphics-vnc", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET); - DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY); - DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = true; - DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncAutoUnixSocket = false; - DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC); - DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-none", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
driver.config->vncSASL = 1; VIR_FREE(driver.config->vncSASLdir); ignore_value(VIR_STRDUP(driver.config->vncSASLdir, "/root/.sasl2")); - DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncTLS = 1; driver.config->vncTLSx509verify = 1; - DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->vncSASL = driver.config->vncTLSx509verify = driver.config->vncTLS = 0; VIR_FREE(driver.config->vncSASLdir); VIR_FREE(driver.config->vncTLSx509certdir);
- DO_TEST("graphics-sdl", QEMU_CAPS_SDL); - DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL); + DO_TEST("graphics-sdl", QEMU_CAPS_SDL, QEMU_CAPS_DEVICE_VGA); + DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_SDL, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("nographics", NONE); DO_TEST("nographics-display", QEMU_CAPS_DISPLAY); @@ -999,7 +1007,7 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-no-args", - QEMU_CAPS_SPICE); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceSASL = 1; ignore_value(VIR_STRDUP(driver.config->spiceSASLdir, "/root/.sasl2")); DO_TEST("graphics-spice-sasl", @@ -1011,14 +1019,16 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_NODEFCONFIG); + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-compression", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); DO_TEST("graphics-spice-timeout", QEMU_CAPS_KVM, QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VGA); DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL); @@ -1027,21 +1037,24 @@ mymain(void) QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, - QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-agent-file-xfer", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); DO_TEST("graphics-spice-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-spice-auto-socket", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = true; DO_TEST("graphics-spice-auto-socket-cfg", QEMU_CAPS_SPICE, - QEMU_CAPS_SPICE_UNIX); + QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_CIRRUS_VGA); driver.config->spiceAutoUnixSocket = false;
DO_TEST("input-usbmouse", NONE); @@ -1184,10 +1197,12 @@ mymain(void) QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_SCLP_S390); DO_TEST("channel-spicevmc", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-spicevmc-old", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC); + QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-virtio-default", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); @@ -1561,7 +1576,7 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("video-vga-nodevice", NONE); + DO_TEST("video-vga-nodevice", QEMU_CAPS_DEVICE_VGA); DO_TEST("video-vga-device", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE_VGA, @@ -1652,11 +1667,14 @@ mymain(void) DO_TEST_PARSE_ERROR("pci-slot-invalid", NONE); DO_TEST_PARSE_ERROR("pci-function-invalid", NONE);
- DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE); - DO_TEST("pci-autofill-addr", NONE); + DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("pci-autofill-addr", QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-many", - QEMU_CAPS_DEVICE_PCI_BRIDGE); + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("pci-bridge-many-disks", QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("pcie-root", @@ -2131,7 +2149,7 @@ mymain(void)
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC, - QEMU_CAPS_NAME_GUEST); + QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

We usually uses QEMU_CASP_DEVICE_$NAME to probe for existence of some device and QEMU_CAPS_$NAME_$PROP to probe for existence of some property of that device. This also remove wrong assumption for QEMU_CAPS_DEVICE_VIRTIO_GPU that it's also 'virtio-vga' which isn't true. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 4 +- src/qemu/qemu_capabilities.h | 4 +- src/qemu/qemu_process.c | 2 +- .../qemucapabilitiesdata/caps_1.2.2.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.3.1.x86_64.replies | 28 ++++++---- .../qemucapabilitiesdata/caps_1.4.2.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 32 +++++++---- .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 54 ++++++++++++++---- .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 64 ++++++++++++++++++---- .../caps_2.6.0-gicv2.aarch64.replies | 35 ++++++++++++ .../caps_2.6.0-gicv3.aarch64.replies | 35 ++++++++++++ .../caps_2.6.0.ppc64le.replies | 35 ++++++++++++ .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 64 ++++++++++++++++++---- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 64 ++++++++++++++++++---- tests/qemuxml2argvtest.c | 4 +- 18 files changed, 444 insertions(+), 131 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ae83317..5449b07 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1676,7 +1676,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = { - { "virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL }, + { "virgl", QEMU_CAPS_VIRTIO_GPU_VIRGL }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsICH9[] = { @@ -1745,6 +1745,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, + { "virtio-gpu-device", virQEMUCapsObjectPropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, { "ICH9-LPC", virQEMUCapsObjectPropsICH9, ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9) }, { "virtio-balloon-pci", virQEMUCapsObjectPropsVirtioBalloon, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 2effcb7..1766aa6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -328,8 +328,8 @@ typedef enum { /* 200 */ QEMU_CAPS_INCOMING_DEFER, /* -incoming defer and migrate_incoming */ - QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* & virtio-vga */ - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */ + QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* */ + QEMU_CAPS_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */ QEMU_CAPS_VIRTIO_KEYBOARD, /* -device virtio-keyboard-{device,pci} */ QEMU_CAPS_VIRTIO_MOUSE, /* -device virtio-mouse-{device,pci} */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index eb3add9..7068a54 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4476,7 +4476,7 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm, if (video->accel) { if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL))) { + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("%s 3d acceleration is not supported"), virDomainVideoTypeToString(video->type)); diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies index 6d356db..dff9788 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies @@ -1604,6 +1604,14 @@ "id": "libvirt-33", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-34", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1643,11 +1651,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { - "id": "libvirt-35", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1655,7 +1663,7 @@ } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1689,7 +1697,7 @@ "type": "uint32" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -1730,7 +1738,7 @@ "name": "none" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -1802,7 +1810,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -1810,11 +1818,11 @@ "enabled": false, "present": true }, - "id": "libvirt-40" + "id": "libvirt-41" } { - "id": "libvirt-41", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1822,7 +1830,7 @@ } { - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1830,7 +1838,7 @@ } { - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1844,5 +1852,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-44" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies index 69bf0c2..c40f9fe 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies @@ -1804,6 +1804,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1843,11 +1851,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1855,7 +1863,7 @@ } { - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1909,7 +1917,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -1957,7 +1965,7 @@ "name": "none" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -2035,7 +2043,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -2043,11 +2051,11 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2055,7 +2063,7 @@ } { - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2063,7 +2071,7 @@ } { - "id": "libvirt-44", + "id": "libvirt-45", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies index a69846a..7e86cff 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies @@ -1851,6 +1851,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1890,11 +1898,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1902,7 +1910,7 @@ } { - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1956,7 +1964,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -2007,7 +2015,7 @@ "name": "none" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -2085,7 +2093,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -2093,11 +2101,11 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2105,7 +2113,7 @@ } { - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2113,7 +2121,7 @@ } { - "id": "libvirt-44", + "id": "libvirt-45", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -2127,5 +2135,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies index 2c835ad..7486579 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies @@ -1954,6 +1954,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1993,11 +2001,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2007,7 +2015,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -2057,7 +2065,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -2130,7 +2138,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -2208,7 +2216,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -2216,19 +2224,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -2929,7 +2937,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -2939,5 +2947,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies index 91481bb..aad28ca 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies @@ -1999,6 +1999,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -2038,11 +2046,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2052,7 +2060,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -2102,7 +2110,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -2183,7 +2191,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -2261,7 +2269,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -2269,19 +2277,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -2884,7 +2892,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -2906,5 +2914,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies index bde8c20..b44d5f1 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies @@ -2016,6 +2016,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -2055,11 +2063,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2069,7 +2077,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -2119,7 +2127,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -2208,7 +2216,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -2286,7 +2294,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -2294,19 +2302,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -3099,7 +3107,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -3121,5 +3129,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies index 344497c..a7d8f36 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies @@ -2368,6 +2368,14 @@ } { + "id": "libvirt-34", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ "return": [ { "name": "memory-hotplug-support", @@ -2418,7 +2426,7 @@ "type": "pci-devfn" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -2468,11 +2476,11 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2482,7 +2490,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -2536,7 +2544,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -2641,7 +2649,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -2722,7 +2730,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -2730,21 +2738,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -3604,7 +3612,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -3626,5 +3634,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies index 95a3fc8..c483c48 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies @@ -2806,6 +2806,36 @@ { "return": [ { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "enable_tco", "type": "bool" }, @@ -2877,7 +2907,7 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -2962,11 +2992,11 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3009,7 +3039,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -3079,7 +3109,7 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -3208,7 +3238,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -3298,7 +3328,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -3306,21 +3336,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -4328,7 +4358,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -4358,5 +4388,5 @@ "capability": "events" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies index 2deb044..75a00ce 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies @@ -2944,6 +2944,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3015,7 +3055,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -3115,11 +3155,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3162,7 +3202,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -3232,7 +3272,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -3369,7 +3409,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -3459,7 +3499,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -3467,21 +3507,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -4526,7 +4566,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -4560,5 +4600,5 @@ "capability": "x-postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies index f6107a0..35095b5 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies @@ -3390,6 +3390,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies index 609e38b..0009f8f 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies @@ -3390,6 +3390,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies index 7051e31..1835b6d 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies @@ -3537,6 +3537,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies index 74e48b0..5db3f5a 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies @@ -3026,6 +3026,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3097,7 +3137,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -3197,11 +3237,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3244,7 +3284,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -3314,7 +3354,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -3427,7 +3467,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -3517,7 +3557,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -3525,21 +3565,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -4633,7 +4673,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -4667,5 +4707,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies index 6514dd1..c525f66 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies @@ -3199,6 +3199,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3279,7 +3319,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -3383,11 +3423,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3430,7 +3470,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -3505,7 +3545,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -3654,7 +3694,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -3747,7 +3787,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -3755,21 +3795,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" } { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -4867,7 +4907,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -4901,5 +4941,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1e910f3..6404865 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1608,11 +1608,11 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-gpu-virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU, - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_VIRGL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-gpu-spice-gl", QEMU_CAPS_DEVICE_VIRTIO_GPU, - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_VIRGL, QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
We usually uses QEMU_CASP_DEVICE_$NAME to probe for existence of some
libvirt generally uses QEMU_CAPS_DEVICE_$NAME
device and QEMU_CAPS_$NAME_$PROP to probe for existence of some property of that device.
This also remove wrong assumption for QEMU_CAPS_DEVICE_VIRTIO_GPU that it's also 'virtio-vga' which isn't true.
This will remove the wrong ...
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 4 +- src/qemu/qemu_capabilities.h | 4 +- src/qemu/qemu_process.c | 2 +- .../qemucapabilitiesdata/caps_1.2.2.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.3.1.x86_64.replies | 28 ++++++---- .../qemucapabilitiesdata/caps_1.4.2.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 32 +++++++---- .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 54 ++++++++++++++---- .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 64 ++++++++++++++++++---- .../caps_2.6.0-gicv2.aarch64.replies | 35 ++++++++++++ .../caps_2.6.0-gicv3.aarch64.replies | 35 ++++++++++++ .../caps_2.6.0.ppc64le.replies | 35 ++++++++++++ .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 64 ++++++++++++++++++---- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 64 ++++++++++++++++++---- tests/qemuxml2argvtest.c | 4 +- 18 files changed, 444 insertions(+), 131 deletions(-)
I think there's two things going on here... A name change wouldn't affect the replies files... [ahh, umm - I just read patch 9... I think there's some synergies there - glad I waited before sending all my comments... But I didn't change anything below...]
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ae83317..5449b07 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1676,7 +1676,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { };
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = { - { "virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL }, + { "virgl", QEMU_CAPS_VIRTIO_GPU_VIRGL }, };
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsICH9[] = { @@ -1745,6 +1745,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, + { "virtio-gpu-device", virQEMUCapsObjectPropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) },
Should this be a separate bug fix? Since this is less renaming and more adding something that wasn't there and causes all the change to the qemucapabilitiesdata replies files. The "virtio-gpu" cap was added with commit id '21373feb' - it added "virtio-gpu-pci" and "virtio-gpu-device" to virQEMUCapsObjectTypes. The "virtio-gcpu.virgl" cap was added with commit id '06198b9c' - it added the virQEMUCapsObjectPropsVirtioGpu and added just "virtio-gpu-pci" to virQEMUCapsObjectProps. So it seems you are indicating it should have also added "virtio-gpu-device" to that table - is that what's going on here? I think it should be separate and clearly stated.
{ "ICH9-LPC", virQEMUCapsObjectPropsICH9, ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9) }, { "virtio-balloon-pci", virQEMUCapsObjectPropsVirtioBalloon, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 2effcb7..1766aa6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -328,8 +328,8 @@ typedef enum {
/* 200 */ QEMU_CAPS_INCOMING_DEFER, /* -incoming defer and migrate_incoming */ - QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* & virtio-vga */ - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */ + QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* */ + QEMU_CAPS_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */
Any specific reason to remove the & virtio-vga comment? As I read commit id '21373feb' it says "It can be used with -device virtio-vga for primary devices, or -device virtio-gpu for non-vga devices. However, only the primary device (VGA) is supported with this patch." The name change reasoning is right/ok, but needs to be separate. John
QEMU_CAPS_VIRTIO_KEYBOARD, /* -device virtio-keyboard-{device,pci} */ QEMU_CAPS_VIRTIO_MOUSE, /* -device virtio-mouse-{device,pci} */
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index eb3add9..7068a54 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4476,7 +4476,7 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm, if (video->accel) { if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL))) { + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("%s 3d acceleration is not supported"), virDomainVideoTypeToString(video->type)); diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies index 6d356db..dff9788 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies @@ -1604,6 +1604,14 @@ "id": "libvirt-33", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-34", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1643,11 +1651,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ - "id": "libvirt-35", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1655,7 +1663,7 @@ }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1689,7 +1697,7 @@ "type": "uint32" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -1730,7 +1738,7 @@ "name": "none" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -1802,7 +1810,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -1810,11 +1818,11 @@ "enabled": false, "present": true }, - "id": "libvirt-40" + "id": "libvirt-41" }
{ - "id": "libvirt-41", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1822,7 +1830,7 @@ }
{ - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1830,7 +1838,7 @@ }
{ - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1844,5 +1852,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-44" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies index 69bf0c2..c40f9fe 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies @@ -1804,6 +1804,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1843,11 +1851,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1855,7 +1863,7 @@ }
{ - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1909,7 +1917,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -1957,7 +1965,7 @@ "name": "none" } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2035,7 +2043,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2043,11 +2051,11 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2055,7 +2063,7 @@ }
{ - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2063,7 +2071,7 @@ }
{ - "id": "libvirt-44", + "id": "libvirt-45", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies index a69846a..7e86cff 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies @@ -1851,6 +1851,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1890,11 +1898,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1902,7 +1910,7 @@ }
{ - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1956,7 +1964,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2007,7 +2015,7 @@ "name": "none" } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2085,7 +2093,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2093,11 +2101,11 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2105,7 +2113,7 @@ }
{ - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2113,7 +2121,7 @@ }
{ - "id": "libvirt-44", + "id": "libvirt-45", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -2127,5 +2135,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies index 2c835ad..7486579 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies @@ -1954,6 +1954,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1993,11 +2001,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2007,7 +2015,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2057,7 +2065,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2130,7 +2138,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2208,7 +2216,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2216,19 +2224,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -2929,7 +2937,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -2939,5 +2947,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies index 91481bb..aad28ca 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies @@ -1999,6 +1999,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -2038,11 +2046,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2052,7 +2060,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2102,7 +2110,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2183,7 +2191,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2261,7 +2269,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2269,19 +2277,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -2884,7 +2892,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -2906,5 +2914,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies index bde8c20..b44d5f1 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies @@ -2016,6 +2016,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -2055,11 +2063,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2069,7 +2077,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2119,7 +2127,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2208,7 +2216,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2286,7 +2294,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2294,19 +2302,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -3099,7 +3107,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -3121,5 +3129,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies index 344497c..a7d8f36 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies @@ -2368,6 +2368,14 @@ }
{ + "id": "libvirt-34", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ "return": [ { "name": "memory-hotplug-support", @@ -2418,7 +2426,7 @@ "type": "pci-devfn" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -2468,11 +2476,11 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2482,7 +2490,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2536,7 +2544,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2641,7 +2649,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2722,7 +2730,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2730,21 +2738,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -3604,7 +3612,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -3626,5 +3634,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies index 95a3fc8..c483c48 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies @@ -2806,6 +2806,36 @@ { "return": [ { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "enable_tco", "type": "bool" }, @@ -2877,7 +2907,7 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -2962,11 +2992,11 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3009,7 +3039,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3079,7 +3109,7 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3208,7 +3238,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3298,7 +3328,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3306,21 +3336,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4328,7 +4358,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4358,5 +4388,5 @@ "capability": "events" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies index 2deb044..75a00ce 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies @@ -2944,6 +2944,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3015,7 +3055,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -3115,11 +3155,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3162,7 +3202,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3232,7 +3272,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3369,7 +3409,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3459,7 +3499,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3467,21 +3507,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4526,7 +4566,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4560,5 +4600,5 @@ "capability": "x-postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies index f6107a0..35095b5 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies @@ -3390,6 +3390,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" }
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies index 609e38b..0009f8f 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies @@ -3390,6 +3390,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" }
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies index 7051e31..1835b6d 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies @@ -3537,6 +3537,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" }
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies index 74e48b0..5db3f5a 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies @@ -3026,6 +3026,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3097,7 +3137,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -3197,11 +3237,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3244,7 +3284,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3314,7 +3354,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3427,7 +3467,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3517,7 +3557,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3525,21 +3565,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4633,7 +4673,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4667,5 +4707,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies index 6514dd1..c525f66 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies @@ -3199,6 +3199,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3279,7 +3319,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -3383,11 +3423,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3430,7 +3470,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3505,7 +3545,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3654,7 +3694,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3747,7 +3787,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3755,21 +3795,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4867,7 +4907,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4901,5 +4941,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1e910f3..6404865 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1608,11 +1608,11 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-gpu-virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU, - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_VIRGL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-gpu-spice-gl", QEMU_CAPS_DEVICE_VIRTIO_GPU, - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_VIRGL, QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);

On Sat, Oct 08, 2016 at 09:59:20AM -0400, John Ferlan wrote:
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
We usually uses QEMU_CASP_DEVICE_$NAME to probe for existence of some
libvirt generally uses QEMU_CAPS_DEVICE_$NAME
device and QEMU_CAPS_$NAME_$PROP to probe for existence of some property of that device.
This also remove wrong assumption for QEMU_CAPS_DEVICE_VIRTIO_GPU that it's also 'virtio-vga' which isn't true.
This will remove the wrong ...
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 4 +- src/qemu/qemu_capabilities.h | 4 +- src/qemu/qemu_process.c | 2 +- .../qemucapabilitiesdata/caps_1.2.2.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.3.1.x86_64.replies | 28 ++++++---- .../qemucapabilitiesdata/caps_1.4.2.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 30 ++++++---- .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 32 +++++++---- .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 54 ++++++++++++++---- .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 64 ++++++++++++++++++---- .../caps_2.6.0-gicv2.aarch64.replies | 35 ++++++++++++ .../caps_2.6.0-gicv3.aarch64.replies | 35 ++++++++++++ .../caps_2.6.0.ppc64le.replies | 35 ++++++++++++ .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 64 ++++++++++++++++++---- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 64 ++++++++++++++++++---- tests/qemuxml2argvtest.c | 4 +- 18 files changed, 444 insertions(+), 131 deletions(-)
I think there's two things going on here... A name change wouldn't affect the replies files...
OK, I'll stop hiding two changes into one patch.
[ahh, umm - I just read patch 9... I think there's some synergies there - glad I waited before sending all my comments... But I didn't change anything below...]
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ae83317..5449b07 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1676,7 +1676,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { };
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = { - { "virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL }, + { "virgl", QEMU_CAPS_VIRTIO_GPU_VIRGL }, };
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsICH9[] = { @@ -1745,6 +1745,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, + { "virtio-gpu-device", virQEMUCapsObjectPropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) },
Should this be a separate bug fix? Since this is less renaming and more adding something that wasn't there and causes all the change to the qemucapabilitiesdata replies files.
The "virtio-gpu" cap was added with commit id '21373feb' - it added "virtio-gpu-pci" and "virtio-gpu-device" to virQEMUCapsObjectTypes.
The "virtio-gcpu.virgl" cap was added with commit id '06198b9c' - it added the virQEMUCapsObjectPropsVirtioGpu and added just "virtio-gpu-pci" to virQEMUCapsObjectProps.
So it seems you are indicating it should have also added "virtio-gpu-device" to that table - is that what's going on here?
I think it should be separate and clearly stated.
I guess that I was just too lazy to make a separate patch for that.
{ "ICH9-LPC", virQEMUCapsObjectPropsICH9, ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9) }, { "virtio-balloon-pci", virQEMUCapsObjectPropsVirtioBalloon, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 2effcb7..1766aa6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -328,8 +328,8 @@ typedef enum {
/* 200 */ QEMU_CAPS_INCOMING_DEFER, /* -incoming defer and migrate_incoming */ - QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* & virtio-vga */ - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */ + QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* */ + QEMU_CAPS_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */
Any specific reason to remove the & virtio-vga comment? As I read commit id '21373feb' it says "It can be used with -device virtio-vga for primary devices, or -device virtio-gpu for non-vga devices. However, only the primary device (VGA) is supported with this patch."
The reason is that if *virtio-gpu-pci* exists it doesn't ensure that *virtio-vga* exists. One example is aarch64 where there is only *virtio-gpu-pci*. So the comment is wrong and also usage of that capability is wrong. Following patch adds proper check for *virtio-vga*. I should probably change the order of some patches. Pavel
The name change reasoning is right/ok, but needs to be separate.
John
QEMU_CAPS_VIRTIO_KEYBOARD, /* -device virtio-keyboard-{device,pci} */ QEMU_CAPS_VIRTIO_MOUSE, /* -device virtio-mouse-{device,pci} */
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index eb3add9..7068a54 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4476,7 +4476,7 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm, if (video->accel) { if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL))) { + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("%s 3d acceleration is not supported"), virDomainVideoTypeToString(video->type)); diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies index 6d356db..dff9788 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies @@ -1604,6 +1604,14 @@ "id": "libvirt-33", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-34", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1643,11 +1651,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ - "id": "libvirt-35", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1655,7 +1663,7 @@ }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1689,7 +1697,7 @@ "type": "uint32" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -1730,7 +1738,7 @@ "name": "none" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -1802,7 +1810,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -1810,11 +1818,11 @@ "enabled": false, "present": true }, - "id": "libvirt-40" + "id": "libvirt-41" }
{ - "id": "libvirt-41", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1822,7 +1830,7 @@ }
{ - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1830,7 +1838,7 @@ }
{ - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1844,5 +1852,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-44" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies index 69bf0c2..c40f9fe 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.replies @@ -1804,6 +1804,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1843,11 +1851,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1855,7 +1863,7 @@ }
{ - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1909,7 +1917,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -1957,7 +1965,7 @@ "name": "none" } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2035,7 +2043,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2043,11 +2051,11 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2055,7 +2063,7 @@ }
{ - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2063,7 +2071,7 @@ }
{ - "id": "libvirt-44", + "id": "libvirt-45", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies index a69846a..7e86cff 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.replies @@ -1851,6 +1851,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1890,11 +1898,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1902,7 +1910,7 @@ }
{ - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1956,7 +1964,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2007,7 +2015,7 @@ "name": "none" } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2085,7 +2093,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2093,11 +2101,11 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2105,7 +2113,7 @@ }
{ - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2113,7 +2121,7 @@ }
{ - "id": "libvirt-44", + "id": "libvirt-45", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -2127,5 +2135,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies index 2c835ad..7486579 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies @@ -1954,6 +1954,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -1993,11 +2001,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2007,7 +2015,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2057,7 +2065,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2130,7 +2138,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2208,7 +2216,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2216,19 +2224,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -2929,7 +2937,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -2939,5 +2947,5 @@ "capability": "xbzrle" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies index 91481bb..aad28ca 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies @@ -1999,6 +1999,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -2038,11 +2046,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2052,7 +2060,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2102,7 +2110,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2183,7 +2191,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2261,7 +2269,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2269,19 +2277,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -2884,7 +2892,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -2906,5 +2914,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies index bde8c20..b44d5f1 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies @@ -2016,6 +2016,14 @@ "id": "libvirt-34", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ + "id": "libvirt-35", + "error": { + "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" } } @@ -2055,11 +2063,11 @@ "type": "on/off" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2069,7 +2077,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2119,7 +2127,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2208,7 +2216,7 @@ "cpu-max": 1 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2286,7 +2294,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2294,19 +2302,19 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -3099,7 +3107,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -3121,5 +3129,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies index 344497c..a7d8f36 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies @@ -2368,6 +2368,14 @@ }
{ + "id": "libvirt-34", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-device' not found" + } +} + +{ "return": [ { "name": "memory-hotplug-support", @@ -2418,7 +2426,7 @@ "type": "pci-devfn" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -2468,11 +2476,11 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2482,7 +2490,7 @@ { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -2536,7 +2544,7 @@ "type": "on/off" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -2641,7 +2649,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -2722,7 +2730,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -2730,21 +2738,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -3604,7 +3612,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -3626,5 +3634,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies index 95a3fc8..c483c48 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies @@ -2806,6 +2806,36 @@ { "return": [ { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "enable_tco", "type": "bool" }, @@ -2877,7 +2907,7 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -2962,11 +2992,11 @@ "type": "uint32" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3009,7 +3039,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3079,7 +3109,7 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3208,7 +3238,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3298,7 +3328,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3306,21 +3336,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4328,7 +4358,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4358,5 +4388,5 @@ "capability": "events" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies index 2deb044..75a00ce 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies @@ -2944,6 +2944,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3015,7 +3055,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -3115,11 +3155,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3162,7 +3202,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3232,7 +3272,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3369,7 +3409,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3459,7 +3499,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3467,21 +3507,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4526,7 +4566,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4560,5 +4600,5 @@ "capability": "x-postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies index f6107a0..35095b5 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.replies @@ -3390,6 +3390,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" }
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies index 609e38b..0009f8f 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.replies @@ -3390,6 +3390,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" }
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies index 7051e31..1835b6d 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies @@ -3537,6 +3537,41 @@ "type": "uint32" } ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + } + ], "id": "libvirt-34" }
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies index 74e48b0..5db3f5a 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies @@ -3026,6 +3026,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3097,7 +3137,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -3197,11 +3237,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3244,7 +3284,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3314,7 +3354,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3427,7 +3467,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3517,7 +3557,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3525,21 +3565,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4633,7 +4673,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4667,5 +4707,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies index 6514dd1..c525f66 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies @@ -3199,6 +3199,46 @@ { "return": [ { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "stats", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virgl", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "name": "memory-hotplug-support", "type": "bool" }, @@ -3279,7 +3319,7 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-35" }
{ @@ -3383,11 +3423,11 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" }
{ - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -3430,7 +3470,7 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -3505,7 +3545,7 @@ "type": "uint32" } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ @@ -3654,7 +3694,7 @@ "cpu-max": 255 } ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -3747,7 +3787,7 @@ "name": "qemu64" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -3755,21 +3795,21 @@ "enabled": false, "present": true }, - "id": "libvirt-41" + "id": "libvirt-42" }
{ "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -4867,7 +4907,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -4901,5 +4941,5 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1e910f3..6404865 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1608,11 +1608,11 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-gpu-virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU, - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_VIRGL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-gpu-spice-gl", QEMU_CAPS_DEVICE_VIRTIO_GPU, - QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_VIRGL, QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 140 ++++++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 64 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d283c67..aef8c79 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4371,6 +4371,81 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, static int +qemuBuildVgaVideoCommand(virCommandPtr cmd, + const virDomainDef *def, + virQEMUCapsPtr qemuCaps) +{ + const char *vgastr = qemuVideoTypeToString(def->videos[0]->type); + if (!vgastr || STREQ(vgastr, "")) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type %s is not supported with QEMU"), + virDomainVideoTypeToString(def->videos[0]->type)); + return -1; + } + + virCommandAddArgList(cmd, "-vga", vgastr, NULL); + + /* If we cannot use --device option to specify the video device + * in QEMU we will fallback to the old --vga option. To get the + * correct device name for the --vga option the 'qemuVideo' is + * used, but to set some device attributes we need to use the + * --global option and for that we need to specify the device + * name the same as for --device option and for that we need to + * use 'qemuDeviceVideo'. + * + * See 'Graphics Devices' section in docs/qdev-device-use.txt in + * QEMU repository. + */ + const char *dev = qemuDeviceVideoTypeToString(def->videos[0]->type); + + if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + (def->videos[0]->vram || def->videos[0]->ram)) { + unsigned int ram = def->videos[0]->ram; + unsigned int vram = def->videos[0]->vram; + unsigned int vram64 = def->videos[0]->vram64; + unsigned int vgamem = def->videos[0]->vgamem; + + if (ram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.ram_size=%u", + dev, ram * 1024); + } + if (vram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram_size=%u", + dev, vram * 1024); + } + if (vram64 && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram64_size_mb=%u", + dev, vram64 / 1024); + } + if (vgamem && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vgamem / 1024); + } + } + + if (def->videos[0]->vram && + ((def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || + (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { + unsigned int vram = def->videos[0]->vram; + + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vram / 1024); + } + + return 0; +} + + +static int qemuBuildVideoCommandLine(virCommandPtr cmd, const virDomainDef *def, virQEMUCapsPtr qemuCaps) @@ -4398,71 +4473,8 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { /* nothing - vga has no effect on Xen pvfb */ } else { - const char *vgastr = qemuVideoTypeToString(primaryVideoType); - if (!vgastr || STREQ(vgastr, "")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(primaryVideoType)); + if (qemuBuildVgaVideoCommand(cmd, def, qemuCaps) < 0) return -1; - } - - virCommandAddArgList(cmd, "-vga", vgastr, NULL); - - /* If we cannot use --device option to specify the video device - * in QEMU we will fallback to the old --vga option. To get the - * correct device name for the --vga option the 'qemuVideo' is - * used, but to set some device attributes we need to use the - * --global option and for that we need to specify the device - * name the same as for --device option and for that we need to - * use 'qemuDeviceVideo'. - * - * See 'Graphics Devices' section in docs/qdev-device-use.txt in - * QEMU repository. - */ - const char *dev = qemuDeviceVideoTypeToString(primaryVideoType); - - if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && - (def->videos[0]->vram || def->videos[0]->ram)) { - unsigned int ram = def->videos[0]->ram; - unsigned int vram = def->videos[0]->vram; - unsigned int vram64 = def->videos[0]->vram64; - unsigned int vgamem = def->videos[0]->vgamem; - - if (ram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.ram_size=%u", - dev, ram * 1024); - } - if (vram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram_size=%u", - dev, vram * 1024); - } - if (vram64 && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram64_size_mb=%u", - dev, vram64 / 1024); - } - if (vgamem && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vgamem / 1024); - } - } - - if (def->videos[0]->vram && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { - unsigned int vram = def->videos[0]->vram; - - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vram / 1024); - } } for (i = 1; i < def->nvideos; i++) { -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 140 ++++++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 64 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d283c67..aef8c79 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4371,6 +4371,81 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
static int +qemuBuildVgaVideoCommand(virCommandPtr cmd, + const virDomainDef *def,
Instead of *def here, you could have const virDomainVideoDefPtr video, and then replace all the "def->videos[0]" with video
+ virQEMUCapsPtr qemuCaps) +{ + const char *vgastr = qemuVideoTypeToString(def->videos[0]->type); + if (!vgastr || STREQ(vgastr, "")) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type %s is not supported with QEMU"), + virDomainVideoTypeToString(def->videos[0]->type)); + return -1; + } + + virCommandAddArgList(cmd, "-vga", vgastr, NULL); + + /* If we cannot use --device option to specify the video device + * in QEMU we will fallback to the old --vga option. To get the + * correct device name for the --vga option the 'qemuVideo' is + * used, but to set some device attributes we need to use the + * --global option and for that we need to specify the device + * name the same as for --device option and for that we need to + * use 'qemuDeviceVideo'. + * + * See 'Graphics Devices' section in docs/qdev-device-use.txt in + * QEMU repository. + */ + const char *dev = qemuDeviceVideoTypeToString(def->videos[0]->type);
While we're at moving things around - can the "const char *dev... " be defined at the top and not in the middle somewhere?
+ + if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + (def->videos[0]->vram || def->videos[0]->ram)) { + unsigned int ram = def->videos[0]->ram; + unsigned int vram = def->videos[0]->vram; + unsigned int vram64 = def->videos[0]->vram64; + unsigned int vgamem = def->videos[0]->vgamem; + + if (ram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.ram_size=%u", + dev, ram * 1024); + } + if (vram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram_size=%u", + dev, vram * 1024); + } + if (vram64 && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram64_size_mb=%u", + dev, vram64 / 1024); + } + if (vgamem && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vgamem / 1024); + } + } + + if (def->videos[0]->vram && + ((def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || + (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { + unsigned int vram = def->videos[0]->vram; + + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vram / 1024); + } + + return 0; +} + + +static int qemuBuildVideoCommandLine(virCommandPtr cmd, const virDomainDef *def, virQEMUCapsPtr qemuCaps) @@ -4398,71 +4473,8 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) {
I was going to suggest something regarding removing primaryVideoType, but I see the next patch does more overhaul...
/* nothing - vga has no effect on Xen pvfb */ } else { - const char *vgastr = qemuVideoTypeToString(primaryVideoType); - if (!vgastr || STREQ(vgastr, "")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(primaryVideoType)); + if (qemuBuildVgaVideoCommand(cmd, def, qemuCaps) < 0)
To augment my comment above, pass def->videos[0] instead of def. It even works with the next patch. ACK in principle. I'm not requiring the passing of video, just well, strongly suggesting it... makes reading things oh so much easier. John
return -1; - } - - virCommandAddArgList(cmd, "-vga", vgastr, NULL); - - /* If we cannot use --device option to specify the video device - * in QEMU we will fallback to the old --vga option. To get the - * correct device name for the --vga option the 'qemuVideo' is - * used, but to set some device attributes we need to use the - * --global option and for that we need to specify the device - * name the same as for --device option and for that we need to - * use 'qemuDeviceVideo'. - * - * See 'Graphics Devices' section in docs/qdev-device-use.txt in - * QEMU repository. - */ - const char *dev = qemuDeviceVideoTypeToString(primaryVideoType); - - if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && - (def->videos[0]->vram || def->videos[0]->ram)) { - unsigned int ram = def->videos[0]->ram; - unsigned int vram = def->videos[0]->vram; - unsigned int vram64 = def->videos[0]->vram64; - unsigned int vgamem = def->videos[0]->vgamem; - - if (ram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.ram_size=%u", - dev, ram * 1024); - } - if (vram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram_size=%u", - dev, vram * 1024); - } - if (vram64 && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram64_size_mb=%u", - dev, vram64 / 1024); - } - if (vgamem && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vgamem / 1024); - } - } - - if (def->videos[0]->vram && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { - unsigned int vram = def->videos[0]->vram; - - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vram / 1024); - } }
for (i = 1; i < def->nvideos; i++) {

On Sat, Oct 08, 2016 at 10:01:14AM -0400, John Ferlan wrote:
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 140 ++++++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 64 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d283c67..aef8c79 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4371,6 +4371,81 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
static int +qemuBuildVgaVideoCommand(virCommandPtr cmd, + const virDomainDef *def,
Instead of *def here, you could have
const virDomainVideoDefPtr video,
and then replace all the "def->videos[0]" with video
+ virQEMUCapsPtr qemuCaps) +{ + const char *vgastr = qemuVideoTypeToString(def->videos[0]->type); + if (!vgastr || STREQ(vgastr, "")) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type %s is not supported with QEMU"), + virDomainVideoTypeToString(def->videos[0]->type)); + return -1; + } + + virCommandAddArgList(cmd, "-vga", vgastr, NULL); + + /* If we cannot use --device option to specify the video device + * in QEMU we will fallback to the old --vga option. To get the + * correct device name for the --vga option the 'qemuVideo' is + * used, but to set some device attributes we need to use the + * --global option and for that we need to specify the device + * name the same as for --device option and for that we need to + * use 'qemuDeviceVideo'. + * + * See 'Graphics Devices' section in docs/qdev-device-use.txt in + * QEMU repository. + */ + const char *dev = qemuDeviceVideoTypeToString(def->videos[0]->type);
While we're at moving things around - can the "const char *dev... " be defined at the top and not in the middle somewhere?
+ + if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + (def->videos[0]->vram || def->videos[0]->ram)) { + unsigned int ram = def->videos[0]->ram; + unsigned int vram = def->videos[0]->vram; + unsigned int vram64 = def->videos[0]->vram64; + unsigned int vgamem = def->videos[0]->vgamem; + + if (ram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.ram_size=%u", + dev, ram * 1024); + } + if (vram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram_size=%u", + dev, vram * 1024); + } + if (vram64 && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram64_size_mb=%u", + dev, vram64 / 1024); + } + if (vgamem && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vgamem / 1024); + } + } + + if (def->videos[0]->vram && + ((def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || + (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { + unsigned int vram = def->videos[0]->vram; + + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vram / 1024); + } + + return 0; +} + + +static int qemuBuildVideoCommandLine(virCommandPtr cmd, const virDomainDef *def, virQEMUCapsPtr qemuCaps) @@ -4398,71 +4473,8 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) {
I was going to suggest something regarding removing primaryVideoType, but I see the next patch does more overhaul...
/* nothing - vga has no effect on Xen pvfb */ } else { - const char *vgastr = qemuVideoTypeToString(primaryVideoType); - if (!vgastr || STREQ(vgastr, "")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(primaryVideoType)); + if (qemuBuildVgaVideoCommand(cmd, def, qemuCaps) < 0)
To augment my comment above, pass def->videos[0] instead of def. It even works with the next patch.
ACK in principle. I'm not requiring the passing of video, just well, strongly suggesting it... makes reading things oh so much easier.
Thanks, I'll fix it but in separate patch, I would like to leave this patch as clean code movement. Pavel
John
return -1; - } - - virCommandAddArgList(cmd, "-vga", vgastr, NULL); - - /* If we cannot use --device option to specify the video device - * in QEMU we will fallback to the old --vga option. To get the - * correct device name for the --vga option the 'qemuVideo' is - * used, but to set some device attributes we need to use the - * --global option and for that we need to specify the device - * name the same as for --device option and for that we need to - * use 'qemuDeviceVideo'. - * - * See 'Graphics Devices' section in docs/qdev-device-use.txt in - * QEMU repository. - */ - const char *dev = qemuDeviceVideoTypeToString(primaryVideoType); - - if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && - (def->videos[0]->vram || def->videos[0]->ram)) { - unsigned int ram = def->videos[0]->ram; - unsigned int vram = def->videos[0]->vram; - unsigned int vram64 = def->videos[0]->vram64; - unsigned int vgamem = def->videos[0]->vgamem; - - if (ram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.ram_size=%u", - dev, ram * 1024); - } - if (vram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram_size=%u", - dev, vram * 1024); - } - if (vram64 && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram64_size_mb=%u", - dev, vram64 / 1024); - } - if (vgamem && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vgamem / 1024); - } - } - - if (def->videos[0]->vram && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { - unsigned int vram = def->videos[0]->vram; - - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vram / 1024); - } }
for (i = 1; i < def->nvideos; i++) {
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 69 ++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index aef8c79..15bb381 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4451,43 +4451,54 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, virQEMUCapsPtr qemuCaps) { size_t i; - int primaryVideoType; + char *str = NULL; - if (!def->videos) - return 0; + for (i = 0; i < def->nvideos; i++) { + virDomainVideoDefPtr video = def->videos[i]; - primaryVideoType = def->videos[0]->type; + switch (video->type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: + case VIR_DOMAIN_VIDEO_TYPE_QXL: + if (video->primary) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { - for (i = 0; i < def->nvideos; i++) { - char *str; - virCommandAddArg(cmd, "-device"); - if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], - qemuCaps))) - return -1; + virCommandAddArg(cmd, "-device"); - virCommandAddArg(cmd, str); - VIR_FREE(str); - } - } else { - if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { - /* nothing - vga has no effect on Xen pvfb */ - } else { - if (qemuBuildVgaVideoCommand(cmd, def, qemuCaps) < 0) - return -1; - } + if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], + qemuCaps))) + return -1; + + virCommandAddArg(cmd, str); + VIR_FREE(str); + } else { + if (qemuBuildVgaVideoCommand(cmd, def, qemuCaps) < 0) + return -1; + } + } else { + virCommandAddArg(cmd, "-device"); - for (i = 1; i < def->nvideos; i++) { - char *str; + if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], + qemuCaps))) + return -1; - virCommandAddArg(cmd, "-device"); + virCommandAddArg(cmd, str); + VIR_FREE(str); + } + break; - if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], - qemuCaps))) - return -1; + case VIR_DOMAIN_VIDEO_TYPE_VBOX: + case VIR_DOMAIN_VIDEO_TYPE_XEN: + case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type '%s' is not supported with QEMU"), + virDomainVideoTypeToString(video->type)); + return -1; - virCommandAddArg(cmd, str); - VIR_FREE(str); + case VIR_DOMAIN_VIDEO_TYPE_LAST: + break; } } -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 69 ++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 29 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index aef8c79..15bb381 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4451,43 +4451,54 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, virQEMUCapsPtr qemuCaps) { size_t i; - int primaryVideoType; + char *str = NULL;
- if (!def->videos) - return 0; + for (i = 0; i < def->nvideos; i++) { + virDomainVideoDefPtr video = def->videos[i];
- primaryVideoType = def->videos[0]->type; + switch (video->type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: + case VIR_DOMAIN_VIDEO_TYPE_QXL: + if (video->primary) {
So thinking back to my patch 5 comment - this essentially assumes def->videos[0] and video->primary are equivalent, right?
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) {
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { - for (i = 0; i < def->nvideos; i++) { - char *str; - virCommandAddArg(cmd, "-device"); - if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], - qemuCaps))) - return -1; + virCommandAddArg(cmd, "-device");
- virCommandAddArg(cmd, str); - VIR_FREE(str); - } - } else { - if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { - /* nothing - vga has no effect on Xen pvfb */ - } else { - if (qemuBuildVgaVideoCommand(cmd, def, qemuCaps) < 0) - return -1; - } + if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i],
This would be "video", not the def->videos[i]
+ qemuCaps))) + return -1; + + virCommandAddArg(cmd, str); + VIR_FREE(str); + } else { + if (qemuBuildVgaVideoCommand(cmd, def, qemuCaps) < 0)
And from the previous patch passing video here still works
+ return -1; + } + } else { + virCommandAddArg(cmd, "-device");
- for (i = 1; i < def->nvideos; i++) { - char *str; + if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i],
Likewise "video" not the def->videos[i]
+ qemuCaps))) + return -1;
- virCommandAddArg(cmd, "-device"); + virCommandAddArg(cmd, str); + VIR_FREE(str); + } + break;
- if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], - qemuCaps))) - return -1; + case VIR_DOMAIN_VIDEO_TYPE_VBOX: + case VIR_DOMAIN_VIDEO_TYPE_XEN:
Doesn't putting this here break the previous else check of: - if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { - /* nothing - vga has no effect on Xen pvfb */ IOW: Shouldn't the XEN type code check code "skip" def->videos[0] (or video->primary)? ACK with the proper usage of video not def->videos[i] and making sure the _XEN case is handled properly John
+ case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type '%s' is not supported with QEMU"), + virDomainVideoTypeToString(video->type)); + return -1;
- virCommandAddArg(cmd, str); - VIR_FREE(str); + case VIR_DOMAIN_VIDEO_TYPE_LAST: + break; } }

Commit 21373feb added support for primary virtio-vga device but it was checking for virtio-gpu. Let's check for existence of virtio-vga if we want to use it. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + 7 files changed, 8 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5449b07..55e5527 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -344,6 +344,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-hotpluggable-cpus", "virtio-net.rx_queue_size", /* 235 */ + "virtio-vga", ); @@ -1570,6 +1571,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-net-device", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "virtio-gpu-pci", QEMU_CAPS_DEVICE_VIRTIO_GPU }, { "virtio-gpu-device", QEMU_CAPS_DEVICE_VIRTIO_GPU }, + { "virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_VGA }, { "virtio-keyboard-device", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-keyboard-pci", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-mouse-device", QEMU_CAPS_VIRTIO_MOUSE }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1766aa6..b2c8c9f 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -378,6 +378,7 @@ typedef enum { /* 235 */ QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE, /* virtio-net-*.rx_queue_size */ + QEMU_CAPS_DEVICE_VIRTIO_VGA, /* virtio-vga */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml index 8d53988..17bd4bb 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -180,6 +180,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2004000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml index a4f5663..fe058d9 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -185,6 +185,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml index 60f5392..e63e7c1 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml @@ -152,6 +152,7 @@ <flag name='display'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005094</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml index 50506ba..5f93d59 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -191,6 +191,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2006000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml index b0b4ab1..dc11677 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -192,6 +192,7 @@ <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> <flag name='query-hotpluggable-cpus'/> + <flag name='virtio-vga'/> <version>2007000</version> <kvmVersion>0</kvmVersion> <package> (v2.7.0)</package> -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Commit 21373feb added support for primary virtio-vga device but it was checking for virtio-gpu. Let's check for existence of virtio-vga if we want to use it.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + 7 files changed, 8 insertions(+)
It seems this is related to your patch 6 changes or what I said should be split. There's something funky there and I think everything should be kept "closer" if not merged together. It could get ugly, but getting it all done and explained at once would be best IMO. It seems what you're indicating is that the two shouldn't have been combined into one CAP. Still that seems to be counter intuitive to the first part of this series which was merging caps. It's a bit confusing to say the least ;-)! Also you'll have a merge to handle with this patch...
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5449b07..55e5527 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -344,6 +344,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-hotpluggable-cpus",
"virtio-net.rx_queue_size", /* 235 */ + "virtio-vga", );
@@ -1570,6 +1571,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-net-device", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "virtio-gpu-pci", QEMU_CAPS_DEVICE_VIRTIO_GPU }, { "virtio-gpu-device", QEMU_CAPS_DEVICE_VIRTIO_GPU }, + { "virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_VGA }, { "virtio-keyboard-device", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-keyboard-pci", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-mouse-device", QEMU_CAPS_VIRTIO_MOUSE }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1766aa6..b2c8c9f 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -378,6 +378,7 @@ typedef enum {
/* 235 */ QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE, /* virtio-net-*.rx_queue_size */ + QEMU_CAPS_DEVICE_VIRTIO_VGA, /* virtio-vga */
/* -device virtio-vga */ Before an ACK - I'll be interested to understand the relationship w/ patch 6 and a bit of the history/reasoning for a separate cap (especially in light of combining other caps). John
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml index 8d53988..17bd4bb 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -180,6 +180,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2004000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml index a4f5663..fe058d9 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -185,6 +185,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml index 60f5392..e63e7c1 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml @@ -152,6 +152,7 @@ <flag name='display'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005094</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml index 50506ba..5f93d59 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -191,6 +191,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2006000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml index b0b4ab1..dc11677 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -192,6 +192,7 @@ <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> <flag name='query-hotpluggable-cpus'/> + <flag name='virtio-vga'/> <version>2007000</version> <kvmVersion>0</kvmVersion> <package> (v2.7.0)</package>

On Sat, Oct 08, 2016 at 10:01:51AM -0400, John Ferlan wrote:
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Commit 21373feb added support for primary virtio-vga device but it was checking for virtio-gpu. Let's check for existence of virtio-vga if we want to use it.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + 7 files changed, 8 insertions(+)
It seems this is related to your patch 6 changes or what I said should be split. There's something funky there and I think everything should be kept "closer" if not merged together. It could get ugly, but getting it all done and explained at once would be best IMO.
It seems what you're indicating is that the two shouldn't have been combined into one CAP. Still that seems to be counter intuitive to the first part of this series which was merging caps. It's a bit confusing to say the least ;-)!
The thing is that there is a difference in QXL video and virtio video. If QXL video device is compiled in QEMU there are always both models *qxl-vga* and *qxl*. But this is not the same as for virtio video. It is currently represented by three different models *virtio-gpu-device*, *virtio-gpu-pci* and *virtio-vga*. The first two models are tied together and if virtio video devices is compiled in they both exist. However, the *virtio-vga* model doesn't have to exist on some architectures even if the first two models exist. So we cannot group all three together. Pavel
Also you'll have a merge to handle with this patch...
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5449b07..55e5527 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -344,6 +344,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-hotpluggable-cpus",
"virtio-net.rx_queue_size", /* 235 */ + "virtio-vga", );
@@ -1570,6 +1571,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-net-device", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "virtio-gpu-pci", QEMU_CAPS_DEVICE_VIRTIO_GPU }, { "virtio-gpu-device", QEMU_CAPS_DEVICE_VIRTIO_GPU }, + { "virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_VGA }, { "virtio-keyboard-device", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-keyboard-pci", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-mouse-device", QEMU_CAPS_VIRTIO_MOUSE }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1766aa6..b2c8c9f 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -378,6 +378,7 @@ typedef enum {
/* 235 */ QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE, /* virtio-net-*.rx_queue_size */ + QEMU_CAPS_DEVICE_VIRTIO_VGA, /* virtio-vga */
/* -device virtio-vga */
Before an ACK - I'll be interested to understand the relationship w/ patch 6 and a bit of the history/reasoning for a separate cap (especially in light of combining other caps).
John
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml index 8d53988..17bd4bb 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -180,6 +180,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2004000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml index a4f5663..fe058d9 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -185,6 +185,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml index 60f5392..e63e7c1 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml @@ -152,6 +152,7 @@ <flag name='display'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005094</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml index 50506ba..5f93d59 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -191,6 +191,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2006000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml index b0b4ab1..dc11677 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -192,6 +192,7 @@ <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> <flag name='query-hotpluggable-cpus'/> + <flag name='virtio-vga'/> <version>2007000</version> <kvmVersion>0</kvmVersion> <package> (v2.7.0)</package>
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 10/10/2016 06:50 AM, Pavel Hrdina wrote:
On Sat, Oct 08, 2016 at 10:01:51AM -0400, John Ferlan wrote:
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Commit 21373feb added support for primary virtio-vga device but it was checking for virtio-gpu. Let's check for existence of virtio-vga if we want to use it.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + 7 files changed, 8 insertions(+)
It seems this is related to your patch 6 changes or what I said should be split. There's something funky there and I think everything should be kept "closer" if not merged together. It could get ugly, but getting it all done and explained at once would be best IMO.
It seems what you're indicating is that the two shouldn't have been combined into one CAP. Still that seems to be counter intuitive to the first part of this series which was merging caps. It's a bit confusing to say the least ;-)!
The thing is that there is a difference in QXL video and virtio video. If QXL video device is compiled in QEMU there are always both models *qxl-vga* and *qxl*. But this is not the same as for virtio video. It is currently represented by three different models *virtio-gpu-device*, *virtio-gpu-pci* and *virtio-vga*. The first two models are tied together and if virtio video devices is compiled in they both exist. However, the *virtio-vga* model doesn't have to exist on some architectures even if the first two models exist. So we cannot group all three together.
Cut, snip, place into commit message! ACK - now that it's a bit clearer John
Pavel
Also you'll have a merge to handle with this patch...
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5449b07..55e5527 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -344,6 +344,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-hotpluggable-cpus",
"virtio-net.rx_queue_size", /* 235 */ + "virtio-vga", );
@@ -1570,6 +1571,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-net-device", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "virtio-gpu-pci", QEMU_CAPS_DEVICE_VIRTIO_GPU }, { "virtio-gpu-device", QEMU_CAPS_DEVICE_VIRTIO_GPU }, + { "virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_VGA }, { "virtio-keyboard-device", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-keyboard-pci", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-mouse-device", QEMU_CAPS_VIRTIO_MOUSE }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1766aa6..b2c8c9f 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -378,6 +378,7 @@ typedef enum {
/* 235 */ QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE, /* virtio-net-*.rx_queue_size */ + QEMU_CAPS_DEVICE_VIRTIO_VGA, /* virtio-vga */
/* -device virtio-vga */
Before an ACK - I'll be interested to understand the relationship w/ patch 6 and a bit of the history/reasoning for a separate cap (especially in light of combining other caps).
John
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml index 8d53988..17bd4bb 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -180,6 +180,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2004000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml index a4f5663..fe058d9 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -185,6 +185,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml index 60f5392..e63e7c1 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml @@ -152,6 +152,7 @@ <flag name='display'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2005094</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml index 50506ba..5f93d59 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -191,6 +191,7 @@ <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> + <flag name='virtio-vga'/> <version>2006000</version> <kvmVersion>0</kvmVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml index b0b4ab1..dc11677 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -192,6 +192,7 @@ <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> <flag name='query-hotpluggable-cpus'/> + <flag name='virtio-vga'/> <version>2007000</version> <kvmVersion>0</kvmVersion> <package> (v2.7.0)</package>
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

This improves commit 706b5b6277 in a way that we instead use qemu capabilities to detect whether we can use virto-vga or not. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 4 +-- src/qemu/qemu_domain.c | 12 ++++++++ src/qemu/qemu_domain.h | 3 ++ .../qemuxml2argv-video-virtio-gpu-device.args | 2 +- .../qemuxml2argv-video-virtio-gpu-spice-gl.args | 2 +- .../qemuxml2argv-video-virtio-gpu-virgl.args | 2 +- .../qemuxml2argv-video-virtio-vga.args | 24 ++++++++++++++++ .../qemuxml2argv-video-virtio-vga.xml | 33 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 9 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 15bb381..bb8128e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4307,10 +4307,8 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virDomainVideoTypeToString(video->type)); goto error; } - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - qemuDomainMachineIsVirt(def)) { + if (!qemuDomainSupportVideoVga(video, qemuCaps)) model = "virtio-gpu-pci"; - } } else { model = "qxl"; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2b7e6d4..79c945a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6230,3 +6230,15 @@ qemuDomainCheckMonitor(virQEMUDriverPtr driver, return ret; } + + +bool +qemuDomainSupportVideoVga(virDomainVideoDefPtr video, + virQEMUCapsPtr qemuCaps) +{ + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA)) + return false; + + return true; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 521531b..b968858 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -738,4 +738,7 @@ int qemuDomainCheckMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, qemuDomainAsyncJob asyncJob); +bool qemuDomainSupportVideoVga(virDomainVideoDefPtr video, + virQEMUCapsPtr qemuCaps); + #endif /* __QEMU_DOMAIN_H__ */ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args index fefa2b6..1107409 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --device virtio-vga,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args index 8844498..f1ebb62 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=spice \ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ -spice port=0,gl=on \ --device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args index 6a55311..0131be8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args new file mode 100644 index 0000000..fefa2b6 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args @@ -0,0 +1,24 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 1024 \ +-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=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ +id=drive-ide0-0-0,cache=none \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-device virtio-vga,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml new file mode 100644 index 0000000..e3d28bb --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</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</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6404865..4cbe57e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1616,6 +1616,10 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-virtio-vga", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST_PARSE_ERROR("video-invalid", NONE); DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE_VIRTIO_RNG, -- 2.10.0

On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
This improves commit 706b5b6277 in a way that we instead use qemu capabilities to detect whether we can use virto-vga or not.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 4 +-- src/qemu/qemu_domain.c | 12 ++++++++ src/qemu/qemu_domain.h | 3 ++ .../qemuxml2argv-video-virtio-gpu-device.args | 2 +- .../qemuxml2argv-video-virtio-gpu-spice-gl.args | 2 +- .../qemuxml2argv-video-virtio-gpu-virgl.args | 2 +- .../qemuxml2argv-video-virtio-vga.args | 24 ++++++++++++++++ .../qemuxml2argv-video-virtio-vga.xml | 33 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 9 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 15bb381..bb8128e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4307,10 +4307,8 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virDomainVideoTypeToString(video->type)); goto error; } - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - qemuDomainMachineIsVirt(def)) { + if (!qemuDomainSupportVideoVga(video, qemuCaps)) model = "virtio-gpu-pci"; - } } else { model = "qxl"; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2b7e6d4..79c945a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6230,3 +6230,15 @@ qemuDomainCheckMonitor(virQEMUDriverPtr driver,
return ret; } + + +bool +qemuDomainSupportVideoVga(virDomainVideoDefPtr video, + virQEMUCapsPtr qemuCaps) +{ + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA))
Shall I assume losing the qemuDomainMachineIsVirt check is expected? Perhaps a quick explanation in the commit message would suffice... As in, commit id 'xxx' use MachineIsVirt, when it should have been checking the cap instead... There's two things going on in this one patch - not only creating a helper, but you're altering the logic such that you have differences in output (.args) that should have been "that way" when the code was first introduced. In a way it feels like fixing a bug... Following the breadcrumbs is, well mind numbing! ACK in principle - still just a better explanation would be good! John
+ return false; + + return true; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 521531b..b968858 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -738,4 +738,7 @@ int qemuDomainCheckMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, qemuDomainAsyncJob asyncJob);
+bool qemuDomainSupportVideoVga(virDomainVideoDefPtr video, + virQEMUCapsPtr qemuCaps); + #endif /* __QEMU_DOMAIN_H__ */ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args index fefa2b6..1107409 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --device virtio-vga,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args index 8844498..f1ebb62 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=spice \ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ -spice port=0,gl=on \ --device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args index 6a55311..0131be8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args new file mode 100644 index 0000000..fefa2b6 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args @@ -0,0 +1,24 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 1024 \ +-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=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ +id=drive-ide0-0-0,cache=none \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-device virtio-vga,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml new file mode 100644 index 0000000..e3d28bb --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</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</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6404865..4cbe57e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1616,6 +1616,10 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-virtio-vga", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST_PARSE_ERROR("video-invalid", NONE);
DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE_VIRTIO_RNG,

On Sat, Oct 08, 2016 at 10:02:00AM -0400, John Ferlan wrote:
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
This improves commit 706b5b6277 in a way that we instead use qemu capabilities to detect whether we can use virto-vga or not.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 4 +-- src/qemu/qemu_domain.c | 12 ++++++++ src/qemu/qemu_domain.h | 3 ++ .../qemuxml2argv-video-virtio-gpu-device.args | 2 +- .../qemuxml2argv-video-virtio-gpu-spice-gl.args | 2 +- .../qemuxml2argv-video-virtio-gpu-virgl.args | 2 +- .../qemuxml2argv-video-virtio-vga.args | 24 ++++++++++++++++ .../qemuxml2argv-video-virtio-vga.xml | 33 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 9 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 15bb381..bb8128e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4307,10 +4307,8 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virDomainVideoTypeToString(video->type)); goto error; } - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - qemuDomainMachineIsVirt(def)) { + if (!qemuDomainSupportVideoVga(video, qemuCaps)) model = "virtio-gpu-pci"; - } } else { model = "qxl"; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2b7e6d4..79c945a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6230,3 +6230,15 @@ qemuDomainCheckMonitor(virQEMUDriverPtr driver,
return ret; } + + +bool +qemuDomainSupportVideoVga(virDomainVideoDefPtr video, + virQEMUCapsPtr qemuCaps) +{ + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA))
Shall I assume losing the qemuDomainMachineIsVirt check is expected? Perhaps a quick explanation in the commit message would suffice...
Yes, because previous patch adds proper detection whether we can use *virtio-vga* model or not, so we can use that capability instead of listing architectures (which may change in the future).
As in, commit id 'xxx' use MachineIsVirt, when it should have been checking the cap instead...
At that time it was a quick fix to resolve that bug and using the capability was not possible because that capability did not exist.
There's two things going on in this one patch - not only creating a helper, but you're altering the logic such that you have differences in output (.args) that should have been "that way" when the code was first introduced. In a way it feels like fixing a bug... Following the breadcrumbs is, well mind numbing!
This basically fixes a bug by improving the logic, I'll try to explain it better in the commit message. Pavel
ACK in principle - still just a better explanation would be good!
John
+ return false; + + return true; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 521531b..b968858 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -738,4 +738,7 @@ int qemuDomainCheckMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, qemuDomainAsyncJob asyncJob);
+bool qemuDomainSupportVideoVga(virDomainVideoDefPtr video, + virQEMUCapsPtr qemuCaps); + #endif /* __QEMU_DOMAIN_H__ */ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args index fefa2b6..1107409 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --device virtio-vga,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args index 8844498..f1ebb62 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=spice \ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ -spice port=0,gl=on \ --device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args index 6a55311..0131be8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args @@ -20,5 +20,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ id=drive-ide0-0-0,cache=none \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args new file mode 100644 index 0000000..fefa2b6 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args @@ -0,0 +1,24 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 1024 \ +-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=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ +id=drive-ide0-0-0,cache=none \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-device virtio-vga,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml new file mode 100644 index 0000000..e3d28bb --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</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</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6404865..4cbe57e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1616,6 +1616,10 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-virtio-vga", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST_PARSE_ERROR("video-invalid", NONE);
DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE_VIRTIO_RNG,
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 3 +- src/qemu/qemu_command.c | 32 ++++++++++++------- src/qemu/qemu_domain.c | 3 +- .../qemuxml2argv-video-virtio-gpu-sec.args | 25 +++++++++++++++ .../qemuxml2argv-video-virtio-gpu-sec.xml | 36 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 6 files changed, 89 insertions(+), 13 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 1266e9d..f08cd01 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5641,7 +5641,8 @@ qemu-kvm -net nic,model=? /dev/null video device in domain xml is the primary one, but the optional attribute <code>primary</code> (<span class="since">since 1.0.2</span>) with value 'yes' can be used to mark the primary in cases of multiple - video device. The non-primary must be type of "qxl". + video device. The non-primary must be type of "qxl" or + "virtio" (<span class="since">since 2.4.0</span>). </p> </dd> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index bb8128e..2314b2df 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -114,6 +114,18 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* don't support parallels */ "virtio-vga"); +VIR_ENUM_DECL(qemuDeviceVideoSec) + +VIR_ENUM_IMPL(qemuDeviceVideoSec, VIR_DOMAIN_VIDEO_TYPE_LAST, + "", /* no secondary device for VGA*/ + "", /* no secondary device for cirrus-vga*/ + "", /* no secondary device for vmware-svga*/ + "", /* no device for xen */ + "", /* don't support vbox */ + "qxl", + "", /* don't support parallels */ + "virtio-gpu-pci"); + VIR_ENUM_DECL(qemuSoundCodec) VIR_ENUM_IMPL(qemuSoundCodec, VIR_DOMAIN_SOUND_CODEC_TYPE_LAST, @@ -4299,18 +4311,16 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virBuffer buf = VIR_BUFFER_INITIALIZER; const char *model; - if (video->primary) { + if (video->primary && qemuDomainSupportVideoVga(video, qemuCaps)) model = qemuDeviceVideoTypeToString(video->type); - if (!model || STREQ(model, "")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(video->type)); - goto error; - } - if (!qemuDomainSupportVideoVga(video, qemuCaps)) - model = "virtio-gpu-pci"; - } else { - model = "qxl"; + else + model = qemuDeviceVideoSecTypeToString(video->type); + + if (!model || STREQ(model, "")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid model for video type '%s'"), + virDomainVideoTypeToString(video->type)); + goto error; } virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 79c945a..8218609 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2404,7 +2404,8 @@ qemuDomainDefValidateVideo(const virDomainDef *def) video = def->videos[i]; if (!video->primary && - video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + video->type != VIR_DOMAIN_VIDEO_TYPE_QXL && + video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("video type '%s' is only valid as primary " "video device"), diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args new file mode 100644 index 0000000..a87c37b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args @@ -0,0 +1,25 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 1024 \ +-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=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ +id=drive-ide0-0-0,cache=none \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml new file mode 100644 index 0000000..feba717 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml @@ -0,0 +1,36 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</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</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + </video> + <video> + <model type='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4cbe57e..d8bcf93 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1616,6 +1616,9 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-virtio-gpu-sec", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA, -- 2.10.0

Nothing else to say?! Is this fixing an existing bug making some other patch/fix "more correct". On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 3 +- src/qemu/qemu_command.c | 32 ++++++++++++------- src/qemu/qemu_domain.c | 3 +- .../qemuxml2argv-video-virtio-gpu-sec.args | 25 +++++++++++++++ .../qemuxml2argv-video-virtio-gpu-sec.xml | 36 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 6 files changed, 89 insertions(+), 13 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml
Adding a new .xml without also adding a qemuxml2xmltest for the same xml file? Note that you can "save" space if you make the xml2xml output file be the same as the input file and just create a link to it (like a number of other more recent changes are doing). Also it seems there are two changes happening here - thus separate patches.
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 1266e9d..f08cd01 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5641,7 +5641,8 @@ qemu-kvm -net nic,model=? /dev/null video device in domain xml is the primary one, but the optional attribute <code>primary</code> (<span class="since">since 1.0.2</span>) with value 'yes' can be used to mark the primary in cases of multiple - video device. The non-primary must be type of "qxl". + video device. The non-primary must be type of "qxl" or + "virtio" (<span class="since">since 2.4.0</span>). </p> </dd>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index bb8128e..2314b2df 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -114,6 +114,18 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* don't support parallels */ "virtio-vga");
+VIR_ENUM_DECL(qemuDeviceVideoSec) + +VIR_ENUM_IMPL(qemuDeviceVideoSec, VIR_DOMAIN_VIDEO_TYPE_LAST, + "", /* no secondary device for VGA*/ + "", /* no secondary device for cirrus-vga*/ + "", /* no secondary device for vmware-svga*/ + "", /* no device for xen */ + "", /* don't support vbox */ + "qxl", + "", /* don't support parallels */ + "virtio-gpu-pci"); +
I know "Sec" is shorthand for secondary, but I've also seen it used for "second"... being verbose isn't bad especially when you read the code months later.
VIR_ENUM_DECL(qemuSoundCodec)
VIR_ENUM_IMPL(qemuSoundCodec, VIR_DOMAIN_SOUND_CODEC_TYPE_LAST, @@ -4299,18 +4311,16 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virBuffer buf = VIR_BUFFER_INITIALIZER; const char *model;
- if (video->primary) { + if (video->primary && qemuDomainSupportVideoVga(video, qemuCaps))
This alters your logic, but the else condition is assuming secondary and in fact digging into that table... Shouldn't the logic be: if (video->primary) { if (qemuDomainSupportVideoVga() model = qemuDeviceVideoTypeToString(video->type); else model = "virtio-gpu-pci"; } else { model = qemuDeviceVideoSecTypeToString(video->type); }
model = qemuDeviceVideoTypeToString(video->type); - if (!model || STREQ(model, "")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(video->type)); - goto error; - } - if (!qemuDomainSupportVideoVga(video, qemuCaps)) - model = "virtio-gpu-pci"; - } else { - model = "qxl"; + else + model = qemuDeviceVideoSecTypeToString(video->type); + + if (!model || STREQ(model, "")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid model for video type '%s'"), + virDomainVideoTypeToString(video->type)); + goto error; }
virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 79c945a..8218609 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2404,7 +2404,8 @@ qemuDomainDefValidateVideo(const virDomainDef *def) video = def->videos[i];
if (!video->primary && - video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + video->type != VIR_DOMAIN_VIDEO_TYPE_QXL && + video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
This would seemingly be a different/separate patch wouldn't it? And I'm not sure which of the remaining checks this belongs with, but I'm assuming it's this change. John
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("video type '%s' is only valid as primary " "video device"), diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args new file mode 100644 index 0000000..a87c37b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args @@ -0,0 +1,25 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 1024 \ +-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=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ +id=drive-ide0-0-0,cache=none \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml new file mode 100644 index 0000000..feba717 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml @@ -0,0 +1,36 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</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</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + </video> + <video> + <model type='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4cbe57e..d8bcf93 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1616,6 +1616,9 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-virtio-gpu-sec", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA,

On Sat, Oct 08, 2016 at 10:02:14AM -0400, John Ferlan wrote:
Nothing else to say?! Is this fixing an existing bug making some other patch/fix "more correct".
After sending the patch I've find out that there is a BZ for this and I was planning to add it to the commit message before pushing. Other than that the subject explain everything form my POW.
On 09/30/2016 12:02 PM, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 3 +- src/qemu/qemu_command.c | 32 ++++++++++++------- src/qemu/qemu_domain.c | 3 +- .../qemuxml2argv-video-virtio-gpu-sec.args | 25 +++++++++++++++ .../qemuxml2argv-video-virtio-gpu-sec.xml | 36 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 6 files changed, 89 insertions(+), 13 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml
Adding a new .xml without also adding a qemuxml2xmltest for the same xml file? Note that you can "save" space if you make the xml2xml output file be the same as the input file and just create a link to it (like a number of other more recent changes are doing).
Also it seems there are two changes happening here - thus separate patches.
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 1266e9d..f08cd01 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5641,7 +5641,8 @@ qemu-kvm -net nic,model=? /dev/null video device in domain xml is the primary one, but the optional attribute <code>primary</code> (<span class="since">since 1.0.2</span>) with value 'yes' can be used to mark the primary in cases of multiple - video device. The non-primary must be type of "qxl". + video device. The non-primary must be type of "qxl" or + "virtio" (<span class="since">since 2.4.0</span>). </p> </dd>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index bb8128e..2314b2df 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -114,6 +114,18 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* don't support parallels */ "virtio-vga");
+VIR_ENUM_DECL(qemuDeviceVideoSec) + +VIR_ENUM_IMPL(qemuDeviceVideoSec, VIR_DOMAIN_VIDEO_TYPE_LAST, + "", /* no secondary device for VGA*/ + "", /* no secondary device for cirrus-vga*/ + "", /* no secondary device for vmware-svga*/ + "", /* no device for xen */ + "", /* don't support vbox */ + "qxl", + "", /* don't support parallels */ + "virtio-gpu-pci"); +
I know "Sec" is shorthand for secondary, but I've also seen it used for "second"... being verbose isn't bad especially when you read the code months later.
Sure, I can change it to ..Secondary.
VIR_ENUM_DECL(qemuSoundCodec)
VIR_ENUM_IMPL(qemuSoundCodec, VIR_DOMAIN_SOUND_CODEC_TYPE_LAST, @@ -4299,18 +4311,16 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virBuffer buf = VIR_BUFFER_INITIALIZER; const char *model;
- if (video->primary) { + if (video->primary && qemuDomainSupportVideoVga(video, qemuCaps))
This alters your logic, but the else condition is assuming secondary and in fact digging into that table... Shouldn't the logic be:
if (video->primary) { if (qemuDomainSupportVideoVga() model = qemuDeviceVideoTypeToString(video->type); else model = "virtio-gpu-pci"; } else { model = qemuDeviceVideoSecTypeToString(video->type); }
This is exactly what I was trying to avoid. Having an extra string outside of that two enums. There are two sets of models for video devices, the first one is with VGA compatibility support (qemuDeviceVideo) and the second one is without the VGA compatibility (qemuDeviceVideoSec). The concept of primary vs secondary video devices is based on the fact that libvirt tries to use video device with VGA compatibility as primary video device. The logic is to use the best possible model that is available.
model = qemuDeviceVideoTypeToString(video->type); - if (!model || STREQ(model, "")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(video->type)); - goto error; - } - if (!qemuDomainSupportVideoVga(video, qemuCaps)) - model = "virtio-gpu-pci"; - } else { - model = "qxl"; + else + model = qemuDeviceVideoSecTypeToString(video->type); + + if (!model || STREQ(model, "")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid model for video type '%s'"), + virDomainVideoTypeToString(video->type)); + goto error; }
virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 79c945a..8218609 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2404,7 +2404,8 @@ qemuDomainDefValidateVideo(const virDomainDef *def) video = def->videos[i];
if (!video->primary && - video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + video->type != VIR_DOMAIN_VIDEO_TYPE_QXL && + video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
This would seemingly be a different/separate patch wouldn't it?
This updates the check which devices can be used as secondary so this is related to this patch. Thanks for review, I'll send a v2. Pavel
And I'm not sure which of the remaining checks this belongs with, but I'm assuming it's this change.
John
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("video type '%s' is only valid as primary " "video device"), diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args new file mode 100644 index 0000000..a87c37b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.args @@ -0,0 +1,25 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 1024 \ +-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=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\ +id=drive-ide0-0-0,cache=none \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml new file mode 100644 index 0000000..feba717 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-sec.xml @@ -0,0 +1,36 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</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</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + </video> + <video> + <model type='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4cbe57e..d8bcf93 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1616,6 +1616,9 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_GL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-virtio-gpu-sec", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA,
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (2)
-
John Ferlan
-
Pavel Hrdina