See: https://fedoraproject.org/w/index.php?title=QA:Testcase_Virtualization_KVM_PCI_Device_Assignment_assign_using_libvirt If you attach a device to a guest in "managed" mode, then libvirt automatically detaches the device from the host before starting the guest, but it doesn't automatically do it when the guest shuts down This would be particularly noticeable if you were using virt-manager - you'd have to drop to the shell and do "virsh reattach" before you can use the device in the guest again. Granted, libvirtd might not even be running when the guest dies, but is there anything we can do here for the common case?
Agreed, it should reset the device after guest shutdown and then re-attach the host OS drivers. We should assume libvirtd is running at time of guest shutdown. Any scenario where it wouldn't be running is a bug.
NB, we need to be careful in the reset to avoid outstanding DMA ops clobbering the host OS memory - see this note from xen http://xenbits.xensource.com/xen-unstable.hg?rev/026957d523f9 This might mean we need KVM todo a FLR in the guest cleanup path ?
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
Patch committed upstream: http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=4035152a87
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.