qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH 15/24] macio: Fix macio-bus to be a subtype of System bus


From: Markus Armbruster
Subject: Re: [PATCH 15/24] macio: Fix macio-bus to be a subtype of System bus
Date: Tue, 19 May 2020 08:09:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Mark Cave-Ayland <address@hidden> writes:

> On 18/05/2020 06:03, Markus Armbruster wrote:
>
>> The devices we plug into the macio-bus are all sysbus devices
>> (DeviceClass member bus_type is TYPE_SYSTEM_BUS), but macio-bus does
>> not derive from TYPE_SYSTEM_BUS.  Fix that.
>> 
>> "info qtree" now shows the devices' mmio ranges, as it should
>> 
>> Cc: Mark Cave-Ayland <address@hidden>
>> Cc: David Gibson <address@hidden>
>> Cc: address@hidden
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>>  hw/misc/macio/macio.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
>> index ebc96cc8f6..53a9fd5696 100644
>> --- a/hw/misc/macio/macio.c
>> +++ b/hw/misc/macio/macio.c
>> @@ -492,7 +492,7 @@ static void macio_class_init(ObjectClass *klass, void 
>> *data)
>>  
>>  static const TypeInfo macio_bus_info = {
>>      .name = TYPE_MACIO_BUS,
>> -    .parent = TYPE_BUS,
>> +    .parent = TYPE_SYSTEM_BUS,
>>      .instance_size = sizeof(MacIOBusState),
>>  };
>
> Here I learned something new: a device that has a class TYPE_SYS_BUS_DEVICE 
> should be
> attached to a bus that derives from TYPE_SYSTEM_BUS. I have a feeling that 
> there are
> going to be quite a few instances of this around, particularly in places where
> existing sysbus devices have been borrowed from the PC world and reused.

Not that many.  I clean them up this series, and "[PATCH 22/24] qdev:
Assert devices are plugged into a bus that can take them" should ensure
we stay clean.




reply via email to

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