Created attachment 342865 [details] lspci -tv While testing virt-manager's device assignment with the following steps: * Run virt-manager, open an existing guest and go to the details tab * Click "Add hardware", choose "Physical host device" and click "Forward" * Choose the appropriate device from the drop down list (This is the second LOM): "01:00.1 NetXtreme II BCM5716 Gigabit Ethernet" * Click "Forward" and "Finish" and it failed with: Uncaught error adding device: Could not detach PCI device: this function is not supported by the hypervisor: No PCI reset capability available for 0000:01:00.1 Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/addhardware.py", line 571, in finish self.add_hostdev() File "/usr/share/virt-manager/virtManager/addhardware.py", line 607, in add_hostdev self._dev.setup() File "/usr/lib/python2.6/site-packages/virtinst/VirtualHostDevice.py", line 208, in setup raise RuntimeError(_("Could not detach PCI device: %s" % str(e))) RuntimeError: Could not detach PCI device: this function is not supported by the hypervisor: No PCI reset capability available for 0000:01:00.1 I will test this with another network card.
I am using python-virtinst-0.400.3-8.fc11
charles: could you attach the output of "lspci -vvv" and "lspi -t -v" ? Are there any libvirtd messages output to /var/log/messages at the time? it looks like this is one function of a multi-function PCI device, and you're hitting this case: /* Secondary Bus Reset is our sledgehammer - it resets all * devices behind a bus. */ static int pciTrySecondaryBusReset(virConnectPtr conn, pciDevice *dev) { ... /* 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; } or this case: /* Power management reset attempts to reset a device using a * D-state transition from D3hot to D0. Note, in detect_pm_reset() * above we require the device supports a full internal reset. */ static int pciTryPowerManagementReset(virConnectPtr conn, pciDevice *dev) { ... /* For now, we just refuse to do a power management reset * if there are other functions on this device. * In future, we could allow it so long as those functions * are not in use by the host or other guests. */ if (pciDeviceContainsOtherFunctions(conn, dev)) { VIR_WARN("%s contains other functions, not resetting", dev->name); return -1; } We need to improve this code so that it will reset reset a function, even if the reset affects other functions/devices, so long as the device has been detached in the host and is not in use by any other guest
clarifying ... before we can reset: 1) a function on a multi-function device, using PM reset 2) a device sharing a bus with other devices, using a bus reset we must check that the other affected functions/devices: a) are detached in the host - i.e. bound to pci-stub b) not in use by any other guest c) not in use by this guest, in the case of hotplug
Created attachment 342879 [details] lspci -vvv
Created attachment 342887 [details] Syslog with virsh nodedev-reset
Created attachment 342889 [details] Syslog with virt-manager PCI Assignment
Right, there we go - libvirt wants to do a Secondary Bus Reset, but it can't because it would also reset the other port on the broadcom NIC: warning : Other devices on bus with 0000:01:00.1, not doing bus reset By the way, even if we fix libvirt as I describe above, you will not be able to use one port in the guest while the other port is in use by the host or another guest
Urgh, we really ought to get this kind of message back to the application The error reported is: "Could not detach PCI device: this function is not supported by the hypervisor: No PCI reset capability available for 0000:01:00.1" It should really have said something more like "Could not detach PCI device: Other in-use devices on the same bus as device 0000:01:00.1, and FLR is not available"
(In reply to comment #8) > It should really have said something more like > > "Could not detach PCI device: Other in-use devices on the same bus as device > 0000:01:00.1, and FLR is not available" Agreed it should be better, all the possible reasons are: 1) device doesn't implement FLR 2) can't use bus reset because it affects other devices 3) device doesn't implement PM reset 4) can't use PM reset on multi-function device 5) something went wrong doing FLR, SBR or PMR
Additinal info to the issue: I updated the packages again today. Added a Intel dual port NIC. Tried adding this add-on NIC to a guest. I got the same error as before. Tried, resetting the NIC from virtual shell, I got the same error. (No PCI reset capability available for 0000:84:00.0) Am attaching lspci outputs of my config.
Created attachment 343051 [details] lspci -t -v output
Created attachment 343052 [details] lspci -vvv output
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle. Changing version to '11'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Upstream fix for this: http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=6318808270 http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=c106c8a18c
libvirt-0.6.2-16.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/libvirt-0.6.2-16.fc11
libvirt-0.6.2-17.fc11 has been pushed to the Fedora 11 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update libvirt'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8790
libvirt-0.6.2-17.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.