qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH] hw/scsi/vmw_pvscsi: Use qbus_reset_all() dire


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-trivial] [PATCH] hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly
Date: Tue, 28 May 2019 17:51:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 5/28/19 4:12 PM, Peter Maydell wrote:
> On Tue, 28 May 2019 at 15:08, Philippe Mathieu-Daudé <address@hidden> wrote:
>>
>> Since the BusState is accesible from the SCSIBus object,
>> it is pointless to use qbus_reset_all_fn.
>> Use qbus_reset_all() directly.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> One step toward removing qbus_reset_all_fn()
>> ---
>>  hw/scsi/vmw_pvscsi.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
>> index 584b4be07e..6f571d0d19 100644
>> --- a/hw/scsi/vmw_pvscsi.c
>> +++ b/hw/scsi/vmw_pvscsi.c
>> @@ -440,7 +440,7 @@ static void
>>  pvscsi_reset_adapter(PVSCSIState *s)
>>  {
>>      s->resetting++;
>> -    qbus_reset_all_fn(&s->bus);
>> +    qbus_reset_all(&s->bus.qbus);
> 
> I thought our QOM style prefers using "BUS(&s->bus)"
> rather than looking inside the definition of the
> SCSIBus struct with "s->bus.qbus" ? (Compare preferring
> "DEVICE(s)" to "s->qdev".)

This is not explicit in HACKING/CODING_STYLE, but I agree this is
cleaner and better to treat the generic QOM objects as opaque, and use
the macros to check for the QOM type.

I'll respin.



reply via email to

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