diff mbox series

[10/18] qemu: Support filesystem model=virtio-{non-}transitional

Message ID 95116e9e597f703acd654bdae2c6411fb20084e5.1547746867.git.crobinso@redhat.com
State New
Headers show
Series qemu: virtio-{non-}transitional support | expand

Commit Message

Cole Robinson Jan. 17, 2019, 5:52 p.m. UTC
Add <filesystem> model handling for virtio transitional devices. Ex:

  <filesystem type='mount' model='virtio-transitional'>
    ...
  </filesystem

* "virtio-transitional" maps to qemu "virtio-9p-pci-transitional"
* "virtio-non-transitional" maps to qemu "virtio-9p-pci-non-transitional"

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

---
 src/qemu/qemu_capabilities.c                  |  6 +++++
 src/qemu/qemu_capabilities.h                  |  4 ++++
 src/qemu/qemu_command.c                       | 12 ++++++++--
 src/qemu/qemu_domain_address.c                |  3 ++-
 .../caps_4.0.0.x86_64.xml                     |  2 ++
 .../virtio-non-transitional.x86_64-3.1.0.args |  3 ++-
 ...virtio-non-transitional.x86_64-latest.args |  3 ++-
 .../virtio-transitional.x86_64-3.1.0.args     | 17 +++++++-------
 .../virtio-transitional.x86_64-latest.args    | 16 ++++++-------
 .../virtio-transitional.xml                   | 23 ++++++++-----------
 10 files changed, 53 insertions(+), 36 deletions(-)

-- 
2.20.1

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

Comments

Daniel P. Berrangé Jan. 18, 2019, 11:44 a.m. UTC | #1
On Thu, Jan 17, 2019 at 12:52:37PM -0500, Cole Robinson wrote:
> Add <filesystem> model handling for virtio transitional devices. Ex:

> 

>   <filesystem type='mount' model='virtio-transitional'>

>     ...

>   </filesystem

> 

> * "virtio-transitional" maps to qemu "virtio-9p-pci-transitional"

> * "virtio-non-transitional" maps to qemu "virtio-9p-pci-non-transitional"


For QEMU the <filesystem> element currently implies the 9p filesystem
passthrough impl.

We already have a need to reuse it for USB-MTP filesystem sharing,
and quite soon we'll have to support virtio-fs too. The virtio-fs
module is essentially fuse-over-virtio IIUC.  In fact I wonder why
we're not just calling that device virtio-fuse to make it explicit !

Anyway the point is that model=virtio-transitional is potentially
ambiguous, depending on how we intend to deal with this.

I was at first thinking of  model="virtio-9p|virtio-fs|usb-mtp"
to deal with the existing issue, but you're proposing using model
already.

I'm a little mixed about how to best dovetail with the transitional
stuff. We could use 'model' stuff but expand it:

   virtio-9p
   virtio-9p-transitional
   virtio-9p-non-transitional
   virtio-fs
   usb-mtp

IIUC, we don't need a -transitional/-non-transitional variant for
virtio-fs since it will be a modern device only - same as with
virtio-gpu.

