我在Linux服务器上有以下USB设备:
# lsusb -t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M |__ Port 2: Dev 3, If 0, Class=HID, Driver=usbfs, 1.5M |__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M |__ Port 1: Dev 8, If 0, Class=print, Driver=usbfs, 12M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M
我想将整个USB集线器(Dev 4)传递给Windows XP guest虚拟机。 在这个连接和移动到集线器的设备应由客人自动处理(右?)。
我用virsh attach-device尝试了下面的代码:
<hostdev mode='subsystem' type='usb' managed='yes'> <source> <address type='usb' bus='0x002' port='1.3' /> </source> </hostdev>
但它没有工作:
error: Failed to attach device from attach_hub.xml error: internal error usb address needs device id
我究竟做错了什么?
xml for hub: https : //libvirt.org/formatdomain.html#elementsHub
一个例子:
<hub type='usb'> <address type='usb' bus='0' port='1'/> </hub>
https://www.redhat.com/archives/libvir-list/2011-August/msg00816.html
如果有人仍然在寻找,请使用以下格式:
<address type='usb' bus='0' device='1'/>
设备条目对应于lsusb -t输出的“Dev”条目