diff mbox series

[v2,17/25] conf: Add <filesystem model='virtio-9p-{non-}transitional'/>

Message ID e21cd68b223e51ce2abd57518bbe99c68594f499.1548278585.git.crobinso@redhat.com
State Superseded
Headers show
Series qemu: virtio-{non-}transitional support | expand

Commit Message

Cole Robinson Jan. 23, 2019, 9:32 p.m. UTC
<filesystem> devices lack the model= attribute which is used by
most other device types. To eventually support
virtio-9p-pci-{non-}traditional in qemu, let's add a standard
model= attribute. The accepted values are:

- virtio-9p
- virtio-9p-transitional
- virtio-9p-non-transitional

The divergence in naming from other *-transitional values is
because we expect to support virtio-fs in the future.

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 docs/formatdomain.html.in                     |  4 +++
 docs/schemas/domaincommon.rng                 |  9 +++++
 src/conf/domain_conf.c                        | 33 +++++++++++++++++--
 src/conf/domain_conf.h                        | 11 +++++++
 .../virtio-non-transitional.x86_64-3.1.0.args | 11 ++++---
 ...virtio-non-transitional.x86_64-latest.args | 11 ++++---
 .../virtio-non-transitional.xml               |  4 +++
 .../virtio-transitional.x86_64-3.1.0.args     | 15 +++++----
 .../virtio-transitional.x86_64-latest.args    | 15 +++++----
 .../qemuxml2argvdata/virtio-transitional.xml  |  4 +++
 .../virtio-non-transitional.xml               | 18 +++++++---
 .../virtio-transitional.xml                   | 26 ++++++++++-----
 12 files changed, 127 insertions(+), 34 deletions(-)

-- 
2.20.1

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

Comments

Andrea Bolognani Jan. 29, 2019, 1:49 p.m. UTC | #1
On Wed, 2019-01-23 at 16:32 -0500, Cole Robinson wrote:
[...]
> +++ b/docs/schemas/domaincommon.rng

> @@ -2499,6 +2499,15 @@

>            </element>

>          </optional>

>        </interleave>

> +      <optional>

> +        <attribute name="model">

> +          <choice>

> +            <value>virtio-9p</value>

> +            <value>virtio-9p-transitional</value>

> +            <value>virtio-9p-non-transitional</value>


I thought there was rough consensus on having separate 'model'
and 'protocol' attributes, with the former using the same values
as other VirtIO devices, but looking through the archives I've
found

  https://www.redhat.com/archives/libvir-list/2019-January/msg00799.html

where you said you were going this route for v2... Sorry I didn't
notice earlier and thus didn't have a chance to yell :)

I think being consistent with other devices is more important than,
for lack of a better term, "marketing" virtio-fs.

Moreover, management applications like virt-manager and Cockpit
will probably present this as a single drop-down to users, so it
hardly matters that it ultimately ends up being translated to two
separate attributes and what the corresponding values are.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Cole Robinson Feb. 6, 2019, 5:46 p.m. UTC | #2
On 1/29/19 8:49 AM, Andrea Bolognani wrote:
> On Wed, 2019-01-23 at 16:32 -0500, Cole Robinson wrote:

> [...]

>> +++ b/docs/schemas/domaincommon.rng

>> @@ -2499,6 +2499,15 @@

>>            </element>

>>          </optional>

>>        </interleave>

>> +      <optional>

>> +        <attribute name="model">

>> +          <choice>

>> +            <value>virtio-9p</value>

>> +            <value>virtio-9p-transitional</value>

>> +            <value>virtio-9p-non-transitional</value>

> 

> I thought there was rough consensus on having separate 'model'

> and 'protocol' attributes, with the former using the same values

> as other VirtIO devices, but looking through the archives I've

> found

> 

>   https://www.redhat.com/archives/libvir-list/2019-January/msg00799.html

> 

> where you said you were going this route for v2... Sorry I didn't

> notice earlier and thus didn't have a chance to yell :)

> 

> I think being consistent with other devices is more important than,

> for lack of a better term, "marketing" virtio-fs.

> 

> Moreover, management applications like virt-manager and Cockpit

> will probably present this as a single drop-down to users, so it

> hardly matters that it ultimately ends up being translated to two

> separate attributes and what the corresponding values are.

> 


Okay I'll go with the protocol= syntax danpb suggested

