]> git.ipfire.org Git - thirdparty/qemu.git/commit
spapr_cpu_core: vmstate_[un]register per-CPU data from (un)realizefn
authorBharata B Rao <bharata@linux.ibm.com>
Wed, 8 Aug 2018 15:59:19 +0000 (21:29 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 19 Mar 2019 02:04:30 +0000 (21:04 -0500)
commitb7f525bf891d91d78b93f7e12af91b83da15a04e
treeee9be337579f8d87485aa84f48ac63511a0ee43b
parent5a49083b1e436ca1fdedf89f0e35d6af579b8e9d
spapr_cpu_core: vmstate_[un]register per-CPU data from (un)realizefn

VMStateDescription vmstate_spapr_cpu_state was added by commit
b94020268e0b6 (spapr_cpu_core: migrate per-CPU data) to migrate per-CPU
data with the required vmstate registration and unregistration calls.
However the unregistration is being done only from vcpu creation error path
and not from CPU delete path.

This causes migration to fail with the following error if migration is
attempted after a CPU unplug like this:
Unknown savevm section or instance 'spapr_cpu' 16
Additionally this leaves the source VM unresponsive after migration failure.

Fix this by ensuring the vmstate_unregister happens during CPU removal.
Fixing this becomes easier when vmstate (un)registration calls are moved to
vcpu (un)realize functions which is what this patch does.

Fixes: https://bugs.launchpad.net/qemu/+bug/1785972
Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Bharata B Rao <bharata@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit cc71c7760e263f808c4240a725425671eeeb7e4d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr_cpu_core.c