qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] USB problem in QEMU


From: Yu, Xiaoyang
Subject: [Qemu-devel] USB problem in QEMU
Date: Thu, 5 Apr 2007 15:23:52 +0800

Hi guys,

 

The USB problem I met is that using some kind of USB disks will cause guest OS run extremely slow, while these disks can work properly in host OS. It looks like the USB simulation in QEMU is not fully featured, and can not handle some error conditions properly.

 

Below are the /proc/bus/usb/devices information in the host OS for four type of USB disks. The first two disks can work properly in guest OS; while the last two disks will cause the gust OS extremely slow (like not responding).

 

The /proc/bus/usb/devices information in host OS for USB disks which works properly in guest OS:

===============================================================================================

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0

D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=1043 ProdID=8006 Rev= 1.00

S:  Manufacturer=Generic

S:  Product=Flash Disk

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

 

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  6 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=0930 ProdID=6533 Rev= 1.00

S:  Manufacturer=Kingston

S:  Product=DataTraveler 2.0

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=31875us

E:  Ad=83(I) Atr=03(Int.) MxPS=   8 Ivl=64ms

 

 

The /proc/bus/usb/devices information in host OS for USB disks which does not work properly in guest OS:

======================================================================================================================

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0

D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=0ed1 ProdID=6680 Rev= 1.00

S:  Manufacturer=Generic

S:  Product=Mass Storage Device

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 50mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

 

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  4 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=0204 ProdID=6025 Rev= 1.00

S:  Manufacturer=USB0612

S:  Product=Flash Disk

S:  SerialNumber=335657409262

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

 

To get more information, I turned on the DEBUG_PACKET macro in xen/tools/ioemu/hw/usb-uhci.c to get QEMU log messages. The logs contain the UHCI packets. You may kindly find the log files in the attachment. “log.good” is the log file for inserting a “good” disk which works properly in guest OS. “log.bad” is the log file for inserting a “bad” disk which cause the guest OS not responding.

 

We analyzed the log files.

 

In line 149 of “log.bad”, there is a “ret=-3”, which means there was error sending the SETUP packet to endpoint 0. There are also errors for receiving IN packets from endpoint 0.

 

In line 247 of “log.bad”, there is a “handle_data: errno=32”, which means a “broken pipe” error. Then from line 255 of “log.bad”, there are lots of “ret=-2” error for receiving IN packets from endpoint 2.

 

For compare, we used Device Monitoring Studio to log the URBs on Windows XP host OS when inserting the “bad” USB disk. You may check it in the attachment as “usb.htm”. In record 000061 of “usb.htm”, there is a “Reset Pipe” URB message.

 

Compare “log.bad” and “usb.htm”, we guess maybe the QEMU do not send “Reset Pipe” message upon a “broken pipe” error.

 

Any instructions or comments will be much appreciated.

 

Regards

Xiaoyang

Attachment: log files.zip
Description: log files.zip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]