virtio: add Virtio*BusClass sizes
authorCornelia Huck <cohuck@redhat.com>
Mon, 24 Aug 2020 12:20:51 +0000 (14:20 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Wed, 2 Sep 2020 11:29:26 +0000 (07:29 -0400)
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>
Message-Id: <20200824122051.99432-1-cohuck@redhat.com>

hw/s390x/virtio-ccw.c
hw/virtio/virtio-pci.c

index 0e602702971b3871586111ecf4955e0771b74abf..8feb3451a098a822b08a89fe6c8579aae9ce0b98 100644 (file)
@@ -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,
 };
 
index fc69570dccd879282b6e9103345941cd73e5aa19..5bc769f685ce43047f247475bd7efd38883082a9 100644 (file)
@@ -2133,6 +2133,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,
 };