qemu-e2k/hw
Laszlo Ersek 4c0cfc72b3 pflash_cfi01: write flash contents to bdrv on incoming migration
A drive that backs a pflash device is special:
- it is very small,
- its entire contents are kept in a RAMBlock at all times, covering the
  guest-phys address range that provides the guest's view of the emulated
  flash chip.

The pflash device model keeps the drive (the host-side file) and the
guest-visible flash contents in sync. When migrating the guest, the
guest-visible flash contents (the RAMBlock) is migrated by default, but on
the target host, the drive (the host-side file) remains in full sync with
the RAMBlock only if:
- the source and target hosts share the storage underlying the pflash
  drive,
- or the migration requests full or incremental block migration too, which
  then covers all drives.

Due to the special nature of pflash drives, the following scenario makes
sense as well:
- no full nor incremental block migration, covering all drives, alongside
  the base migration (justified eg. by shared storage for "normal" (big)
  drives),
- non-shared storage for pflash drives.

In this case, currently only those portions of the flash drive are updated
on the target disk that the guest reprograms while running on the target
host.

In order to restore accord, dump the entire flash contents to the bdrv in
a post_load() callback.

- The read-only check follows the other call-sites of pflash_update();
- both "pfl->ro" and pflash_update() reflect / consider the case when
  "pfl->bs" is NULL;
- the total size of the flash device is calculated as in
  pflash_cfi01_realize().

When using shared storage, or requesting full or incremental block
migration along with the normal migration, the patch should incur a
harmless rewrite from the target side.

It is assumed that, on the target host, RAM is loaded ahead of the call to
pflash_post_load().

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08 11:12:43 +01:00
..
9pfs hw/9pfs: Don't return type from host in readdir on local 9p filesystem 2014-09-04 10:51:13 -05:00
acpi
alpha iommu: add is_write as a parameter to the translate function of MemoryRegionIOMMUOps 2014-08-28 23:10:22 +02:00
arm aarch64: raise max_cpus to 8 2014-08-29 15:00:29 +01:00
audio
block pflash_cfi01: write flash contents to bdrv on incoming migration 2014-09-08 11:12:43 +01:00
bt
char
core qdev: Add cleanup logic in device_set_realized() to avoid resource leak 2014-09-04 19:15:54 +02:00
cpu
cris
display vbe: rework sanity checks 2014-09-04 08:23:14 +02:00
dma
gpio
i2c Fix debug print warning 2014-09-02 22:38:16 +04:00
i386 trivial patches for 2014-09-03 2014-09-04 13:33:53 +01:00
ide ide: Fix bootindex for bus_id > 9 2014-08-29 10:46:57 +01:00
input Fix debug print warning 2014-09-02 22:38:16 +04:00
intc Fix debug print warning 2014-09-02 22:38:16 +04:00
ipack
isa Fix debug print warning 2014-09-02 22:38:16 +04:00
lm32
m68k
mem
microblaze
mips
misc vfio: Enable NVIDIA 88000 region quirk regardless of VGA 2014-08-25 12:10:15 -06:00
moxie
net Net patches 2014-09-04 17:39:07 +01:00
nvram
openrisc
pci pci: avoid losing config updates to MSI/MSIX cap regs 2014-09-02 17:28:26 +03:00
pci-bridge ioh3420: remove unused ioh3420_init() declaration 2014-09-02 17:28:26 +03:00
pci-host intel-iommu: add context-cache to cache context-entry 2014-08-28 23:10:22 +02:00
pcmcia
ppc pci, pc fixes, features 2014-09-02 16:07:31 +01:00
s390x sclp-s390: Add memory hotplug SCLPs 2014-09-01 09:25:32 +02:00
scsi pci, pc fixes, features 2014-09-04 12:20:41 +01:00
sd
sh4
sparc
sparc64
ssi
timer Fix debug print warning 2014-09-02 22:38:16 +04:00
tpm
tricore target-tricore: Add board for systemmode 2014-09-01 14:49:20 +01:00
unicore32
usb usb: add usb host adapters exit trace 2014-08-29 12:52:14 +02:00
virtio Net patches 2014-09-04 17:39:07 +01:00
watchdog
xen
xenpv
xtensa
Makefile.objs