From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:50075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmOjo-0007DM-EC for qemu-devel@nongnu.org; Wed, 23 Jan 2019 15:03:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmOd0-0002T3-0Q for qemu-devel@nongnu.org; Wed, 23 Jan 2019 14:56:02 -0500 From: David Hildenbrand Date: Wed, 23 Jan 2019 20:55:23 +0100 Message-Id: <20190123195527.29575-6-david@redhat.com> In-Reply-To: <20190123195527.29575-1-david@redhat.com> References: <20190123195527.29575-1-david@redhat.com> Subject: [Qemu-devel] [PATCH RFCv2 5/9] virtio-pci: Allow to specify additional interfaces for the base type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Dr . David Alan Gilbert" , "Michael S . Tsirkin" , Igor Mammedov , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , David Gibson , Cornelia Huck , Halil Pasic , Christian Borntraeger , David Hildenbrand , Collin Walling , Eric Blake , Markus Armbruster , Murilo Opsfelder Araujo , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org 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. Signed-off-by: David Hildenbrand --- hw/virtio/virtio-pci.c | 1 + hw/virtio/virtio-pci.h | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index b282109343..8f53192f4f 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1938,6 +1938,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, diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index bd223a6e3b..5d303b1641 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -232,6 +232,7 @@ typedef struct VirtioPCIDeviceTypeInfo { size_t instance_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. */ -- 2.17.2