]> git.proxmox.com Git - mirror_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)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 27 Sep 2023 17:58:02 +0000 (13:58 -0400)
commit7478fb0df914f0a5ab551ff74b1df62dd250500e
tree57bb8703699a2afdb524d0aefafc0caef6fdcecd
parent639decf529793fc544c8055b82be8abe77fa48fa
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>
migration/migration.c