Bharata B Rao 8d5981c4fc spapr: Fix QEMU abort during memory unplug
Commit 0cffce56 (hw/ppc/spapr.c: adding pending_dimm_unplugs to
sPAPRMachineState) introduced a new way to track pending LMBs of DIMM
device that is marked for removal. Since this commit we can hit the
assert in spapr_pending_dimm_unplugs_add() in the following situation:

- DIMM device removal fails as the guest doesn't allow the removal.
- Subsequent attempt to remove the same DIMM would hit the assert
  as the corresponding sPAPRDIMMState is still part of the
  pending_dimm_unplugs list.

Fix this by removing the assert and conditionally adding the
sPAPRDIMMState to pending_dimm_unplugs list only when it is not
already present.

Fixes: 0cffce56ae3501c5783d779f97993ce478acf856
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
[dwg: Tweaked to avoid returning NULL when spapr_pending_dimm_unplugs_add()
 does find an existing entry]
Reviewed-by: Daniel Barboza <danielhb@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-07-25 11:14:25 +10:00
..
2016-10-04 13:28:07 +01:00
2017-06-02 11:33:53 +04:00
2017-07-17 13:36:08 +01:00
2017-07-19 12:30:41 +01:00
2017-07-17 17:12:41 +01:00
2017-07-14 12:16:09 +01:00
2017-06-02 14:07:53 +01:00
2017-07-19 13:43:58 +01:00
2017-07-14 12:29:49 +02:00
2016-05-18 15:04:27 +03:00
2017-01-27 18:07:59 +01:00
2017-07-14 12:04:43 +02:00
2017-07-18 11:47:56 -04:00
2017-07-17 20:13:56 +08:00
2016-01-29 15:07:25 +00:00
2017-06-27 15:09:15 +02:00
2016-10-28 18:17:24 +03:00
2017-07-20 10:02:11 +02:00