@@ -427,6 +427,41 @@
element.</dd>
</dl>
+
+ <h4><a id="elementsRNG">RNG device</a></h4>
+ <p>RNG device capabilities are exposed under the
+ <code>rng</code> element. For instance:</p>
+
+<pre>
+<domainCapabilities>
+ ...
+ <devices>
+ <rng supported='yes'>
+ <enum name='model'>
+ <value>virtio</value>
+ <value>virtio-transitional</value>
+ <value>virtio-non-transitional</value>
+ </enum>
+ <enum name='backendModel'>
+ <value>random</value>
+ <value>egd</value>
+ </enum>
+ </rng>
+ ...
+ </devices>
+</domainCapabilities>
+</pre>
+
+ <dl>
+ <dt><code>model</code></dt>
+ <dd>Options for the <code>model</code> attribute of the
+ <rng> element.</dd>
+ <dt><code>backendModel</code></dt>
+ <dd>Options for the <code>model</code> attribute of the
+ <rng><backend> element.</dd>
+ </dl>
+
+
<h3><a id="elementsFeatures">Features</a></h3>
<p>One more set of XML elements describe the supported features and
@@ -154,6 +154,9 @@
<optional>
<ref name='hostdev'/>
</optional>
+ <optional>
+ <ref name='rng'/>
+ </optional>
</element>
</define>
@@ -185,6 +188,13 @@
</element>
</define>
+ <define name='rng'>
+ <element name='rng'>
+ <ref name='supported'/>
+ <ref name='enum'/>
+ </element>
+ </define>
+
<define name='features'>
<element name='features'>
<optional>
@@ -543,6 +543,19 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf,
}
+static void
+virDomainCapsDeviceRNGFormat(virBufferPtr buf,
+ virDomainCapsDeviceRNGPtr const rng)
+{
+ FORMAT_PROLOGUE(rng);
+
+ ENUM_PROCESS(rng, model, virDomainRNGModelTypeToString);
+ ENUM_PROCESS(rng, backendModel, virDomainRNGBackendTypeToString);
+
+ FORMAT_EPILOGUE(rng);
+}
+
+
/**
* virDomainCapsFeatureGICFormat:
* @buf: target buffer
@@ -621,6 +634,7 @@ virDomainCapsFormat(virDomainCapsPtr const caps)
virDomainCapsDeviceGraphicsFormat(&buf, &caps->graphics);
virDomainCapsDeviceVideoFormat(&buf, &caps->video);
virDomainCapsDeviceHostdevFormat(&buf, &caps->hostdev);
+ virDomainCapsDeviceRNGFormat(&buf, &caps->rng);
virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</devices>\n");
@@ -96,6 +96,14 @@ struct _virDomainCapsDeviceHostdev {
/* add new fields here */
};
+typedef struct _virDomainCapsDeviceRNG virDomainCapsDeviceRNG;
+typedef virDomainCapsDeviceRNG *virDomainCapsDeviceRNGPtr;
+struct _virDomainCapsDeviceRNG {
+ virTristateBool supported;
+ virDomainCapsEnum model; /* virDomainRNGModel */
+ virDomainCapsEnum backendModel; /* virDomainRNGBackend */
+};
+
typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC;
typedef virDomainCapsFeatureGIC *virDomainCapsFeatureGICPtr;
struct _virDomainCapsFeatureGIC {
@@ -165,6 +173,7 @@ struct _virDomainCaps {
virDomainCapsDeviceGraphics graphics;
virDomainCapsDeviceVideo video;
virDomainCapsDeviceHostdev hostdev;
+ virDomainCapsDeviceRNG rng;
/* add new domain devices here */
virDomainCapsFeatureGIC gic;
This adds device <rng> reporting. Example output: <rng supported='yes'> <enum name='model'> <value>virtio</value> <value>virtio-transitional</value> <value>virtio-non-transitional</value> </enum> <enum name='backendModel'> <value>random</value> <value>egd</value> </enum> </rng> Signed-off-by: Cole Robinson <crobinso@redhat.com> --- docs/formatdomaincaps.html.in | 35 ++++++++++++++++++++++++++++++++++ docs/schemas/domaincaps.rng | 10 ++++++++++ src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 9 +++++++++ 4 files changed, 68 insertions(+) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list