mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:03:48 +03:00
conf: domcaps: Report device <rng>
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> Reviewed-by: Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
0e66f0669a
commit
9828b6e7fe
@ -450,6 +450,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
|
||||
|
@ -155,6 +155,9 @@
|
||||
<optional>
|
||||
<ref name='hostdev'/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='rng'/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@ -186,6 +189,13 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='rng'>
|
||||
<element name='rng'>
|
||||
<ref name='supported'/>
|
||||
<ref name='enum'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='features'>
|
||||
<element name='features'>
|
||||
<optional>
|
||||
|
@ -547,6 +547,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
|
||||
@ -625,6 +638,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");
|
||||
|
@ -98,6 +98,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 {
|
||||
@ -167,6 +175,7 @@ struct _virDomainCaps {
|
||||
virDomainCapsDeviceGraphics graphics;
|
||||
virDomainCapsDeviceVideo video;
|
||||
virDomainCapsDeviceHostdev hostdev;
|
||||
virDomainCapsDeviceRNG rng;
|
||||
/* add new domain devices here */
|
||||
|
||||
virDomainCapsFeatureGIC gic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user