[PATCH 0/5] qemu: Adapt to virtio-gpu-gl-pci and virtio-vga-gl

The virgl property of virtio-gpu-pci&virtio-vga will be replaced by virtio-gpu-gl-pci&virtio-vga-gl in QEMU 6.1. Adapt to that update. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/167 https://bugzilla.redhat.com/show_bug.cgi?id=1967356 Han Han (5): qemu_capabilities: Add QEMU_CAPS_VIRTIO_GPU_GL_PCI qemu: Adapt to virtio-gpu-gl-pci device when available qemu_capabilities: Add QEMU_CAPS_VIRTIO_VGA_GL qemu: Adapt to virtio-vga-gl device tests: Tests for virtio-vga-gl and virtio-gpu-gl-pci device src/qemu/qemu_capabilities.c | 4 ++ src/qemu/qemu_capabilities.h | 2 + src/qemu/qemu_command.c | 11 ++++- .../caps_6.1.0.x86_64.xml | 2 + .../video-virtio-vga-gpu-gl.args | 29 +++++++++++++ .../video-virtio-vga-gpu-gl.xml | 34 +++++++++++++++ tests/qemuxml2argvtest.c | 6 +++ .../video-virtio-vga-gpu-gl.xml | 43 +++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 9 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml create mode 100644 tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml -- 2.31.1

This flag will be used for the device virtio-gpu-gl-pci which is introduced since QEMU 6.1. Signed-off-by: Han Han <hhan@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 + 3 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 75dd01f06e..6df1b89aa0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -630,6 +630,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "compat-deprecated", "acpi-index", "input-linux", + "virtio-gpu-gl-pci", ); @@ -1349,6 +1350,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-pmem-pci", QEMU_CAPS_DEVICE_VIRTIO_PMEM_PCI }, { "vhost-user-blk", QEMU_CAPS_DEVICE_VHOST_USER_BLK }, { "input-linux", QEMU_CAPS_INPUT_LINUX }, + { "virtio-gpu-gl-pci", QEMU_CAPS_VIRTIO_GPU_GL_PCI }, }; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 94f2fad05a..d6430babce 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -610,6 +610,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_COMPAT_DEPRECATED, /* -compat deprecated-(input|output) is supported */ QEMU_CAPS_ACPI_INDEX, /* PCI device 'acpi-index' property */ QEMU_CAPS_INPUT_LINUX, /* -object input-linux */ + QEMU_CAPS_VIRTIO_GPU_GL_PCI, /* -device virtio-gpu-gl-pci */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml index 4df3200219..56d8534f7f 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -254,6 +254,7 @@ <flag name='compat-deprecated'/> <flag name='acpi-index'/> <flag name='input-linux'/> + <flag name='virtio-gpu-gl-pci'/> <version>6000050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100243</microcodeVersion> -- 2.31.1

QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property of virtio-gpu-pci device. Adapt to that change. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356 Signed-off-by: Han Han <hhan@redhat.com> --- src/qemu/qemu_command.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4ed82ed570..a79e96a121 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -546,7 +546,11 @@ qemuBuildVirtioDevStr(virBuffer *buf, return -1; } - virBufferAsprintf(buf, "%s-%s", baseName, implName); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && + STREQ(baseName, "virtio-gpu")) + virBufferAsprintf(buf, "%s-gl-%s", baseName, implName); + else + virBufferAsprintf(buf, "%s-%s", baseName, implName); switch (devtype) { case VIR_DOMAIN_DEVICE_DISK: @@ -4242,6 +4246,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { if (video->accel && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON || video->accel->accel3d == VIR_TRISTATE_SWITCH_OFF)) { virBufferAsprintf(&buf, ",virgl=%s", -- 2.31.1

On 6/8/21 3:15 AM, Han Han wrote:
QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property of virtio-gpu-pci device. Adapt to that change.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356
Signed-off-by: Han Han <hhan@redhat.com> --- src/qemu/qemu_command.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4ed82ed570..a79e96a121 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -546,7 +546,11 @@ qemuBuildVirtioDevStr(virBuffer *buf, return -1; }
- virBufferAsprintf(buf, "%s-%s", baseName, implName); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && + STREQ(baseName, "virtio-gpu")) + virBufferAsprintf(buf, "%s-gl-%s", baseName, implName); + else + virBufferAsprintf(buf, "%s-%s", baseName, implName);
This doesn't look right. What if domain has: <acceleration accel3d='no'/> This will still pick virtio-gpu-gl-pci, wouldn't it? I think we need to pick the correct model beforehand and leave qemuBuildVirtioDevStr() unmodified.
switch (devtype) { case VIR_DOMAIN_DEVICE_DISK: @@ -4242,6 +4246,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { if (video->accel && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON || video->accel->accel3d == VIR_TRISTATE_SWITCH_OFF)) { virBufferAsprintf(&buf, ",virgl=%s",
Michal

On Tue, Jun 08, 2021 at 16:14:36 +0200, Michal Prívozník wrote:
On 6/8/21 3:15 AM, Han Han wrote:
QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property of virtio-gpu-pci device. Adapt to that change.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356
Signed-off-by: Han Han <hhan@redhat.com> --- src/qemu/qemu_command.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4ed82ed570..a79e96a121 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -546,7 +546,11 @@ qemuBuildVirtioDevStr(virBuffer *buf, return -1; }
- virBufferAsprintf(buf, "%s-%s", baseName, implName); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && + STREQ(baseName, "virtio-gpu")) + virBufferAsprintf(buf, "%s-gl-%s", baseName, implName); + else + virBufferAsprintf(buf, "%s-%s", baseName, implName);
This doesn't look right. What if domain has:
<acceleration accel3d='no'/>
This will still pick virtio-gpu-gl-pci, wouldn't it? I think we need to pick the correct model beforehand and leave qemuBuildVirtioDevStr() unmodified.
Definitely. Ideally the command line formatter itself should never do any form of logic of picking the models or device types which could have ABI impact.

On Tue, Jun 8, 2021 at 10:14 PM Michal Prívozník <mprivozn@redhat.com> wrote:
On 6/8/21 3:15 AM, Han Han wrote:
QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property of virtio-gpu-pci device. Adapt to that change.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356
Signed-off-by: Han Han <hhan@redhat.com> --- src/qemu/qemu_command.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4ed82ed570..a79e96a121 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -546,7 +546,11 @@ qemuBuildVirtioDevStr(virBuffer *buf, return -1; }
- virBufferAsprintf(buf, "%s-%s", baseName, implName); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && + STREQ(baseName, "virtio-gpu")) + virBufferAsprintf(buf, "%s-gl-%s", baseName, implName); + else + virBufferAsprintf(buf, "%s-%s", baseName, implName);
This doesn't look right. What if domain has:
<acceleration accel3d='no'/>
This will still pick virtio-gpu-gl-pci, wouldn't it? I think we need to
Yes. I forget to add the boolean of acceleration@accel3d here.
pick the correct model beforehand and leave qemuBuildVirtioDevStr() unmodified.
I will try the unmodified qemuBuildVirtioDevStr() next
switch (devtype) { case VIR_DOMAIN_DEVICE_DISK: @@ -4242,6 +4246,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { if (video->accel && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON || video->accel->accel3d == VIR_TRISTATE_SWITCH_OFF)) { virBufferAsprintf(&buf, ",virgl=%s",
Michal

It will be used for virtio-vga-gl device later. Signed-off-by: Han Han <hhan@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 + 3 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6df1b89aa0..2b9ab9af60 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -631,6 +631,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "acpi-index", "input-linux", "virtio-gpu-gl-pci", + "virtio-vga-gl", ); @@ -1351,6 +1352,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vhost-user-blk", QEMU_CAPS_DEVICE_VHOST_USER_BLK }, { "input-linux", QEMU_CAPS_INPUT_LINUX }, { "virtio-gpu-gl-pci", QEMU_CAPS_VIRTIO_GPU_GL_PCI }, + { "virtio-vga-gl", QEMU_CAPS_VIRTIO_VGA_GL }, }; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index d6430babce..eac3e099b1 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -611,6 +611,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_ACPI_INDEX, /* PCI device 'acpi-index' property */ QEMU_CAPS_INPUT_LINUX, /* -object input-linux */ QEMU_CAPS_VIRTIO_GPU_GL_PCI, /* -device virtio-gpu-gl-pci */ + QEMU_CAPS_VIRTIO_VGA_GL, /* -device virtio-vga-gl */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml index 56d8534f7f..695492d566 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -255,6 +255,7 @@ <flag name='acpi-index'/> <flag name='input-linux'/> <flag name='virtio-gpu-gl-pci'/> + <flag name='virtio-vga-gl'/> <version>6000050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100243</microcodeVersion> -- 2.31.1

QEMU 6.1 will replace the virgl property of virtio-vga device to virtio-vga-gl device. Adapt to that update. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/167 Signed-off-by: Han Han <hhan@redhat.com> --- src/qemu/qemu_command.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a79e96a121..c3de5baa26 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4238,6 +4238,9 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, } } else { virBufferAsprintf(&buf, "%s", model); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) && + STREQ(model, "virtio-vga")) + virBufferAddLit(&buf, "-gl"); } virBufferAsprintf(&buf, ",id=%s", video->info.alias); @@ -4247,6 +4250,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, if (video->accel && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) && (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON || video->accel->accel3d == VIR_TRISTATE_SWITCH_OFF)) { virBufferAsprintf(&buf, ",virgl=%s", -- 2.31.1

Signed-off-by: Han Han <hhan@redhat.com> --- .../video-virtio-vga-gpu-gl.args | 29 +++++++++++++ .../video-virtio-vga-gpu-gl.xml | 34 +++++++++++++++ tests/qemuxml2argvtest.c | 6 +++ .../video-virtio-vga-gpu-gl.xml | 43 +++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 5 files changed, 118 insertions(+) create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml create mode 100644 tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args new file mode 100644 index 0000000000..72e04f3c3e --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args @@ -0,0 +1,29 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 1024 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-vga-gl,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-gl-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..40e68fc458 --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml @@ -0,0 +1,34 @@ +<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='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <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'> + <acceleration accel3d='yes'/> + </model> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9ec81eb8e..99fe7ac115 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2501,6 +2501,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL); DO_TEST_CAPS_LATEST("video-bochs-display-device"); DO_TEST_CAPS_LATEST("video-ramfb-display-device"); DO_TEST_CAPS_LATEST_PARSE_ERROR("video-ramfb-display-device-pci-address"); diff --git a/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..618d70c635 --- /dev/null +++ b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml @@ -0,0 +1,43 @@ +<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='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index dd039bd846..ac49d39f06 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1340,6 +1340,12 @@ mymain(void) QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW); DO_TEST("video-none-device", QEMU_CAPS_VNC); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL); DO_TEST_CAPS_LATEST("intel-iommu"); DO_TEST_CAPS_LATEST("intel-iommu-caching-mode"); -- 2.31.1

On 6/8/21 3:15 AM, Han Han wrote:
Signed-off-by: Han Han <hhan@redhat.com> --- .../video-virtio-vga-gpu-gl.args | 29 +++++++++++++ .../video-virtio-vga-gpu-gl.xml | 34 +++++++++++++++ tests/qemuxml2argvtest.c | 6 +++ .../video-virtio-vga-gpu-gl.xml | 43 +++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 5 files changed, 118 insertions(+) create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml create mode 100644 tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args new file mode 100644 index 0000000000..72e04f3c3e --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args @@ -0,0 +1,29 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 1024 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-vga-gl,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-gl-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..40e68fc458 --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml @@ -0,0 +1,34 @@ +<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='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <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'> + <acceleration accel3d='yes'/> + </model> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9ec81eb8e..99fe7ac115 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2501,6 +2501,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL);
Any reason for not using DO_TEST_CAPS_LATEST()?
DO_TEST_CAPS_LATEST("video-bochs-display-device"); DO_TEST_CAPS_LATEST("video-ramfb-display-device"); DO_TEST_CAPS_LATEST_PARSE_ERROR("video-ramfb-display-device-pci-address"); diff --git a/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..618d70c635 --- /dev/null +++ b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
This output XML differs from the input XML only in unimportant details (e.g. PCI addresses computed for <controller/>-s). Can those changes be made to the input XML and this be just a symlink to the input XML?
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index dd039bd846..ac49d39f06 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1340,6 +1340,12 @@ mymain(void) QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW); DO_TEST("video-none-device", QEMU_CAPS_VNC); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL);
Again, I think DO_TEST_CAPS_LATEST() is preferred. Michal

