spapr: Simplify spapr_cpu_core_realize() and spapr_cpu_core_unrealize()
commit3cff86f036142057368b6040a8c78dce225500c7
authorGreg Kurz <groug@kaod.org>
Thu, 15 Oct 2020 21:18:53 +0000 (15 23:18 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 27 Oct 2020 14:08:53 +0000 (28 01:08 +1100)
treed4988fd771a3d362c6ba49021e5b1db36328d9b8
parent9370c28f12ca9336dd893e3b673a334c4938c58f
spapr: Simplify spapr_cpu_core_realize() and spapr_cpu_core_unrealize()

Now that the error path of spapr_cpu_core_realize() is just to call
idempotent spapr_cpu_core_unrealize() for rollback, no need to create
and realize the vCPUs in two separate loops.

Merge them and do them same in spapr_cpu_core_unrealize() for symmetry.

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