public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Jaap Winius <jwinius@umrk.nl>
Cc: kvm@vger.kernel.org
Subject: Re: Constantly changing USB product ID
Date: Wed, 28 Mar 2012 16:27:46 +0200	[thread overview]
Message-ID: <4F731FE2.1060207@redhat.com> (raw)
In-Reply-To: <20120327174835.1167690z7ttpckw8@bitis.umrk.nl>

On 03/27/12 17:48, Jaap Winius wrote:
> Hi folks,
> 
> Recently I learned how to configure KVM with USB pass-though
> functionality. In my case I configured my guest domain with this block
> of code:
> 
>     <hostdev mode='subsystem' type='usb' managed='yes'>
>       <source>
>         <vendor id='0x0c93'/>
>         <product id='0x1772'/>
>         <address bus='1' device='4'/>
>       </source>
>     </hostdev>
> 
> At first this worked fine, but then later the guest domain refused to
> start because the USB device was absent.

Not sure what libvirt does there, but qemu can handle this just fine.
If you add '-device usb-host,vendorid=0x0c93,productid=0x1772' qemu will
start just fine no matter if the device is present or not.  You can plug
in in and out as you like and it will show up in the guest when plugged in.

Might be a some security thing, when running qemu depriviledged and
selinux-controlled libvirt probably has to make sure the files in
/dev/bus/usb/ have correct permissions and labels.

> When I checked, I found that
> its product ID had mysteriously changed to 1771. Later it was back at
> 1772. Now it appears that the USB device I am dealing with has a product
> ID that changes back and forth between 1771 and 1772 at random.

Guess it has two modes, one "real" and one "install" where it presents
itself as mass storage device with windows drivers.

> Apparently, the Windows program running on the guest domain is designed
> to deal with this nonsense, but the question is, Can KVM be configured
> to deal with it? Something like <product id='0x177*'/> would be useful,
> but that doesn't work.

qemu is fine with '-device usb-host,vendorid=0x0c93' which will match
any product with from that vendor.  Dunno about the libvirt side.

cheers,
  Gerd


      parent reply	other threads:[~2012-03-28 14:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 15:48 Constantly changing USB product ID Jaap Winius
2012-03-28 12:41 ` Avi Kivity
2012-03-28 12:42   ` Avi Kivity
2012-03-28 14:27 ` Gerd Hoffmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F731FE2.1060207@redhat.com \
    --to=kraxel@redhat.com \
    --cc=jwinius@umrk.nl \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox