diff options
author | Peter Xu <peterx@redhat.com> | 2018-05-02 18:47:38 +0800 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2018-05-15 22:12:41 +0200 |
commit | 62df066ffffdbd41b42ca91130611e40fbc53f0b (patch) | |
tree | b834f0b0dc36054f7a883be9a3a8e10ea66dec32 /migration/channel.c | |
parent | 3b563c4be01f42d2a4e641d50736bd5ac8e3b15f (diff) |
migration: introduce lock for to_dst_file
Let's introduce a lock for that QEMUFile since we are going to operate
on it in multiple threads.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180502104740.12123-23-peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/channel.c')
-rw-r--r-- | migration/channel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/migration/channel.c b/migration/channel.c index c5eaf0fa0e..716192bf75 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -74,8 +74,9 @@ void migration_channel_connect(MigrationState *s, } else { QEMUFile *f = qemu_fopen_channel_output(ioc); + qemu_mutex_lock(&s->qemu_file_lock); s->to_dst_file = f; - + qemu_mutex_unlock(&s->qemu_file_lock); } } migrate_fd_connect(s, error); |