Thanks,
Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Cole Robinson Feb. 6, 2019, 7 p.m. UTC | #3
On 2/6/19 12:46 PM, Cole Robinson wrote:
> On 1/29/19 8:49 AM, Andrea Bolognani wrote:

>> On Wed, 2019-01-23 at 16:32 -0500, Cole Robinson wrote:

>> [...]

>>> +++ b/docs/schemas/domaincommon.rng

>>> @@ -2499,6 +2499,15 @@

>>>            </element>

>>>          </optional>

>>>        </interleave>

>>> +      <optional>

>>> +        <attribute name="model">

>>> +          <choice>

>>> +            <value>virtio-9p</value>

>>> +            <value>virtio-9p-transitional</value>

>>> +            <value>virtio-9p-non-transitional</value>

>>

>> I thought there was rough consensus on having separate 'model'

>> and 'protocol' attributes, with the former using the same values

>> as other VirtIO devices, but looking through the archives I've

>> found

>>

>>   https://www.redhat.com/archives/libvir-list/2019-January/msg00799.html

>>

>> where you said you were going this route for v2... Sorry I didn't

>> notice earlier and thus didn't have a chance to yell :)

>>

>> I think being consistent with other devices is more important than,

>> for lack of a better term, "marketing" virtio-fs.

>>

>> Moreover, management applications like virt-manager and Cockpit

>> will probably present this as a single drop-down to users, so it

>> hardly matters that it ultimately ends up being translated to two

>> separate attributes and what the corresponding values are.

>>

> 

> Okay I'll go with the protocol= syntax danpb suggested

> 


Althought I guess the protocol= syntax is really only interesting once
we have another use case like usb-mtp or virtio-fs wired up. So I guess
I'll just do model=virtio|virtio-transitional|virtio-non-transitional

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Andrea Bolognani Feb. 7, 2019, 8:41 a.m. UTC | #4
On Wed, 2019-02-06 at 14:00 -0500, Cole Robinson wrote:
> > Okay I'll go with the protocol= syntax danpb suggested

> 

> Althought I guess the protocol= syntax is really only interesting once

> we have another use case like usb-mtp or virtio-fs wired up. So I guess

> I'll just do model=virtio|virtio-transitional|virtio-non-transitional


Sounds fair :)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox series

Patch

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index bf64bf9feb..1f39601749 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3880,6 +3880,10 @@ 
         </dd>
         </dl>
 
+      <span class="since">Since 5.1.0</span>, the filesystem element
+      has an optional attribute <code>model</code> with supported values
+      "virtio-9p-transitional", "virtio-9p-non-transitional", or
+      "virtio-9p" which matches the default behavior of the QEMU driver.
       </dd>
 
       <dt><code>driver</code></dt>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 58ae874dfd..a6783a55c7 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2499,6 +2499,15 @@ 
           </element>
         </optional>
       </interleave>
+      <optional>
+        <attribute name="model">
+          <choice>
+            <value>virtio-9p</value>
+            <value>virtio-9p-transitional</value>
+            <value>virtio-9p-non-transitional</value>
+          </choice>
+        </attribute>
+      </optional>
     </element>
   </define>
   <define name="fsDriver">
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index fa772da52f..9bfedcb219 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -408,6 +408,13 @@  VIR_ENUM_IMPL(virDomainFSWrpolicy, VIR_DOMAIN_FS_WRPOLICY_LAST,
               "default",
               "immediate")
 
+VIR_ENUM_IMPL(virDomainFSModel, VIR_DOMAIN_FS_MODEL_LAST,
+              "default",
+              "virtio-9p",
+              "virtio-9p-transitional",
+              "virtio-9p-non-transitional",
+);
+
 VIR_ENUM_IMPL(virDomainNet, VIR_DOMAIN_NET_TYPE_LAST,
               "user",
               "ethernet",
@@ -10723,6 +10730,7 @@  virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
     char *wrpolicy = NULL;
     char *usage = NULL;
     char *units = NULL;
+    char *model = NULL;
 
     ctxt->node = node;
 
@@ -10751,6 +10759,15 @@  virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
         def->accessmode = VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH;
     }
 
