diff options
author | Lidong Chen <jemmy858585@gmail.com> | 2018-08-06 21:29:29 +0800 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2018-08-22 12:12:26 +0200 |
commit | 74637e6f08fceda988065f02c25d2cdb2ccd1762 (patch) | |
tree | 20b64090c48e3c1c6a660f7d4aaae8ffbad84002 /migration/ram.c | |
parent | 55cc1b5937a8e709e4c102e74b206281073aab82 (diff) |
migration: implement bi-directional RDMA QIOChannel
This patch implements bi-directional RDMA QIOChannel. Because different
threads may access RDMAQIOChannel currently, this patch use RCU to protect it.
Signed-off-by: Lidong Chen <lidongchen@tencent.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/ram.c')
-rw-r--r-- | migration/ram.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/migration/ram.c b/migration/ram.c index 1e5c45a514..2f9e8bd7e0 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -989,6 +989,7 @@ static void *multifd_send_thread(void *opaque) int ret; trace_multifd_send_thread_start(p->id); + rcu_register_thread(); if (multifd_send_initial_packet(p, &local_err) < 0) { goto out; @@ -1051,6 +1052,7 @@ out: p->running = false; qemu_mutex_unlock(&p->mutex); + rcu_unregister_thread(); trace_multifd_send_thread_end(p->id, p->num_packets, p->num_pages); return NULL; @@ -1220,6 +1222,7 @@ static void *multifd_recv_thread(void *opaque) int ret; trace_multifd_recv_thread_start(p->id); + rcu_register_thread(); while (true) { uint32_t used; @@ -1266,6 +1269,7 @@ static void *multifd_recv_thread(void *opaque) p->running = false; qemu_mutex_unlock(&p->mutex); + rcu_unregister_thread(); trace_multifd_recv_thread_end(p->id, p->num_packets, p->num_pages); return NULL; |