Reports a tristate enum value for acceptable video model=virtio <acceleration accel3d=XXX/>. Wire it up for qemu too. 'no' is always a valid value, so we unconditionally report it. --- docs/formatdomaincaps.html.in | 9 +++++++++ src/conf/domain_capabilities.c | 1 + src/conf/domain_capabilities.h | 2 ++ src/qemu/qemu_capabilities.c | 4 ++++ tests/domaincapsschemadata/domaincaps-full.xml | 5 +++++ tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml | 3 +++ tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml | 4 ++++ tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml | 3 +++ tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml | 3 +++ tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml | 3 +++ tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml | 3 +++ tests/domaincapstest.c | 1 + 12 files changed, 41 insertions(+) diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index c424107..b87a45a 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -268,6 +268,10 @@ <value>qxl</value> <value>virtio</value> </enum> + <enum name='virtioAccel3D'> + <value>yes</value> + <value>no</value> + </enum> </video> ... </devices> @@ -278,6 +282,11 @@ <dt><code>modelType</code></dt> <dd>Options for the <code>type</code> attribute of the <video><model> element.</dd> + + <dt><code>spiceGL</code></dt> + <dd>Options for the <code>accel3D</code> attribute of the + <video><model type='virtio'/><acceleration/> + element.</dd> </dl> diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 344955c..b5715d4 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -266,6 +266,7 @@ virDomainCapsDeviceVideoFormat(virBufferPtr buf, FORMAT_PROLOGUE(video); ENUM_PROCESS(video, modelType, virDomainVideoTypeToString); + ENUM_PROCESS(video, virtioAccel3D, virTristateBoolTypeToString); FORMAT_EPILOGUE(video); } diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 916dba0..0501e99 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -82,6 +82,8 @@ typedef virDomainCapsDeviceVideo *virDomainCapsDeviceVideoPtr; struct _virDomainCapsDeviceVideo { bool supported; virDomainCapsEnum modelType; /* virDomainVideoType */ + virDomainCapsEnum virtioAccel3D; /* tristate for type=virtio + <acceleration accel3d=X/> */ }; typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f228f4f..511faee 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4208,6 +4208,10 @@ virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr qemuCaps, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_VIRTIO); + VIR_DOMAIN_CAPS_ENUM_SET(dev->virtioAccel3D, VIR_TRISTATE_BOOL_NO); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) + VIR_DOMAIN_CAPS_ENUM_SET(dev->virtioAccel3D, VIR_TRISTATE_BOOL_YES); + return 0; } diff --git a/tests/domaincapsschemadata/domaincaps-full.xml b/tests/domaincapsschemadata/domaincaps-full.xml index 4eb5637..568f452 100644 --- a/tests/domaincapsschemadata/domaincaps-full.xml +++ b/tests/domaincapsschemadata/domaincaps-full.xml @@ -64,6 +64,11 @@ <value>parallels</value> <value>virtio</value> </enum> + <enum name='virtioAccel3D'> + <value>default</value> + <value>yes</value> + <value>no</value> + </enum> </video> <hostdev supported='yes'> <enum name='mode'> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml index 6213297..f287a22 100644 --- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml +++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml @@ -51,6 +51,9 @@ <value>vmvga</value> <value>qxl</value> </enum> + <enum name='virtioAccel3D'> + <value>no</value> + </enum> </video> <hostdev supported='yes'> <enum name='mode'> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml index 2a1477f..7182b3d 100644 --- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml +++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml @@ -53,6 +53,10 @@ <value>qxl</value> <value>virtio</value> </enum> + <enum name='virtioAccel3D'> + <value>yes</value> + <value>no</value> + </enum> </video> <hostdev supported='yes'> <enum name='mode'> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml index 4349998..64d4c03 100644 --- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml +++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml @@ -49,6 +49,9 @@ <value>qxl</value> <value>virtio</value> </enum> + <enum name='virtioAccel3D'> + <value>no</value> + </enum> </video> <hostdev supported='yes'> <enum name='mode'> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml index 27173c4..c019ac4 100644 --- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml +++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml @@ -49,6 +49,9 @@ <value>qxl</value> <value>virtio</value> </enum> + <enum name='virtioAccel3D'> + <value>no</value> + </enum> </video> <hostdev supported='yes'> <enum name='mode'> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml index d7d81b5..539545b 100644 --- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml +++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml @@ -49,6 +49,9 @@ <value>qxl</value> <value>virtio</value> </enum> + <enum name='virtioAccel3D'> + <value>no</value> + </enum> </video> <hostdev supported='yes'> <enum name='mode'> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml index 51c5615..454233f 100644 --- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml +++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml @@ -47,6 +47,9 @@ <value>qxl</value> <value>virtio</value> </enum> + <enum name='virtioAccel3D'> + <value>no</value> + </enum> </video> <hostdev supported='yes'> <enum name='mode'> diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 1b62781..ba34a08 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -87,6 +87,7 @@ fillAllCaps(virDomainCapsPtr domCaps) video->supported = true; SET_ALL_BITS(video->modelType); + SET_ALL_BITS(video->virtioAccel3D); hostdev->supported = true; SET_ALL_BITS(hostdev->mode); -- 2.7.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list