mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Split `add_pci_device()` into two phases: `allocate_pci_bars()` which only allocates BAR address space, and `commit_pci_device()` which makes the device visible to the guest on the PCI bus. All callers now follow the pattern: allocate BARs → perform device- specific setup (ioeventfd, device_tree, mmio mapping) → commit device. This eliminates a race window where the guest could discover a partially-initialized device via `acpiphp_check_bridge()` during rapid sequential hotplug, causing BAR reprogramming to fail because ioeventfds and device_tree entries were not yet in place. Signed-off-by: wuxinyue <wuxinyue.wxy@antgroup.com> Assisted-by: Claude:Opus-4.6