Support PCI-e device hot-add multi-function via device_add, just ensure add the function 0 is added last. While allow user to roll back in the middle via device_del, in case user cancle the operation.
changelog v4: 1. take ari into account, add api: pci_is_function_0() 2. reorder the patch 3. other minor fix according to the v3 comment changelog v3: 1. Flag device as unexposed when func 0 doesn`t exist, via return 0xFF in case of gratuitous pci bus scan. 2. Since device is unexposed to guest, can remove function individually, without interaction with the guest. Cao jin (2): remove function during multi-function hot-add enable multi-function hot-add hw/pci/pci.c | 29 +++++++++++++++++++++++++++++ hw/pci/pci_host.c | 11 +++++++++-- hw/pci/pcie.c | 39 ++++++++++++++++++++++++++------------- include/hw/pci/pci.h | 1 + 4 files changed, 65 insertions(+), 15 deletions(-) -- 2.1.0