<filesystem ...>
...
<virtio revision='1.0'/>
</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 6fa0c1a..ebe7a14 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2997,6 +2997,16 @@
hard limit is enforced.
<span class="since">Since 0.9.13</span>
</dd>
+
+ <dt><code>virtio</code></dt>
+ <dd>
+ <p>
+ Optional <code>virtio</code> elements can be used to enforce a
particular
+ virtio revision in QEMU. The valid values for the
<code>revision</code>
+ are <code>0.9</code> and <code>1.0</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 4f4db8c..58fc6e3 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2099,6 +2099,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 098c853..3ab2644 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8731,6 +8731,9 @@ virDomainFSDefParseXML(xmlNodePtr node,
goto error;
}
+ if (virDomainVirtioRevisionParseXML(ctxt, &def->virtio_rev) < 0)
+ goto error;
+
def->src->path = source;
source = NULL;
def->dst = target;
@@ -20420,6 +20423,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 23f320b..6c1ce1b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -826,6 +826,7 @@ struct _virDomainFSDef {
unsigned long long space_hard_limit; /* in bytes */
unsigned long long space_soft_limit; /* in bytes */
bool symlinksResolved;
+ virBitmapPtr virtio_rev;
};
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml
b/tests/qemuxml2argvdata/qemuxml2argv-virtio-revision.xml
index 7972617..ad846e1 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.9'/>
+ </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.0'/>
+ </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 7972617..ad846e1 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.9'/>
+ </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.0'/>
+ </filesystem>
<input type='mouse' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x0e' function='0x0'/>
</input>
--
2.7.3