[libvirt] [PATCH 0/6] Add virtio-gpu & virgl support

The following series allow using virtio-gpu and virgl if qemu support it. Ths Spice bits are not yet in qemu 2.5, but should make it in 2.6 and I added the RFC patches that are expected to not change much. Marc-André Lureau (6): qemu: add virtio video device qemu: query virtio-gpu for virgl support tests: add qemu 2.5 caps test tests: add a few qemuxml2argv virtio-gpu tests RFC qemu: add spice opengl support RFC tests: add virgl/spice qemuxml2argv test docs/formatdomain.html.in | 11 +- docs/schemas/domaincommon.rng | 6 + src/conf/domain_conf.c | 14 +- src/conf/domain_conf.h | 2 + src/qemu/qemu_capabilities.c | 21 + src/qemu/qemu_capabilities.h | 5 + src/qemu/qemu_command.c | 44 +- tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 22 +- tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 22 +- tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 22 +- tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 22 +- tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 22 +- tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 22 +- tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 22 +- tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 3 + tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 95 +- tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 170 + tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 4043 ++++++++++++++++++++ tests/qemucapabilitiestest.c | 1 + .../qemuxml2argv-video-virtio-gpu-device.args | 23 + .../qemuxml2argv-video-virtio-gpu-device.xml | 29 + .../qemuxml2argv-video-virtio-gpu-nodevice.args | 24 + .../qemuxml2argv-video-virtio-gpu-nodevice.xml | 29 + .../qemuxml2argv-video-virtio-gpu-virgl.args | 23 + .../qemuxml2argv-video-virtio-gpu-virgl.xml | 32 + tests/qemuxml2argvtest.c | 11 + 26 files changed, 4676 insertions(+), 64 deletions(-) create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.caps create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.replies create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.xml -- 2.5.0

qemu 2.5 provides virtio video device. Similarly to other devices, it can be used with -vga virtio or -device virtio-vga for primary devices, or -device virtio-gpu for non-vga devices. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- docs/formatdomain.html.in | 5 +++-- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 11 +++++++++++ src/qemu/qemu_capabilities.h | 3 +++ src/qemu/qemu_command.c | 19 +++++++++++++++---- tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 3 +++ 8 files changed, 39 insertions(+), 7 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index e5e0167..df29fa1 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5153,8 +5153,9 @@ qemu-kvm -net nic,model=? /dev/null <p> The <code>model</code> element has a mandatory <code>type</code> attribute which takes the value "vga", "cirrus", "vmvga", "xen", - "vbox", or "qxl" (<span class="since">since 0.8.6</span>) depending - on the hypervisor features available. + "vbox", "qxl" (<span class="since">since 0.8.6</span>) or + "virtio" (<span class="since">since 1.2.22</span>) + depending on the hypervisor features available. </p> <p> You can provide the amount of video memory in kibibytes (blocks of diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 994face..228f062 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2921,6 +2921,7 @@ <value>vmvga</value> <value>xen</value> <value>vbox</value> + <value>virtio</value> </choice> </attribute> <group> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0ac7dbf..15413dc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -532,7 +532,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "xen", "vbox", "qxl", - "parallels") + "parallels", + "virtio") VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST, "mouse", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8d43ee6..c26c56d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1374,6 +1374,7 @@ typedef enum { VIR_DOMAIN_VIDEO_TYPE_VBOX, VIR_DOMAIN_VIDEO_TYPE_QXL, VIR_DOMAIN_VIDEO_TYPE_PARALLELS, /* pseudo device for VNC in containers */ + VIR_DOMAIN_VIDEO_TYPE_VIRTIO, VIR_DOMAIN_VIDEO_TYPE_LAST } virDomainVideoType; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2813212..357980b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -301,6 +301,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "gic-version", "incoming-defer", /* 200 */ + "vga-virtio", + "virtio-gpu", + "virtio-vga", ); @@ -1117,6 +1120,8 @@ virQEMUCapsComputeCmdFlags(const char *help, const char *nl = strstr(p, "\n"); if (strstr(p, "|qxl")) virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_QXL); + if (strstr(p, "|virtio")) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_VIRTIO); if ((p = strstr(p, "|none")) && p < nl) virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_NONE); } @@ -1543,6 +1548,9 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-net-ccw", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "virtio-net-s390", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "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 }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { @@ -2399,6 +2407,9 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, /* 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); + /* If qemu supports newer -device virtio-gpu-pci it supports -vga virtio as well */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_VIRTIO); return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index e3e40e5..cbe28ae 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -327,6 +327,9 @@ typedef enum { /* 200 */ QEMU_CAPS_INCOMING_DEFER, /* -incoming defer and migrate_incoming */ + QEMU_CAPS_VGA_VIRTIO, /* The 'virtio' arg for '-vga' */ + QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* */ + QEMU_CAPS_DEVICE_VIRTIO_VGA, /* -device virtio-vga */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ef5ef93..787e3bb 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -104,7 +104,8 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* no arg needed for xen */ "", /* don't support vbox */ "qxl", - "" /* don't support parallels */); + "", /* don't support parallels */ + "virtio"); VIR_ENUM_DECL(qemuDeviceVideo) @@ -115,7 +116,8 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* no device for xen */ "", /* don't support vbox */ "qxl-vga", - "" /* don't support parallels */); + "", /* don't support parallels */ + "virtio-vga"); VIR_ENUM_DECL(qemuSoundCodec) @@ -10496,8 +10498,10 @@ qemuBuildCommandLine(virConnectPtr conn, (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_VGA)) || + (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA))) + ) { for (i = 0; i < def->nvideos; i++) { char *str; virCommandAddArg(cmd, "-device"); @@ -10518,6 +10522,13 @@ qemuBuildCommandLine(virConnectPtr conn, goto error; } + if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VIRTIO)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU does not support virtio graphics adapters")); + goto error; + } + const char *vgastr = qemuVideoTypeToString(primaryVideoType); if (!vgastr || STREQ(vgastr, "")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/tests/qemucapabilitiesdata/caps_2.4.0-1.caps b/tests/qemucapabilitiesdata/caps_2.4.0-1.caps index 6694b7d..51480e8 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_2.4.0-1.caps @@ -162,4 +162,7 @@ <flag name='e1000'/> <flag name='virtio-net'/> <flag name='incoming-defer'/> + <flag name='vga-virtio'/> + <flag name='virtio-vga'/> + <flag name='virtio-gpu'/> </qemuCaps> -- 2.5.0

On Fri, Nov 20, 2015 at 04:30:40PM +0100, Marc-André Lureau wrote:
qemu 2.5 provides virtio video device. Similarly to other devices, it can be used with -vga virtio or -device virtio-vga for primary devices, or -device virtio-gpu for non-vga devices.
This adds virtio-vga but not virtio-gpu. It would be nice to say so in the commit message. There is a public bug filed for this functionality that would also be nice to include in the commit message. https://bugzilla.redhat.com/show_bug.cgi?id=1195176
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- docs/formatdomain.html.in | 5 +++-- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 +
The .xml test file could be squashed in with the parser changes and added to qemuxml2xmltest as well.
src/qemu/qemu_capabilities.c | 11 +++++++++++ src/qemu/qemu_capabilities.h | 3 +++ src/qemu/qemu_command.c | 19 +++++++++++++++---- tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 3 +++ 8 files changed, 39 insertions(+), 7 deletions(-)
Similarly to qemu command line builder and the qemuxml2argvtest addition.
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index e5e0167..df29fa1 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5153,8 +5153,9 @@ qemu-kvm -net nic,model=? /dev/null <p> The <code>model</code> element has a mandatory <code>type</code> attribute which takes the value "vga", "cirrus", "vmvga", "xen", - "vbox", or "qxl" (<span class="since">since 0.8.6</span>) depending - on the hypervisor features available. + "vbox", "qxl" (<span class="since">since 0.8.6</span>) or + "virtio" (<span class="since">since 1.2.22</span>) + depending on the hypervisor features available.
The next planned version is 1.3.0.
</p> <p> You can provide the amount of video memory in kibibytes (blocks of diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 994face..228f062 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2921,6 +2921,7 @@ <value>vmvga</value> <value>xen</value> <value>vbox</value> + <value>virtio</value> </choice> </attribute> <group> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0ac7dbf..15413dc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -532,7 +532,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "xen", "vbox", "qxl", - "parallels") + "parallels", + "virtio")
This is for QEMUs without -device support, I hope nobody would bother backporting the feature to such ancient QEMUs.
VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST, "mouse", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8d43ee6..c26c56d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1374,6 +1374,7 @@ typedef enum { VIR_DOMAIN_VIDEO_TYPE_VBOX, VIR_DOMAIN_VIDEO_TYPE_QXL, VIR_DOMAIN_VIDEO_TYPE_PARALLELS, /* pseudo device for VNC in containers */ + VIR_DOMAIN_VIDEO_TYPE_VIRTIO,
VIR_DOMAIN_VIDEO_TYPE_LAST } virDomainVideoType; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2813212..357980b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -301,6 +301,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "gic-version",
"incoming-defer", /* 200 */ + "vga-virtio", + "virtio-gpu", + "virtio-vga", );
@@ -1117,6 +1120,8 @@ virQEMUCapsComputeCmdFlags(const char *help, const char *nl = strstr(p, "\n"); if (strstr(p, "|qxl")) virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_QXL); + if (strstr(p, "|virtio")) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_VIRTIO);
The -help output is only parsed for QEMUs older than 1.2.0, this capability can be dropped too.
if ((p = strstr(p, "|none")) && p < nl) virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_NONE); }
@@ -1543,6 +1548,9 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-net-ccw", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "virtio-net-s390", QEMU_CAPS_DEVICE_VIRTIO_NET }, { "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 }, };
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { @@ -2399,6 +2407,9 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, /* 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); + /* If qemu supports newer -device virtio-gpu-pci it supports -vga virtio as well */
Actually, -vga virtio was added one commit later than virtio-vga. Either way, just one capability should be enough. (Also, we will never use -vga virtio - we prefer the -device syntax for primary video since QEMU 1.6.0, see QEMU_CAPS_DEVICE_VIDEO_PRIMARY).
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_VIRTIO);
return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index e3e40e5..cbe28ae 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -327,6 +327,9 @@ typedef enum {
/* 200 */ QEMU_CAPS_INCOMING_DEFER, /* -incoming defer and migrate_incoming */ + QEMU_CAPS_VGA_VIRTIO, /* The 'virtio' arg for '-vga' */ + QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* */ + QEMU_CAPS_DEVICE_VIRTIO_VGA, /* -device virtio-vga */
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ef5ef93..787e3bb 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -104,7 +104,8 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* no arg needed for xen */ "", /* don't support vbox */ "qxl", - "" /* don't support parallels */); + "", /* don't support parallels */ + "virtio");
Changing this to an empty string (since it is not supported for QEMUs < 1.6.0) would remove the need for the specific error message below [1].
VIR_ENUM_DECL(qemuDeviceVideo)
@@ -115,7 +116,8 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* no device for xen */ "", /* don't support vbox */ "qxl-vga", - "" /* don't support parallels */); + "", /* don't support parallels */ + "virtio-vga");
VIR_ENUM_DECL(qemuSoundCodec)
@@ -10496,8 +10498,10 @@ qemuBuildCommandLine(virConnectPtr conn, (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_VGA)) || + (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA))) + ) { for (i = 0; i < def->nvideos; i++) { char *str; virCommandAddArg(cmd, "-device"); @@ -10518,6 +10522,13 @@ qemuBuildCommandLine(virConnectPtr conn, goto error; }
+ if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VIRTIO)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU does not support virtio graphics adapters")); + goto error; + } +
See [1], this can be handled by the generic error below. Jan

Check if virtio-gpu provides virgl option. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- src/qemu/qemu_capabilities.c | 8 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 15 +++- tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 95 ++++++++++++++++++++++-- 11 files changed, 216 insertions(+), 57 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 357980b..29763f9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -304,6 +304,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "vga-virtio", "virtio-gpu", "virtio-vga", + "virtio-gpu.virgl", ); @@ -1636,6 +1637,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = { { "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM }, }; +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = { + { "virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL }, +}; + struct virQEMUCapsObjectTypeProps { const char *type; struct virQEMUCapsStringFlags *props; @@ -1689,6 +1694,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, { "qxl-vga", virQEMUCapsObjectPropsQxlVga, ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) }, + { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, }; @@ -1886,6 +1893,7 @@ virQEMUCapsExtractDeviceStr(const char *qemu, "-device", "vmware-svga,?", "-device", "qxl,?", "-device", "qxl-vga,?", + "-device", "virtio-gpu-pci,?", NULL); /* qemu -help goes to stdout, but qemu -device ? goes to stderr. */ virCommandSetErrorBuffer(cmd, &output); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index cbe28ae..17eed58 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -330,6 +330,7 @@ typedef enum { QEMU_CAPS_VGA_VIRTIO, /* The 'virtio' arg for '-vga' */ QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* */ QEMU_CAPS_DEVICE_VIRTIO_VGA, /* -device virtio-vga */ + QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 787e3bb..e8187b7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5894,7 +5894,20 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); - if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + if (video->accel) { + if (video->accel->support3d && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("virtio-gpu 3d acceleration is not supported")); + goto error; + } + + virBufferAsprintf(&buf, ",virgl=%s", + video->accel->support3d ? "on" : "off"); + } + + } else 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'"), diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies index f501218..e7de77b 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies @@ -1598,6 +1598,14 @@ } { + "id": "libvirt-31", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-pci' not found" + } +} + +{ "return": [ { "name": "xenpv" @@ -1641,7 +1649,7 @@ "name": "none" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -1713,7 +1721,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -1721,11 +1729,11 @@ "enabled": false, "present": true }, - "id": "libvirt-33" + "id": "libvirt-34" } { - "id": "libvirt-34", + "id": "libvirt-35", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1733,7 +1741,7 @@ } { - "id": "libvirt-35", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1741,7 +1749,7 @@ } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1755,5 +1763,5 @@ "state": false } ], - "id": "libvirt-37" + "id": "libvirt-38" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies index e1f9704..bf9cbad 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies @@ -1777,6 +1777,14 @@ } { + "id": "libvirt-32", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-pci' not found" + } +} + +{ "return": [ { "name": "xenpv" @@ -1827,7 +1835,7 @@ "name": "none" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -1905,7 +1913,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -1913,11 +1921,11 @@ "enabled": false, "present": true }, - "id": "libvirt-34" + "id": "libvirt-35" } { - "id": "libvirt-35", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1925,7 +1933,7 @@ } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1933,7 +1941,7 @@ } { - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1947,5 +1955,5 @@ "state": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies index 3d797b2..bd7980f 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies @@ -1824,6 +1824,14 @@ } { + "id": "libvirt-32", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-pci' not found" + } +} + +{ "return": [ { "name": "xenpv" @@ -1877,7 +1885,7 @@ "name": "none" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -1955,7 +1963,7 @@ "name": "qemu64" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -1963,11 +1971,11 @@ "enabled": false, "present": true }, - "id": "libvirt-34" + "id": "libvirt-35" } { - "id": "libvirt-35", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1975,7 +1983,7 @@ } { - "id": "libvirt-36", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1983,7 +1991,7 @@ } { - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1997,5 +2005,5 @@ "state": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies index 45571a3..abdba6c 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies @@ -1898,6 +1898,14 @@ } { + "id": "libvirt-32", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-pci' not found" + } +} + +{ "return": [ { "name": "pc-q35-1.4", @@ -1967,7 +1975,7 @@ "cpu-max": 1 } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -2045,7 +2053,7 @@ "name": "qemu64" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -2053,19 +2061,19 @@ "enabled": false, "present": true }, - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -2741,7 +2749,7 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -2751,5 +2759,5 @@ "state": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies index ae4b3f4..26a0e9d 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies @@ -1960,6 +1960,14 @@ } { + "id": "libvirt-32", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-pci' not found" + } +} + +{ "return": [ { "name": "xenpv", @@ -2045,7 +2053,7 @@ "cpu-max": 1 } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -2123,7 +2131,7 @@ "name": "qemu64" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -2131,19 +2139,19 @@ "enabled": false, "present": true }, - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -2721,7 +2729,7 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -2743,5 +2751,5 @@ "state": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies index 90d31f0..5c493b7 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies @@ -1924,6 +1924,14 @@ } { + "id": "libvirt-32", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-pci' not found" + } +} + +{ "return": [ { "name": "xenpv", @@ -2017,7 +2025,7 @@ "cpu-max": 1 } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -2095,7 +2103,7 @@ "name": "qemu64" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -2103,19 +2111,19 @@ "enabled": false, "present": true }, - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -2703,7 +2711,7 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -2725,5 +2733,5 @@ "state": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies index 511461a..ba85b28 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies @@ -2370,6 +2370,14 @@ } { + "id": "libvirt-32", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-gpu-pci' not found" + } +} + +{ "return": [ { "name": "pc-1.3", @@ -2479,7 +2487,7 @@ "cpu-max": 255 } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -2560,7 +2568,7 @@ "name": "qemu64" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -2568,21 +2576,21 @@ "enabled": false, "present": true }, - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [ "tpm-tis" ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ "passthrough" ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -3442,7 +3450,7 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -3464,5 +3472,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-38" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_2.4.0-1.replies b/tests/qemucapabilitiesdata/caps_2.4.0-1.replies index e8a1047..8f50128 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0-1.replies @@ -2680,6 +2680,87 @@ { "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" + }, + { + "name": "virtio-backend", + "type": "child<virtio-gpu-device>" + }, + { + "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": "disable-modern", + "description": "on/off", + "type": "bool" + }, + { + "name": "disable-legacy", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-pci-bus-master-bug-migration", + "description": "on/off", + "type": "bool" + }, + { + "name": "vectors", + "type": "uint32" + }, + { + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-32" +} + +{ + "return": [ + { "name": "pc-i440fx-2.4", "is-default": true, "cpu-max": 255, @@ -2803,7 +2884,7 @@ "cpu-max": 255 } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -2893,7 +2974,7 @@ "name": "qemu64" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -2901,21 +2982,21 @@ "enabled": false, "present": true }, - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [ "tpm-tis" ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ "passthrough" ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -3919,7 +4000,7 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -3949,5 +4030,5 @@ "capability": "events" } ], - "id": "libvirt-38" + "id": "libvirt-39" } -- 2.5.0

