mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
spapr: Don't request to unplug the same core twice
We must not call spapr_drc_detach() on a detached DRC otherwise bad things can happen, ie. QEMU hangs or crashes. This is easily demonstrated with a CPU hotplug/unplug loop using QMP. Signed-off-by: Greg Kurz <[email protected]> Message-Id: <[email protected]> Signed-off-by: David Gibson <[email protected]>
This commit is contained in:
1 parent
cb97526aa4
commit
47c8c915b1
1 file changed
+4
-3
+4
-3
@@ -3741,9 +3741,10 @@ void spapr_core_unplug_request(HotplugHandler *hotplug_dev, DeviceState *dev,
|
||||
spapr_vcpu_id(spapr, cc->core_id));
|
||||
g_assert(drc);
|
||||
|
||||
spapr_drc_detach(drc);
|
||||
|
||||
spapr_hotplug_req_remove_by_index(drc);
|
||||
if (!spapr_drc_unplug_requested(drc)) {
|
||||
spapr_drc_detach(drc);
|
||||
spapr_hotplug_req_remove_by_index(drc);
|
||||
}
|
||||
}
|
||||
|
||||
int spapr_core_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr,
|
||||
|
||||
Reference in new issue
Block a user