[PATCH v1] hw/pci-host/xilinx-pcie: Set explicit bus name for Root Port

gaochengbo posted 1 patch 2 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260317072018.2586572-1-gaochengbo@bosc.ac.cn
Maintainers: Paul Burton <paulburton@kernel.org>, Aleksandar Rikalo <arikalo@gmail.com>
hw/pci-host/xilinx-pcie.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH v1] hw/pci-host/xilinx-pcie: Set explicit bus name for Root Port
Posted by gaochengbo 2 weeks, 6 days ago
Assign the name "xdma-pcie" to the PCI bridge bus in xilinx_pcie_root_realize().
This makes it easier to identify the Xilinx PCIe host bridge in QEMU monitor
commands (e.g., 'info qtree', 'info mtree') and debugging logs, distinguishing
it from generic pci-bridge instances.

Signed-off-by: Chengbo Gao <gaochengbo@bosc.ac.cn>
---
 hw/pci-host/xilinx-pcie.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
index 40f625b61d..2949c5385e 100644
--- a/hw/pci-host/xilinx-pcie.c
+++ b/hw/pci-host/xilinx-pcie.c
@@ -271,7 +271,9 @@ static void xilinx_pcie_root_realize(PCIDevice *pci_dev, Error **errp)
 {
     BusState *bus = qdev_get_parent_bus(DEVICE(pci_dev));
     XilinxPCIEHost *s = XILINX_PCIE_HOST(bus->parent);
+    PCIBridge *br = PCI_BRIDGE(pci_dev);
 
+    br->bus_name  = "xdma-pcie";
     pci_set_word(pci_dev->config + PCI_COMMAND,
                  PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
     pci_set_word(pci_dev->config + PCI_MEMORY_BASE, s->mmio_base >> 16);
-- 
2.43.0