On Fri, Nov 20, 2015 at 04:30:41PM +0100, Marc-André Lureau wrote:
Check if virtio-gpu provides virgl option.
The commit also formats qemu command line.
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- src/qemu/qemu_capabilities.c | 8 ++ src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 15 +++-
The qemuxml2argvtest can be squashed together with the command line formatter.
tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 22 ++++-- tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 95 ++++++++++++++++++++++-- 11 files changed, 216 insertions(+), 57 deletions(-)
@@ -1886,6 +1893,7 @@ virQEMUCapsExtractDeviceStr(const char *qemu, "-device", "vmware-svga,?", "-device", "qxl,?", "-device", "qxl-vga,?", + "-device", "virtio-gpu-pci,?", NULL); /* qemu -help goes to stdout, but qemu -device ? goes to stderr. */ virCommandSetErrorBuffer(cmd, &output);
This hunk should not be needed; -help parsing is only used for QEMU older than 1.2.0. Jan

Add check for virtio-gpu caps. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 169 + tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 4039 +++++++++++++++++++++++ tests/qemucapabilitiestest.c | 1 + 3 files changed, 4209 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.caps create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.replies diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.caps b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps new file mode 100644 index 0000000..437eba9 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps @@ -0,0 +1,169 @@ + <qemuCaps> + <flag name='mem-path'/> + <flag name='drive-serial'/> + <flag name='chardev'/> + <flag name='enable-kvm'/> + <flag name='monitor-json'/> + <flag name='balloon'/> + <flag name='device'/> + <flag name='sdl'/> + <flag name='smp-topology'/> + <flag name='netdev'/> + <flag name='rtc'/> + <flag name='vhost-net'/> + <flag name='no-hpet'/> + <flag name='no-kvm-pit'/> + <flag name='pci-configfd'/> + <flag name='nodefconfig'/> + <flag name='boot-menu'/> + <flag name='fsdev'/> + <flag name='name-process'/> + <flag name='drive-readonly'/> + <flag name='smbios-type'/> + <flag name='vga-qxl'/> + <flag name='spice'/> + <flag name='vga-none'/> + <flag name='boot-index'/> + <flag name='hda-duplex'/> + <flag name='drive-aio'/> + <flag name='pci-multibus'/> + <flag name='pci-bootindex'/> + <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'/> + <flag name='virtio-blk-pci.event_idx'/> + <flag name='virtio-net-pci.event_idx'/> + <flag name='cache-directsync'/> + <flag name='piix3-usb-uhci'/> + <flag name='piix4-usb-uhci'/> + <flag name='usb-ehci'/> + <flag name='ich9-usb-ehci1'/> + <flag name='vt82c686b-usb-uhci'/> + <flag name='pci-ohci'/> + <flag name='usb-redir'/> + <flag name='usb-hub'/> + <flag name='no-shutdown'/> + <flag name='cache-unsafe'/> + <flag name='rombar'/> + <flag name='ich9-ahci'/> + <flag name='no-acpi'/> + <flag name='fsdev-readonly'/> + <flag name='virtio-blk-pci.scsi'/> + <flag name='blk-sg-io'/> + <flag name='drive-copy-on-read'/> + <flag name='cpu-host'/> + <flag name='fsdev-writeout'/> + <flag name='drive-iotune'/> + <flag name='system_wakeup'/> + <flag name='scsi-disk.channel'/> + <flag name='scsi-block'/> + <flag name='transaction'/> + <flag name='block-job-async'/> + <flag name='scsi-cd'/> + <flag name='ide-cd'/> + <flag name='no-user-config'/> + <flag name='hda-micro'/> + <flag name='dump-guest-memory'/> + <flag name='nec-usb-xhci'/> + <flag name='balloon-event'/> + <flag name='bridge'/> + <flag name='lsi'/> + <flag name='virtio-scsi-pci'/> + <flag name='blockio'/> + <flag name='disable-s3'/> + <flag name='disable-s4'/> + <flag name='usb-redir.filter'/> + <flag name='ide-drive.wwn'/> + <flag name='scsi-disk.wwn'/> + <flag name='seccomp-sandbox'/> + <flag name='dump-guest-core'/> + <flag name='seamless-migration'/> + <flag name='block-commit'/> + <flag name='vnc'/> + <flag name='drive-mirror'/> + <flag name='usb-redir.bootindex'/> + <flag name='usb-host.bootindex'/> + <flag name='blockdev-snapshot-sync'/> + <flag name='qxl'/> + <flag name='VGA'/> + <flag name='cirrus-vga'/> + <flag name='vmware-svga'/> + <flag name='device-video-primary'/> + <flag name='usb-serial'/> + <flag name='usb-net'/> + <flag name='add-fd'/> + <flag name='nbd-server'/> + <flag name='virtio-rng'/> + <flag name='rng-random'/> + <flag name='rng-egd'/> + <flag name='dtb'/> + <flag name='megasas'/> + <flag name='ipv6-migration'/> + <flag name='machine-opt'/> + <flag name='machine-usb-opt'/> + <flag name='tpm-passthrough'/> + <flag name='tpm-tis'/> + <flag name='pci-bridge'/> + <flag name='vfio-pci'/> + <flag name='vfio-pci.bootindex'/> + <flag name='scsi-generic'/> + <flag name='scsi-generic.bootindex'/> + <flag name='mem-merge'/> + <flag name='vnc-websocket'/> + <flag name='drive-discard'/> + <flag name='mlock'/> + <flag name='vnc-share-policy'/> + <flag name='device-del-event'/> + <flag name='dmi-to-pci-bridge'/> + <flag name='i440fx-pci-hole64-size'/> + <flag name='q35-pci-hole64-size'/> + <flag name='usb-storage'/> + <flag name='usb-storage.removable'/> + <flag name='virtio-mmio'/> + <flag name='ich9-intel-hda'/> + <flag name='kvm-pit-lost-tick-policy'/> + <flag name='boot-strict'/> + <flag name='pvpanic'/> + <flag name='reboot-timeout'/> + <flag name='spice-file-xfer-disable'/> + <flag name='spiceport'/> + <flag name='usb-kbd'/> + <flag name='host-pci-multidomain'/> + <flag name='msg-timestamp'/> + <flag name='active-commit'/> + <flag name='change-backing-file'/> + <flag name='memory-backend-ram'/> + <flag name='memory-backend-file'/> + <flag name='numa'/> + <flag name='usb-audio'/> + <flag name='rtc-reset-reinjection'/> + <flag name='splash-timeout'/> + <flag name='iothread'/> + <flag name='migrate-rdma'/> + <flag name='ivshmem'/> + <flag name='drive-iotune-max'/> + <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'/> + <flag name='ioh3420'/> + <flag name='vhost-user-multiqueue'/> + <flag name='migration-event'/> + <flag name='x3130-upstream'/> + <flag name='xio3130-downstream'/> + <flag name='rtl8139'/> + <flag name='e1000'/> + <flag name='virtio-net'/> + <flag name='incoming-defer'/> + <flag name='vga-virtio'/> + <flag name='virtio-gpu'/> + <flag name='virtio-vga'/> + <flag name='virtio-gpu.virgl'/> + </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.replies b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies new file mode 100644 index 0000000..d90a74b --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies @@ -0,0 +1,4039 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 0, + "minor": 4, + "major": 2 + }, + "package": "" + }, + "capabilities": [ + ] + } +} + +{ + "return": { + }, + "id": "libvirt-1" +} + +{ + "return": { + "qemu": { + "micro": 0, + "minor": 4, + "major": 2 + }, + "package": "" + }, + "id": "libvirt-2" +} + +{ + "return": { + "arch": "x86_64" + }, + "id": "libvirt-3" +} + +{ + "return": [ + { + "name": "query-rocker-of-dpa-groups" + }, + { + "name": "query-rocker-of-dpa-flows" + }, + { + "name": "query-rocker-ports" + }, + { + "name": "query-rocker" + }, + { + "name": "block-set-write-threshold" + }, + { + "name": "x-input-send-event" + }, + { + "name": "trace-event-set-state" + }, + { + "name": "trace-event-get-state" + }, + { + "name": "rtc-reset-reinjection" + }, + { + "name": "query-acpi-ospm-status" + }, + { + "name": "query-memory-devices" + }, + { + "name": "query-memdev" + }, + { + "name": "query-named-block-nodes" + }, + { + "name": "blockdev-add" + }, + { + "name": "query-rx-filter" + }, + { + "name": "chardev-remove" + }, + { + "name": "chardev-add" + }, + { + "name": "query-tpm-types" + }, + { + "name": "query-tpm-models" + }, + { + "name": "query-tpm" + }, + { + "name": "query-target" + }, + { + "name": "query-cpu-definitions" + }, + { + "name": "query-machines" + }, + { + "name": "device-list-properties" + }, + { + "name": "qom-list-types" + }, + { + "name": "change-vnc-password" + }, + { + "name": "nbd-server-stop" + }, + { + "name": "nbd-server-add" + }, + { + "name": "nbd-server-start" + }, + { + "name": "qom-get" + }, + { + "name": "qom-set" + }, + { + "name": "qom-list" + }, + { + "name": "query-block-jobs" + }, + { + "name": "query-balloon" + }, + { + "name": "query-migrate-parameters" + }, + { + "name": "migrate-set-parameters" + }, + { + "name": "query-migrate-capabilities" + }, + { + "name": "migrate-set-capabilities" + }, + { + "name": "query-migrate" + }, + { + "name": "query-command-line-options" + }, + { + "name": "query-uuid" + }, + { + "name": "query-name" + }, + { + "name": "query-spice" + }, + { + "name": "query-vnc-servers" + }, + { + "name": "query-vnc" + }, + { + "name": "query-mice" + }, + { + "name": "query-status" + }, + { + "name": "query-kvm" + }, + { + "name": "query-pci" + }, + { + "name": "query-iothreads" + }, + { + "name": "query-cpus" + }, + { + "name": "query-blockstats" + }, + { + "name": "query-block" + }, + { + "name": "query-chardev-backends" + }, + { + "name": "query-chardev" + }, + { + "name": "query-events" + }, + { + "name": "query-commands" + }, + { + "name": "query-version" + }, + { + "name": "human-monitor-command" + }, + { + "name": "qmp_capabilities" + }, + { + "name": "add_client" + }, + { + "name": "expire_password" + }, + { + "name": "set_password" + }, + { + "name": "block_set_io_throttle" + }, + { + "name": "block_passwd" + }, + { + "name": "query-fdsets" + }, + { + "name": "remove-fd" + }, + { + "name": "add-fd" + }, + { + "name": "closefd" + }, + { + "name": "getfd" + }, + { + "name": "set_link" + }, + { + "name": "balloon" + }, + { + "name": "change-backing-file" + }, + { + "name": "drive-mirror" + }, + { + "name": "blockdev-snapshot-delete-internal-sync" + }, + { + "name": "blockdev-snapshot-internal-sync" + }, + { + "name": "blockdev-snapshot-sync" + }, + { + "name": "block-dirty-bitmap-clear" + }, + { + "name": "block-dirty-bitmap-remove" + }, + { + "name": "block-dirty-bitmap-add" + }, + { + "name": "transaction" + }, + { + "name": "block-job-complete" + }, + { + "name": "block-job-resume" + }, + { + "name": "block-job-pause" + }, + { + "name": "block-job-cancel" + }, + { + "name": "block-job-set-speed" + }, + { + "name": "blockdev-backup" + }, + { + "name": "drive-backup" + }, + { + "name": "block-commit" + }, + { + "name": "block-stream" + }, + { + "name": "block_resize" + }, + { + "name": "object-del" + }, + { + "name": "object-add" + }, + { + "name": "netdev_del" + }, + { + "name": "netdev_add" + }, + { + "name": "query-dump-guest-memory-capability" + }, + { + "name": "dump-guest-memory" + }, + { + "name": "client_migrate_info" + }, + { + "name": "migrate_set_downtime" + }, + { + "name": "migrate_set_speed" + }, + { + "name": "query-migrate-cache-size" + }, + { + "name": "migrate-set-cache-size" + }, + { + "name": "migrate-incoming" + }, + { + "name": "migrate_cancel" + }, + { + "name": "migrate" + }, + { + "name": "xen-set-global-dirty-log" + }, + { + "name": "xen-save-devices-state" + }, + { + "name": "ringbuf-read" + }, + { + "name": "ringbuf-write" + }, + { + "name": "inject-nmi" + }, + { + "name": "pmemsave" + }, + { + "name": "memsave" + }, + { + "name": "cpu-add" + }, + { + "name": "cpu" + }, + { + "name": "send-key" + }, + { + "name": "device_del" + }, + { + "name": "device_add" + }, + { + "name": "system_powerdown" + }, + { + "name": "system_reset" + }, + { + "name": "system_wakeup" + }, + { + "name": "cont" + }, + { + "name": "stop" + }, + { + "name": "screendump" + }, + { + "name": "change" + }, + { + "name": "eject" + }, + { + "name": "quit" + } + ], + "id": "libvirt-4" +} + +{ + "return": { + "fd": 11, + "fdset-id": 0 + }, + "id": "libvirt-5" +} + +{ + "id": "libvirt-6", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'bogus' not found" + } +} + +{ + "return": [ + { + "name": "MEM_UNPLUG_ERROR" + }, + { + "name": "VSERPORT_CHANGE" + }, + { + "name": "QUORUM_REPORT_BAD" + }, + { + "name": "QUORUM_FAILURE" + }, + { + "name": "GUEST_PANICKED" + }, + { + "name": "BALLOON_CHANGE" + }, + { + "name": "ACPI_DEVICE_OST" + }, + { + "name": "MIGRATION" + }, + { + "name": "SPICE_MIGRATE_COMPLETED" + }, + { + "name": "SPICE_DISCONNECTED" + }, + { + "name": "SPICE_INITIALIZED" + }, + { + "name": "SPICE_CONNECTED" + }, + { + "name": "VNC_DISCONNECTED" + }, + { + "name": "VNC_INITIALIZED" + }, + { + "name": "VNC_CONNECTED" + }, + { + "name": "NIC_RX_FILTER_CHANGED" + }, + { + "name": "DEVICE_DELETED" + }, + { + "name": "WATCHDOG" + }, + { + "name": "RTC_CHANGE" + }, + { + "name": "WAKEUP" + }, + { + "name": "SUSPEND_DISK" + }, + { + "name": "SUSPEND" + }, + { + "name": "RESUME" + }, + { + "name": "STOP" + }, + { + "name": "RESET" + }, + { + "name": "POWERDOWN" + }, + { + "name": "SHUTDOWN" + }, + { + "name": "DEVICE_TRAY_MOVED" + }, + { + "name": "BLOCK_WRITE_THRESHOLD" + }, + { + "name": "BLOCK_JOB_READY" + }, + { + "name": "BLOCK_JOB_ERROR" + }, + { + "name": "BLOCK_JOB_CANCELLED" + }, + { + "name": "BLOCK_JOB_COMPLETED" + }, + { + "name": "BLOCK_IO_ERROR" + }, + { + "name": "BLOCK_IMAGE_CORRUPTED" + } + ], + "id": "libvirt-7" +} + +{ + "return": [ + { + "name": "virtio-tablet-pci" + }, + { + "name": "pc-0.13-machine" + }, + { + "name": "fw_cfg" + }, + { + "name": "generic-sdhci" + }, + { + "name": "i82551" + }, + { + "name": "i82550" + }, + { + "name": "Westmere-x86_64-cpu" + }, + { + "name": "e1000-82540em" + }, + { + "name": "pci-serial-4x" + }, + { + "name": "Penryn-x86_64-cpu" + }, + { + "name": "Haswell-x86_64-cpu" + }, + { + "name": "iothread" + }, + { + "name": "pc-q35-2.3-machine" + }, + { + "name": "icc-bridge" + }, + { + "name": "cfi.pflash01" + }, + { + "name": "virtio-gpu-device" + }, + { + "name": "Opteron_G3-x86_64-cpu" + }, + { + "name": "Broadwell-x86_64-cpu" + }, + { + "name": "piix3-ide" + }, + { + "name": "isa-parallel" + }, + { + "name": "pc-q35-2.4-machine" + }, + { + "name": "i2c-bus" + }, + { + "name": "megasas" + }, + { + "name": "usb-braille" + }, + { + "name": "vmware-svga" + }, + { + "name": "pc-i440fx-2.0-machine" + }, + { + "name": "PIIX3-xen" + }, + { + "name": "ccid-bus" + }, + { + "name": "scsi-cd" + }, + { + "name": "isa-serial" + }, + { + "name": "usb-ehci" + }, + { + "name": "user-creatable" + }, + { + "name": "container" + }, + { + "name": "host-x86_64-cpu" + }, + { + "name": "pci-serial-2x" + }, + { + "name": "piix4-ide" + }, + { + "name": "scsi-generic" + }, + { + "name": "pc-1.0-machine" + }, + { + "name": "virtio-net-pci" + }, + { + "name": "pc-dimm" + }, + { + "name": "pc-q35-1.7-machine" + }, + { + "name": "Haswell-noTSX-x86_64-cpu" + }, + { + "name": "pc-i440fx-2.1-machine" + }, + { + "name": "virtio-mouse-device" + }, + { + "name": "virtio-mouse-pci" + }, + { + "name": "isa-debugcon" + }, + { + "name": "ide-hd" + }, + { + "name": "virtio-vga" + }, + { + "name": "qemu64-x86_64-cpu" + }, + { + "name": "rng-egd" + }, + { + "name": "isa-pcspk" + }, + { + "name": "isa-pit" + }, + { + "name": "pc-1.1-machine" + }, + { + "name": "ich9-usb-ehci1" + }, + { + "name": "ich9-usb-ehci2" + }, + { + "name": "pxb-host" + }, + { + "name": "intel-iommu" + }, + { + "name": "irq" + }, + { + "name": "cirrus-vga" + }, + { + "name": "virtconsole" + }, + { + "name": "virtio-rng-pci" + }, + { + "name": "PCIE" + }, + { + "name": "pentium3-x86_64-cpu" + }, + { + "name": "qxl-vga" + }, + { + "name": "ioapic" + }, + { + "name": "kvm-pit" + }, + { + "name": "pc-0.14-machine" + }, + { + "name": "pc-i440fx-1.4-machine" + }, + { + "name": "pc-q35-2.0-machine" + }, + { + "name": "usb-host" + }, + { + "name": "usb-bus" + }, + { + "name": "vhost-scsi-pci" + }, + { + "name": "usb-kbd" + }, + { + "name": "486-x86_64-cpu" + }, + { + "name": "ES1370" + }, + { + "name": "gus" + }, + { + "name": "PIIX3" + }, + { + "name": "isa-applesmc" + }, + { + "name": "kvm-pci-assign" + }, + { + "name": "i82559er" + }, + { + "name": "q35-pcihost" + }, + { + "name": "e1000-82545em" + }, + { + "name": "pc-i440fx-1.5-machine" + }, + { + "name": "usb-bt-dongle" + }, + { + "name": "AC97" + }, + { + "name": "i6300esb" + }, + { + "name": "mc146818rtc" + }, + { + "name": "e1000-82544gc" + }, + { + "name": "PIIX4_PM" + }, + { + "name": "piix4-usb-uhci" + }, + { + "name": "sysbus-ahci" + }, + { + "name": "virtio-tablet-device" + }, + { + "name": "kvm-ioapic" + }, + { + "name": "pvpanic" + }, + { + "name": "core2duo-x86_64-cpu" + }, + { + "name": "virtio-9p-pci" + }, + { + "name": "scsi-disk" + }, + { + "name": "acpi-device-interface" + }, + { + "name": "sb16" + }, + { + "name": "pc-0.15-machine" + }, + { + "name": "usb-mouse" + }, + { + "name": "piix3-usb-uhci" + }, + { + "name": "vfio-calxeda-xgmac" + }, + { + "name": "virtio-scsi-device" + }, + { + "name": "virtio-blk-pci" + }, + { + "name": "virtio-9p-device" + }, + { + "name": "hda-output" + }, + { + "name": "SUNW,fdtwo" + }, + { + "name": "tpci200" + }, + { + "name": "Opteron_G4-x86_64-cpu" + }, + { + "name": "pc-q35-1.4-machine" + }, + { + "name": "virtio-mmio" + }, + { + "name": "qemu-console" + }, + { + "name": "isa-i8259" + }, + { + "name": "System" + }, + { + "name": "pvscsi" + }, + { + "name": "virtio-net-device" + }, + { + "name": "usb-hub" + }, + { + "name": "IvyBridge-x86_64-cpu" + }, + { + "name": "hda-duplex" + }, + { + "name": "pc-i440fx-2.3-machine" + }, + { + "name": "virtio-keyboard-pci" + }, + { + "name": "pci-ohci" + }, + { + "name": "isapc-machine" + }, + { + "name": "ipoctal232" + }, + { + "name": "pc-1.2-machine" + }, + { + "name": "xio3130-downstream" + }, + { + "name": "ide-cd" + }, + { + "name": "pc-i440fx-2.2-machine" + }, + { + "name": "isabus-bridge" + }, + { + "name": "nec-usb-xhci" + }, + { + "name": "memory-backend-file" + }, + { + "name": "isa-ide" + }, + { + "name": "virtio-keyboard-device" + }, + { + "name": "megasas-gen2" + }, + { + "name": "isa-vga" + }, + { + "name": "qemu:memory-region" + }, + { + "name": "rng-random" + }, + { + "name": "hotplug-handler" + }, + { + "name": "kvm-i8259" + }, + { + "name": "i440FX-pcihost" + }, + { + "name": "qemu32-x86_64-cpu" + }, + { + "name": "tpm-tis" + }, + { + "name": "tpm-passthrough" + }, + { + "name": "apic" + }, + { + "name": "isa-debug-exit" + }, + { + "name": "pc-0.10-machine" + }, + { + "name": "pc-testdev" + }, + { + "name": "rocker" + }, + { + "name": "Opteron_G1-x86_64-cpu" + }, + { + "name": "sga" + }, + { + "name": "pcnet" + }, + { + "name": "ivshmem" + }, + { + "name": "hpet" + }, + { + "name": "adlib" + }, + { + "name": "lsi53c895a" + }, + { + "name": "pxb-bus" + }, + { + "name": "usb-audio" + }, + { + "name": "usb-wacom-tablet" + }, + { + "name": "pc-0.11-machine" + }, + { + "name": "kvm-apic" + }, + { + "name": "phenom-x86_64-cpu" + }, + { + "name": "fw_cfg_io" + }, + { + "name": "ioh3420" + }, + { + "name": "pc-q35-2.1-machine" + }, + { + "name": "cs4231a" + }, + { + "name": "dc390" + }, + { + "name": "nvme" + }, + { + "name": "i82801b11-bridge" + }, + { + "name": "kvmvapic" + }, + { + "name": "fw-path-provider" + }, + { + "name": "usb-net" + }, + { + "name": "pci-bridge-seat" + }, + { + "name": "mch" + }, + { + "name": "usb-tablet" + }, + { + "name": "vhost-scsi" + }, + { + "name": "usb-ccid" + }, + { + "name": "pc-i440fx-1.7-machine" + }, + { + "name": "tcg-accel" + }, + { + "name": "virtio-mmio-bus" + }, + { + "name": "pc-q35-2.2-machine" + }, + { + "name": "usb-bot" + }, + { + "name": "ICH9-LPC" + }, + { + "name": "edu" + }, + { + "name": "accel" + }, + { + "name": "pc-i440fx-1.6-machine" + }, + { + "name": "kvmclock" + }, + { + "name": "lsi53c810" + }, + { + "name": "isa-cirrus-vga" + }, + { + "name": "virtio-serial-bus" + }, + { + "name": "ib700" + }, + { + "name": "SandyBridge-x86_64-cpu" + }, + { + "name": "esp" + }, + { + "name": "virtio-balloon-device" + }, + { + "name": "ccid-card-passthru" + }, + { + "name": "ich9-usb-uhci5" + }, + { + "name": "qxl" + }, + { + "name": "intel-hda" + }, + { + "name": "ich9-usb-uhci6" + }, + { + "name": "pci-bridge" + }, + { + "name": "virtio-serial-device" + }, + { + "name": "ich9-usb-uhci3" + }, + { + "name": "ICH9 SMB" + }, + { + "name": "ich9-usb-uhci4" + }, + { + "name": "piix3-ide-xen" + }, + { + "name": "virtio-input-host-device" + }, + { + "name": "icc-bus" + }, + { + "name": "vmxnet3" + }, + { + "name": "IDE" + }, + { + "name": "VGA" + }, + { + "name": "pci-testdev" + }, + { + "name": "ich9-usb-uhci2" + }, + { + "name": "ich9-usb-uhci1" + }, + { + "name": "x3130-upstream" + }, + { + "name": "none-machine" + }, + { + "name": "sysbus-fdc" + }, + { + "name": "SCSI" + }, + { + "name": "n270-x86_64-cpu" + }, + { + "name": "pci-serial" + }, + { + "name": "pc-q35-1.5-machine" + }, + { + "name": "athlon-x86_64-cpu" + }, + { + "name": "ISA" + }, + { + "name": "i8042" + }, + { + "name": "kvm-accel" + }, + { + "name": "i82559c" + }, + { + "name": "i82559b" + }, + { + "name": "i82559a" + }, + { + "name": "scsi-hd" + }, + { + "name": "qtest-accel" + }, + { + "name": "virtio-balloon-pci" + }, + { + "name": "hda-micro" + }, + { + "name": "scsi-block" + }, + { + "name": "virtio-scsi-pci" + }, + { + "name": "rtl8139" + }, + { + "name": "vmmouse" + }, + { + "name": "ich9-intel-hda" + }, + { + "name": "usb-mtp" + }, + { + "name": "ide-drive" + }, + { + "name": "fw_cfg_mem" + }, + { + "name": "PCI" + }, + { + "name": "Opteron_G5-x86_64-cpu" + }, + { + "name": "vmport" + }, + { + "name": "coreduo-x86_64-cpu" + }, + { + "name": "virtio-serial-pci" + }, + { + "name": "pc-q35-1.6-machine" + }, + { + "name": "virtio-input-host-pci" + }, + { + "name": "virtio-pci-bus" + }, + { + "name": "pentium2-x86_64-cpu" + }, + { + "name": "nmi" + }, + { + "name": "i82558b" + }, + { + "name": "i82558a" + }, + { + "name": "pc-0.12-machine" + }, + { + "name": "am53c974" + }, + { + "name": "sdhci-pci" + }, + { + "name": "port92" + }, + { + "name": "pxb" + }, + { + "name": "kvm64-x86_64-cpu" + }, + { + "name": "e1000" + }, + { + "name": "Conroe-x86_64-cpu" + }, + { + "name": "ne2k_isa" + }, + { + "name": "pc-1.3-machine" + }, + { + "name": "HDA" + }, + { + "name": "usb-storage" + }, + { + "name": "usb-serial" + }, + { + "name": "usb-uas" + }, + { + "name": "pc-i440fx-2.4-machine" + }, + { + "name": "sysbus-ohci" + }, + { + "name": "usb-redir" + }, + { + "name": "i82801" + }, + { + "name": "Broadwell-noTSX-x86_64-cpu" + }, + { + "name": "i82557c" + }, + { + "name": "i82557b" + }, + { + "name": "i82557a" + }, + { + "name": "Nehalem-x86_64-cpu" + }, + { + "name": "memory-backend-ram" + }, + { + "name": "QJSON" + }, + { + "name": "virtserialport" + }, + { + "name": "i440FX" + }, + { + "name": "ne2k_pci" + }, + { + "name": "smbus-eeprom" + }, + { + "name": "i82562" + }, + { + "name": "ich9-ahci" + }, + { + "name": "virtio-rng-device" + }, + { + "name": "isa-fdc" + }, + { + "name": "kvm32-x86_64-cpu" + }, + { + "name": "Opteron_G2-x86_64-cpu" + }, + { + "name": "vfio-pci" + }, + { + "name": "IndustryPack" + }, + { + "name": "virtio-gpu-pci" + }, + { + "name": "vt82c686b-usb-uhci" + }, + { + "name": "secondary-vga" + }, + { + "name": "pentium-x86_64-cpu" + }, + { + "name": "virtio-blk-device" + } + ], + "id": "libvirt-8" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "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": "x-data-plane", + "description": "on/off", + "type": "bool" + }, + { + "name": "request-merging", + "description": "on/off", + "type": "bool" + }, + { + "name": "scsi", + "description": "on/off", + "type": "bool" + }, + { + "name": "config-wce", + "description": "on/off", + "type": "bool" + }, + { + "name": "serial", + "type": "str" + }, + { + "name": "secs", + "type": "uint32" + }, + { + "name": "heads", + "type": "uint32" + }, + { + "name": "cyls", + "type": "uint32" + }, + { + "name": "discard_granularity", + "type": "uint32" + }, + { + "name": "opt_io_size", + "type": "uint32" + }, + { + "name": "min_io_size", + "type": "uint16" + }, + { + "name": "physical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "logical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "drive", + "description": "ID of a drive to use as a backend", + "type": "str" + }, + { + "name": "virtio-backend", + "type": "child<virtio-blk-device>" + }, + { + "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": "disable-modern", + "description": "on/off", + "type": "bool" + }, + { + "name": "disable-legacy", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-pci-bus-master-bug-migration", + "description": "on/off", + "type": "bool" + }, + { + "name": "vectors", + "type": "uint32" + }, + { + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + }, + { + "name": "class", + "type": "uint32" + } + ], + "id": "libvirt-9" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "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": "tx", + "type": "str" + }, + { + "name": "x-txburst", + "type": "int32" + }, + { + "name": "x-txtimer", + "type": "uint32" + }, + { + "name": "netdev", + "description": "ID of a netdev to use as a backend", + "type": "str" + }, + { + "name": "vlan", + "description": "Integer VLAN id to connect to", + "type": "int32" + }, + { + "name": "mac", + "description": "Ethernet 6-byte MAC Address, example: 52:54:00:12:34:56", + "type": "str" + }, + { + "name": "mq", + "description": "on/off", + "type": "bool" + }, + { + "name": "ctrl_guest_offloads", + "description": "on/off", + "type": "bool" + }, + { + "name": "ctrl_mac_addr", + "description": "on/off", + "type": "bool" + }, + { + "name": "ctrl_rx_extra", + "description": "on/off", + "type": "bool" + }, + { + "name": "ctrl_vlan", + "description": "on/off", + "type": "bool" + }, + { + "name": "ctrl_rx", + "description": "on/off", + "type": "bool" + }, + { + "name": "ctrl_vq", + "description": "on/off", + "type": "bool" + }, + { + "name": "status", + "description": "on/off", + "type": "bool" + }, + { + "name": "mrg_rxbuf", + "description": "on/off", + "type": "bool" + }, + { + "name": "host_ufo", + "description": "on/off", + "type": "bool" + }, + { + "name": "host_ecn", + "description": "on/off", + "type": "bool" + }, + { + "name": "host_tso6", + "description": "on/off", + "type": "bool" + }, + { + "name": "host_tso4", + "description": "on/off", + "type": "bool" + }, + { + "name": "guest_announce", + "description": "on/off", + "type": "bool" + }, + { + "name": "guest_ufo", + "description": "on/off", + "type": "bool" + }, + { + "name": "guest_ecn", + "description": "on/off", + "type": "bool" + }, + { + "name": "guest_tso6", + "description": "on/off", + "type": "bool" + }, + { + "name": "guest_tso4", + "description": "on/off", + "type": "bool" + }, + { + "name": "gso", + "description": "on/off", + "type": "bool" + }, + { + "name": "guest_csum", + "description": "on/off", + "type": "bool" + }, + { + "name": "csum", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-backend", + "type": "child<virtio-net-device>" + }, + { + "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": "disable-modern", + "description": "on/off", + "type": "bool" + }, + { + "name": "disable-legacy", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-pci-bus-master-bug-migration", + "description": "on/off", + "type": "bool" + }, + { + "name": "vectors", + "type": "uint32" + }, + { + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-10" +} + +{ + "id": "libvirt-11", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-blk-ccw' not found" + } +} + +{ + "id": "libvirt-12", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-net-ccw' not found" + } +} + +{ + "id": "libvirt-13", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-blk-s390' not found" + } +} + +{ + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-net-s390' not found" + } +} + +{ + "id": "libvirt-15", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'pci-assign' not found" + } +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "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": "configfd", + "type": "str" + }, + { + "name": "share_intx", + "description": "on/off", + "type": "bool" + }, + { + "name": "prefer_msi", + "description": "on/off", + "type": "bool" + }, + { + "name": "host", + "description": "Address (bus/device/function) of the host device, example: 04:10.0", + "type": "str" + } + ], + "id": "libvirt-16" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "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": "x-mmap", + "type": "bool" + }, + { + "name": "x-req", + "description": "on/off", + "type": "bool" + }, + { + "name": "x-vga", + "description": "on/off", + "type": "bool" + }, + { + "name": "x-intx-mmap-timeout-ms", + "type": "uint32" + }, + { + "name": "host", + "description": "Address (bus/device/function) of the host device, example: 04:10.0", + "type": "str" + } + ], + "id": "libvirt-17" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "name": "lun", + "type": "uint32" + }, + { + "name": "scsi-id", + "type": "uint32" + }, + { + "name": "channel", + "type": "uint32" + }, + { + "name": "max_io_size", + "type": "uint64" + }, + { + "name": "max_unmap_size", + "type": "uint64" + }, + { + "name": "port_index", + "type": "uint16" + }, + { + "name": "port_wwn", + "type": "uint64" + }, + { + "name": "wwn", + "type": "uint64" + }, + { + "name": "dpofua", + "description": "on/off", + "type": "bool" + }, + { + "name": "removable", + "description": "on/off", + "type": "bool" + }, + { + "name": "product", + "type": "str" + }, + { + "name": "vendor", + "type": "str" + }, + { + "name": "serial", + "type": "str" + }, + { + "name": "ver", + "type": "str" + }, + { + "name": "discard_granularity", + "type": "uint32" + }, + { + "name": "opt_io_size", + "type": "uint32" + }, + { + "name": "min_io_size", + "type": "uint16" + }, + { + "name": "physical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "logical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "drive", + "description": "ID of a drive to use as a backend", + "type": "str" + } + ], + "id": "libvirt-18" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "name": "unit", + "type": "uint32" + }, + { + "name": "model", + "type": "str" + }, + { + "name": "serial", + "type": "str" + }, + { + "name": "wwn", + "type": "uint64" + }, + { + "name": "ver", + "type": "str" + }, + { + "name": "discard_granularity", + "type": "uint32" + }, + { + "name": "opt_io_size", + "type": "uint32" + }, + { + "name": "min_io_size", + "type": "uint16" + }, + { + "name": "physical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "logical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "drive", + "description": "ID of a drive to use as a backend", + "type": "str" + } + ], + "id": "libvirt-19" +} + +{ + "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": "memory-hotplug-support", + "type": "bool" + }, + { + "name": "acpi-pci-hotplug-with-bridge-support", + "type": "bool" + }, + { + "name": "s4_val", + "type": "uint8" + }, + { + "name": "disable_s4", + "type": "uint8" + }, + { + "name": "disable_s3", + "type": "uint8" + }, + { + "name": "smb_io_base", + "type": "uint32" + } + ], + "id": "libvirt-20" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "name": "msos-desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "full-path", + "description": "on/off", + "type": "bool" + }, + { + "name": "serial", + "type": "str" + }, + { + "name": "port", + "type": "str" + }, + { + "name": "filter", + "type": "str" + }, + { + "name": "debug", + "type": "uint8" + }, + { + "name": "chardev", + "description": "ID of a chardev to use as a backend", + "type": "str" + } + ], + "id": "libvirt-21" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "name": "msos-desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "full-path", + "description": "on/off", + "type": "bool" + }, + { + "name": "serial", + "type": "str" + }, + { + "name": "port", + "type": "str" + }, + { + "name": "pipeline", + "description": "on/off", + "type": "bool" + }, + { + "name": "loglevel", + "type": "uint32" + }, + { + "name": "isobsize", + "type": "uint32" + }, + { + "name": "isobufs", + "type": "uint32" + }, + { + "name": "productid", + "type": "uint32" + }, + { + "name": "vendorid", + "type": "uint32" + }, + { + "name": "hostport", + "type": "str" + }, + { + "name": "hostaddr", + "type": "uint32" + }, + { + "name": "hostbus", + "type": "uint32" + } + ], + "id": "libvirt-22" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "name": "lun", + "type": "uint32" + }, + { + "name": "scsi-id", + "type": "uint32" + }, + { + "name": "channel", + "type": "uint32" + }, + { + "name": "drive", + "description": "ID of a drive to use as a backend", + "type": "str" + } + ], + "id": "libvirt-23" +} + +{ + "return": [ + { + "name": "pci-hole64-end", + "type": "int" + }, + { + "name": "pci-hole64-start", + "type": "int" + }, + { + "name": "pci-hole-end", + "type": "int" + }, + { + "name": "pci-hole-start", + "type": "int" + }, + { + "name": "pci-conf-data[0]", + "type": "child<qemu:memory-region>" + }, + { + "name": "pci-conf-idx[0]", + "type": "child<qemu:memory-region>" + }, + { + "name": "short_root_bus", + "type": "uint32" + }, + { + "name": "pci-hole64-size", + "type": "size" + } + ], + "id": "libvirt-24" +} + +{ + "return": [ + { + "name": "mcfg_size", + "type": "int" + }, + { + "name": "pci-hole64-end", + "type": "int" + }, + { + "name": "pci-hole64-start", + "type": "int" + }, + { + "name": "pci-hole-end", + "type": "int" + }, + { + "name": "pci-hole-start", + "type": "int" + }, + { + "name": "mch", + "type": "child<mch>" + }, + { + "name": "pci-conf-data[0]", + "type": "child<qemu:memory-region>" + }, + { + "name": "pci-conf-idx[0]", + "type": "child<qemu:memory-region>" + }, + { + "name": "pcie-mmcfg-mmio[0]", + "type": "child<qemu:memory-region>" + }, + { + "name": "short_root_bus", + "type": "uint32" + }, + { + "name": "pci-hole64-size", + "type": "size" + }, + { + "name": "MCFG", + "type": "uint64" + } + ], + "id": "libvirt-25" +} + +{ + "return": [ + { + "name": "bootindex", + "type": "int32" + }, + { + "name": "msos-desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "full-path", + "description": "on/off", + "type": "bool" + }, + { + "name": "serial", + "type": "str" + }, + { + "name": "port", + "type": "str" + }, + { + "name": "removable", + "description": "on/off", + "type": "bool" + }, + { + "name": "discard_granularity", + "type": "uint32" + }, + { + "name": "opt_io_size", + "type": "uint32" + }, + { + "name": "min_io_size", + "type": "uint16" + }, + { + "name": "physical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "logical_block_size", + "description": "A power of two between 512 and 32768", + "type": "uint16" + }, + { + "name": "drive", + "description": "ID of a drive to use as a backend", + "type": "str" + } + ], + "id": "libvirt-26" +} + +{ + "return": [ + { + "name": "lost_tick_policy", + "type": "LostTickPolicy" + }, + { + "name": "iobase", + "type": "uint32" + } + ], + "id": "libvirt-27" +} + +{ + "return": [ + { + "name": "big-endian-framebuffer", + "type": "bool" + }, + { + "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": "qemu-extended-regs", + "description": "on/off", + "type": "bool" + }, + { + "name": "mmio", + "description": "on/off", + "type": "bool" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "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": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "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": "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-30" +} + +{ + "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": "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-31" +} + +{ + "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": "virgl", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_outputs", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-gpu-device>" + }, + { + "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": "disable-modern", + "description": "on/off", + "type": "bool" + }, + { + "name": "disable-legacy", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-pci-bus-master-bug-migration", + "description": "on/off", + "type": "bool" + }, + { + "name": "vectors", + "type": "uint32" + }, + { + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-32" +} + +{ + "return": [ + { + "name": "pc-i440fx-2.4", + "is-default": true, + "cpu-max": 255, + "alias": "pc" + }, + { + "name": "pc-1.3", + "cpu-max": 255 + }, + { + "name": "pc-0.12", + "cpu-max": 255 + }, + { + "name": "pc-q35-1.6", + "cpu-max": 255 + }, + { + "name": "pc-q35-1.5", + "cpu-max": 255 + }, + { + "name": "none", + "cpu-max": 1 + }, + { + "name": "pc-i440fx-1.6", + "cpu-max": 255 + }, + { + "name": "pc-q35-2.2", + "cpu-max": 255 + }, + { + "name": "pc-i440fx-1.7", + "cpu-max": 255 + }, + { + "name": "pc-q35-2.1", + "cpu-max": 255 + }, + { + "name": "pc-0.11", + "cpu-max": 255 + }, + { + "name": "pc-0.10", + "cpu-max": 255 + }, + { + "name": "pc-i440fx-2.2", + "cpu-max": 255 + }, + { + "name": "pc-1.2", + "cpu-max": 255 + }, + { + "name": "isapc", + "cpu-max": 1 + }, + { + "name": "pc-i440fx-2.3", + "cpu-max": 255 + }, + { + "name": "pc-q35-1.4", + "cpu-max": 255 + }, + { + "name": "pc-0.15", + "cpu-max": 255 + }, + { + "name": "pc-i440fx-1.5", + "cpu-max": 255 + }, + { + "name": "pc-q35-2.0", + "cpu-max": 255 + }, + { + "name": "pc-i440fx-1.4", + "cpu-max": 255 + }, + { + "name": "pc-0.14", + "cpu-max": 255 + }, + { + "name": "pc-1.1", + "cpu-max": 255 + }, + { + "name": "pc-i440fx-2.1", + "cpu-max": 255 + }, + { + "name": "pc-q35-1.7", + "cpu-max": 255 + }, + { + "name": "pc-1.0", + "cpu-max": 255 + }, + { + "name": "pc-i440fx-2.0", + "cpu-max": 255 + }, + { + "name": "pc-q35-2.4", + "cpu-max": 255, + "alias": "q35" + }, + { + "name": "pc-q35-2.3", + "cpu-max": 255 + }, + { + "name": "pc-0.13", + "cpu-max": 255 + } + ], + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "Opteron_G5" + }, + { + "name": "Opteron_G4" + }, + { + "name": "Opteron_G3" + }, + { + "name": "Opteron_G2" + }, + { + "name": "Opteron_G1" + }, + { + "name": "Broadwell" + }, + { + "name": "Broadwell-noTSX" + }, + { + "name": "Haswell" + }, + { + "name": "Haswell-noTSX" + }, + { + "name": "IvyBridge" + }, + { + "name": "SandyBridge" + }, + { + "name": "Westmere" + }, + { + "name": "Nehalem" + }, + { + "name": "Penryn" + }, + { + "name": "Conroe" + }, + { + "name": "n270" + }, + { + "name": "athlon" + }, + { + "name": "pentium3" + }, + { + "name": "pentium2" + }, + { + "name": "pentium" + }, + { + "name": "486" + }, + { + "name": "coreduo" + }, + { + "name": "kvm32" + }, + { + "name": "qemu32" + }, + { + "name": "kvm64" + }, + { + "name": "core2duo" + }, + { + "name": "phenom" + }, + { + "name": "qemu64" + } + ], + "id": "libvirt-34" +} + +{ + "return": { + "enabled": false, + "present": true + }, + "id": "libvirt-35" +} + +{ + "return": [ + "tpm-tis" + ], + "id": "libvirt-36" +} + +{ + "return": [ + "passthrough" + ], + "id": "libvirt-37" +} + +{ + "return": [ + { + "parameters": [ + { + "name": "timeout", + "help": "Request timeout in seconds (default 0 = no timeout)", + "type": "number" + }, + { + "name": "initiator-name", + "help": "Initiator iqn name to use when connecting", + "type": "string" + }, + { + "name": "header-digest", + "help": "HeaderDigest setting. {CRC32C|CRC32C-NONE|NONE-CRC32C|NONE}", + "type": "string" + }, + { + "name": "password", + "help": "password for CHAP authentication to target", + "type": "string" + }, + { + "name": "user", + "help": "username for CHAP authentication to target", + "type": "string" + } + ], + "option": "iscsi" + }, + { + "parameters": [ + { + "name": "non-adaptive", + "type": "boolean" + }, + { + "name": "lossy", + "type": "boolean" + }, + { + "name": "acl", + "type": "boolean" + }, + { + "name": "x509verify", + "type": "string" + }, + { + "name": "tls", + "type": "boolean" + }, + { + "name": "sasl", + "type": "boolean" + }, + { + "name": "lock-key-sync", + "type": "boolean" + }, + { + "name": "reverse", + "type": "boolean" + }, + { + "name": "password", + "type": "boolean" + }, + { + "name": "ipv6", + "type": "boolean" + }, + { + "name": "ipv4", + "type": "boolean" + }, + { + "name": "to", + "type": "number" + }, + { + "name": "connections", + "type": "number" + }, + { + "name": "head", + "type": "number" + }, + { + "name": "display", + "type": "string" + }, + { + "name": "share", + "type": "string" + }, + { + "name": "x509", + "type": "string" + }, + { + "name": "websocket", + "type": "string" + }, + { + "name": "vnc", + "type": "string" + } + ], + "option": "vnc" + }, + { + "parameters": [ + { + "name": "seamless-migration", + "type": "boolean" + }, + { + "name": "playback-compression", + "type": "boolean" + }, + { + "name": "agent-mouse", + "type": "boolean" + }, + { + "name": "streaming-video", + "type": "string" + }, + { + "name": "zlib-glz-wan-compression", + "type": "string" + }, + { + "name": "jpeg-wan-compression", + "type": "string" + }, + { + "name": "image-compression", + "type": "string" + }, + { + "name": "plaintext-channel", + "type": "string" + }, + { + "name": "tls-channel", + "type": "string" + }, + { + "name": "tls-ciphers", + "type": "string" + }, + { + "name": "x509-dh-key-file", + "type": "string" + }, + { + "name": "x509-cacert-file", + "type": "string" + }, + { + "name": "x509-cert-file", + "type": "string" + }, + { + "name": "x509-key-password", + "type": "string" + }, + { + "name": "x509-key-file", + "type": "string" + }, + { + "name": "x509-dir", + "type": "string" + }, + { + "name": "sasl", + "type": "boolean" + }, + { + "name": "disable-agent-file-xfer", + "type": "boolean" + }, + { + "name": "disable-copy-paste", + "type": "boolean" + }, + { + "name": "disable-ticketing", + "type": "boolean" + }, + { + "name": "password", + "type": "string" + }, + { + "name": "ipv6", + "type": "boolean" + }, + { + "name": "ipv4", + "type": "boolean" + }, + { + "name": "addr", + "type": "string" + }, + { + "name": "tls-port", + "type": "number" + }, + { + "name": "port", + "type": "number" + } + ], + "option": "spice" + }, + { + "parameters": [ + ], + "option": "acpi" + }, + { + "parameters": [ + { + "name": "sock_fd", + "type": "number" + }, + { + "name": "socket", + "type": "string" + }, + { + "name": "readonly", + "type": "boolean" + }, + { + "name": "writeout", + "type": "string" + }, + { + "name": "security_model", + "type": "string" + }, + { + "name": "mount_tag", + "type": "string" + }, + { + "name": "path", + "type": "string" + }, + { + "name": "fsdriver", + "type": "string" + } + ], + "option": "virtfs" + }, + { + "parameters": [ + { + "name": "sock_fd", + "type": "number" + }, + { + "name": "socket", + "type": "string" + }, + { + "name": "readonly", + "type": "boolean" + }, + { + "name": "writeout", + "type": "string" + }, + { + "name": "security_model", + "type": "string" + }, + { + "name": "path", + "type": "string" + }, + { + "name": "fsdriver", + "type": "string" + } + ], + "option": "fsdev" + }, + { + "parameters": [ + ], + "option": "smbios" + }, + { + "parameters": [ + { + "name": "file", + "help": "Sets the name of the file from which\nthe fw_cfg blob will be loaded", + "type": "string" + }, + { + "name": "name", + "help": "Sets the fw_cfg name of the blob to be inserted", + "type": "string" + } + ], + "option": "fw_cfg" + }, + { + "parameters": [ + { + "name": "arg", + "type": "string" + }, + { + "name": "target", + "type": "string" + }, + { + "name": "enable", + "type": "boolean" + } + ], + "option": "semihosting-config" + }, + { + "parameters": [ + { + "name": "sleep", + "type": "boolean" + }, + { + "name": "align", + "type": "boolean" + }, + { + "name": "shift", + "type": "string" + } + ], + "option": "icount" + }, + { + "parameters": [ + ], + "option": "numa" + }, + { + "parameters": [ + { + "name": "debug-threads", + "help": "When enabled, name the individual threads; defaults off.\nNOTE: The thread names are for debugging and not a\nstable API.", + "type": "boolean" + }, + { + "name": "process", + "help": "Sets the name of the QEMU process, as shown in top etc", + "type": "string" + }, + { + "name": "guest", + "help": "Sets the name of the guest.\nThis name will be displayed in the SDL window caption.\nThe name will also be used for the VNC server", + "type": "string" + } + ], + "option": "name" + }, + { + "parameters": [ + { + "name": "timestamp", + "type": "boolean" + } + ], + "option": "msg" + }, + { + "parameters": [ + { + "name": "mlock", + "type": "boolean" + } + ], + "option": "realtime" + }, + { + "parameters": [ + ], + "option": "tpmdev" + }, + { + "parameters": [ + ], + "option": "object" + }, + { + "parameters": [ + { + "name": "opaque", + "help": "free-form string used to describe fd", + "type": "string" + }, + { + "name": "set", + "help": "ID of the fd set to add fd to", + "type": "number" + }, + { + "name": "fd", + "help": "file descriptor of which a duplicate is added to fd set", + "type": "number" + } + ], + "option": "add-fd" + }, + { + "parameters": [ + { + "name": "enable", + "type": "boolean" + } + ], + "option": "sandbox" + }, + { + "parameters": [ + { + "name": "strict", + "type": "boolean" + }, + { + "name": "reboot-timeout", + "type": "string" + }, + { + "name": "splash-time", + "type": "string" + }, + { + "name": "splash", + "type": "string" + }, + { + "name": "menu", + "type": "boolean" + }, + { + "name": "once", + "type": "string" + }, + { + "name": "order", + "type": "string" + } + ], + "option": "boot-opts" + }, + { + "parameters": [ + { + "name": "maxcpus", + "type": "number" + }, + { + "name": "threads", + "type": "number" + }, + { + "name": "cores", + "type": "number" + }, + { + "name": "sockets", + "type": "number" + }, + { + "name": "cpus", + "type": "number" + } + ], + "option": "smp-opts" + }, + { + "parameters": [ + { + "name": "maxmem", + "type": "size" + }, + { + "name": "slots", + "type": "number" + }, + { + "name": "size", + "type": "size" + } + ], + "option": "memory" + }, + { + "parameters": [ + { + "name": "suppress-vmdesc", + "help": "Set on to disable self-describing migration", + "type": "boolean" + }, + { + "name": "iommu", + "help": "Set on/off to enable/disable Intel IOMMU (VT-d)", + "type": "boolean" + }, + { + "name": "firmware", + "help": "firmware image", + "type": "string" + }, + { + "name": "usb", + "help": "Set on/off to enable/disable usb", + "type": "boolean" + }, + { + "name": "mem-merge", + "help": "enable/disable memory merge support", + "type": "boolean" + }, + { + "name": "dump-guest-core", + "help": "Include guest memory in a core dump", + "type": "boolean" + }, + { + "name": "dt_compatible", + "help": "Overrides the \"compatible\" property of the dt root node", + "type": "string" + }, + { + "name": "phandle_start", + "help": "The first phandle ID we may generate dynamically", + "type": "number" + }, + { + "name": "dumpdtb", + "help": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "dtb", + "help": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "append", + "help": "Linux kernel command line", + "type": "string" + }, + { + "name": "initrd", + "help": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "kernel", + "help": "Linux kernel image file", + "type": "string" + }, + { + "name": "kvm_shadow_mem", + "help": "KVM shadow MMU size", + "type": "size" + }, + { + "name": "kernel_irqchip", + "help": "use KVM in-kernel irqchip", + "type": "boolean" + }, + { + "name": "accel", + "help": "accelerator list", + "type": "string" + }, + { + "name": "type", + "help": "emulated machine", + "type": "string" + } + ], + "option": "machine" + }, + { + "parameters": [ + { + "name": "romfile", + "type": "string" + }, + { + "name": "bootindex", + "type": "number" + } + ], + "option": "option-rom" + }, + { + "parameters": [ + { + "name": "file", + "type": "string" + }, + { + "name": "events", + "type": "string" + } + ], + "option": "trace" + }, + { + "parameters": [ + { + "name": "pretty", + "type": "boolean" + }, + { + "name": "default", + "type": "boolean" + }, + { + "name": "chardev", + "type": "string" + }, + { + "name": "mode", + "type": "string" + } + ], + "option": "mon" + }, + { + "parameters": [ + { + "name": "value", + "type": "string" + }, + { + "name": "property", + "type": "string" + }, + { + "name": "driver", + "type": "string" + } + ], + "option": "global" + }, + { + "parameters": [ + { + "name": "driftfix", + "type": "string" + }, + { + "name": "clock", + "type": "string" + }, + { + "name": "base", + "type": "string" + } + ], + "option": "rtc" + }, + { + "parameters": [ + ], + "option": "net" + }, + { + "parameters": [ + ], + "option": "netdev" + }, + { + "parameters": [ + ], + "option": "device" + }, + { + "parameters": [ + { + "name": "chardev", + "type": "string" + }, + { + "name": "size", + "type": "size" + }, + { + "name": "debug", + "type": "number" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "signal", + "type": "boolean" + }, + { + "name": "mux", + "type": "boolean" + }, + { + "name": "rows", + "type": "number" + }, + { + "name": "cols", + "type": "number" + }, + { + "name": "height", + "type": "number" + }, + { + "name": "width", + "type": "number" + }, + { + "name": "telnet", + "type": "boolean" + }, + { + "name": "reconnect", + "type": "number" + }, + { + "name": "delay", + "type": "boolean" + }, + { + "name": "server", + "type": "boolean" + }, + { + "name": "wait", + "type": "boolean" + }, + { + "name": "ipv6", + "type": "boolean" + }, + { + "name": "ipv4", + "type": "boolean" + }, + { + "name": "to", + "type": "number" + }, + { + "name": "localport", + "type": "string" + }, + { + "name": "localaddr", + "type": "string" + }, + { + "name": "port", + "type": "string" + }, + { + "name": "host", + "type": "string" + }, + { + "name": "path", + "type": "string" + }, + { + "name": "backend", + "type": "string" + } + ], + "option": "chardev" + }, + { + "parameters": [ + { + "name": "copy-on-read", + "help": "copy read data from backing file into image file", + "type": "boolean" + }, + { + "name": "werror", + "help": "write error action", + "type": "string" + }, + { + "name": "rerror", + "help": "read error action", + "type": "string" + }, + { + "name": "read-only", + "help": "open drive file as read-only", + "type": "boolean" + }, + { + "name": "file", + "help": "file name", + "type": "string" + }, + { + "name": "serial", + "help": "disk serial number", + "type": "string" + }, + { + "name": "addr", + "help": "pci address (virtio only)", + "type": "string" + }, + { + "name": "boot", + "help": "(deprecated, ignored)", + "type": "boolean" + }, + { + "name": "trans", + "help": "chs translation (auto, lba, none)", + "type": "string" + }, + { + "name": "secs", + "help": "number of sectors (ide disk geometry)", + "type": "number" + }, + { + "name": "heads", + "help": "number of heads (ide disk geometry)", + "type": "number" + }, + { + "name": "cyls", + "help": "number of cylinders (ide disk geometry)", + "type": "number" + }, + { + "name": "if", + "help": "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)", + "type": "string" + }, + { + "name": "media", + "help": "media type (disk, cdrom)", + "type": "string" + }, + { + "name": "index", + "help": "index number", + "type": "number" + }, + { + "name": "unit", + "help": "unit number (i.e. lun for scsi)", + "type": "number" + }, + { + "name": "bus", + "help": "bus number", + "type": "number" + }, + { + "name": "detect-zeroes", + "help": "try to optimize zero writes (off, on, unmap)", + "type": "string" + }, + { + "name": "throttling.group", + "help": "name of the block throttling group", + "type": "string" + }, + { + "name": "throttling.iops-size", + "help": "when limiting by iops max size of an I/O in bytes", + "type": "number" + }, + { + "name": "throttling.bps-write-max", + "help": "total bytes write burst", + "type": "number" + }, + { + "name": "throttling.bps-read-max", + "help": "total bytes read burst", + "type": "number" + }, + { + "name": "throttling.bps-total-max", + "help": "total bytes burst", + "type": "number" + }, + { + "name": "throttling.iops-write-max", + "help": "I/O operations write burst", + "type": "number" + }, + { + "name": "throttling.iops-read-max", + "help": "I/O operations read burst", + "type": "number" + }, + { + "name": "throttling.iops-total-max", + "help": "I/O operations burst", + "type": "number" + }, + { + "name": "throttling.bps-write", + "help": "limit write bytes per second", + "type": "number" + }, + { + "name": "throttling.bps-read", + "help": "limit read bytes per second", + "type": "number" + }, + { + "name": "throttling.bps-total", + "help": "limit total bytes per second", + "type": "number" + }, + { + "name": "throttling.iops-write", + "help": "limit write operations per second", + "type": "number" + }, + { + "name": "throttling.iops-read", + "help": "limit read operations per second", + "type": "number" + }, + { + "name": "throttling.iops-total", + "help": "limit total I/O operations per second", + "type": "number" + }, + { + "name": "werror", + "help": "write error action", + "type": "string" + }, + { + "name": "format", + "help": "disk format (raw, qcow2, ...)", + "type": "string" + }, + { + "name": "aio", + "help": "host AIO implementation (threads, native)", + "type": "string" + }, + { + "name": "cache.no-flush", + "help": "ignore any flush requests for the device", + "type": "boolean" + }, + { + "name": "cache.direct", + "help": "enables use of O_DIRECT (bypass the host page cache)", + "type": "boolean" + }, + { + "name": "cache.writeback", + "help": "enables writeback mode for any caches", + "type": "boolean" + }, + { + "name": "discard", + "help": "discard operation (ignore/off, unmap/on)", + "type": "string" + }, + { + "name": "snapshot", + "help": "enable/disable snapshot mode", + "type": "boolean" + } + ], + "option": "drive" + } + ], + "id": "libvirt-38" +} + +{ + "return": [ + { + "state": false, + "capability": "xbzrle" + }, + { + "state": false, + "capability": "rdma-pin-all" + }, + { + "state": false, + "capability": "auto-converge" + }, + { + "state": false, + "capability": "zero-blocks" + }, + { + "state": false, + "capability": "compress" + }, + { + "state": false, + "capability": "events" + } + ], + "id": "libvirt-39" +} diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index fff8a76..94a76af 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -191,6 +191,7 @@ mymain(void) DO_TEST("caps_1.6.50-1"); DO_TEST("caps_2.1.1-1"); DO_TEST("caps_2.4.0-1"); + DO_TEST("caps_2.5.0-1"); qemuTestDriverFree(&driver); -- 2.5.0

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- .../qemuxml2argv-video-virtio-gpu-device.args | 23 +++++++++++++++++ .../qemuxml2argv-video-virtio-gpu-device.xml | 29 ++++++++++++++++++++++ .../qemuxml2argv-video-virtio-gpu-nodevice.args | 24 ++++++++++++++++++ .../qemuxml2argv-video-virtio-gpu-nodevice.xml | 29 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 5 files changed, 109 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args new file mode 100644 index 0000000..762a987 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args @@ -0,0 +1,23 @@ +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 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=/var/lib/libvirt/images/QEMUGuest1,if=none,id=drive-ide0-0-0,format=qcow2,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-gpu-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml new file mode 100644 index 0000000..36805c8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml @@ -0,0 +1,29 @@ +<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='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args new file mode 100644 index 0000000..83e6a55 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.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 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-monitor unix:/tmp/test-monitor,server,nowait \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=/var/lib/libvirt/images/QEMUGuest1,if=ide,bus=0,unit=0,format=qcow2,\ +cache=none \ +-net none \ +-serial none \ +-parallel none \ +-vga virtio diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml new file mode 100644 index 0000000..36805c8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml @@ -0,0 +1,29 @@ +<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='virtio' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index dc8654e..cfb0243 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1748,6 +1748,10 @@ mymain(void) DO_TEST("qemu-ns-commandline-ns0", NONE); DO_TEST("qemu-ns-commandline-ns1", NONE); + DO_TEST("video-virtio-gpu-nodevice", QEMU_CAPS_VGA_VIRTIO); + DO_TEST("video-virtio-gpu-device", QEMU_CAPS_DEVICE, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); qemuTestDriverFree(&driver); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -- 2.5.0

