All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio: add Virtio*BusClass sizes
@ 2020-08-24 12:20 Cornelia Huck
  2020-09-01 12:57 ` Halil Pasic
  0 siblings, 1 reply; 2+ messages in thread
From: Cornelia Huck @ 2020-08-24 12:20 UTC (permalink / raw)
  To: Michael S. Tsirkin, Halil Pasic
  Cc: qemu-s390x, Cornelia Huck, qemu-devel, Eduardo Habkost

Both VirtioPCIBusClass and VirtioCcwBusClass are typedefs of
VirtioBusClass, but set .class_size in the TypeInfo anyway
to be safe if that changes in the future.

Reported-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/virtio-ccw.c  | 1 +
 hw/virtio/virtio-pci.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 0e602702971b..8feb3451a098 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1237,6 +1237,7 @@ static const TypeInfo virtio_ccw_bus_info = {
     .name = TYPE_VIRTIO_CCW_BUS,
     .parent = TYPE_VIRTIO_BUS,
     .instance_size = sizeof(VirtioCcwBusState),
+    .class_size = sizeof(VirtioCcwBusClass),
     .class_init = virtio_ccw_bus_class_init,
 };
 
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index ccdf54e81c78..45e7b65a8d24 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -2101,6 +2101,7 @@ static const TypeInfo virtio_pci_bus_info = {
     .name          = TYPE_VIRTIO_PCI_BUS,
     .parent        = TYPE_VIRTIO_BUS,
     .instance_size = sizeof(VirtioPCIBusState),
+    .class_size    = sizeof(VirtioPCIBusClass),
     .class_init    = virtio_pci_bus_class_init,
 };
 
-- 
2.25.4



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

* Re: [PATCH] virtio: add Virtio*BusClass sizes
  2020-08-24 12:20 [PATCH] virtio: add Virtio*BusClass sizes Cornelia Huck
@ 2020-09-01 12:57 ` Halil Pasic
  0 siblings, 0 replies; 2+ messages in thread
From: Halil Pasic @ 2020-09-01 12:57 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: qemu-s390x, qemu-devel, Eduardo Habkost, Michael S. Tsirkin

On Mon, 24 Aug 2020 14:20:51 +0200
Cornelia Huck <cohuck@redhat.com> wrote:

> Both VirtioPCIBusClass and VirtioCcwBusClass are typedefs of
> VirtioBusClass, but set .class_size in the TypeInfo anyway
> to be safe if that changes in the future.
> 
> Reported-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>

> ---
>  hw/s390x/virtio-ccw.c  | 1 +
>  hw/virtio/virtio-pci.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
> index 0e602702971b..8feb3451a098 100644
> --- a/hw/s390x/virtio-ccw.c
> +++ b/hw/s390x/virtio-ccw.c
> @@ -1237,6 +1237,7 @@ static const TypeInfo virtio_ccw_bus_info = {
>      .name = TYPE_VIRTIO_CCW_BUS,
>      .parent = TYPE_VIRTIO_BUS,
>      .instance_size = sizeof(VirtioCcwBusState),
> +    .class_size = sizeof(VirtioCcwBusClass),
>      .class_init = virtio_ccw_bus_class_init,
>  };
>  
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index ccdf54e81c78..45e7b65a8d24 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -2101,6 +2101,7 @@ static const TypeInfo virtio_pci_bus_info = {
>      .name          = TYPE_VIRTIO_PCI_BUS,
>      .parent        = TYPE_VIRTIO_BUS,
>      .instance_size = sizeof(VirtioPCIBusState),
> +    .class_size    = sizeof(VirtioPCIBusClass),
>      .class_init    = virtio_pci_bus_class_init,
>  };
>  



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

end of thread, other threads:[~2020-09-01 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 12:20 [PATCH] virtio: add Virtio*BusClass sizes Cornelia Huck
2020-09-01 12:57 ` Halil Pasic

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.