Description of problem: If I have an Nvidia graphics card with nouveau blacklisted in the host then the device will have no "driver" entry in sysfs. If I then try to make use of it with libvirt, I get: # virsh nodedev-detach pci_0000_01_00_0 --driver=vfio error: Failed to detach device pci_0000_01_00_0 error: internal error: Invalid device 0000:01:00.0 driver file /sys/bus/pci/devices/0000:01:00.0/driver is not a symlink If the device is already attached to a driver like pci-stub, then the above will succeed and move the device to vfio-pci. This does not seem to be specific to vfio support, --driver=kvm behaves the same. Version-Release number of selected component (if applicable): 1.1.4-1.fc20.x86_64 How reproducible: always Steps to Reproduce: 1. Find or create a device with no drivers 2. Attempt to use virsh to detach it from the host 3. Actual results: Does not work Expected results: Device moved to requested driver regardless of having an initial driver. Additional info:
This should be fixed upstream by the following commit: commit df4283a55bf3516b333352e2052dbe3317936953 Author: Michal Privoznik <mprivozn> AuthorDate: Thu Oct 31 10:32:58 2013 +0000 Commit: Michal Privoznik <mprivozn> CommitDate: Mon Nov 4 17:28:51 2013 +0100 virpci: Don't error on unbinded devices https://bugzilla.redhat.com/show_bug.cgi?id=1018897 If a PCI deivce is not binded to any driver (e.g. there's yet no PCI driver in the linux kernel) but still users want to passthru the device we fail the whole operation as we fail to resolve the 'driver' link under the PCI device sysfs tree. Obviously, this is not a fatal error and it shouldn't be error at all. Signed-off-by: Michal Privoznik <mprivozn> v1.1.4-15-gdf4283a
I've pushed that patch to the libvirt 1.1.3 maint branch (the f20 version). The initial report is against the virt-preview/rawhide version though, and that's where the GPU passthrough testing is currently happening, so I'll do a rawhide build with the fix for now. The next maint release will pick it up for F20.
Fixed in libvirt-1.1.4-2.fc21