Red Hat Bugzilla – Bug 1028629
virsh nodedev-detach fails if device has no driver
Last modified: 2013-11-12 10:15:05 EST
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):
Steps to Reproduce:
1. Find or create a device with no drivers
2. Attempt to use virsh to detach it from the host
Does not work
Device moved to requested driver regardless of having an initial driver.
This should be fixed upstream by the following commit:
Author: Michal Privoznik <firstname.lastname@example.org>
AuthorDate: Thu Oct 31 10:32:58 2013 +0000
Commit: Michal Privoznik <email@example.com>
CommitDate: Mon Nov 4 17:28:51 2013 +0100
virpci: Don't error on unbinded devices
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 <firstname.lastname@example.org>
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