[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/26] pci: conventional-pci-device and pci-express-d
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 15/26] pci: conventional-pci-device and pci-express-device interfaces |
Date: |
Sun, 15 Oct 2017 06:23:25 +0300 |
From: Eduardo Habkost <address@hidden>
Those two interfaces will be used to indicate which device types
support Conventional PCI or PCI Express buses. Management
software will be able to use the qom-list-types QMP command to
query that information.
Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/pci/pci.h | 6 ++++++
hw/pci/pci.c | 12 ++++++++++++
2 files changed, 18 insertions(+)
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index aa7ef9c..8d02a0a 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -198,6 +198,12 @@ enum {
#define PCI_DEVICE_GET_CLASS(obj) \
OBJECT_GET_CLASS(PCIDeviceClass, (obj), TYPE_PCI_DEVICE)
+/* Implemented by devices that can be plugged on PCI Express buses */
+#define INTERFACE_PCIE_DEVICE "pci-express-device"
+
+/* Implemented by devices that can be plugged on Conventional PCI buses */
+#define INTERFACE_CONVENTIONAL_PCI_DEVICE "conventional-pci-device"
+
typedef struct PCIINTxRoute {
enum {
PCI_INTX_ENABLED,
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 1e6fb88..1b08e18 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -170,6 +170,16 @@ static const TypeInfo pci_bus_info = {
.class_init = pci_bus_class_init,
};
+static const TypeInfo pcie_interface_info = {
+ .name = INTERFACE_PCIE_DEVICE,
+ .parent = TYPE_INTERFACE,
+};
+
+static const TypeInfo conventional_pci_interface_info = {
+ .name = INTERFACE_CONVENTIONAL_PCI_DEVICE,
+ .parent = TYPE_INTERFACE,
+};
+
static const TypeInfo pcie_bus_info = {
.name = TYPE_PCIE_BUS,
.parent = TYPE_PCI_BUS,
@@ -2667,6 +2677,8 @@ static void pci_register_types(void)
{
type_register_static(&pci_bus_info);
type_register_static(&pcie_bus_info);
+ type_register_static(&conventional_pci_interface_info);
+ type_register_static(&pcie_interface_info);
type_register_static(&pci_device_type_info);
}
--
MST
- [Qemu-devel] [PULL 05/26] dump: add guest ELF note, (continued)
- [Qemu-devel] [PULL 05/26] dump: add guest ELF note, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 06/26] dump: update phys_base header field based on VMCOREINFO content, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 07/26] kdump: set vmcoreinfo location, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 08/26] scripts/dump-guest-memory.py: add vmcoreinfo, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 09/26] MAINTAINERS: add Dump maintainers, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 10/26] virtio/vhost: reset dev->log after syncing, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 11/26] pci: allow 32-bit PCI IO accesses to pass through the PCI bridge, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 12/26] hw/pci-bridge/pcie_pci_bridge: properly handle MSI unavailability case, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 13/26] virtio/pci/migration: Convert to VMState, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 14/26] PCI: PCIe access should always be little endian, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 15/26] pci: conventional-pci-device and pci-express-device interfaces,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 16/26] pci: Add interface names to hybrid PCI devices, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 17/26] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 19/26] xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 20/26] pci: Validate interfaces on base_class_init, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 21/26] hw/gen_pcie_root_port: make IO RO 0 on IO disabled, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 22/26] virtio: fix descriptor counting in virtqueue_pop, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 24/26] isapc: Remove unnecessary migration compatibility code, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 23/26] virtio-pci: Replace modern_as with direct access to modern_bar, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 25/26] pc: remove useless hot_add_cpu initialisation, Michael S. Tsirkin, 2017/10/14
- [Qemu-devel] [PULL 26/26] tests/pxe: Test more NICs when running in SPEED=slow mode, Michael S. Tsirkin, 2017/10/14