qdev: create default bus names.
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 15 Jul 2009 11:59:24 +0000 (13:59 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 27 Jul 2009 13:39:29 +0000 (08:39 -0500)
commit9a87a11bf8e53c4ea61a48144169239df97d03b4
treed970ac5d39660127b33ad3b2a58e346085b79b39
parentd1eef853f39bd59d82066854c4f589861f29e401
qdev: create default bus names.

Create a default bus name if none is passed to qbus_create().

If the parent device has DeviceState->id set it will be used to create
the bus name,. i.e. -device lsi,id=foo will give you a scsi bus named
"foo.0".

If there is no id BusInfo->name (lowercased) will be used instead, i.e.
-device lsi will give you a scsi bus named "scsi.0".

A scsi adapter with two scsi busses would have "scsi.0" and "scsi.1" or
"$id.0" and "$id.1" busses.  The numbers of the child busses are per
device, i.e. when adding two lsi adapters both will have a "*.0" child
bus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/qdev.c
hw/qdev.h