On Tue, Jun 8, 2021 at 10:14 PM Michal Prívozník <mprivozn@redhat.com> wrote:
On 6/8/21 3:15 AM, Han Han wrote:
Signed-off-by: Han Han <hhan@redhat.com> --- .../video-virtio-vga-gpu-gl.args | 29 +++++++++++++ .../video-virtio-vga-gpu-gl.xml | 34 +++++++++++++++ tests/qemuxml2argvtest.c | 6 +++ .../video-virtio-vga-gpu-gl.xml | 43 +++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 5 files changed, 118 insertions(+) create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml create mode 100644 tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args new file mode 100644 index 0000000000..72e04f3c3e --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args @@ -0,0 +1,29 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 1024 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-vga-gl,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-gl-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..40e68fc458 --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml @@ -0,0 +1,34 @@ +<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='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <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'> + <acceleration accel3d='yes'/> + </model> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9ec81eb8e..99fe7ac115 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2501,6 +2501,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL);
Any reason for not using DO_TEST_CAPS_LATEST()?
I tried DO_TEST_CAPS_LATEST(), but as I remembered, it reported an error "3d acceleration is not supported" when running tests. That looks like QEMU_CAPS_VIRTIO_GPU_VIRGL is missing in DO_TEST_CAPS_LATEST() I will try DO_TEST_CAPS_LATEST() again to see if it will happen
DO_TEST_CAPS_LATEST("video-bochs-display-device"); DO_TEST_CAPS_LATEST("video-ramfb-display-device");
DO_TEST_CAPS_LATEST_PARSE_ERROR("video-ramfb-display-device-pci-address");
diff --git a/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..618d70c635 --- /dev/null +++ b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
This output XML differs from the input XML only in unimportant details (e.g. PCI addresses computed for <controller/>-s). Can those changes be made to the input XML and this be just a symlink to the input XML?
Yes. Because of no updates on xml formatting codes, I think it is OK to create a symlink of input xml for the output xml.
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index dd039bd846..ac49d39f06 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1340,6 +1340,12 @@ mymain(void) QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW); DO_TEST("video-none-device", QEMU_CAPS_VNC); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL);
Again, I think DO_TEST_CAPS_LATEST() is preferred.
Michal

