[libvirt-users] Host should not touch passed-through USB device, how?

Hello list, this may be off topic but it is closely related to my Libvirt adventures so maybe you can help me. I want to pass a USB device (a USB Huawei E620 modem) through to a KVM guest. Pass-through in general works fine and the modem is visible in the guest. However, the host still sees it and sometimes tries to access it (such modems seem to also be USB storage devices). This naturally leads to conflicts and I believe this crashed the guest very badly yesterday. So I am looking for a way to make sure the host passes through the USB device (in its entirety) without trying to touch it and claim it as its own. Preferably without disabling the USB storage subsystem completely on the host. Any ideas? Is there a best practice for such things in the Libvirt world? Or any other world? Thanks! Andreas -- Andreas Ntaflos GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC 7E65 397C E2A8 090C A9B4

On 05/28/2010 02:09 PM, Andreas Ntaflos wrote:
Hello list,
this may be off topic but it is closely related to my Libvirt adventures so maybe you can help me.
I want to pass a USB device (a USB Huawei E620 modem) through to a KVM guest. Pass-through in general works fine and the modem is visible in the guest. However, the host still sees it and sometimes tries to access it (such modems seem to also be USB storage devices). This naturally leads to conflicts and I believe this crashed the guest very badly yesterday.
So I am looking for a way to make sure the host passes through the USB device (in its entirety) without trying to touch it and claim it as its own. Preferably without disabling the USB storage subsystem completely on the host.
Any ideas? Is there a best practice for such things in the Libvirt world? Or any other world?
For PCI devices, libvirt automatically performs a device reset and some other voodoo to make sure the host doesn't try to use the device. Maybe there is something similar that libvirt can do for USB devices as well? I'm not very knowledgable about that stuff so I can't say for certain. - Cole

On Tue, Jun 01, 2010 at 12:49:05PM -0400, Cole Robinson wrote:
On 05/28/2010 02:09 PM, Andreas Ntaflos wrote:
Hello list,
this may be off topic but it is closely related to my Libvirt adventures so maybe you can help me.
I want to pass a USB device (a USB Huawei E620 modem) through to a KVM guest. Pass-through in general works fine and the modem is visible in the guest. However, the host still sees it and sometimes tries to access it (such modems seem to also be USB storage devices). This naturally leads to conflicts and I believe this crashed the guest very badly yesterday.
So I am looking for a way to make sure the host passes through the USB device (in its entirety) without trying to touch it and claim it as its own. Preferably without disabling the USB storage subsystem completely on the host.
Any ideas? Is there a best practice for such things in the Libvirt world? Or any other world?
For PCI devices, libvirt automatically performs a device reset and some other voodoo to make sure the host doesn't try to use the device. Maybe there is something similar that libvirt can do for USB devices as well? I'm not very knowledgable about that stuff so I can't say for certain.
Yes there is the same. We need to finish implementing identical infrastructure to that used for PCI devices. We need to do resets and bind/unbind host device drivers, and implement the so called 'managed' mode. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Tuesday 01 June 2010 19:42:55 Daniel P. Berrange wrote:
So I am looking for a way to make sure the host passes through the USB device (in its entirety) without trying to touch it and claim it as its own. Preferably without disabling the USB storage subsystem completely on the host.
Any ideas? Is there a best practice for such things in the Libvirt world? Or any other world?
For PCI devices, libvirt automatically performs a device reset and some other voodoo to make sure the host doesn't try to use the device. Maybe there is something similar that libvirt can do for USB devices as well? I'm not very knowledgable about that stuff so I can't say for certain.
Yes there is the same. We need to finish implementing identical infrastructure to that used for PCI devices. We need to do resets and bind/unbind host device drivers, and implement the so called 'managed' mode.
Hi, thanks to both of you for your replies! Great to know you guys are working on it, but just to be clear: at the moment Libvirt does not yet see to it that USB devices are unbound from their drivers on the host? Do you have any idea how I could perform the necessary steps by myself so that my particular USB GSM modem is unbound from and not accessed by the host? I am not very familiar with USB device and driver management these days; it has just gotten too easy: plug the device in and wait for the desktop environment to do something :) Thanks again, Andreas -- Andreas Ntaflos Vienna, Austria GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC 7E65 397C E2A8 090C A9B4
participants (3)
-
Andreas Ntaflos
-
Cole Robinson
-
Daniel P. Berrange