virtio-pci: Allow to specify additional interfaces for the base type
authorDavid Hildenbrand <david@redhat.com>
Wed, 19 Jun 2019 09:49:02 +0000 (15:19 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 2 Jul 2019 16:59:22 +0000 (12:59 -0400)
Let's allow to specify additional interfaces for the base type (e.g.
later TYPE_MEMORY_DEVICE), something that was possible before the
rework of virtio PCI device instantiation.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190619094907.10131-3-pagupta@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-pci.c
hw/virtio/virtio-pci.h

index e6d5467e5417c7236010ec05cf0f8b4b8fd5983f..62e78e98f50d9e2712d1f5b2319ee72d0bb7d0d6 100644 (file)
@@ -1947,6 +1947,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
         .class_init    = virtio_pci_base_class_init,
         .class_data    = (void *)t,
         .abstract      = true,
+        .interfaces    = t->interfaces,
     };
     TypeInfo generic_type_info = {
         .name = t->generic_name,
index bfea2892a540160d6144ebdf6c16fae89f7904be..619d9098c1d0d2170a32505ac5c5112d004b8ef9 100644 (file)
@@ -252,6 +252,7 @@ typedef struct VirtioPCIDeviceTypeInfo {
     size_t class_size;
     void (*instance_init)(Object *obj);
     void (*class_init)(ObjectClass *klass, void *data);
+    InterfaceInfo *interfaces;
 } VirtioPCIDeviceTypeInfo;
 
 /* Register virtio-pci type(s).  @t must be static. */