Or we could do things different and invert something like a 'protocol'
concept for the filesystem. 

  <filesystem type='mount'>
     <target dir="foo" protocol="9p|mtp|fuse"/>
  </filesystem>



Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Andrea Bolognani Jan. 21, 2019, 1:30 p.m. UTC | #2
On Fri, 2019-01-18 at 11:44 +0000, Daniel P. Berrangé wrote:
> For QEMU the <filesystem> element currently implies the 9p filesystem
> passthrough impl.
> 
> We already have a need to reuse it for USB-MTP filesystem sharing,
> and quite soon we'll have to support virtio-fs too. The virtio-fs
> module is essentially fuse-over-virtio IIUC.  In fact I wonder why
> we're not just calling that device virtio-fuse to make it explicit !
> 
> Anyway the point is that model=virtio-transitional is potentially
> ambiguous, depending on how we intend to deal with this.
> 
> I was at first thinking of  model="virtio-9p|virtio-fs|usb-mtp"
> to deal with the existing issue, but you're proposing using model
> already.
> 
> I'm a little mixed about how to best dovetail with the transitional
> stuff. We could use 'model' stuff but expand it:
> 
>    virtio-9p
>    virtio-9p-transitional
>    virtio-9p-non-transitional
>    virtio-fs
>    usb-mtp
> 
> IIUC, we don't need a -transitional/-non-transitional variant for
> virtio-fs since it will be a modern device only - same as with
> virtio-gpu.
> 
> Or we could do things different and invert something like a 'protocol'
> concept for the filesystem. 
> 
>   <filesystem type='mount'>
>      <target dir="foo" protocol="9p|mtp|fuse"/>
>   </filesystem>

Welp, I wish I'd re-read this message before reviewing the previous
patch :)

It looks to me like 'model' as used by Cole and and 'protocol' as
suggested by you are basically complementary, so having both of
them seems pretty reasonable from a quick look.
Cole Robinson Jan. 22, 2019, 6:37 p.m. UTC | #3
On 01/18/2019 06:44 AM, Daniel P. Berrangé wrote:
> On Thu, Jan 17, 2019 at 12:52:37PM -0500, Cole Robinson wrote:
>> Add <filesystem> model handling for virtio transitional devices. Ex:
>>
>>   <filesystem type='mount' model='virtio-transitional'>
>>     ...
>>   </filesystem
>>
>> * "virtio-transitional" maps to qemu "virtio-9p-pci-transitional"
>> * "virtio-non-transitional" maps to qemu "virtio-9p-pci-non-transitional"
> 
> For QEMU the <filesystem> element currently implies the 9p filesystem
> passthrough impl.
> 
> We already have a need to reuse it for USB-MTP filesystem sharing,
> and quite soon we'll have to support virtio-fs too. The virtio-fs
> module is essentially fuse-over-virtio IIUC.  In fact I wonder why
> we're not just calling that device virtio-fuse to make it explicit !
> 
> Anyway the point is that model=virtio-transitional is potentially
> ambiguous, depending on how we intend to deal with this.
> 
> I was at first thinking of  model="virtio-9p|virtio-fs|usb-mtp"
> to deal with the existing issue, but you're proposing using model
> already.
> 
> I'm a little mixed about how to best dovetail with the transitional
> stuff. We could use 'model' stuff but expand it:
> 
>    virtio-9p
>    virtio-9p-transitional
>    virtio-9p-non-transitional
>    virtio-fs
>    usb-mtp
> 
> IIUC, we don't need a -transitional/-non-transitional variant for
> virtio-fs since it will be a modern device only - same as with
> virtio-gpu.
> 
> Or we could do things different and invert something like a 'protocol'
> concept for the filesystem. 
> 
>   <filesystem type='mount'>
>      <target dir="foo" protocol="9p|mtp|fuse"/>
>   </filesystem>
> 
The 9p|mtp|fuse is certainly more generalized, but I think it's helpful
for self documenting purposes to have virtio-fs somewhere in the XML, if
that's what the feature will commonly be known as. Users may not even
realize virtio-fs is using fuse, leading to ask questions about how to
enable virtio-fs or if it's enabled in their XML. Makes me think of the
ich6/ich9 vs hda naming... the former is technically more correct and
follows qemu naming, yet I've had a dozen questions over the years about
where the libvirt HDA option is.

I'll aim for the model=virtio-9p-transitional for the next round unless
somebody yells...

- Cole

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

Patch

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 0241353006..2f54b2c81b 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -530,6 +530,10 @@  VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "vhost-scsi-pci-non-transitional",
               "virtio-rng-pci-transitional",
               "virtio-rng-pci-non-transitional",
