qemu/migration
Greg Kurz 875fcd013a migration: incoming postcopy advise sanity checks
If postcopy-ram was set on the source but not on the destination,
migration doesn't occur, the destination prints an error and boots
the guest:

qemu-system-ppc64: Expected vmdescription section, but got 0

We end up with two running instances.

This behaviour was introduced in 2.11 by commit 58110f0acb "migration:
split common postcopy out of ram postcopy" to prepare ground for the
upcoming dirty bitmap postcopy support. It adds a new case where the
source may send an empty postcopy advise because dirty bitmap doesn't
need to check page sizes like RAM postcopy does.

If the source has enabled postcopy-ram, then it sends an advise with
the page size values. If the destination hasn't enabled postcopy-ram,
then loadvm_postcopy_handle_advise() leaves the page size values on
the stream and returns. This confuses qemu_loadvm_state() later on
and causes the destination to start execution.

As discussed several times, postcopy-ram should be enabled both sides
to be functional. This patch changes the destination to perform some
extra checks on the advise length to ensure this is the case. Otherwise
an error is returned and migration is aborted.

Reported-by: Balamuruhan S <bala24@linux.vnet.ibm.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <151791621042.19120.3103118434734245776.stgit@bahia>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2018-02-06 14:53:02 +00:00
..
block.c
block.h
channel.c migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
channel.h migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
colo-comm.c
colo-failover.c
colo.c
exec.c migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
exec.h
fd.c migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
fd.h
global_state.c
Makefile.objs
migration.c migration: Recover block devices if failure in device state 2018-02-06 14:53:02 +00:00
migration.h migration: Allow migrate_fd_connect to take an Error * 2018-02-06 10:55:12 +00:00
page_cache.c
page_cache.h
postcopy-ram.c migration: Revert postcopy-blocktime commit set 2018-01-23 10:08:05 +00:00
postcopy-ram.h
qemu-file-channel.c
qemu-file-channel.h
qemu-file.c
qemu-file.h
qjson.c
qjson.h
ram.c migration: Drop current address parameter from save_zero_page() 2018-02-06 10:55:13 +00:00
ram.h
rdma.c migration: Allow migrate_fd_connect to take an Error * 2018-02-06 10:55:12 +00:00
rdma.h
savevm.c migration: incoming postcopy advise sanity checks 2018-02-06 14:53:02 +00:00
savevm.h
socket.c migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
socket.h
tls.c migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
tls.h
trace-events migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
vmstate-types.c
vmstate.c
xbzrle.c
xbzrle.h