[PATCH for-6.2 3/6] s390-sclp-events-bus: Set instance_size

Eduardo Habkost posted 6 patches 4 years, 6 months ago
Maintainers: Igor Mammedov <imammedo@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Eduardo Habkost <ehabkost@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, David Hildenbrand <david@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH for-6.2 3/6] s390-sclp-events-bus: Set instance_size
Posted by Eduardo Habkost 4 years, 6 months ago
We have a SCLPEventsBus struct defined, but the struct is not
used at the TypeInfo definition.  This works today but will break
silently if anybody adds a new field to SCLPEventsBus.

Set instance_size properly to avoid problems in the future.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Cornelia Huck <cohuck@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Halil Pasic <pasic@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: qemu-s390x@nongnu.org
Cc: qemu-devel@nongnu.org
---
 hw/s390x/event-facility.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index ed92ce510d9..0a65e16cdd9 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -332,6 +332,7 @@ static void write_event_mask(SCLPEventFacility *ef, SCCB *sccb)
 static const TypeInfo sclp_events_bus_info = {
     .name = TYPE_SCLP_EVENTS_BUS,
     .parent = TYPE_BUS,
+    .instance_size = sizeof(SCLPEventsBus),
 };
 
 static void command_handler(SCLPEventFacility *ef, SCCB *sccb, uint64_t code)
-- 
2.31.1


Re: [PATCH for-6.2 3/6] s390-sclp-events-bus: Set instance_size
Posted by Thomas Huth 4 years, 6 months ago
On 05/08/2021 21.34, Eduardo Habkost wrote:
> We have a SCLPEventsBus struct defined, but the struct is not
> used at the TypeInfo definition.  This works today but will break
> silently if anybody adds a new field to SCLPEventsBus.
> 
> Set instance_size properly to avoid problems in the future.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: Cornelia Huck <cohuck@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: Halil Pasic <pasic@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: qemu-s390x@nongnu.org
> Cc: qemu-devel@nongnu.org
> ---
>   hw/s390x/event-facility.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
> index ed92ce510d9..0a65e16cdd9 100644
> --- a/hw/s390x/event-facility.c
> +++ b/hw/s390x/event-facility.c
> @@ -332,6 +332,7 @@ static void write_event_mask(SCLPEventFacility *ef, SCCB *sccb)
>   static const TypeInfo sclp_events_bus_info = {
>       .name = TYPE_SCLP_EVENTS_BUS,
>       .parent = TYPE_BUS,
> +    .instance_size = sizeof(SCLPEventsBus),
>   };
>   
>   static void command_handler(SCLPEventFacility *ef, SCCB *sccb, uint64_t code)
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>


Re: [PATCH for-6.2 3/6] s390-sclp-events-bus: Set instance_size
Posted by David Hildenbrand 4 years, 6 months ago
On 05.08.21 21:34, Eduardo Habkost wrote:
> We have a SCLPEventsBus struct defined, but the struct is not
> used at the TypeInfo definition.  This works today but will break
> silently if anybody adds a new field to SCLPEventsBus.
> 
> Set instance_size properly to avoid problems in the future.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: Cornelia Huck <cohuck@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: Halil Pasic <pasic@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: qemu-s390x@nongnu.org
> Cc: qemu-devel@nongnu.org
> ---
>   hw/s390x/event-facility.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
> index ed92ce510d9..0a65e16cdd9 100644
> --- a/hw/s390x/event-facility.c
> +++ b/hw/s390x/event-facility.c
> @@ -332,6 +332,7 @@ static void write_event_mask(SCLPEventFacility *ef, SCCB *sccb)
>   static const TypeInfo sclp_events_bus_info = {
>       .name = TYPE_SCLP_EVENTS_BUS,
>       .parent = TYPE_BUS,
> +    .instance_size = sizeof(SCLPEventsBus),
>   };
>   
>   static void command_handler(SCLPEventFacility *ef, SCCB *sccb, uint64_t code)
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


Re: [PATCH for-6.2 3/6] s390-sclp-events-bus: Set instance_size
Posted by Cornelia Huck 4 years, 6 months ago
On Thu, Aug 05 2021, Eduardo Habkost <ehabkost@redhat.com> wrote:

> We have a SCLPEventsBus struct defined, but the struct is not
> used at the TypeInfo definition.  This works today but will break
> silently if anybody adds a new field to SCLPEventsBus.
>
> Set instance_size properly to avoid problems in the future.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: Cornelia Huck <cohuck@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: Halil Pasic <pasic@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: qemu-s390x@nongnu.org
> Cc: qemu-devel@nongnu.org
> ---
>  hw/s390x/event-facility.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

(I assume that you'll queue the whole series yourself? Or should we pick
the s390x parts separately?)