spapr: fix spapr-nvram migration
commitcf472f48d57a533cc46ee651159abcbe0b362df0
authorlvivier@redhat.com <lvivier@redhat.com>
Thu, 21 Jul 2016 12:05:46 +0000 (21 14:05 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 25 Jul 2016 00:19:30 +0000 (25 10:19 +1000)
treefbb54f4b49b1c4ad5ecea8120ebd612894b6da6c
parentc573fc03da65e35bf44bce0448ea12801e3631ac
spapr: fix spapr-nvram migration

When spapr-nvram is backed by a file using pflash interface,
migration fails on the destination guest with assert:

    bdrv_co_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed.

This avoids the problem by delaying the pflash update until after
the device loads complete.

This fix is similar to the one for the pflash_cfi01 migration:

    90c647d Fix pflash migration

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/nvram/spapr_nvram.c