qemu/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 pcihp: fix possible array out of bounds 2014-08-25 00:16:06 +02:00
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 SCSI changes that enable sending vendor-specific commands via virtio-scsi. 2014-08-19 13:00:57 +01:00
block pflash_cfi01: write flash contents to bdrv on incoming migration 2014-09-08 11:12:43 +01:00
bt l2cap: fix access to freed memory 2014-08-15 19:12:48 +04:00
char SCSI changes that enable sending vendor-specific commands via virtio-scsi. 2014-08-19 13:00:57 +01:00
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 dma: axidma: Variablise repeated s->streams[i] sub-expr 2014-08-24 13:16:32 +04:00
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 memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
isa Fix debug print warning 2014-09-02 22:38:16 +04:00
lm32
m68k
mem pc-dimm: fix up error message 2014-08-14 13:22:00 +02:00
microblaze microblaze: ml605: Get rid of ddr_base variable 2014-08-24 13:16:32 +04:00
mips memory: convert memory_region_destroy to object_unparent 2014-08-18 12:06:20 +02:00
misc vfio: Enable NVIDIA 88000 region quirk regardless of VGA 2014-08-25 12:10:15 -06:00
moxie hw/moxie/moxiesim.c: Remove unused moxie_intc_create() 2014-06-24 20:01:24 +04:00
net Net patches 2014-09-04 17:39:07 +01:00
nvram spapr: Fix RTAS token numbers 2014-06-27 13:48:22 +02:00
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 hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
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 sd: sdhci: Fix ADMA dma_memory_read access 2014-08-04 14:41:54 +01:00
sh4 hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
sparc tcx: move initialisation from realizefn to initfn 2014-06-05 20:51:57 +01:00
sparc64 sun4u: switch second PCI-ebus bridge BAR over to PCI IO space 2014-08-17 13:12:52 +01:00
ssi ssi: xilinx_spi: Initialise CS GPIOs as NULL 2014-08-15 18:54:40 +04:00
timer Fix debug print warning 2014-09-02 22:38:16 +04:00
tpm Add ACPI tables for TPM 2014-08-25 00:16:06 +02:00
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 memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
xen memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
xenpv
xtensa hw/xtensa/xtfpga: implement initrd loading 2014-06-29 02:32:42 +04:00
Makefile.objs pc: implement pc-dimm device abstraction 2014-06-19 16:41:47 +03:00