migrate_ignore_shared() is an optimization that avoids copying memory
that is visible and can be mapped on the target. However, a
memory-backend-ram or a memory-backend-memfd block with the RAM_SHARED
flag set is not migrated when migrate_ignore_shared() is true. This is
wrong, because the block has no named backing store, and its contents will
be lost. To fix, ignore shared memory iff it is a named file. Define a
new flag RAM_NAMED_FILE to distinguish this case.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---
backends/hostmem-file.c | 1 +
include/exec/cpu-common.h | 1 +
include/exec/memory.h | 3 +++
migration/ram.c | 3 ++-
qapi/migration.json | 4 ++--
softmmu/physmem.c | 7 ++++++-
6 files changed, 15 insertions(+), 4 deletions(-)