spapr: Fix leak of CPU machine specific data
commit90689a32ce2b84580646956c2417343943e5df37
authorGreg Kurz <groug@kaod.org>
Thu, 15 Oct 2020 21:18:25 +0000 (15 23:18 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 27 Oct 2020 14:08:53 +0000 (28 01:08 +1100)
tree9c352724e85f2b00af2dca0edec608521e87d6c8
parentce316b5118c732c5fef23d7763b8c01054bfcdfa
spapr: Fix leak of CPU machine specific data

When a CPU core is being removed, the machine specific data of each
CPU thread object is leaked.

Fix this by calling the dedicated helper we have for that instead of
simply unparenting the CPU object. Call it from a separate loop in
spapr_cpu_core_unrealize() for symmetry with spapr_cpu_core_realize().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <160279670540.1808373.17319746576919615623.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_cpu_core.c