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

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