Blame SOURCES/kvm-pci-conventional-pci-device-and-pci-express-device-i.patch

9bac43
From e4794a20f02368af6260ed3b4d9e040b41734459 Mon Sep 17 00:00:00 2001
9bac43
From: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Date: Fri, 20 Oct 2017 18:29:12 +0200
9bac43
Subject: [PATCH 07/19] pci: conventional-pci-device and pci-express-device
9bac43
 interfaces
9bac43
9bac43
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Message-id: <20171020182917.10771-3-ehabkost@redhat.com>
9bac43
Patchwork-id: 77422
9bac43
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH v2 2/7] pci: conventional-pci-device and pci-express-device interfaces
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
Those two interfaces will be used to indicate which device types
9bac43
support Conventional PCI or PCI Express buses.  Management
9bac43
software will be able to use the qom-list-types QMP command to
9bac43
query that information.
9bac43
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 619f02aefc587e5e2821cd84b584eba199c97c9e)
9bac43
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 hw/pci/pci.c         | 12 ++++++++++++
9bac43
 include/hw/pci/pci.h |  6 ++++++
9bac43
 2 files changed, 18 insertions(+)
9bac43
9bac43
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
9bac43
index 258fbe5..1226696 100644
9bac43
--- a/hw/pci/pci.c
9bac43
+++ b/hw/pci/pci.c
9bac43
@@ -168,6 +168,16 @@ static const TypeInfo pci_bus_info = {
9bac43
     .class_init = pci_bus_class_init,
9bac43
 };
9bac43
 
9bac43
+static const TypeInfo pcie_interface_info = {
9bac43
+    .name          = INTERFACE_PCIE_DEVICE,
9bac43
+    .parent        = TYPE_INTERFACE,
9bac43
+};
9bac43
+
9bac43
+static const TypeInfo conventional_pci_interface_info = {
9bac43
+    .name          = INTERFACE_CONVENTIONAL_PCI_DEVICE,
9bac43
+    .parent        = TYPE_INTERFACE,
9bac43
+};
9bac43
+
9bac43
 static const TypeInfo pcie_bus_info = {
9bac43
     .name = TYPE_PCIE_BUS,
9bac43
     .parent = TYPE_PCI_BUS,
9bac43
@@ -2645,6 +2655,8 @@ static void pci_register_types(void)
9bac43
 {
9bac43
     type_register_static(&pci_bus_info);
9bac43
     type_register_static(&pcie_bus_info);
9bac43
+    type_register_static(&conventional_pci_interface_info);
9bac43
+    type_register_static(&pcie_interface_info);
9bac43
     type_register_static(&pci_device_type_info);
9bac43
 }
9bac43
 
9bac43
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
9bac43
index e598b09..cc6f5d2 100644
9bac43
--- a/include/hw/pci/pci.h
9bac43
+++ b/include/hw/pci/pci.h
9bac43
@@ -195,6 +195,12 @@ enum {
9bac43
 #define PCI_DEVICE_GET_CLASS(obj) \
9bac43
      OBJECT_GET_CLASS(PCIDeviceClass, (obj), TYPE_PCI_DEVICE)
9bac43
 
9bac43
+/* Implemented by devices that can be plugged on PCI Express buses */
9bac43
+#define INTERFACE_PCIE_DEVICE "pci-express-device"
9bac43
+
9bac43
+/* Implemented by devices that can be plugged on Conventional PCI buses */
9bac43
+#define INTERFACE_CONVENTIONAL_PCI_DEVICE "conventional-pci-device"
9bac43
+
9bac43
 typedef struct PCIINTxRoute {
9bac43
     enum {
9bac43
         PCI_INTX_ENABLED,
9bac43
-- 
9bac43
1.8.3.1
9bac43