qemu-patch-raspberry4/migration
Peter Xu 43044ac0ee migration: Make from_dst_file accesses thread-safe
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 protect it too, just like to_dst_file.

When it's safe to access without lock, comment it.

There's one special reference in migration_thread() that can be replaced by
the newly introduced rp_thread_created flag.

Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Message-Id: <20210722175841.938739-3-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  with Peter's fixup
2021-07-26 12:44:46 +01:00
..
block-dirty-bitmap.c
block.c
block.h
channel.c yank: Unregister function when using TLS migration 2021-06-08 18:50:03 +01:00
channel.h
colo-failover.c
colo.c Remove migrate_set_block_enabled in checkpoint 2021-06-11 10:30:13 +08:00
dirtyrate.c hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds 2021-06-08 20:18:26 +01:00
dirtyrate.h migration/dirtyrate: make sample page count configurable 2021-06-08 20:18:25 +01:00
exec.c
exec.h
fd.c
fd.h
global_state.c
meson.build migration: Move populate_vfio_info() into a separate file 2021-05-14 12:31:51 +02:00
migration.c migration: Make from_dst_file accesses thread-safe 2021-07-26 12:44:46 +01:00
migration.h migration: Make from_dst_file accesses thread-safe 2021-07-26 12:44:46 +01:00
multifd-zlib.c
multifd-zstd.c
multifd.c migration/socket: Close the listener at the end 2021-06-08 19:36:19 +01:00
multifd.h
page_cache.c
page_cache.h
postcopy-ram.c
postcopy-ram.h
qemu-file-channel.c yank: Unregister function when using TLS migration 2021-06-08 18:50:03 +01:00
qemu-file-channel.h
qemu-file.c migration: fix the memory overwriting risk in add_to_iovec 2021-07-05 10:51:26 +01:00
qemu-file.h
ram.c migration: Make from_dst_file accesses thread-safe 2021-07-26 12:44:46 +01:00
ram.h
rdma.c migration/rdma: prevent from double free the same mr 2021-07-13 16:21:57 +01:00
rdma.h
savevm.c migration: use GDateTime for formatting timestamp in snapshot names 2021-06-14 13:28:50 +01:00
savevm.h
socket.c migration/socket: Close the listener at the end 2021-06-08 19:36:19 +01:00
socket.h
target.c migration: Move populate_vfio_info() into a separate file 2021-05-14 12:31:51 +02:00
tls.c migration/tls: Use qcrypto_tls_creds_check_endpoint() 2021-06-29 18:30:20 +01:00
tls.h
trace-events migration: add trace point when vm_stop_force_state fails 2021-06-14 13:28:50 +01:00
trace.h
vmstate-types.c
vmstate.c
xbzrle.c
xbzrle.h
yank_functions.c
yank_functions.h