Fix pflash migration
commit90c647db8d59e47c9000affc0d81754eb346e939
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 15 Apr 2016 11:41:30 +0000 (15 12:41 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 15 Apr 2016 15:27:34 +0000 (15 17:27 +0200)
treecf91e4494449229974a9feede8a3f5ff17518c4e
parent16aaf975eeed92cce602a844f795a027182a6861
Fix pflash migration

Pflash migration (e.g. q35 + EFI variable storage) fails
with the assert:

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

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

Tested by:
  Migrating Q35/EFI vm.
  Changing efi variable content (with efiboot in the guest)
  md5sum'ing the variable file before migration and after.

This is a fix that Paolo posted in the message
  570244B3.4070105@redhat.com

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/pflash_cfi01.c