[reducing the cc-list]
On Fri, Feb 19, 2016 at 03:30:15PM +0100, Marc-André Lureau wrote:
Add Spice graphics gl attribute. qemu 2.6 should have -spice gl=on
argument to
enable opengl rendering context (patches on the ML). This is necessary to
actually enable virgl rendering.
Add a qemuxml2argv test for virtio-gpu + spice with virgl.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
docs/formatdomain.html.in | 8 ++++
docs/schemas/domaincommon.rng | 8 ++++
src/conf/domain_conf.c | 26 ++++++++++++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 13 +++++++
tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.6.0-1.replies | 4 ++
.../qemuxml2argv-video-virtio-gpu-spice-gl.args | 24 ++++++++++++
.../qemuxml2argv-video-virtio-gpu-spice-gl.xml | 38 ++++++++++++++++++
tests/qemuxml2argvtest.c | 6 +++
.../qemuxml2xmlout-video-virtio-gpu-spice-gl.xml | 45 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
14 files changed, 177 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.xml
create mode 100644
tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml
@@ -6047,6 +6047,19 @@
qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
}
}
+ if (graphics->data.spice.gl) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_GL)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("This QEMU doesn't support spice OpenGL"));
+ goto error;
+ }
QEMU support is not needed if the request was to turn it off.
Jan
+
+ /* spice.gl is a TristateBool, but qemu expects on/off: use
+ * TristateSwitch helper */
+ virBufferAsprintf(&opt, ",gl=%s",
+ virTristateSwitchTypeToString(graphics->data.spice.gl));
+ }
+
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION)) {
/* If qemu supports seamless migration turn it
* unconditionally on. If migration destination