[CentOS-virt] Hot adding USB devices to guests at a fixed address

Stephen Harris lists at spuddy.org
Wed Nov 27 21:50:33 UTC 2013

On Tue, Nov 26, 2013 at 11:45:43AM -0500, R P Herrold wrote:
> On Tue, 26 Nov 2013, Stephen Harris wrote:
> >   % cat /etc/udev/rules.d/90-owon.rules 
> >   ACTION=="add", \
> >     SUBSYSTEM=="usb", \
> >     SYSFS{idVendor}=="5345", \
> >     SYSFS{idProduct}=="1234", \
> >     RUN+="/usr/bin/virsh attach-device XP_VM1 /etc/libvirt/HotPlug/owon.xml"
> > Now this works; I plug the device in and the guest sees it.
> most USB persistent enumeration are done by the device serial 
> number, which should appear along with the Vendor and Product.
> Can you expose that through the udev rules as well?

udev merely triggers virsh to expose the device; the actual connection
of the device into the VM is done by the "attach-device" rule.

However I don't seem to be able to see the serial number inside the VM
and I can't work out how to expose it.




More information about the CentOS-virt mailing list