Requires adding the plumbing for <device><video>
The value is <enum name='modelType'> to match the associated domain
XML of <video><model type='XXX'/>
Wire it up for qemu too
---
docs/formatdomaincaps.html.in | 29 ++++++++++++++++++++++
docs/schemas/domaincaps.rng | 8 ++++++
src/conf/domain_capabilities.c | 13 ++++++++++
src/conf/domain_capabilities.h | 10 ++++++++
src/qemu/qemu_capabilities.c | 23 +++++++++++++++++
tests/domaincapsschemadata/domaincaps-basic.xml | 1 +
tests/domaincapsschemadata/domaincaps-full.xml | 12 +++++++++
.../domaincaps-qemu_1.6.50-1.xml | 8 ++++++
.../domaincaps-qemu_2.6.0-1.xml | 9 +++++++
.../domaincaps-qemu_2.6.0-2.xml | 7 ++++++
.../domaincaps-qemu_2.6.0-3.xml | 7 ++++++
.../domaincaps-qemu_2.6.0-4.xml | 7 ++++++
.../domaincaps-qemu_2.6.0-5.xml | 7 ++++++
tests/domaincapstest.c | 4 +++
14 files changed, 145 insertions(+)
diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in
index 52e4463..d5a8414 100644
--- a/docs/formatdomaincaps.html.in
+++ b/docs/formatdomaincaps.html.in
@@ -244,6 +244,35 @@
</dl>
+ <h4><a name="elementsVideo">Video device</a></h4>
+ <p>Video device capabilities are exposed under the
+ <code>video</code> element. For instance:</p>
+
+<pre>
+<domainCapabilities>
+ ...
+ <devices>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>cirrus</value>
+ <value>vmvga</value>
+ <value>qxl</value>
+ <value>virtio</value>
+ </enum>
+ </video>
+ ...
+ </devices>
+</domainCapabilities>
+</pre>
+
+ <dl>
+ <dt><code>modelType</code></dt>
+ <dd>Options for the <code>type</code> attribute of the
+ <video><model> element.</dd>
+ </dl>
+
+
<h4><a name="elementsHostDev">Host device
assignment</a></h4>
<p>Some host devices can be passed through to a guest (e.g. USB, PCI and
SCSI). Well, only if the following is enabled:</p>
diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng
index 3e82b57..97da41f 100644
--- a/docs/schemas/domaincaps.rng
+++ b/docs/schemas/domaincaps.rng
@@ -73,6 +73,7 @@
<interleave>
<ref name='disk'/>
<ref name='graphics'/>
+ <ref name='video'/>
<ref name='hostdev'/>
</interleave>
</element>
@@ -92,6 +93,13 @@
</element>
</define>
+ <define name='video'>
+ <element name='video'>
+ <ref name='supported'/>
+ <ref name='enum'/>
+ </element>
+ </define>
+
<define name='hostdev'>
<element name='hostdev'>
<ref name='supported'/>
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 232acd5..1676f0e 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -259,6 +259,18 @@ virDomainCapsDeviceGraphicsFormat(virBufferPtr buf,
static void
+virDomainCapsDeviceVideoFormat(virBufferPtr buf,
+ virDomainCapsDeviceVideoPtr const video)
+{
+ FORMAT_PROLOGUE(video);
+
+ ENUM_PROCESS(video, modelType, virDomainVideoTypeToString);
+
+ FORMAT_EPILOGUE(video);
+}
+
+
+static void
virDomainCapsDeviceHostdevFormat(virBufferPtr buf,
virDomainCapsDeviceHostdevPtr const hostdev)
{
@@ -327,6 +339,7 @@ virDomainCapsFormatInternal(virBufferPtr buf,
virDomainCapsDeviceDiskFormat(buf, &caps->disk);
virDomainCapsDeviceGraphicsFormat(buf, &caps->graphics);
+ virDomainCapsDeviceVideoFormat(buf, &caps->video);
virDomainCapsDeviceHostdevFormat(buf, &caps->hostdev);
virBufferAdjustIndent(buf, -2);
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 545ada7..d0ca009 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -76,6 +76,15 @@ struct _virDomainCapsDeviceGraphics {
virDomainCapsEnum type; /* virDomainGraphicsType */
};
+typedef struct _virDomainCapsDeviceVideo virDomainCapsDeviceVideo;
+typedef virDomainCapsDeviceVideo *virDomainCapsDeviceVideoPtr;
+struct _virDomainCapsDeviceVideo {
+ bool supported;
+ virDomainCapsEnum modelType; /* virDomainVideoType */
+};
+
+typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev;
+
typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev;
typedef virDomainCapsDeviceHostdev *virDomainCapsDeviceHostdevPtr;
struct _virDomainCapsDeviceHostdev {
@@ -109,6 +118,7 @@ struct _virDomainCaps {
virDomainCapsOS os;
virDomainCapsDeviceDisk disk;
virDomainCapsDeviceGraphics graphics;
+ virDomainCapsDeviceVideo video;
virDomainCapsDeviceHostdev hostdev;
/* add new domain devices here */
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c675f9f..1bddf43 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4188,6 +4188,27 @@ virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCapsPtr qemuCaps,
static int
+virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr qemuCaps,
+ virDomainCapsDeviceVideoPtr dev)
+{
+ dev->supported = true;
+
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA))
+ VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_VGA);
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA))
+ VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_CIRRUS);
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA))
+ VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_VMVGA);
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA))
+ VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_QXL);
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))
+ VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_VIRTIO);
+
+ return 0;
+}
+
+
+static int
virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps,
virDomainCapsDeviceHostdevPtr hostdev)
{
@@ -4299,6 +4320,7 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
virDomainCapsDeviceDiskPtr disk = &domCaps->disk;
virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev;
virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics;
+ virDomainCapsDeviceVideoPtr video = &domCaps->video;
int maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine);
domCaps->maxvcpus = maxvcpus;
@@ -4308,6 +4330,7 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps,
domCaps->machine, disk) < 0 ||
virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics) < 0 ||
+ virQEMUCapsFillDomainDeviceVideoCaps(qemuCaps, video) < 0 ||
virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0 ||
virQEMUCapsFillDomainFeatureGICCaps(qemuCaps, domCaps) < 0)
return -1;
diff --git a/tests/domaincapsschemadata/domaincaps-basic.xml
b/tests/domaincapsschemadata/domaincaps-basic.xml
index f0f0864..5513f99 100644
--- a/tests/domaincapsschemadata/domaincaps-basic.xml
+++ b/tests/domaincapsschemadata/domaincaps-basic.xml
@@ -7,6 +7,7 @@
<devices>
<disk supported='no'/>
<graphics supported='no'/>
+ <video supported='no'/>
<hostdev supported='no'/>
</devices>
<features>
diff --git a/tests/domaincapsschemadata/domaincaps-full.xml
b/tests/domaincapsschemadata/domaincaps-full.xml
index b3b8855..2f529ff 100644
--- a/tests/domaincapsschemadata/domaincaps-full.xml
+++ b/tests/domaincapsschemadata/domaincaps-full.xml
@@ -48,6 +48,18 @@
<value>spice</value>
</enum>
</graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>cirrus</value>
+ <value>vmvga</value>
+ <value>xen</value>
+ <value>vbox</value>
+ <value>qxl</value>
+ <value>parallels</value>
+ <value>virtio</value>
+ </enum>
+ </video>
<hostdev supported='yes'>
<enum name='mode'>
<value>subsystem</value>
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
index 147424d..161d0ab 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
@@ -41,6 +41,14 @@
<value>spice</value>
</enum>
</graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>cirrus</value>
+ <value>vmvga</value>
+ <value>qxl</value>
+ </enum>
+ </video>
<hostdev supported='yes'>
<enum name='mode'>
<value>subsystem</value>
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
index f8f7465..f42d239 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
@@ -41,6 +41,15 @@
<value>spice</value>
</enum>
</graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>cirrus</value>
+ <value>vmvga</value>
+ <value>qxl</value>
+ <value>virtio</value>
+ </enum>
+ </video>
<hostdev supported='yes'>
<enum name='mode'>
<value>subsystem</value>
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
index 7913703..4e87cd2 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
@@ -40,6 +40,13 @@
<value>vnc</value>
</enum>
</graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>qxl</value>
+ <value>virtio</value>
+ </enum>
+ </video>
<hostdev supported='yes'>
<enum name='mode'>
<value>subsystem</value>
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
index 6f30819..f5f0f1c 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
@@ -40,6 +40,13 @@
<value>vnc</value>
</enum>
</graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>qxl</value>
+ <value>virtio</value>
+ </enum>
+ </video>
<hostdev supported='yes'>
<enum name='mode'>
<value>subsystem</value>
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
index 6845e92..1ae8172 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
@@ -40,6 +40,13 @@
<value>vnc</value>
</enum>
</graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>qxl</value>
+ <value>virtio</value>
+ </enum>
+ </video>
<hostdev supported='yes'>
<enum name='mode'>
<value>subsystem</value>
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
index 68d88d1..583fdf0 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
@@ -38,6 +38,13 @@
<value>vnc</value>
</enum>
</graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>qxl</value>
+ <value>virtio</value>
+ </enum>
+ </video>
<hostdev supported='yes'>
<enum name='mode'>
<value>subsystem</value>
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 6bef682..6ae3f35 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -62,6 +62,7 @@ fillAllCaps(virDomainCapsPtr domCaps)
virDomainCapsLoaderPtr loader = &os->loader;
virDomainCapsDeviceDiskPtr disk = &domCaps->disk;
virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics;
+ virDomainCapsDeviceVideoPtr video = &domCaps->video;
virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev;
domCaps->maxvcpus = 255;
@@ -83,6 +84,9 @@ fillAllCaps(virDomainCapsPtr domCaps)
graphics->supported = true;
SET_ALL_BITS(graphics->type);
+ video->supported = true;
+ SET_ALL_BITS(video->modelType);
+
hostdev->supported = true;
SET_ALL_BITS(hostdev->mode);
SET_ALL_BITS(hostdev->startupPolicy);
--
2.7.4