All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly
@ 2019-05-28 14:07 Philippe Mathieu-Daudé
  2019-05-28 14:12 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-28 14:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Fam Zheng, Peter Maydell, Dmitry Fleytman, Markus Armbruster,
	Paolo Bonzini, Philippe Mathieu-Daudé

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é <philmd@redhat.com>
---
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);
     s->resetting--;
     pvscsi_process_completion_queue(s);
     assert(QTAILQ_EMPTY(&s->pending_queue));
@@ -848,7 +848,7 @@ pvscsi_on_cmd_reset_bus(PVSCSIState *s)
     trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_RESET_BUS");
 
     s->resetting++;
-    qbus_reset_all_fn(&s->bus);
+    qbus_reset_all(&s->bus.qbus);
     s->resetting--;
     return PVSCSI_COMMAND_PROCESSING_SUCCEEDED;
 }
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly
  2019-05-28 14:07 [Qemu-devel] [PATCH] hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly Philippe Mathieu-Daudé
@ 2019-05-28 14:12 ` Peter Maydell
  2019-05-28 15:51   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2019-05-28 14:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fam Zheng, Dmitry Fleytman, QEMU Trivial, QEMU Developers,
	Markus Armbruster, Paolo Bonzini

On Tue, 28 May 2019 at 15:08, Philippe Mathieu-Daudé <philmd@redhat.com> 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é <philmd@redhat.com>
> ---
> 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".)

thanks
-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly
  2019-05-28 14:12 ` Peter Maydell
@ 2019-05-28 15:51   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-28 15:51 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Fam Zheng, Dmitry Fleytman, QEMU Trivial, QEMU Developers,
	Markus Armbruster, Paolo Bonzini

On 5/28/19 4:12 PM, Peter Maydell wrote:
> On Tue, 28 May 2019 at 15:08, Philippe Mathieu-Daudé <philmd@redhat.com> 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é <philmd@redhat.com>
>> ---
>> 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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-28 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 14:07 [Qemu-devel] [PATCH] hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly Philippe Mathieu-Daudé
2019-05-28 14:12 ` Peter Maydell
2019-05-28 15:51   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.