From: Gerd Hoffmann <kraxel@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: Linqiangmin <linqiangmin@huawei.com>,
Hans de Goede <hdegoede@redhat.com>,
Luonengjun <luonengjun@huawei.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Huangweidong (Hardware)" <huangweidong@huawei.com>
Subject: Re: [Qemu-devel] usb: a problem of using libusb for usb pass through
Date: Mon, 22 Jul 2013 14:58:59 +0200 [thread overview]
Message-ID: <51ED2C93.5050103@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF190207EF5D6D2@szxeml538-mbx.china.huawei.com>
On 07/16/13 10:45, Gonglei (Arei) wrote:
> Hi, Gerd
> My Qemu version is 1.5.1, and use libusb for usb pass through.
> I pass through a host usb device to the guest by bus number and physical port, when I unplug the usb device from
> the host, and plug in on the same physical port immediately, but the usb device don't show up in the guest.
> The qemu log show:
> libusb_release_interface: -4 [NO_DEVICE]
> libusbx: error [_get_usbfs_fd] libusbx couldn't open USB device /dev/bus/usb/002/004: No such file or directory
> libusbx: error [_get_usbfs_fd] libusbx couldn't open USB device /dev/bus/usb/002/004: No such file or directory
> libusbx: error [_get_usbfs_fd] libusbx couldn't open USB device /dev/bus/usb/002/004: No such file or directory
>
> I find the reason is that the global libusb_context has recorded the usb devices' devnum, but when the host device was unplugged and plugged
> from the host, the devnum will change, finally cause the problem.
> Any ideas ? Thanks!
Sounds like libusbx doesn't flush the cache on unplug even though it
should. Hans?
[ qemu uses one global libusb_context. libusb_device and
libusb_device_handle are allocated and released on open/close ]
cheers,
Gerd
next prev parent reply other threads:[~2013-07-22 13:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 8:45 [Qemu-devel] usb: a problem of using libusb for usb pass through Gonglei (Arei)
2013-07-22 12:58 ` Gerd Hoffmann [this message]
2013-07-25 13:21 ` Gonglei (Arei)
2013-07-30 17:13 ` Hans de Goede
2013-07-30 17:15 ` Hans de Goede
2013-07-31 9:47 ` Gerd Hoffmann
2013-08-01 1:24 ` Gonglei (Arei)
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=51ED2C93.5050103@redhat.com \
--to=kraxel@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=hdegoede@redhat.com \
--cc=huangweidong@huawei.com \
--cc=linqiangmin@huawei.com \
--cc=luonengjun@huawei.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).