Add Spice graphics gl attribute. qemu 2.6 should have -spice gl=on argument to enable opengl rendering context. This is necessary to actually enable virgl rendering. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- docs/formatdomain.html.in | 6 ++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 11 +++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 10 ++++++++++ tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 4 ++++ 9 files changed, 41 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index df29fa1..d7e1d49 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4979,6 +4979,12 @@ qemu-kvm -net nic,model=? /dev/null 0.8.8</span>); and <code>usbredir</code> (<span class="since">since 0.9.12</span>). </p> + <p> + Spice may provide accelerated server-side rendering with + OpenGL. You can enable OpenGL support with + <code>gl</code> attribute. It is disabled by default. + (<span class="since">since 1.1.22</span>). + </p> <pre> <graphics type='spice' port='-1' tlsPort='-1' autoport='yes'> <channel name='main' mode='secure'/> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 228f062..8f4d2ac 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2711,6 +2711,11 @@ </choice> </attribute> </optional> + <optional> + <attribute name="gl"> + <ref name="virYesNo"/> + </attribute> + </optional> <interleave> <ref name="listenElements"/> <zeroOrMore> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 15413dc..c4bdd11 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10918,6 +10918,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, char *port = virXMLPropString(node, "port"); char *tlsPort; char *autoport; + char *gl; char *defaultMode; int defaultModeVal; @@ -10952,6 +10953,12 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, VIR_FREE(autoport); } + if ((gl = virXMLPropString(node, "gl")) != NULL) { + if (STREQ(gl, "yes")) + def->data.spice.gl = true; + VIR_FREE(gl); + } + def->data.spice.defaultMode = VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY; if ((defaultMode = virXMLPropString(node, "defaultMode")) != NULL) { @@ -21196,6 +21203,10 @@ virDomainGraphicsDefFormat(virBufferPtr buf, break; case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: + if (def->data.spice.gl) + virBufferAsprintf(buf, " gl='%s'", + virTristateBoolTypeToString(def->data.spice.gl)); + if (def->data.spice.port) virBufferAsprintf(buf, " port='%d'", def->data.spice.port); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c26c56d..1a9be96 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1579,6 +1579,7 @@ struct _virDomainGraphicsDef { int streaming; int copypaste; /* enum virTristateBool */ int filetransfer; /* enum virTristateBool */ + int gl; /* enum virTristateBool */ } spice; } data; /* nListens, listens, and *port are only useful if type is vnc, diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 29763f9..48ef48e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -305,6 +305,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "virtio-gpu", "virtio-vga", "virtio-gpu.virgl", + "spice-gl", ); @@ -2596,6 +2597,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { { "drive", "throttling.bps-total-max", QEMU_CAPS_DRIVE_IOTUNE_MAX}, { "machine", "aes-key-wrap", QEMU_CAPS_AES_KEY_WRAP }, { "machine", "dea-key-wrap", QEMU_CAPS_DEA_KEY_WRAP }, + { "spice", "gl", QEMU_CAPS_SPICE_GL }, }; static int diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 17eed58..a43bb10 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -331,6 +331,7 @@ typedef enum { QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* */ QEMU_CAPS_DEVICE_VIRTIO_VGA, /* -device virtio-vga */ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */ + QEMU_CAPS_SPICE_GL, /* -spice gl */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e8187b7..0c543b5 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8443,6 +8443,16 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg, } } + if (graphics->data.spice.gl == VIR_TRISTATE_BOOL_YES) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_GL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU can't enable spice OpenGL support")); + goto error; + } else { + virBufferAddLit(&opt, ",gl=on"); + } + } + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION)) { /* If qemu supports seamless migration turn it * unconditionally on. If migration destination diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.caps b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps index 437eba9..67b5a6c 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps @@ -166,4 +166,5 @@ <flag name='virtio-gpu'/> <flag name='virtio-vga'/> <flag name='virtio-gpu.virgl'/> + <flag name='spice-gl'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.replies b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies index d90a74b..5452c0f 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies @@ -3120,6 +3120,10 @@ { "parameters": [ { + "name": "gl", + "type": "boolean" + }, + { "name": "seamless-migration", "type": "boolean" }, -- 2.5.0