On 6/9/21 5:08 AM, Han Han wrote:
On Tue, Jun 8, 2021 at 10:14 PM Michal Prívozník <mprivozn@redhat.com> wrote:
On 6/8/21 3:15 AM, Han Han wrote:
Signed-off-by: Han Han <hhan@redhat.com> --- .../video-virtio-vga-gpu-gl.args | 29 +++++++++++++ .../video-virtio-vga-gpu-gl.xml | 34 +++++++++++++++ tests/qemuxml2argvtest.c | 6 +++ .../video-virtio-vga-gpu-gl.xml | 43 +++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 5 files changed, 118 insertions(+) create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml create mode 100644 tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args new file mode 100644 index 0000000000..72e04f3c3e --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args @@ -0,0 +1,29 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 1024 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-vga-gl,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-gl-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..40e68fc458 --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml @@ -0,0 +1,34 @@ +<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='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <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'> + <acceleration accel3d='yes'/> + </model> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9ec81eb8e..99fe7ac115 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2501,6 +2501,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL);
Any reason for not using DO_TEST_CAPS_LATEST()?
I tried DO_TEST_CAPS_LATEST(), but as I remembered, it reported an error "3d acceleration is not supported" when running tests. That looks like QEMU_CAPS_VIRTIO_GPU_VIRGL is missing in DO_TEST_CAPS_LATEST()
Of course it is! That is the whole point of the gilab issue. Previously QEMU had -device virtio-*,virgl=on but now they promoted virgl into a device and thus they have -device virtio-*-gl-* (which then no longer has/needs virgl attribute) The QEMU_CAPS_VIRTIO_GPU_VIRGL capability checks, whether virgl attribute is present. It won't be with these new devices.
I will try DO_TEST_CAPS_LATEST() again to see if it will happen
DO_TEST_CAPS_LATEST("video-bochs-display-device"); DO_TEST_CAPS_LATEST("video-ramfb-display-device");
DO_TEST_CAPS_LATEST_PARSE_ERROR("video-ramfb-display-device-pci-address");
diff --git a/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..618d70c635 --- /dev/null +++ b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
This output XML differs from the input XML only in unimportant details (e.g. PCI addresses computed for <controller/>-s). Can those changes be made to the input XML and this be just a symlink to the input XML?
Yes. Because of no updates on xml formatting codes, I think it is OK to create a symlink of input xml for the output xml.
Exactly. We don't need to check if parser/post parse callback fills in some missing info. Michal

