qemu/migration
Fam Zheng a1fbe750fd migration: Fix race of image locking between src and dst
Previously, dst side will immediately try to lock the write byte upon
receiving QEMU_VM_EOF, but at src side, bdrv_inactivate_all() is only
done after sending it. If the src host is under load, dst may fail to
acquire the lock due to racing with the src unlocking it.

Fix this by hoisting the bdrv_inactivate_all() operation before
QEMU_VM_EOF.

N.B. A further improvement could possibly be done to cleanly handover
locks between src and dst, so that there is no window where a third QEMU
could steal the locks and prevent src and dst from running.

N.B. This commit includes a minor improvement to the error handling
by using qemu_file_set_error().

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 20170616160658.32290-1-famz@redhat.com
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
[PMM: noted qemu_file_set_error() use in commit as suggested by Daniel]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-19 17:53:33 +01:00
..
block.c
block.h
channel.c
channel.h
colo-comm.c
colo-failover.c
colo.c migration: Fix race of image locking between src and dst 2017-06-19 17:53:33 +01:00
exec.c
exec.h
fd.c
fd.h
global_state.c
Makefile.objs
migration.c migration: Fix race of image locking between src and dst 2017-06-19 17:53:33 +01:00
migration.h
page_cache.c
page_cache.h
postcopy-ram.c
postcopy-ram.h
qemu-file-channel.c
qemu-file-channel.h
qemu-file.c
qemu-file.h
qjson.c
qjson.h
ram.c
ram.h
rdma.c
rdma.h
savevm.c migration: Fix race of image locking between src and dst 2017-06-19 17:53:33 +01:00
savevm.h migration: Fix race of image locking between src and dst 2017-06-19 17:53:33 +01:00
socket.c
socket.h
tls.c
tls.h
trace-events
vmstate-types.c
vmstate.c
xbzrle.c
xbzrle.h