On Fri, Nov 20, 2015 at 04:30:44PM +0100, Marc-André Lureau wrote:
Add Spice graphics gl attribute. qemu 2.6 should have -spice gl=on argument to enable opengl rendering context. This is necessary to actually enable virgl rendering.
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- docs/formatdomain.html.in | 6 ++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 11 +++++++++++ src/conf/domain_conf.h | 1 +
A qemuxml2xmltest would be nice to go with the parser.
src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 10 ++++++++++
And the qemuxml2argvtest can be squashed in with the cmd line formatter.
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 4 ++++ 9 files changed, 41 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index df29fa1..d7e1d49 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4979,6 +4979,12 @@ qemu-kvm -net nic,model=? /dev/null 0.8.8</span>); and <code>usbredir</code> (<span class="since">since 0.9.12</span>). </p> + <p> + Spice may provide accelerated server-side rendering with + OpenGL. You can enable OpenGL support with + <code>gl</code> attribute. It is disabled by default. + (<span class="since">since 1.1.22</span>).
According to the plan: http://wiki.qemu.org/Planning/2.5 QEMU 2.5.0 is planned for 10th Dec. Only features merged on qemu master are accepted to libvirt, so this won't make the next 1.3.0 release at the beginning of December.
+ </p> <pre> <graphics type='spice' port='-1' tlsPort='-1' autoport='yes'> <channel name='main' mode='secure'/> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 228f062..8f4d2ac 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2711,6 +2711,11 @@ </choice> </attribute> </optional> + <optional> + <attribute name="gl"> + <ref name="virYesNo"/>
This accepts "yes", "no" and "default",
+ </attribute> + </optional> <interleave> <ref name="listenElements"/> <zeroOrMore> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 15413dc..c4bdd11 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10952,6 +10953,12 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, VIR_FREE(autoport); }
+ if ((gl = virXMLPropString(node, "gl")) != NULL) { + if (STREQ(gl, "yes")) + def->data.spice.gl = true; + VIR_FREE(gl); + }
but the parser only implements "yes" and "default". Overall, the XML looks good to me. Apart from the accel3d attribute, which is ugly, but less ugly than inveting a separate one. Anyone else with an opinion? Jan

