From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uwp0E-0000el-UA for qemu-devel@nongnu.org; Wed, 10 Jul 2013 03:39:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uwp0D-0005Wc-E8 for qemu-devel@nongnu.org; Wed, 10 Jul 2013 03:39:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uwp0D-0005WU-6M for qemu-devel@nongnu.org; Wed, 10 Jul 2013 03:39:53 -0400 Message-ID: <51DD0FC3.3040402@redhat.com> Date: Wed, 10 Jul 2013 09:39:47 +0200 From: Hans de Goede MIME-Version: 1.0 References: <51DA82BA.9040102@suse.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qeustion] USB passthough doesn't work on Windows. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Geunhae Lee Cc: Gerd Hoffmann , =?ISO-8859-1?Q?Andreas_F=E4rber?= , qemu-devel@nongnu.org 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