+
+              /* 335 */
+              "virtio-9p-pci-transitional",
+              "virtio-9p-pci-non-transitional",
     );
 
 
@@ -1126,6 +1130,8 @@  struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
     {"vhost-scsi-pci-non-transitional", QEMU_CAPS_DEVICE_VHOST_SCSI_NON_TRANSITIONAL},
     {"virtio-rng-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_RNG_TRANSITIONAL},
     {"virtio-rng-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_RNG_NON_TRANSITIONAL},
+    {"virtio-9p-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_9P_TRANSITIONAL},
+    {"virtio-9p-pci-non-transitional", QEMU_CAPS_DEVICE_VIRTIO_9P_NON_TRANSITIONAL},
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index b01578d88a..fef94883c9 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -515,6 +515,10 @@  typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
     QEMU_CAPS_DEVICE_VIRTIO_RNG_TRANSITIONAL, /* -device virtio-blk-rng-transitional */
     QEMU_CAPS_DEVICE_VIRTIO_RNG_NON_TRANSITIONAL, /* -device virtio-rng-pci-non-transitional */
 
+    /* 335 */
+    QEMU_CAPS_DEVICE_VIRTIO_9P_TRANSITIONAL, /* -device virtio-9p-pci-transitional */
+    QEMU_CAPS_DEVICE_VIRTIO_9P_NON_TRANSITIONAL, /* -device virtio-9p-pci-non-transitional */
+
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
 
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 73f145dcd7..56d52e1d7e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -483,9 +483,14 @@  qemuBuildVirtioTransitional(virBufferPtr buf,
             tmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_RNG_TRANSITIONAL;
             ntmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_RNG_NON_TRANSITIONAL;
             break;
+        case VIR_DOMAIN_DEVICE_FS:
+            has_tmodel = model == VIR_DOMAIN_FS_MODEL_VIRTIO_TRANSITIONAL;
+            has_ntmodel = model == VIR_DOMAIN_FS_MODEL_VIRTIO_NON_TRANSITIONAL;
+            tmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_9P_TRANSITIONAL;
+            ntmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_9P_NON_TRANSITIONAL;
+            break;
 
         case VIR_DOMAIN_DEVICE_LEASE:
-        case VIR_DOMAIN_DEVICE_FS:
         case VIR_DOMAIN_DEVICE_INPUT:
         case VIR_DOMAIN_DEVICE_SOUND:
         case VIR_DOMAIN_DEVICE_VIDEO:
@@ -2742,7 +2747,10 @@  qemuBuildFSDevStr(const virDomainDef *def,
         goto error;
     }
 
-    if (qemuBuildVirtioDevStr(&opt, "virtio-9p", fs->info.type) < 0)
+    if (qemuBuildVirtioTransitional(&opt, "virtio-9p", qemuCaps,
+                                    fs->info.type,
+                                    fs->model, NULL,
+                                    VIR_DOMAIN_DEVICE_FS) < 0)
         goto error;
 
     virBufferAsprintf(&opt, ",id=%s", fs->info.alias);
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index a5491a1c0e..b7a1cbe2d1 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -681,7 +681,8 @@  qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
         break;
 
     case VIR_DOMAIN_DEVICE_FS:
-        /* the only type of filesystem so far is virtio-9p-pci */
+        if (dev->data.fs->model == VIR_DOMAIN_FS_MODEL_VIRTIO_TRANSITIONAL)
+            return pciFlags;
         return virtioFlags;
 
     case VIR_DOMAIN_DEVICE_NET: {
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
index e54fe53590..1de12a9828 100644
--- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
@@ -220,6 +220,8 @@ 
   <flag name='vhost-scsi-pci-non-transitional'/>
   <flag name='virtio-rng-pci-transitional'/>
   <flag name='virtio-rng-pci-non-transitional'/>
+  <flag name='virtio-9p-pci-transitional'/>
+  <flag name='virtio-9p-pci-non-transitional'/>
   <version>3001050</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>446361</microcodeVersion>
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 a7b663a728..60c84bee29 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
@@ -34,7 +34,8 @@  addr=0x1 \
 -device virtio-blk-pci,disable-legacy=on,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 \
+-device virtio-9p-pci,disable-legacy=on,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,\
+bus=pci.1,addr=0x0 \
 -netdev user,id=hostnet0 \
 -device virtio-net-pci,disable-legacy=on,netdev=hostnet0,id=net0,\
 mac=00:11:22:33:44:55,bus=pci.2,addr=0x0 \
diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
index e454eeadbd..8c571c04f1 100644
--- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
@@ -34,7 +34,8 @@  addr=0x1 \
 -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 \
+-device virtio-9p-pci-non-transitional,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.2,addr=0x0 \
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 6f07d5b707..8fbeb6e937 100644
--- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
+++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
@@ -25,21 +25,20 @@  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-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 \
+-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 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci,scsi=off,bus=pci.3,addr=0x2,drive=drive-virtio-disk0,\
+-device virtio-blk-pci,scsi=off,bus=pci.2,addr=0x3,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 \
+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.2,addr=0x1 \
 -netdev user,id=hostnet0 \
--device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.3,\
-addr=0x1 \
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.2,\
+addr=0x2 \
 -device vhost-scsi-pci,wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,\
-bus=pci.3,addr=0x3 \
+bus=pci.2,addr=0x4 \
 -object rng-random,id=objrng0,filename=/dev/urandom \
--device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.3,addr=0x4 \
+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.2,addr=0x5 \
 -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 43c1cafd45..eb8da465f6 100644
--- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
@@ -25,21 +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-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 \
+-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 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci-transitional,scsi=off,bus=pci.3,addr=0x2,\
+-device virtio-blk-pci-transitional,scsi=off,bus=pci.2,addr=0x3,\
 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 \
+-device virtio-9p-pci-transitional,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,\
+bus=pci.2,addr=0x1 \
 -netdev user,id=hostnet0 \
 -device virtio-net-pci-transitional,netdev=hostnet0,id=net0,\
-mac=00:11:22:33:44:55,bus=pci.3,addr=0x1 \
+mac=00:11:22:33:44:55,bus=pci.2,addr=0x2 \
 -device vhost-scsi-pci-transitional,wwpn=naa.5123456789abcde0,vhostfd=3,\
-id=hostdev0,bus=pci.3,addr=0x3 \
+id=hostdev0,bus=pci.2,addr=0x4 \
 -object rng-random,id=objrng0,filename=/dev/urandom \
--device virtio-rng-pci-transitional,rng=objrng0,id=rng0,bus=pci.3,addr=0x4 \
+-device virtio-rng-pci-transitional,rng=objrng0,id=rng0,bus=pci.2,addr=0x5 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2xmloutdata/virtio-transitional.xml b/tests/qemuxml2xmloutdata/virtio-transitional.xml
index 6e18c1c301..334cfaa6e4 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='0x03' slot='0x02' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
     </disk>
     <controller type='usb' index='0' model='none'/>
     <controller type='sata' index='0'>
@@ -30,40 +30,35 @@ 
       <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-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'>
+    <controller type='pci' index='2' 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='4' model='pcie-root-port'>
+    <controller type='pci' index='3' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='4' port='0xa'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+      <target chassis='3' port='0x9'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <filesystem type='mount' accessmode='passthrough' model='virtio-transitional'>
       <source dir='/export/fs1'/>
       <target dir='fs1'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
     </filesystem>
     <interface type='user'>
       <mac address='00:11:22:33:44:55'/>
       <model type='virtio-transitional'/>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' 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='0x03' slot='0x03' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
     </hostdev>
     <memballoon model='none'/>
     <rng model='virtio-transitional'>
       <backend model='random'>/dev/urandom</backend>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x04' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
     </rng>
   </devices>
 </domain>