mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
3b563c4be0
commit
62df066fff
3 changed files with 27 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue