From patchwork Wed Jan 16 11:35:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 1025779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43flcZ5Qv3z9sD4 for ; Wed, 16 Jan 2019 22:39:58 +1100 (AEDT) Received: from localhost ([127.0.0.1]:57316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjjY4-0007Xp-K5 for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2019 06:39:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjjUv-0005RR-7y for qemu-devel@nongnu.org; Wed, 16 Jan 2019 06:36:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjjUt-00006i-2G for qemu-devel@nongnu.org; Wed, 16 Jan 2019 06:36:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjjUO-0006lN-UZ; Wed, 16 Jan 2019 06:36:33 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E637889ACB; Wed, 16 Jan 2019 11:36:05 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A011608E0; Wed, 16 Jan 2019 11:36:01 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2019 12:35:18 +0100 Message-Id: <20190116113523.9213-6-david@redhat.com> In-Reply-To: <20190116113523.9213-1-david@redhat.com> References: <20190116113523.9213-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 16 Jan 2019 11:36:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFC 05/10] virtio-pci: Allow to specify additional interfaces for the base type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Collin Walling , Eduardo Habkost , "Michael S . Tsirkin" , Cornelia Huck , David Hildenbrand , "Dr . David Alan Gilbert" , Markus Armbruster , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 d05066deb8..62fe1278e0 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1995,6 +1995,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 29b4216107..9d8f41ea15 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -466,6 +466,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. */