[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [RFC v5 01/22] machine: Add a get_primary_pci_bus callback
From: |
Eric Auger |
Subject: |
[Qemu-arm] [RFC v5 01/22] machine: Add a get_primary_pci_bus callback |
Date: |
Fri, 19 Jan 2018 14:48:54 +0000 |
After e492dc5a267e "pci: Eliminate pci_find_primary_bus()" we don't
have an easy mean to retrieve the primary bus of a machine. This will be
needed by virtio-iommu-device which is bound to be dynamically instantiated
in at least ARM virt and Q35 machines.
Adding a get_primary_pci_bus() callback allows to retrieve the PCIBus the
iommu is connected to.
Signed-off-by: Eric Auger <address@hidden>
---
This is a temporary solution until we decide whether the
virtio-iommu-device should be instantiable through a -device command
line or through a machine command line, as already suggested by Peter
(for vsmmuv3 though).
---
include/hw/boards.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 156b16f..3a65701 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -151,6 +151,8 @@ typedef struct {
* should instead use "unimplemented-device" for all memory ranges where
* the guest will attempt to probe for a device that QEMU doesn't
* implement and a stub device is required.
+ * @get_primary_pci_bus: return the primary PCI bus or NULL if there are
+ * several root buses
*/
struct MachineClass {
/*< private >*/
@@ -207,6 +209,7 @@ struct MachineClass {
unsigned cpu_index);
const CPUArchIdList *(*possible_cpu_arch_ids)(MachineState *machine);
int64_t (*get_default_cpu_node_id)(const MachineState *ms, int idx);
+ PCIBus *(*get_primary_pci_bus)(const MachineState *ms);
};
/**
--
1.9.1
- [Qemu-arm] [RFC v5 00/22] VIRTIO-IOMMU device, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 01/22] machine: Add a get_primary_pci_bus callback,
Eric Auger <=
- [Qemu-arm] [RFC v5 02/22] hw/arm/virt: Implement get_primary_pci_bus, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 03/22] pc: Implement get_primary_pci_bus, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 04/22] update-linux-headers: Import virtio_iommu.h, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 05/22] linux-headers: Partial update for virtio-iommu, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 06/22] virtio-iommu: Add skeleton, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 07/22] virtio-iommu: Decode the command payload, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 08/22] virtio-iommu: Add the iommu regions, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 09/22] virtio-iommu: Register attached endpoints, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 10/22] virtio-iommu: Implement attach/detach command, Eric Auger, 2018/01/19
- [Qemu-arm] [RFC v5 11/22] virtio-iommu: Implement map/unmap, Eric Auger, 2018/01/19