[PATCH 5/8] Add virtio revision attribute to filesystems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<filesystem ...>
   ...
   <virtio revision='1'/>
</filesystem>

https://bugzilla.redhat.com/show_bug.cgi?id=1227354
---
 docs/formatdomain.html.in                                   | 10 ++++++++++
 docs/schemas/domaincommon.rng                               |  3 +++
 src/conf/domain_conf.c                                      |  6 ++++++
 src/conf/domain_conf.h                                      |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml     | 13 +++++++++++++
 tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-revision.xml | 13 +++++++++++++
 6 files changed, 46 insertions(+)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 703dd26..fa8124d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2963,6 +2963,16 @@
         hard limit is enforced.
         <span class="since">Since 0.9.13</span>
       </dd>
+
+      <dt><code>virtio</code></dt>
+      <dd>
+        <p>
+          An optional <code>virtio</code> element can be used to enforce a particular
+          virtio revision in QEMU. The valid values for the <code>revision</code>
+          are <code>0</code> and <code>1</code>.
+          <span class='since'>Since 2.2.0</span>
+        </p>
+      </dd>
     </dl>
 
     <h4><a name="elementsAddress">Device Addresses</a></h4>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index c24a060..24616a9 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2079,6 +2079,9 @@
             <ref name='scaledInteger'/>
           </element>
         </optional>
+        <optional>
+          <ref name="virtioRevision"/>
+        </optional>
       </interleave>
     </element>
   </define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 844cd4b..7fa50d3 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8688,6 +8688,9 @@ virDomainFSDefParseXML(xmlNodePtr node,
             goto error;
     }
 
+    if (virDomainVirtioRevisionParseXML(ctxt, &def->virtio_rev) < 0)
+        goto error;
+
     def->src->path = source;
     source = NULL;
     def->dst = target;
@@ -20334,6 +20337,9 @@ virDomainFSDefFormat(virBufferPtr buf,
         virBufferAsprintf(buf, "<space_soft_limit unit='bytes'>"
                           "%llu</space_soft_limit>\n", def->space_soft_limit);
     }
+
+    virDomainVirtioRevisionFormatXML(buf, def->virtio_rev);
+
     virBufferAdjustIndent(buf, -2);
     virBufferAddLit(buf, "</filesystem>\n");
     return 0;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 18b5bbd..af46c64 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -824,6 +824,7 @@ struct _virDomainFSDef {
     unsigned long long space_hard_limit; /* in bytes */
     unsigned long long space_soft_limit; /* in bytes */
     bool symlinksResolved;
+    virDomainVirtioRevision virtio_rev;
 };
 
 
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml
index b8fa986..2ee3533 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml
@@ -48,6 +48,19 @@
     <controller type='virtio-serial' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
     </controller>
+    <filesystem type='mount' accessmode='passthrough'>
+      <source dir='/export/fs1'/>
+      <target dir='fs1'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+      <virtio revision='0'/>
+    </filesystem>
+    <filesystem type='mount' accessmode='mapped'>
+      <driver type='path' wrpolicy='immediate'/>
+      <source dir='/export/fs2'/>
+      <target dir='fs2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+      <virtio revision='1'/>
+    </filesystem>
     <input type='mouse' bus='virtio'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
     </input>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-revision.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-revision.xml
index b8fa986..2ee3533 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-revision.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-revision.xml
@@ -48,6 +48,19 @@
     <controller type='virtio-serial' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
     </controller>
+    <filesystem type='mount' accessmode='passthrough'>
+      <source dir='/export/fs1'/>
+      <target dir='fs1'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+      <virtio revision='0'/>
+    </filesystem>
+    <filesystem type='mount' accessmode='mapped'>
+      <driver type='path' wrpolicy='immediate'/>
+      <source dir='/export/fs2'/>
+      <target dir='fs2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+      <virtio revision='1'/>
+    </filesystem>
     <input type='mouse' bus='virtio'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
     </input>
-- 
2.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]