On Wed, Jun 9, 2021 at 2:20 PM Michal Prívozník <mprivozn@redhat.com> wrote:
On 6/9/21 5:08 AM, Han Han wrote:
On Tue, Jun 8, 2021 at 10:14 PM Michal Prívozník <mprivozn@redhat.com> wrote:
On 6/8/21 3:15 AM, Han Han wrote:
Signed-off-by: Han Han <hhan@redhat.com> --- .../video-virtio-vga-gpu-gl.args | 29 +++++++++++++ .../video-virtio-vga-gpu-gl.xml | 34 +++++++++++++++ tests/qemuxml2argvtest.c | 6 +++ .../video-virtio-vga-gpu-gl.xml | 43 +++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 5 files changed, 118 insertions(+) create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args create mode 100644 tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml create mode 100644 tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args new file mode 100644 index 0000000000..72e04f3c3e --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.args @@ -0,0 +1,29 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 1024 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off
\
+-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-vga-gl,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-gpu-gl-pci,id=video1,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..40e68fc458 --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-vga-gpu-gl.xml @@ -0,0 +1,34 @@ +<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='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <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'> + <acceleration accel3d='yes'/> + </model> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9ec81eb8e..99fe7ac115 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2501,6 +2501,12 @@ mymain(void) QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS); + DO_TEST("video-virtio-vga-gpu-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_VIRTIO_GPU_GL_PCI, + QEMU_CAPS_VIRTIO_VGA_GL);
Any reason for not using DO_TEST_CAPS_LATEST()?
I tried DO_TEST_CAPS_LATEST(), but as I remembered, it reported an error "3d acceleration is not supported" when running tests. That looks like QEMU_CAPS_VIRTIO_GPU_VIRGL is missing in DO_TEST_CAPS_LATEST()
Of course it is! That is the whole point of the gilab issue. Previously QEMU had -device virtio-*,virgl=on but now they promoted virgl into a device and thus they have -device virtio-*-gl-* (which then no longer has/needs virgl attribute)
The QEMU_CAPS_VIRTIO_GPU_VIRGL capability checks, whether virgl attribute is present. It won't be with these new devices.
Wow, I know it. virtio*gl* devices can work without QEMU_CAPS_VIRTIO_GPU_VIRGL. I will send a patch to src/qemu/qemu_validate.c to make virtio*gl* devices pass the validation of 3d acceleration.
I will try DO_TEST_CAPS_LATEST() again to see if it will happen
DO_TEST_CAPS_LATEST("video-bochs-display-device"); DO_TEST_CAPS_LATEST("video-ramfb-display-device");
DO_TEST_CAPS_LATEST_PARSE_ERROR("video-ramfb-display-device-pci-address");
diff --git a/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml new file mode 100644 index 0000000000..618d70c635 --- /dev/null +++ b/tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.xml
This output XML differs from the input XML only in unimportant details (e.g. PCI addresses computed for <controller/>-s). Can those changes be made to the input XML and this be just a symlink to the input XML?
Yes. Because of no updates on xml formatting codes, I think it is OK to create a symlink of input xml for the output xml.
Exactly. We don't need to check if parser/post parse callback fills in some missing info.
Michal
participants (3)
-
Han Han
-
Michal Prívozník
-
Peter Krempa