From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT3L2-0002kn-IM for qemu-devel@nongnu.org; Tue, 22 Nov 2011 22:17:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RT3L1-0002S2-Fg for qemu-devel@nongnu.org; Tue, 22 Nov 2011 22:17:32 -0500 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:41792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT3L0-0002RD-Q2 for qemu-devel@nongnu.org; Tue, 22 Nov 2011 22:17:31 -0500 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 Nov 2011 03:15:03 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAN3GoOQ4694230 for ; Wed, 23 Nov 2011 14:16:57 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAN3GnLJ023824 for ; Wed, 23 Nov 2011 14:16:50 +1100 Message-ID: <4ECC659D.6080000@linux.vnet.ibm.com> Date: Wed, 23 Nov 2011 11:16:45 +0800 From: hkran MIME-Version: 1.0 References: <4ECB643D.10308@linux.vnet.ibm.com> <4ECB9738.1000506@redhat.com> In-Reply-To: <4ECB9738.1000506@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Implement the function usb_hub_handle_reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel , Stefan Hajnoczi On 11/22/2011 08:36 PM, Gerd Hoffmann wrote: > On 11/22/11 09:58, hkran wrote: >> Implement the function usb_hub_handle_reset. without it the guest >> propablly fail to configure the usb device attached to the virtulized >> hub with a correct address. >> >> Typically, attaching more than one usb devices when lauch qemu may lead >> to the problem. > What is the exact problem you are trying to fix? > > cheers, > Gerd > > For example, I use the following command line to lautch qemu to play win7 /home/huikai/qemu10/bin/qemu-system-x86_64 -enable-kvm -m 1024 -drive file=/root/win7_86.img,if=ide -net user -net nic,model=rtl8139 -localtime -chardev stdio,id=muxstdio -mon chardev=muxstdio -usb -usbdevice tablet -spice port=2345,disable-ticketing -cdrom /home/guest/Fedora-15-i686-Live-Desktop.iso -boot once=d -usbdevice host:0000:7777 Here, I attatched two usbdevice tablet and a usb storage device "host:0000:7777" on the host side. After guest have booted.there will not see the usb storage device. using monitor cmd "info usb" found the below: (qemu) info usb Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet Device 0.3, Port 2, Speed 12 Mb/s, Product QEMU USB Hub Device 0.3, Port 2.1, Speed 480 Mb/s, Product host:2.4 the device "host:0000:7777" have not been configured successfully, guest OS can not to see it. I traced qemu and found that there will be several reset cmd issued by the guest usb protocol stack during win7 booting, if we left the hub_reset to do nothing, the usbdevice attached to it will fail to be configured just in above case. (If we "hot plug-in " a usb device via qemu's monitor, the problem is not so easy to be reproduced because the reset cmd only be issued only once or none) (the problem is not always reproduced, but high possibility).