qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] inconsistency between device traversal in qdev and legacy
@ 2011-06-08 15:07 Peter Maydell
  2011-06-08 17:00 ` Gerd Hoffmann
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2011-06-08 15:07 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Markus Armbruster

If you have a model with more than one USB bus, and you
create a USB device on the command line without specifying
which bus to plug it into, QEMU will choose a different bus
depending on whether you use the legacy "-usbdevice keyboard"
or the qdev "-device usb-kbd".

This is because the legacy option finds the USB bus with
usb_bus_find(), which searches the 'busses' list, which is
populated by usb_bus_new(), with each new bus added to the
tail of the list. The qdev option looks for the USB bus
with qbus_find_recursive(), which walks the qdev tree.
Since qbus_create_inplace() adds each new child bus to
the front of the parent's child_bus list, this means that
qbus_find_recursive() will encounter the last-added bus
first, whereas usb_bus_find() will get the first-added bus.

I assume this is likely to apply to other bus types as well.

Is there anything we can do to fix this inconsistency [*],
or are we tied to the existing enumeration orders in both
cases for compatibility with users with currently-working
command lines or configurations?

[*] the actual code changes are simple enough, obviously

-- PMM

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-06-09 14:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08 15:07 [Qemu-devel] inconsistency between device traversal in qdev and legacy Peter Maydell
2011-06-08 17:00 ` Gerd Hoffmann
2011-06-08 17:37   ` Andreas Färber
2011-06-08 17:39     ` Peter Maydell
2011-06-08 18:19       ` Rob Landley
2011-06-08 19:06       ` Andreas Färber
2011-06-09 13:59   ` Markus Armbruster
2011-06-09 14:12     ` Gerd Hoffmann
2011-06-09 14:32     ` Peter Maydell

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).