@samitouri / QOSamiQemu / commits / 506fa577db

hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device plugging

When trying to plug a PCI device to a Sparc64 machine, you currently have to specify the right bus ("bus=pciB"), otherwise you get this error: $ qemu-system-sparc64 -device virtio-scsi-pci qemu-system-sparc64: -device virtio-scsi-pci: PCI: no slot/function available for virtio-scsi-pci, all in use or reserved This is quite annoying for the unexperienced users, and it also breaks e.g. the iotests ("make check-block") when running with qemu-system-sparc64. Mark the non-usable PCI busses as full now, so that QEMU can automatically plug new PCI devices to the right "pciB" bus. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260309181452.83702-1-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

Thomas Huth committed Mar 9, 2026 at 19:14 UTC 506fa577db1df370eb4894f34a6d9ee28aa1d679
1 file changed +7
hw/sparc64/sun4u.c
+7
@@ -719,6 +719,13 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
719 fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_DEPTH, graphic_depth);
720
721 qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
722 +
723 + /*
724 + * Mark internal PCI busses as full so that the plugging of additional
725 + * PCI devices happens on the right bus that still has free slots:
726 + */
727 + qbus_mark_full(&pci_bus->qbus);
728 + qbus_mark_full(&pci_busA->qbus);
729 }
730
731 enum {