On 31 July 2012 16:29, Markus Armbruster <arm...@redhat.com> wrote: > Igor Mitsyanko <i.mitsya...@samsung.com> writes: >> QEMU requires all objects derived from TYPE_DEVICE to be connected to >> some bus, if no bus was specified in new object class description, >> QEMU practically assumes this object to be a sysbus device and >> connects it to main system bus. >> A while ago it wasn't even possible to create a class directly derived >> from DEVICE_CLASS without tying this class to some bus, QEMU would >> have abort() during initialization. Now, after "bus_info" member was >> removed from DeviceClass structure, it became possible, but still, it >> most definitely will cause errors because QEMU will assume such an >> object to be a SysBusDevice. For example, sysbus_dev_print() (called >> by "info qtree" monitor command) directly casts DeviceState object to >> SysBusDevice without checking if it is actually possible. > > I'm afraid the first few device models that don't connect to a qbus are > bound to flush out a few bugs. Nevertheless, device models should be > subtypes of TYPE_DEVICE, shouldn't they? Anthony?
Sounds right to me. Added bonus, we can use nice APIs for declaring and setting properties (qdev_prop_set_*) rather than nasty ones (object_property-set_*) :-) -- PMM