On Fri, Aug 22, 2014 at 01:18:51PM +0200, VISEUR Eric wrote:
Hi,
Sorry, forgot that bit. Guess holidays made me lose some habits :)
QEMU: 2.1.0-4.fc20
Libvirt: 1.2.7-2.fc20
Virt-manager: 1.0.1-3.fc20
All from the fedora-virt-preview repo.
Hmm, I just tested and I could reproduce what you're seeing, with these
versions:
$ rpm -q qemu libvirt; uname -r
qemu-2.1.0-5.fc22.x86_64
libvirt-1.2.7-2.fc22.x86_64
3.15.6-200.fc20.x86_64
That's my USB device on host:
$ lsusb | grep SanDisk
Bus 001 Device 037: ID 0781:5567 SanDisk Corp. Cruzer Blade
I could see the USB device listed in the guest XML:
$ virsh dumpxml f20vm | grep -i hostdev
<hostdev mode='subsystem' type='usb' managed='yes'>
<alias name='hostdev0'/>
</hostdev>
From the guest log:
$ tail /var/log/libvirt/qemu/f20vm.log
libusb: error [_get_usbfs_fd] libusb couldn't open USB device
/dev/bus/usb/001/037: Permission denied
Check the device file owner:
$ ls -lsrt /dev/bus/usb/001/037
0 crw-rw-r--. 1 root root 189, 36 Aug 23 11:01 /dev/bus/usb/001/037
Just to test, I changed the device's owner to QEMU:
$ chown qemu: /dev/bus/usb/001/037
$ ls -lZ /dev/bus/usb/001/037
crw-rw-r--. qemu qemu system_u:object_r:usb_device_t:s0
/dev/bus/usb/001/037
Then remove the USB device from virt-manager, and re-add it (and check
the device permission again that it reflects QEMU), I see the same error
in the guest log. (SELinux was in permissive.)
Still have to investigate further, though.
--
/kashyap
-----Original Message-----
From: Kashyap Chamarthy [mailto:kchamart@redhat.com]
Sent: 22 August, 2014 12:09
To: VISEUR Eric
Cc: virt(a)lists.fedoraproject.org
Subject: Re: [fedora-virt] USB passthrough stopped working
On Fri, Aug 22, 2014 at 11:27:55AM +0200, VISEUR Eric wrote:
> Hi,
>
> I've just reinstalled a computer with F20 and virt-preview and noticed
> USB passthrough doesn't work with QEMU/KVM. I add the device using
> virt-manager.
No direct answer to your question, but explicitly spelling out versions of QEMU, libvirt
and virt-manager will be useful for anyone who wants to reproduce your issue.
>
>
> · The device indeed appears in the XML declaration after I add
> it;
>
> · Qemu instances are created under the qemu user;
>
> · Qemu.conf wasn't modified;
>
> · The device remains owned by root;
>
> · The VM libvirt log signals a libusb error: libusb requires
> write access to USB device nodes.
>
> Is it a known problem ?
>