qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V4 09/12] hw/sd.c: convert SD state to QOM objec


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH V4 09/12] hw/sd.c: convert SD state to QOM object
Date: Tue, 31 Jul 2012 17:17:39 +0100

On 31 July 2012 16:29, Markus Armbruster <address@hidden> wrote:
> Igor Mitsyanko <address@hidden> 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



reply via email to

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