spapr: Fix pre-2.10 dummy ICP hack
commit1b4ab51493f4e656a211bbb109f4cb621c598443
authorGreg Kurz <groug@kaod.org>
Tue, 1 Dec 2020 11:37:25 +0000 (1 12:37 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 14 Dec 2020 04:54:12 +0000 (14 15:54 +1100)
treec28dc9c30dd5a622db28204ef971c3740661713f
parent4e960974d4ee66bc03ed6ef4b1b1eb6234039417
spapr: Fix pre-2.10 dummy ICP hack

This hack registers dummy VMState entries of ICPs in order to
support migration of old pseries machine types that used to
create all smp.max_cpus possible ICPs at machine init.

Part of the work is to unregister the dummy entries when plugging
an actual vCPU core, and to register them back when unplugging the
core. The code that unregisters the dummy ICPs in spapr_core_plug()
is misplaced: if ppc_set_compat() fails afterwards, the hotplug
operation will be cancelled and the dummy ICPs won't be registered
back since the unplug handler isn't called.

Unregister the dummy ICPs at the end of spapr_core_plug().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-2-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c