On Mon, Dec 03, 2012 at 12:10:02PM +0000, Peter Maydell wrote: >On 3 December 2012 11:58, walimis <walimis...@gmail.com> wrote: >> For example, xilinx_zynq has two EHCI controllers. If I specify a usb >> device of type "usb-storage", the question is: which EHCI controller does the >> usb device attach to? The answer is dependent. >> >> 1. If I use "usbdevice" and pass the host usb device, such as: >> >> $ qemu -usb -usbdevice host:xxxx:xxxx >> >> The device will attach to the first EHCI controller. >> >> 2. If I use "device" and "usb-storage", such as: >> >> $ qemu -usb -device usb-storage,drive=ud -drive >> id=ud,file=usbdisk.img,if=none >> >> The device will attach to the second EHCI controller. > >This is a long standing bug which is caused by the legacy >-usbdevice search looking through the list of usb buses >in one direction, and the generic -device code looking >through it in the other direction: > >http://lists.gnu.org/archive/html/qemu-devel/2011-06/msg00926.html > >> Qemu doesn't provide some properties, such as "bus", to specify which EHCI >> controller the >> usb device attach to. If we use "device" and "usb-storage", we never attach >> the usb >> device to the specified EHCI controller. > >-device certainly ought to let you specify a bus= property;
Sorry, I don't know the bus= property. But why both EHCI controller are named "usb-bus.0"? How to distinguish the different usb usb? Liming Wang >you want to be able to specify the USB controller regardless >of whether we sort out the ordering mess. If that doesn't >work then we have a different bug. > >-- PMM