]> git.ipfire.org Git - thirdparty/qemu.git/commit
migration: Fix possible race when shutting down to_dst_file
authorFabiano Rosas <farosas@suse.de>
Mon, 18 Sep 2023 17:28:18 +0000 (14:28 -0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 2 Oct 2023 23:00:54 +0000 (02:00 +0300)
commit73393af917401ab67dabebae5f12017066503fad
tree3cf4ddf80e372acc976df917175edde23807b63f
parentf5480c4d82a70bd5af1803aa74f0e853a46cc79a
migration: Fix possible race when shutting down to_dst_file

It's not safe to call qemu_file_shutdown() on the to_dst_file without
first checking for the file's presence under the lock. The cleanup of
this file happens at postcopy_pause() and migrate_fd_cleanup() which
are not necessarily running in the same thread as migrate_fd_cancel().

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230918172822.19052-5-farosas@suse.de>
(cherry picked from commit 7478fb0df914f0a5ab551ff74b1df62dd250500e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
migration/migration.c