]> git.proxmox.com Git - mirror_qemu.git/commit - hw/ppc/spapr_cpu_core.c
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)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 21 Aug 2018 01:09:34 +0000 (11:09 +1000)
commitcc71c7760e263f808c4240a725425671eeeb7e4d
treeb15a50c4decbed5d4c82eecc580c0d0465732a74
parentd0092d90eb546a8bbe9e9120426c189474123797
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>
hw/ppc/spapr_cpu_core.c