Hi Jan On Mon, Nov 23, 2015 at 6:58 PM, Ján Tomko <jtomko@redhat.com> wrote:
Overall, the XML looks good to me. Apart from the accel3d attribute, which is ugly, but less ugly than inveting a separate one.
Thanks for your feedback. While reworking the patches and adding xml2xml test, I realized the accel2d/3d is a simple bool, so <model type='virtio' heads='1'> <acceleration accel3d='yes'/> </model> Is turned into: <model type='virtio' heads='1'> <acceleration accel3d='yes' accel2d='no'/> </model> Would it be backward incompatible if we changed it to a tristate? thanks -- Marc-André Lureau

On Tue, Nov 24, 2015 at 03:50:02PM +0100, Marc-André Lureau wrote:
Hi Jan
On Mon, Nov 23, 2015 at 6:58 PM, Ján Tomko <jtomko@redhat.com> wrote:
Overall, the XML looks good to me. Apart from the accel3d attribute, which is ugly, but less ugly than inveting a separate one.
Thanks for your feedback.
While reworking the patches and adding xml2xml test, I realized the accel2d/3d is a simple bool, so <model type='virtio' heads='1'> <acceleration accel3d='yes'/> </model>
Is turned into: <model type='virtio' heads='1'> <acceleration accel3d='yes' accel2d='no'/> </model>
Would it be backward incompatible if we changed it to a tristate?
I think making it a tristate is fine and in fact very desirable Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Add a qemuxml2argv test for virtio-gpu + spice with virgl. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> --- .../qemuxml2argv-video-virtio-gpu-virgl.args | 23 ++++++++++++++++ .../qemuxml2argv-video-virtio-gpu-virgl.xml | 32 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 7 +++++ 3 files changed, 62 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args new file mode 100644 index 0000000..9751ee3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args @@ -0,0 +1,23 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=spice \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 1024 \ +-smp 1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=/var/lib/libvirt/images/QEMUGuest1,if=none,id=drive-ide0-0-0,format=qcow2,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-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.xml new file mode 100644 index 0000000..9424566 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.xml @@ -0,0 +1,32 @@ +<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='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + </video> + <graphics type='spice' autoport='no' gl='yes'/> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index cfb0243..8f5e248 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1752,6 +1752,13 @@ mymain(void) DO_TEST("video-virtio-gpu-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-virtio-gpu-virgl", QEMU_CAPS_DEVICE, + QEMU_CAPS_DEVICE_VIRTIO_VGA, + QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, + QEMU_CAPS_SPICE, + QEMU_CAPS_SPICE_GL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + qemuTestDriverFree(&driver); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -- 2.5.0
participants (3)
-
Daniel P. Berrange
-
Ján Tomko
-
Marc-André Lureau