[libvirt] More then one pci device possible with libvirt and pci passthrough?

Hi, i want to use more then one pci card in my debian guest. But when i start the guest, the log says: libvirtd: 15:44:55.459: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:05:01.0, not doing bus reset With "/usr/bin/qemu-system-x86_64 -m 512 -name test -hda /media/vm/test.img -boot c -vnc :2 -k de -pcidevice host=05:01.0 -pcidevice host=05:02.0 -pcidevice host=05:03.0" there seems to be no problems. How can i start my guest with three pci devices passed through and libvirt? My hostdev section in the xml looks like this: <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address domain='0x0000' bus='0x05' slot='0x01' function='0x0'/> </source> </hostdev> <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address domain='0x0000' bus='0x05' slot='0x02' function='0x0'/> </source> </hostdev> <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address domain='0x0000' bus='0x05' slot='0x03' function='0x0'/> </source> </hostdev> Greetings Mirko

On Sun, Jun 28, 2009 at 05:46:51PM +0200, Mirko Raasch wrote:
Hi,
i want to use more then one pci card in my debian guest.
But when i start the guest, the log says:
libvirtd: 15:44:55.459: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:05:01.0, not doing bus reset
IIUC, what libvirt is complaining about is that there are other devices in the PCI bus which are not associated with this guest, and thus there is no way to safely reset the device you are trying to assign, without endangering the host OS or other guest OS
With "/usr/bin/qemu-system-x86_64 -m 512 -name test -hda /media/vm/test.img -boot c -vnc :2 -k de -pcidevice host=05:01.0 -pcidevice host=05:02.0 -pcidevice host=05:03.0" there seems to be no problems.
How can i start my guest with three pci devices passed through and libvirt?
The difference is that when you launch QEMU manually there is no checking for whether the PCI devices are in use by other guests, or by the host OS. So while it may launch QEMU, it is not running safely, and eg, if your guest OS does a PCI bus reset it could kill/harm your host OS. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

None of the devices is in use by the host or an other guest.
On Sun, Jun 28, 2009 at 05:46:51PM +0200, Mirko Raasch wrote:
Hi,
i want to use more then one pci card in my debian guest.
But when i start the guest, the log says:
libvirtd: 15:44:55.459: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:05:01.0, not doing bus reset
IIUC, what libvirt is complaining about is that there are other devices in the PCI bus which are not associated with this guest, and thus there is no way to safely reset the device you are trying to assign, without endangering the host OS or other guest OS
With "/usr/bin/qemu-system-x86_64 -m 512 -name test -hda /media/vm/test.img -boot c -vnc :2 -k de -pcidevice host=05:01.0 -pcidevice host=05:02.0 -pcidevice host=05:03.0" there seems to be no problems.
How can i start my guest with three pci devices passed through and libvirt?
The difference is that when you launch QEMU manually there is no checking for whether the PCI devices are in use by other guests, or by the host OS. So while it may launch QEMU, it is not running safely, and eg, if your guest OS does a PCI bus reset it could kill/harm your host OS.
Regards, Daniel

Hi Mirko, On Sun, 2009-06-28 at 17:46 +0200, Mirko Raasch wrote:
Hi,
i want to use more then one pci card in my debian guest.
But when i start the guest, the log says:
libvirtd: 15:44:55.459: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:05:01.0, not doing bus reset
With "/usr/bin/qemu-system-x86_64 -m 512 -name test -hda /media/vm/test.img -boot c -vnc :2 -k de -pcidevice host=05:01.0 -pcidevice host=05:02.0 -pcidevice host=05:03.0" there seems to be no problems.
I'm afraid this is purely a limitation with the current code in qemu: /* For now, we just refuse to do a secondary bus reset * if there are other devices/functions behind the bus. * In future, we could allow it so long as those devices * are not in use by the host or other guests. */ if (pciBusContainsOtherDevices(conn, dev)) { VIR_WARN("Other devices on bus with %s, not doing bus reset", dev->name); return -1; } We also have a bug tracking this issue: https://bugzilla.redhat.com/499678 Fixes welcome! :-) Cheers, Mark.

Mark McLoughlin schrieb:
Hi Mirko,
On Sun, 2009-06-28 at 17:46 +0200, Mirko Raasch wrote:
Hi,
i want to use more then one pci card in my debian guest.
But when i start the guest, the log says:
libvirtd: 15:44:55.459: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:05:01.0, not doing bus reset
With "/usr/bin/qemu-system-x86_64 -m 512 -name test -hda /media/vm/test.img -boot c -vnc :2 -k de -pcidevice host=05:01.0 -pcidevice host=05:02.0 -pcidevice host=05:03.0" there seems to be no problems.
I'm afraid this is purely a limitation with the current code in qemu:
/* For now, we just refuse to do a secondary bus reset * if there are other devices/functions behind the bus. * In future, we could allow it so long as those devices * are not in use by the host or other guests. */ if (pciBusContainsOtherDevices(conn, dev)) { VIR_WARN("Other devices on bus with %s, not doing bus reset", dev->name); return -1; }
We also have a bug tracking this issue:
https://bugzilla.redhat.com/499678
Fixes welcome! :-)
Cheers, Mark.
Ok, without these lines it works with three devices in the guest.

Hi, i tried some pci devices in windows guest, but there are some problems. If i only use one pci card, i can install the driver in the guest and the device is working. If i want to use two or more pci devices in the guest, they are not usable, it means i can install the drivers, but the devices are not active in the device manager (yellow* exclamation mark)* If i install two ore more pci devices and pass through only one of them, its also not usable in the guest (yellow *exclamation mark)* Exists there some limitations in the usage of "PCI Passthrough"? (sorry for my bad english) Greetings Mirko
Hi Mirko,
On Sun, 2009-06-28 at 17:46 +0200, Mirko Raasch wrote:
Hi,
i want to use more then one pci card in my debian guest.
But when i start the guest, the log says:
libvirtd: 15:44:55.459: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:05:01.0, not doing bus reset
With "/usr/bin/qemu-system-x86_64 -m 512 -name test -hda /media/vm/test.img -boot c -vnc :2 -k de -pcidevice host=05:01.0 -pcidevice host=05:02.0 -pcidevice host=05:03.0" there seems to be no problems.
I'm afraid this is purely a limitation with the current code in qemu:
/* For now, we just refuse to do a secondary bus reset * if there are other devices/functions behind the bus. * In future, we could allow it so long as those devices * are not in use by the host or other guests. */ if (pciBusContainsOtherDevices(conn, dev)) { VIR_WARN("Other devices on bus with %s, not doing bus reset", dev->name); return -1; }
We also have a bug tracking this issue:
https://bugzilla.redhat.com/499678
Fixes welcome! :-)
Cheers, Mark.
participants (3)
-
Daniel P. Berrange
-
Mark McLoughlin
-
Mirko Raasch