From patchwork Fri Nov 25 22:05:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9448181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 97F126075F for ; Fri, 25 Nov 2016 22:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8697C1FFC9 for ; Fri, 25 Nov 2016 22:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 799522808F; Fri, 25 Nov 2016 22:30:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 160A21FFC9 for ; Fri, 25 Nov 2016 22:30:54 +0000 (UTC) Received: from localhost ([::1]:48200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAP1A-0007Wx-1R for patchwork-qemu-devel@patchwork.kernel.org; Fri, 25 Nov 2016 17:30:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAOdn-0006el-Qc for qemu-devel@nongnu.org; Fri, 25 Nov 2016 17:06:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAOdm-0000Ml-Mm for qemu-devel@nongnu.org; Fri, 25 Nov 2016 17:06:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cAOdm-0000LF-Da for qemu-devel@nongnu.org; Fri, 25 Nov 2016 17:06:42 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB4F791C31 for ; Fri, 25 Nov 2016 22:06:41 +0000 (UTC) Received: from localhost (ovpn-116-207.phx2.redhat.com [10.3.116.207]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAPM6ejC016349; Fri, 25 Nov 2016 17:06:41 -0500 From: Eduardo Habkost To: qemu-devel@nongnu.org, Markus Armbruster , Marcel Apfelbaum , "Michael S. Tsirkin" Date: Fri, 25 Nov 2016 20:05:52 -0200 Message-Id: <1480111556-32586-17-git-send-email-ehabkost@redhat.com> In-Reply-To: <1480111556-32586-1-git-send-email-ehabkost@redhat.com> References: <1480111556-32586-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 25 Nov 2016 22:06:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v2 16/20] [incomplete] remove INTERFACE_LEGACY_PCI_DEVICE from PCIe-only devices 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP With this, only vmxnet3, pvscsi, vfio-pci, virtio-pci kept both interfaces. TODO: The pci-bridge classes still need to be redone, see FIXME comments. Signed-off-by: Eduardo Habkost --- Changes series v1 -> v2: * (new patch added to series) --- hw/block/nvme.c | 1 - hw/net/e1000e.c | 1 - hw/pci-bridge/ioh3420.c | 1 + hw/pci-bridge/xio3130_downstream.c | 1 + hw/pci-bridge/xio3130_upstream.c | 1 + hw/scsi/megasas.c | 14 +++++++------- hw/usb/hcd-xhci.c | 1 - 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index eb85c1a..02cf1eb 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -981,7 +981,6 @@ static const TypeInfo nvme_info = { .instance_init = nvme_instance_init, .interfaces = (InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, - { INTERFACE_LEGACY_PCI_DEVICE }, { } }, }; diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index ff905eb..e397d3f 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -702,7 +702,6 @@ static const TypeInfo e1000e_info = { .instance_init = e1000e_instance_init, .interfaces = (InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, - { INTERFACE_LEGACY_PCI_DEVICE }, { } }, }; diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index 3ee2990..69ba16c 100644 --- a/hw/pci-bridge/ioh3420.c +++ b/hw/pci-bridge/ioh3420.c @@ -209,6 +209,7 @@ static const TypeInfo ioh3420_info = { .parent = TYPE_PCIE_SLOT, .class_init = ioh3420_class_init, .interfaces = (InterfaceInfo[]) { + /*FIXME: remove INTERFACE_LEGACY_PCI_DEVICE */ { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c index 8320777..e9a0974 100644 --- a/hw/pci-bridge/xio3130_downstream.c +++ b/hw/pci-bridge/xio3130_downstream.c @@ -195,6 +195,7 @@ static const TypeInfo xio3130_downstream_info = { .parent = TYPE_PCIE_SLOT, .class_init = xio3130_downstream_class_init, .interfaces = (InterfaceInfo[]) { + /*FIXME: remove INTERFACE_LEGACY_PCI_DEVICE */ { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c index b6361c3..77dfd16 100644 --- a/hw/pci-bridge/xio3130_upstream.c +++ b/hw/pci-bridge/xio3130_upstream.c @@ -166,6 +166,7 @@ static const TypeInfo xio3130_upstream_info = { .parent = TYPE_PCIE_PORT, .class_init = xio3130_upstream_class_init, .interfaces = (InterfaceInfo[]) { + /*FIXME: remove INTERFACE_LEGACY_PCI_DEVICE */ { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index d5c42b1..c30d3e6 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2527,10 +2527,6 @@ static const TypeInfo megasas_info = { .instance_size = sizeof(MegasasState), .class_size = sizeof(MegasasBaseClass), .abstract = true, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_LEGACY_PCI_DEVICE }, - { }, - }, }; static void megasas_register_types(void) @@ -2545,14 +2541,18 @@ static void megasas_register_types(void) { INTERFACE_PCIE_DEVICE }, { }, }; + InterfaceInfo legacy_interfaces[] = { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }; type_info.name = info->name; type_info.parent = TYPE_MEGASAS_BASE; type_info.class_data = (void *)info; type_info.class_init = megasas_class_init; - if (info->is_express) { - type_info.interfaces = pcie_interfaces; - } + type_info.interfaces = info->is_express ? + pcie_interfaces : + legacy_interfaces; type_register(&type_info); } diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index afbe889..1a47c9e 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3963,7 +3963,6 @@ static const TypeInfo xhci_info = { .class_init = xhci_class_init, .interfaces = (InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, - { INTERFACE_LEGACY_PCI_DEVICE }, { } }, };