+    model = virXMLPropString(node, "model");
+    if (model) {
+        if ((def->model = virDomainFSModelTypeFromString(model)) < 0) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("unknown model '%s'"), model);
+            goto error;
+        }
+    }
+
     if (virDomainParseScaledValue("./space_hard_limit[1]",
                                   NULL, ctxt, &def->space_hard_limit,
                                   1, ULLONG_MAX, false) < 0)
@@ -10879,6 +10896,7 @@  virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
     VIR_FREE(usage);
     VIR_FREE(units);
     VIR_FREE(format);
+    VIR_FREE(model);
 
     return def;
 
@@ -22007,6 +22025,12 @@  virDomainFsDefCheckABIStability(virDomainFSDefPtr src,
         return false;
     }
 
+    if (src->model != dst->model) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("Target filesystem model does not match source"));
+        return false;
+    }
+
     if (src->virtio && dst->virtio &&
         !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio))
         return false;
@@ -24812,10 +24836,15 @@  virDomainFSDefFormat(virBufferPtr buf,
         goto cleanup;
     }
 
-
     virBufferAsprintf(buf,
-                      "<filesystem type='%s' accessmode='%s'>\n",
+                      "<filesystem type='%s' accessmode='%s'",
                       type, accessmode);
+    if (def->model) {
+        virBufferAsprintf(buf, " model='%s'",
+                          virDomainFSModelTypeToString(def->model));
+    }
+    virBufferAddLit(buf, ">\n");
+
     virBufferAdjustIndent(buf, 2);
     if (def->fsdriver) {
         virBufferAsprintf(&driverBuf, " type='%s'", fsdriver);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index d73fcd1221..5d24cb0259 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -903,12 +903,22 @@  typedef enum {
     VIR_DOMAIN_FS_WRPOLICY_LAST
 } virDomainFSWrpolicy;
 
+typedef enum {
+    VIR_DOMAIN_FS_MODEL_DEFAULT = 0,
+    VIR_DOMAIN_FS_MODEL_VIRTIO_9P,
+    VIR_DOMAIN_FS_MODEL_VIRTIO_9P_TRANSITIONAL,
+    VIR_DOMAIN_FS_MODEL_VIRTIO_9P_NON_TRANSITIONAL,
+
+    VIR_DOMAIN_FS_MODEL_LAST
+} virDomainFSModel;
+
 struct _virDomainFSDef {
     int type;
     int fsdriver; /* enum virDomainFSDriverType */
     int accessmode; /* enum virDomainFSAccessMode */
     int wrpolicy; /* enum virDomainFSWrpolicy */
     int format; /* virStorageFileFormat */
+    int model; /* virDomainFSModel */
     unsigned long long usage; /* in bytes */
     virStorageSourcePtr src;
     char *dst;
@@ -3453,6 +3463,7 @@  VIR_ENUM_DECL(virDomainFS)
 VIR_ENUM_DECL(virDomainFSDriver)
 VIR_ENUM_DECL(virDomainFSAccessMode)
 VIR_ENUM_DECL(virDomainFSWrpolicy)
+VIR_ENUM_DECL(virDomainFSModel)
 VIR_ENUM_DECL(virDomainNet)
 VIR_ENUM_DECL(virDomainNetBackend)
 VIR_ENUM_DECL(virDomainNetVirtioTxMode)
diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args
index 10cc6236cb..824737338a 100644
--- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args
+++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args
@@ -29,17 +29,20 @@  addr=0x1 \
 -device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \
 -device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \
 -device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \
+-device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci,disable-legacy=on,disable-modern=off,scsi=off,bus=pci.2,\
+-device virtio-blk-pci,disable-legacy=on,disable-modern=off,scsi=off,bus=pci.3,\
 addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.1,addr=0x0 \
 -netdev user,id=hostnet0 \
 -device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=hostnet0,\
-id=net0,mac=00:11:22:33:44:55,bus=pci.1,addr=0x0 \
+id=net0,mac=00:11:22:33:44:55,bus=pci.2,addr=0x0 \
 -device vhost-scsi-pci,disable-legacy=on,disable-modern=off,\
-wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,bus=pci.3,addr=0x0 \
+wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,bus=pci.4,addr=0x0 \
 -object rng-random,id=objrng0,filename=/dev/urandom \
 -device virtio-rng-pci,disable-legacy=on,disable-modern=off,rng=objrng0,\
-id=rng0,bus=pci.4,addr=0x0 \
+id=rng0,bus=pci.5,addr=0x0 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
index a0fc475c2f..e454eeadbd 100644
--- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
@@ -29,16 +29,19 @@  addr=0x1 \
 -device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \
 -device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \
 -device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \
+-device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci-non-transitional,scsi=off,bus=pci.2,addr=0x0,\
+-device virtio-blk-pci-non-transitional,scsi=off,bus=pci.3,addr=0x0,\
 drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.1,addr=0x0 \
 -netdev user,id=hostnet0 \
 -device virtio-net-pci-non-transitional,netdev=hostnet0,id=net0,\
-mac=00:11:22:33:44:55,bus=pci.1,addr=0x0 \
+mac=00:11:22:33:44:55,bus=pci.2,addr=0x0 \
 -device vhost-scsi-pci-non-transitional,wwpn=naa.5123456789abcde0,vhostfd=3,\
-id=hostdev0,bus=pci.3,addr=0x0 \
+id=hostdev0,bus=pci.4,addr=0x0 \
 -object rng-random,id=objrng0,filename=/dev/urandom \
--device virtio-rng-pci-non-transitional,rng=objrng0,id=rng0,bus=pci.4,addr=0x0 \
+-device virtio-rng-pci-non-transitional,rng=objrng0,id=rng0,bus=pci.5,addr=0x0 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.xml b/tests/qemuxml2argvdata/virtio-non-transitional.xml
index 2075ccbf57..5f14e082cd 100644
--- a/tests/qemuxml2argvdata/virtio-non-transitional.xml
+++ b/tests/qemuxml2argvdata/virtio-non-transitional.xml
@@ -22,6 +22,10 @@ 
     <rng model='virtio-non-transitional'>
       <backend model='random'>/dev/urandom</backend>
     </rng>
+    <filesystem type='mount' accessmode='passthrough' model='virtio-9p-non-transitional'>
+      <source dir='/export/fs1'/>
+      <target dir='fs1'/>
+    </filesystem>
     <controller type='usb' index='0' model='none'/>
     <memballoon model='none'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
index dc830d21b1..6f07d5b707 100644
--- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
+++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
@@ -25,18 +25,21 @@  file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 -boot strict=on \
 -device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
 addr=0x1 \
--device pcie-pci-bridge,id=pci.2,bus=pci.1,addr=0x0 \
--device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 \
+-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
+-device pcie-pci-bridge,id=pci.3,bus=pci.1,addr=0x0 \
+-device pcie-root-port,port=0xa,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x2 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci,scsi=off,bus=pci.2,addr=0x2,drive=drive-virtio-disk0,\
+-device virtio-blk-pci,scsi=off,bus=pci.3,addr=0x2,drive=drive-virtio-disk0,\
 id=virtio-disk0,bootindex=1 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.2,addr=0x0 \
 -netdev user,id=hostnet0 \
--device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.2,\
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.3,\
 addr=0x1 \
 -device vhost-scsi-pci,wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,\
-bus=pci.2,addr=0x3 \
+bus=pci.3,addr=0x3 \
 -object rng-random,id=objrng0,filename=/dev/urandom \
--device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.2,addr=0x4 \
+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.3,addr=0x4 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
index 64fb4153fd..43c1cafd45 100644
--- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
@@ -25,18 +25,21 @@  file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 -boot strict=on \
 -device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
 addr=0x1 \
--device pcie-pci-bridge,id=pci.2,bus=pci.1,addr=0x0 \
--device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 \
+-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
+-device pcie-pci-bridge,id=pci.3,bus=pci.1,addr=0x0 \
+-device pcie-root-port,port=0xa,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x2 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci-transitional,scsi=off,bus=pci.2,addr=0x2,\
+-device virtio-blk-pci-transitional,scsi=off,bus=pci.3,addr=0x2,\
 drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.2,addr=0x0 \
 -netdev user,id=hostnet0 \
 -device virtio-net-pci-transitional,netdev=hostnet0,id=net0,\
-mac=00:11:22:33:44:55,bus=pci.2,addr=0x1 \
+mac=00:11:22:33:44:55,bus=pci.3,addr=0x1 \
 -device vhost-scsi-pci-transitional,wwpn=naa.5123456789abcde0,vhostfd=3,\
-id=hostdev0,bus=pci.2,addr=0x3 \
+id=hostdev0,bus=pci.3,addr=0x3 \
 -object rng-random,id=objrng0,filename=/dev/urandom \
--device virtio-rng-pci-transitional,rng=objrng0,id=rng0,bus=pci.2,addr=0x4 \
+-device virtio-rng-pci-transitional,rng=objrng0,id=rng0,bus=pci.3,addr=0x4 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-transitional.xml b/tests/qemuxml2argvdata/virtio-transitional.xml
index 82535c84d6..44639a970c 100644
--- a/tests/qemuxml2argvdata/virtio-transitional.xml
+++ b/tests/qemuxml2argvdata/virtio-transitional.xml
@@ -22,6 +22,10 @@ 
     <rng model='virtio-transitional'>
       <backend model='random'>/dev/urandom</backend>
     </rng>
+    <filesystem type='mount' accessmode='passthrough' model='virtio-9p-transitional'>
+      <source dir='/export/fs1'/>
+      <target dir='fs1'/>
+    </filesystem>
     <controller type='usb' index='0' model='none'/>
     <memballoon model='none'/>
   </devices>
diff --git a/tests/qemuxml2xmloutdata/virtio-non-transitional.xml b/tests/qemuxml2xmloutdata/virtio-non-transitional.xml
index 4a315050ab..a903d44c34 100644
--- a/tests/qemuxml2xmloutdata/virtio-non-transitional.xml
+++ b/tests/qemuxml2xmloutdata/virtio-non-transitional.xml
@@ -18,7 +18,7 @@ 
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
       <target dev='vda' bus='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
     </disk>
     <controller type='usb' index='0' model='none'/>
     <controller type='sata' index='0'>
@@ -50,21 +50,31 @@ 
       <target chassis='5' port='0xc'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/>
     </controller>
+    <controller type='pci' index='6' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='6' port='0xd'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/>
+    </controller>
+    <filesystem type='mount' accessmode='passthrough' model='virtio-9p-non-transitional'>
+      <source dir='/export/fs1'/>
+      <target dir='fs1'/>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+    </filesystem>
     <interface type='user'>
       <mac address='00:11:22:33:44:55'/>
       <model type='virtio-non-transitional'/>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
     </interface>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <hostdev mode='subsystem' type='scsi_host' managed='no' model='virtio-non-transitional'>
       <source protocol='vhost' wwpn='naa.5123456789abcde0'/>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </hostdev>
     <memballoon model='none'/>
     <rng model='virtio-non-transitional'>
       <backend model='random'>/dev/urandom</backend>
-      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
     </rng>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/virtio-transitional.xml b/tests/qemuxml2xmloutdata/virtio-transitional.xml
index ae3789ad93..61a3f91ef8 100644
--- a/tests/qemuxml2xmloutdata/virtio-transitional.xml
+++ b/tests/qemuxml2xmloutdata/virtio-transitional.xml
@@ -18,7 +18,7 @@ 
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
       <target dev='vda' bus='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
     </disk>
     <controller type='usb' index='0' model='none'/>
     <controller type='sata' index='0'>
@@ -30,30 +30,40 @@ 
       <target chassis='1' port='0x8'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
     </controller>
-    <controller type='pci' index='2' model='pcie-to-pci-bridge'>
+    <controller type='pci' index='2' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='2' port='0x9'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+    </controller>
+    <controller type='pci' index='3' model='pcie-to-pci-bridge'>
       <model name='pcie-pci-bridge'/>
       <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
     </controller>
-    <controller type='pci' index='3' model='pcie-root-port'>
+    <controller type='pci' index='4' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='3' port='0x9'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+      <target chassis='4' port='0xa'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
+    <filesystem type='mount' accessmode='passthrough' model='virtio-9p-transitional'>
+      <source dir='/export/fs1'/>
+      <target dir='fs1'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+    </filesystem>
     <interface type='user'>
       <mac address='00:11:22:33:44:55'/>
       <model type='virtio-transitional'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
     </interface>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <hostdev mode='subsystem' type='scsi_host' managed='no' model='virtio-transitional'>
       <source protocol='vhost' wwpn='naa.5123456789abcde0'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x03' function='0x0'/>
     </hostdev>
     <memballoon model='none'/>
     <rng model='virtio-transitional'>
       <backend model='random'>/dev/urandom</backend>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x04' function='0x0'/>
     </rng>
   </devices>
 </domain>