[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 04/15] ssi: Added create_slave_no_init()
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH v5 04/15] ssi: Added create_slave_no_init() |
Date: |
Tue, 7 Aug 2012 10:04:43 +1000 |
On Mon, Aug 6, 2012 at 7:29 PM, Peter Maydell <address@hidden> wrote:
> On 6 August 2012 03:16, Peter A. G. Crosthwaite
> <address@hidden> wrote:
>> Slave creation function that can be used to create an SSI slave without
>> qdev_init() being called. This give machine models a change to set
>> properties.
>
> Not convinced about this one -- I think that if machine models need to
> do more complicated things with the qdev device then they should just
> call qdev_create/set properties/qdev_init themselves.
>
Yeh I tried that didnt work. See comment below.
> -- PMM
>
>> Signed-off-by: Peter A. G. Crosthwaite <address@hidden>
>> ---
>> hw/ssi.c | 9 +++++++--
>> hw/ssi.h | 1 +
>> 2 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/ssi.c b/hw/ssi.c
>> index 2e4f2fe..c47419d 100644
>> --- a/hw/ssi.c
>> +++ b/hw/ssi.c
>> @@ -86,10 +86,15 @@ static TypeInfo ssi_slave_info = {
>> .abstract = true,
>> };
>>
>> +DeviceState *ssi_create_slave_no_init(SSIBus *bus, const char *name)
>> +{
>> + return qdev_create(&bus->qbus, name);
bus->qbus accesses requires the definition of struct SSIBus which is
private to ssi.c. Machine models cant access the qbus field which they
need for qdev_create().
Regards,
Peter
>> +}
>> +
>> DeviceState *ssi_create_slave(SSIBus *bus, const char *name)
>> {
>> - DeviceState *dev;
>> - dev = qdev_create(&bus->qbus, name);
>> + DeviceState *dev = ssi_create_slave_no_init(bus, name);
>> +
>> qdev_init_nofail(dev);
>> return dev;
>> }
>> diff --git a/hw/ssi.h b/hw/ssi.h
>> index 5b69a3b..80b9664 100644
>> --- a/hw/ssi.h
>> +++ b/hw/ssi.h
>> @@ -76,6 +76,7 @@ extern const VMStateDescription vmstate_ssi_slave;
>> }
>>
>> DeviceState *ssi_create_slave(SSIBus *bus, const char *name);
>> +DeviceState *ssi_create_slave_no_init(SSIBus *bus, const char *name);
>>
>> /* Master interface. */
>> SSIBus *ssi_create_bus(DeviceState *parent, const char *name);
>> --
>> 1.7.0.4
>>
- [Qemu-devel] [PATCH v5 01/15] ssi: Support for multiple attached devices, (continued)
- [Qemu-devel] [PATCH v5 01/15] ssi: Support for multiple attached devices, Peter A. G. Crosthwaite, 2012/08/05
- [Qemu-devel] [PATCH v5 02/15] ssi: Added VMSD stub, Peter A. G. Crosthwaite, 2012/08/05
- [Qemu-devel] [PATCH v5 03/15] ssi: Implemented CS behaviour, Peter A. G. Crosthwaite, 2012/08/05
- [Qemu-devel] [PATCH v5 04/15] ssi: Added create_slave_no_init(), Peter A. G. Crosthwaite, 2012/08/05
- [Qemu-devel] [PATCH v5 05/15] qdev: allow multiple qdev_init_gpio_in() calls, Peter A. G. Crosthwaite, 2012/08/05
- [Qemu-devel] [PATCH v5 06/15] hw/stellaris: Removed gpio_out init array., Peter A. G. Crosthwaite, 2012/08/05
- [Qemu-devel] [PATCH v5 08/15] ssd0323: abort() instead of exit(1) on error., Peter A. G. Crosthwaite, 2012/08/05
[Qemu-devel] [PATCH v5 09/15] hw: Added generic FIFO API., Peter A. G. Crosthwaite, 2012/08/05