Blame SOURCES/kvm-pci-Add-INTERFACE_PCIE_DEVICE-to-all-PCIe-devices.patch

9bac43
From 4dc6726309313a4c2e508d2ac9ec3bd7ea29cde2 Mon Sep 17 00:00:00 2001
9bac43
From: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Date: Fri, 20 Oct 2017 18:29:14 +0200
9bac43
Subject: [PATCH 09/19] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
9bac43
9bac43
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Message-id: <20171020182917.10771-5-ehabkost@redhat.com>
9bac43
Patchwork-id: 77423
9bac43
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH v2 4/7] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
9bac43
Bugzilla: 1390348
9bac43
RH-Acked-by: Marcel Apfelbaum <marcel@redhat.com>
9bac43
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
9bac43
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
9bac43
9bac43
Change all devices that set is_express=1 to implement
9bac43
INTERFACE_PCIE_DEVICE.
9bac43
9bac43
Backport notes:
9bac43
* Not included: hw/pci-bridge/pcie_pci_bridge.c
9bac43
9bac43
Cc: Keith Busch <keith.busch@intel.com>
9bac43
Cc: Kevin Wolf <kwolf@redhat.com>
9bac43
Cc: Max Reitz <mreitz@redhat.com>
9bac43
Cc: Dmitry Fleytman <dmitry@daynix.com>
9bac43
Cc: Jason Wang <jasowang@redhat.com>
9bac43
Cc: "Michael S. Tsirkin" <mst@redhat.com>
9bac43
Cc: Marcel Apfelbaum <marcel@redhat.com>
9bac43
Cc: Paul Burton <paul.burton@imgtec.com>
9bac43
Cc: Paolo Bonzini <pbonzini@redhat.com>
9bac43
Cc: Hannes Reinecke <hare@suse.com>
9bac43
Cc: qemu-block@nongnu.org
9bac43
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
9bac43
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
9bac43
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
9bac43
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
9bac43
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9bac43
(cherry picked from commit 71d787677d0cacea846dc851c3e56ad076d59c04)
9bac43
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 hw/block/nvme.c                    | 4 ++++
9bac43
 hw/net/e1000e.c                    | 4 ++++
9bac43
 hw/pci-bridge/pcie_root_port.c     | 4 ++++
9bac43
 hw/pci-bridge/xio3130_downstream.c | 4 ++++
9bac43
 hw/pci-bridge/xio3130_upstream.c   | 4 ++++
9bac43
 hw/pci-host/xilinx-pcie.c          | 4 ++++
9bac43
 hw/scsi/megasas.c                  | 6 ++++++
9bac43
 7 files changed, 30 insertions(+)
9bac43
9bac43
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
9bac43
index 6071dc1..26d58b6 100644
9bac43
--- a/hw/block/nvme.c
9bac43
+++ b/hw/block/nvme.c
9bac43
@@ -1110,6 +1110,10 @@ static const TypeInfo nvme_info = {
9bac43
     .instance_size = sizeof(NvmeCtrl),
9bac43
     .class_init    = nvme_class_init,
9bac43
     .instance_init = nvme_instance_init,
9bac43
+    .interfaces = (InterfaceInfo[]) {
9bac43
+        { INTERFACE_PCIE_DEVICE },
9bac43
+        { }
9bac43
+    },
9bac43
 };
9bac43
 
9bac43
 static void nvme_register_types(void)
9bac43
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
9bac43
index d6ca464..ac9b1e3 100644
9bac43
--- a/hw/net/e1000e.c
9bac43
+++ b/hw/net/e1000e.c
9bac43
@@ -729,6 +729,10 @@ static const TypeInfo e1000e_info = {
9bac43
     .instance_size = sizeof(E1000EState),
9bac43
     .class_init = e1000e_class_init,
9bac43
     .instance_init = e1000e_instance_init,
9bac43
+    .interfaces = (InterfaceInfo[]) {
9bac43
+        { INTERFACE_PCIE_DEVICE },
9bac43
+        { }
9bac43
+    },
9bac43
 };
9bac43
 
9bac43
 static void e1000e_register_types(void)
