qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Geunhae Lee <chris2nd@gmail.com>
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qeustion] USB passthough doesn't work on Windows.
Date: Wed, 10 Jul 2013 09:39:47 +0200	[thread overview]
Message-ID: <51DD0FC3.3040402@redhat.com> (raw)
In-Reply-To: <CAEr0F9TO4y3O4f4uM0Ompdtm68FJ7Ho2bJ7muVkAei5JFQ1wyA@mail.gmail.com>

Hi,

On 07/08/2013 05:08 PM, Geunhae Lee wrote:
> hi thanks for you kind answer,
> admit about lacking of infos haha..
>
> here's my situations.
>
> 1. i currently use QEMU ver 1.2, but plan to upgrade to 1.5 soon.
> 2. in version 1.2, i found that USB passthrough is not supported on Windows/Mac.
>      In version 1.5, however, it seems possible to use passthrough by re-implementing usb host (libusb)  , right?

libusb already is ported to windows and darwin, but support there is limited, mostly
because the OS tends to get in the way a lot more there then under Linux.

In general under Windows it requires uninstalling the windows driver for the device, and
replacing it with one of 3 supported generic usb drivers: winusb, libusb0 or libusbk.

Under Darwin there is a standard API for accessing USB devices from userspace (like under
Linux), and just like under Linux the native device driver needs to be detached first.

The problem is that unlike under Linux, the native driver can refuse to be detached, and
many drivers have stub code for this functionality like this:

int detach_driver(...)
{
     return -EPERM;
}

IOW most Darwin drivers refuse to be detached from their device, making it impossible to
redirect them. This can be circumvented by first replacing the driver with a so called
codeless kext.

So all in all doing usb redirection under Windows and Mac OS X is far from trivial, on paper
it is supported with the new libusb host redirection code, but the user will likely need
to first swap drivers manually before a device can be redirected (and then manually swap them
back to give the device back to the host os later).

>      but i didn't find out any former work which uses USB passthrough on Windows and Mac
>
>   so my questions are 2 followings.
>
> 1.  is there any articles about using USB passthrough on Windows and MAC

No.

> 2.  do you guys have some performance issues?
>       -  libusb vs former implementation (qemu ver 1.2)

libusb's passthrough performance under Linux should be identical (and in some cases slightly
better) then the DIY code we were using before.

Regards,

Hans

  parent reply	other threads:[~2013-07-10  7:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08  8:25 [Qemu-devel] [Qeustion] USB passthough doesn't work on Windows Geunhae Lee
2013-07-08  9:13 ` Andreas Färber
2013-07-08 15:08   ` Geunhae Lee
2013-07-08 15:11     ` Geunhae Lee
2013-07-10  7:39     ` Hans de Goede [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-07-10 13:37 Geunhae Lee
2013-07-11 10:01 ` Hans de Goede

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=51DD0FC3.3040402@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=afaerber@suse.de \
    --cc=chris2nd@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).