This RFC adds a Thunderbolt-flavoured PCIe hotplug layer for QEMU. The main goal is hotplug and hot-unplug of real and virtual devices in guests where direct hotplug for those devices is not supported or not usable. macOS is the main validation target for this path: the guest can observe endpoints through a guest-visible Thunderbolt layer even when direct PCIe hotplug for the same endpoint is not usable.
The series intentionally keeps regular QEMU PCI endpoint devices intact. Devices behind the new layer remain normal QEMU PCI devices; the Thunderbolt root port controls guest-visible link presence, publishes ACPI properties, and emits PCIe hotplug notifications. The patch adds: * thunderbolt-root-port, creating a thunderbolt-bus secondary bus. * thunderbolt-pcie-pci-bridge for tunnelled PCI endpoints. * thunderbolt-vga, a separate stdvga-compatible hotpluggable endpoint. * README/specs documentation with VGA, USB storage, and NVMe examples. * qtest coverage for the Thunderbolt VGA hotplug path. The regular QEMU VGA device is not changed and remains non-hotpluggable. The Thunderbolt display path uses the separate thunderbolt-vga device type. Runtime validation performed so far: * macOS guest booted from QCOW2 overlays over immutable base disk images. * Thunderbolt VGA hotplug/removal while the standard boot VGA remains. * NVMe hotplug/removal with guest driver instance checks. * USB controller hotplug, USB storage mount/write/eject, controller removal, replug, and data persistence verification. Build/test validation: * ninja -C build qemu-system-x86_64 tests/qtest/display-vga-test * meson test -C build qtest-x86_64/display-vga-test --print-errorlogs * scripts/checkpatch.pl --no-tree --no-signoff on the full diff: 0 errors, with expected warnings for MIT inheritance in thunderbolt-vga.c and possible MAINTAINERS coverage. Open questions: * Whether this should be split into smaller review patches after the overall Thunderbolt modelling direction is accepted. * Which MAINTAINERS entry should own the Thunderbolt PCIe layer. * Whether the guest-visible properties are sufficient for non-macOS guests that may also benefit from Thunderbolt-style tunnelling. Dmitry R (1): hw/pci-bridge: add Thunderbolt PCIe hotplug layer README.md | 91 ++++ docs/specs/index.rst | 1 + docs/specs/thunderbolt-pcie-hotplug.rst | 99 ++++ hw/display/meson.build | 1 + hw/display/thunderbolt-vga.c | 275 ++++++++++ hw/pci-bridge/meson.build | 2 + hw/pci-bridge/thunderbolt_pcie_pci_bridge.c | 156 ++++++ hw/pci-bridge/thunderbolt_root_port.c | 565 ++++++++++++++++++++ tests/qtest/display-vga-test.c | 68 +++ 9 files changed, 1258 insertions(+) create mode 100644 README.md create mode 100644 docs/specs/thunderbolt-pcie-hotplug.rst create mode 100644 hw/display/thunderbolt-vga.c create mode 100644 hw/pci-bridge/thunderbolt_pcie_pci_bridge.c create mode 100644 hw/pci-bridge/thunderbolt_root_port.c -- 2.47.3
