]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: domcaps: Report device <filesystem>
authorKristina Hanicova <khanicov@redhat.com>
Wed, 12 May 2021 17:12:55 +0000 (19:12 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 18 May 2021 12:33:21 +0000 (14:33 +0200)
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
docs/formatdomaincaps.html.in
docs/schemas/domaincaps.rng
src/conf/domain_capabilities.c
src/conf/domain_capabilities.h

index 2d417b69530c305d785b66684277ea3045d23c12..62f1940e6a7e5322a8ca6e7b72c67d1e02e7ea13 100644 (file)
     </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
index 83d93ee4945c4a84b754acea4486e61b445181a7..fc668e0c78dcbb3b9c5ad4698928a78baf74b8e4 100644 (file)
       <optional>
         <ref name="rng"/>
       </optional>
+      <optional>
+        <ref name="filesystem"/>
+      </optional>
     </element>
   </define>
 
     </element>
   </define>
 
+  <define name="filesystem">
+    <element name="filesystem">
+      <ref name="supported"/>
+      <ref name="enum"/>
+    </element>
+  </define>
+
   <define name="features">
     <element name="features">
       <optional>
index d0586362ae6570b9a5185f5e8356667c18672fb7..cb90ae0176cf3a7bd50b860c0c4bbd93709c6335 100644 (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");
index 04be34765bd8cb14b2e0f1430fc4d64c03bf065d..69e90893cc3af41c7b87612492a1744a024235c7 100644 (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;