conf: domcaps: Report device <filesystem>

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Kristina Hanicova 2021-05-12 19:12:55 +02:00 committed by Michal Privoznik
parent a7b0026e46
commit f388aa5ff3
4 changed files with 59 additions and 0 deletions

View File

@ -518,6 +518,34 @@
</dl>
<h4><a id="elementsFilesystem">Filesystem device</a></h4>
<p>Filesystem device capabilities are exposed under the
<code>filesystem</code> element. For instance:</p>
<pre>
&lt;domainCapabilities&gt;
...
&lt;devices&gt;
&lt;filesystem supported='yes'&gt;
&lt;enum name='driverType'&gt;
&lt;value&gt;default&lt;/value&gt;
&lt;value&gt;path&lt;/value&gt;
&lt;value&gt;handle&lt;/value&gt;
&lt;value&gt;virtiofs&lt;/value&gt;
&lt;/enum&gt;
&lt;/filesystem&gt;
...
&lt;/devices&gt;
&lt;/domainCapabilities&gt;
</pre>
<dl>
<dt><code>driverType</code></dt>
<dd>Options for the <code>type</code> attribute of the
&lt;filesystem&gt;&lt;driver&gt; element.</dd>
</dl>
<h3><a id="elementsFeatures">Features</a></h3>
<p>One more set of XML elements describe the supported features and

View File

@ -182,6 +182,9 @@
<optional>
<ref name="rng"/>
</optional>
<optional>
<ref name="filesystem"/>
</optional>
</element>
</define>
@ -220,6 +223,13 @@
</element>
</define>
<define name="filesystem">
<element name="filesystem">
<ref name="supported"/>
<ref name="enum"/>
</element>
</define>
<define name="features">
<element name="features">
<optional>

View File

@ -524,6 +524,18 @@ virDomainCapsDeviceRNGFormat(virBuffer *buf,
}
static void
virDomainCapsDeviceFilesystemFormat(virBuffer *buf,
const virDomainCapsDeviceFilesystem *filesystem)
{
FORMAT_PROLOGUE(filesystem);
ENUM_PROCESS(filesystem, driverType, virDomainFSDriverTypeToString);
FORMAT_EPILOGUE(filesystem);
}
/**
* virDomainCapsFeatureGICFormat:
* @buf: target buffer
@ -628,6 +640,7 @@ virDomainCapsFormat(const virDomainCaps *caps)
virDomainCapsDeviceVideoFormat(&buf, &caps->video);
virDomainCapsDeviceHostdevFormat(&buf, &caps->hostdev);
virDomainCapsDeviceRNGFormat(&buf, &caps->rng);
virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem);
virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</devices>\n");

View File

@ -113,6 +113,13 @@ struct _virDomainCapsDeviceRNG {
virDomainCapsEnum backendModel; /* virDomainRNGBackend */
};
STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST);
typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem;
struct _virDomainCapsDeviceFilesystem {
virTristateBool supported;
virDomainCapsEnum driverType; /* virDomainFSDriverType */
};
STATIC_ASSERT_ENUM(VIR_GIC_VERSION_LAST);
typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC;
struct _virDomainCapsFeatureGIC {
@ -194,6 +201,7 @@ struct _virDomainCaps {
virDomainCapsDeviceVideo video;
virDomainCapsDeviceHostdev hostdev;
virDomainCapsDeviceRNG rng;
virDomainCapsDeviceFilesystem filesystem;
/* add new domain devices here */
virDomainCapsFeatureGIC gic;