diff options
author | Jianjun Duan <duanj@linux.vnet.ibm.com> | 2016-05-24 10:55:04 -0700 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2016-05-27 09:40:23 +1000 |
commit | 5dd5238c0b5cc42d347128227f124fe31b05832d (patch) | |
tree | 9b9165a9f0d12767ced92c4319e4b83564723a9f /hw/ppc/spapr_pci.c | |
parent | 41264b385c2b324fea026204e5de9bef980733b1 (diff) |
spapr: ensure device trees are always associated with DRC
There are possible racing situations involving hotplug events and
guest migration. For cases where a hotplug event is migrated, or
the guest is in the process of fetching device tree at the time of
migration, we need to ensure the device tree is created and
associated with the corresponding DRC for devices that were
hotplugged on the source, but 'coldplugged' on the target.
Signed-off-by: Jianjun Duan <duanj@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r-- | hw/ppc/spapr_pci.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index e55b505c96..91a356f851 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1093,13 +1093,11 @@ static void spapr_phb_add_pci_device(sPAPRDRConnector *drc, spapr_tce_set_need_vfio(tcet, true); } - if (dev->hotplugged) { - fdt = create_device_tree(&fdt_size); - fdt_start_offset = spapr_create_pci_child_dt(phb, pdev, fdt, 0); - if (!fdt_start_offset) { - error_setg(errp, "Failed to create pci child device tree node"); - goto out; - } + fdt = create_device_tree(&fdt_size); + fdt_start_offset = spapr_create_pci_child_dt(phb, pdev, fdt, 0); + if (!fdt_start_offset) { + error_setg(errp, "Failed to create pci child device tree node"); + goto out; } drck->attach(drc, DEVICE(pdev), |