Re: [PATCH v3 2/5] migration: Make from_dst_file accesses thread-safe

2021-07-22 Thread Peter Xu
On Thu, Jul 22, 2021 at 01:58:38PM -0400, Peter Xu wrote: > Accessing from_dst_file is potentially racy in current code base like below: > > if (s->from_dst_file) > do_something(s->from_dst_file); > > Because from_dst_file can be reset right after the check in another > thread (rp_thread).

[PATCH v3 2/5] migration: Make from_dst_file accesses thread-safe

2021-07-22 Thread Peter Xu
Accessing from_dst_file is potentially racy in current code base like below: if (s->from_dst_file) do_something(s->from_dst_file); Because from_dst_file can be reset right after the check in another thread (rp_thread). One example is migrate_fd_cancel(). Use the same qemu_file_lock to pro