[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] a1fbe7: migration: Fix race of image locking

From: GitHub
Subject: [Qemu-commits] [qemu/qemu] a1fbe7: migration: Fix race of image locking between src a...
Date: Mon, 19 Jun 2017 09:54:02 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: a1fbe750fd90d29309fd037ab98f263367aaf770
  Author: Fam Zheng <address@hidden>
  Date:   2017-06-19 (Mon, 19 Jun 2017)

  Changed paths:
    M migration/colo.c
    M migration/migration.c
    M migration/savevm.c
    M migration/savevm.h

  Log Message:
  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

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 <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Reviewed-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
[PMM: noted qemu_file_set_error() use in commit as suggested by Daniel]
Signed-off-by: Peter Maydell <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]