-usb \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
--device vfio-pci,host=55aa:20:0f.3,id=hostdev0,bus=pci.0,addr=0x3 \
+-device vfio-pci,host=0021:de:1f.1,id=hostdev0,bus=pci.0,addr=0x3 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
- <address domain='0x55aa' bus='32' slot='15' function='3'/>
+ <address domain='0x0021' bus='222' slot='31' function='1'/>
</source>
</hostdev>
<memballoon model='virtio'/>
-usb \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
--device vfio-pci,host=0000:06:12.5,id=hostdev0,bus=pci.0,addr=0x3 \
+-device vfio-pci,host=0000:06:12.1,id=hostdev0,bus=pci.0,addr=0x3 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
- <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
+ <address domain='0x0000' bus='0x06' slot='0x12' function='0x1'/>
</source>
</hostdev>
<memballoon model='virtio'/>
<interface type='hostdev' managed='yes'>
<mac address='00:11:22:33:44:55'/>
<source>
- <address type='pci' domain='0x0000' bus='0x03' slot='0x07' function='0x1'/>
+ <address type='pci' domain='0x0000' bus='0x06' slot='0x12' function='0x1'/>
</source>
<model type='virtio'/>
<filterref filter='myfilter'/>
-usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
--device vfio-pci,host=0000:03:07.1,id=hostdev0,bus=pci.0,addr=0x3 \
+-device vfio-pci,host=0000:06:12.1,id=hostdev0,bus=pci.0,addr=0x3 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
<mac address='00:11:22:33:44:55'/>
<driver name='vfio'/>
<source>
- <address type='pci' domain='0x0000' bus='0x03' slot='0x07' function='0x1'/>
+ <address type='pci' domain='0x0000' bus='0x06' slot='0x12' function='0x1'/>
</source>
<vlan>
<tag id='42'/>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
- <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
+ <address domain='0x0000' bus='0x06' slot='0x12' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</hostdev>
<mac address='00:11:22:33:44:55'/>
<driver name='vfio'/>
<source>
- <address type='pci' domain='0x0000' bus='0x03' slot='0x07' function='0x1'/>
+ <address type='pci' domain='0x0000' bus='0x06' slot='0x12' function='0x1'/>
</source>
<vlan>
<tag id='42'/>
int device;
int klass;
int iommuGroup;
+ const char *physfn;
struct pciDriver *driver; /* Driver attached. NULL if attached to no driver */
};
make_symlink(devsympath, devid, tmp);
+ if (dev->physfn) {
+ if (snprintf(tmp, sizeof(tmp),
+ "%s%s/devices/%s", fakerootdir,
+ SYSFS_PCI_PREFIX, dev->physfn) < 0) {
+ ABORT("@tmp overflow");
+ }
+ make_symlink(devpath, "physfn", tmp);
+ }
+
if (pci_device_autobind(dev) < 0)
ABORT("Unable to bind: %s", devid);
MAKE_PCI_DEVICE("0000:0a:01.0", 0x8086, 0x0047, 8);
MAKE_PCI_DEVICE("0000:0a:02.0", 0x8286, 0x0048, 8);
MAKE_PCI_DEVICE("0000:0a:03.0", 0x8386, 0x0048, 8);
+ MAKE_PCI_DEVICE("0000:06:12.0", 0x8086, 0x0047, 9);
+ MAKE_PCI_DEVICE("0000:06:12.1", 0x8086, 0x0047, 10,
+ .physfn = "0000:06:12.0"); /* Virtual Function */
+ MAKE_PCI_DEVICE("0000:06:12.2", 0x8086, 0x0047, 11,
+ .physfn = "0000:06:12.0"); /* Virtual Function */
+ MAKE_PCI_DEVICE("0021:de:1f.0", 0x8086, 0x0047, 12);
+ MAKE_PCI_DEVICE("0021:de:1f.1", 0x8086, 0x0047, 13,
+ .physfn = "0021:de:1f.0"); /* Virtual Function */
+
}