9bac43
diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
9bac43
index 4d588cb..9b6e4ce 100644
9bac43
--- a/hw/pci-bridge/pcie_root_port.c
9bac43
+++ b/hw/pci-bridge/pcie_root_port.c
9bac43
@@ -161,6 +161,10 @@ static const TypeInfo rp_info = {
9bac43
     .class_init    = rp_class_init,
9bac43
     .abstract      = true,
9bac43
     .class_size = sizeof(PCIERootPortClass),
9bac43
+    .interfaces = (InterfaceInfo[]) {
9bac43
+        { INTERFACE_PCIE_DEVICE },
9bac43
+        { }
9bac43
+    },
9bac43
 };
9bac43
 
9bac43
 static void rp_register_types(void)
9bac43
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
9bac43
index 5a882b0..1e09d2a 100644
9bac43
--- a/hw/pci-bridge/xio3130_downstream.c
9bac43
+++ b/hw/pci-bridge/xio3130_downstream.c
9bac43
@@ -196,6 +196,10 @@ static const TypeInfo xio3130_downstream_info = {
9bac43
     .name          = "xio3130-downstream",
9bac43
     .parent        = TYPE_PCIE_SLOT,
9bac43
     .class_init    = xio3130_downstream_class_init,
9bac43
+    .interfaces = (InterfaceInfo[]) {
9bac43
+        { INTERFACE_PCIE_DEVICE },
9bac43
+        { }
9bac43
+    },
9bac43
 };
9bac43
 
9bac43
 static void xio3130_downstream_register_types(void)
9bac43
diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
9bac43
index a052224..227997c 100644
9bac43
--- a/hw/pci-bridge/xio3130_upstream.c
9bac43
+++ b/hw/pci-bridge/xio3130_upstream.c
9bac43
@@ -166,6 +166,10 @@ static const TypeInfo xio3130_upstream_info = {
9bac43
     .name          = "x3130-upstream",
9bac43
     .parent        = TYPE_PCIE_PORT,
9bac43
     .class_init    = xio3130_upstream_class_init,
9bac43
+    .interfaces = (InterfaceInfo[]) {
9bac43
+        { INTERFACE_PCIE_DEVICE },
9bac43
+        { }
9bac43
+    },
9bac43
 };
9bac43
 
9bac43
 static void xio3130_upstream_register_types(void)
9bac43
diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
9bac43
index 4613dda..7659253 100644
9bac43
--- a/hw/pci-host/xilinx-pcie.c
9bac43
+++ b/hw/pci-host/xilinx-pcie.c
9bac43
@@ -317,6 +317,10 @@ static const TypeInfo xilinx_pcie_root_info = {
9bac43
     .parent = TYPE_PCI_BRIDGE,
9bac43
     .instance_size = sizeof(XilinxPCIERoot),
9bac43
     .class_init = xilinx_pcie_root_class_init,
9bac43
+    .interfaces = (InterfaceInfo[]) {
9bac43
+        { INTERFACE_PCIE_DEVICE },
9bac43
+        { }
9bac43
+    },
9bac43
 };
9bac43
 
9bac43
 static void xilinx_pcie_register(void)
9bac43
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
9bac43
index 734fdae..3641c30 100644
9bac43
--- a/hw/scsi/megasas.c
9bac43
+++ b/hw/scsi/megasas.c
9bac43
@@ -2451,6 +2451,7 @@ typedef struct MegasasInfo {
9bac43
     int osts;
9bac43
     const VMStateDescription *vmsd;
9bac43
     Property *props;
9bac43
+    InterfaceInfo *interfaces;
9bac43
 } MegasasInfo;
9bac43
 
9bac43
 static struct MegasasInfo megasas_devices[] = {
9bac43
@@ -2480,6 +2481,10 @@ static struct MegasasInfo megasas_devices[] = {
9bac43
         .is_express = true,
9bac43
         .vmsd = &vmstate_megasas_gen2,
9bac43
         .props = megasas_properties_gen2,
9bac43
+        .interfaces = (InterfaceInfo[]) {
9bac43
+            { INTERFACE_PCIE_DEVICE },
9bac43
+            { }
9bac43
+        },
9bac43
     }
9bac43
 };
9bac43
 
9bac43
@@ -2531,6 +2536,7 @@ static void megasas_register_types(void)
9bac43
         type_info.parent = TYPE_MEGASAS_BASE;
9bac43
         type_info.class_data = (void *)info;
9bac43
         type_info.class_init = megasas_class_init;
9bac43
+        type_info.interfaces = info->interfaces;
9bac43
 
9bac43
         type_register(&type_info);
9bac43
     }
9bac43
-- 
9bac43
1.8.3.1
9bac43