• G
    spapr: fix migration of ICPState objects from/to older QEMU · 46f7afa3
    Greg Kurz 提交于
    Commit 5bc8d26d ("spapr: allocate the ICPState object from under
    sPAPRCPUCore") moved ICPState objects from the machine to CPU cores.
    This is an improvement since we no longer allocate ICPState objects
    that will never be used. But it has the side-effect of breaking
    migration of older machine types from older QEMU versions.
    
    This patch allows spapr to register dummy "icp/server" entries to vmstate.
    These entries use a dedicated VMStateDescription that can swallow and
    discard state of an incoming migration stream, and that don't send anything
    on outgoing migration.
    
    As for real ICPState objects, the instance_id is the cpu_index of the
    corresponding vCPU, which happens to be equal to the generated instance_id
    of older machine types.
    
    The machine can unregister/register these entries when CPUs are dynamically
    plugged/unplugged.
    
    This is only available for pseries-2.9 and older machines, thanks to a
    compat property.
    Signed-off-by: NGreg Kurz <groug@kaod.org>
    Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
    46f7afa3
spapr.c 120.5 KB