aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorDaniel Brodsky <dnbrdsky@gmail.com>2020-04-03 21:21:08 -0700
committerStefan Hajnoczi <stefanha@redhat.com>2020-05-04 16:07:43 +0100
commit6e8a355de6c4d32e9df336cdafb009cd78262836 (patch)
treedc839bbdbdfab8c588445a8b9d9283e0dda18d39 /migration/migration.c
parent56f21718b8767a1b523f2a14107d6307336ca51d (diff)
lockable: replaced locks with lock guard macros where appropriate
- ran regexp "qemu_mutex_lock\(.*\).*\n.*if" to find targets - replaced result with QEMU_LOCK_GUARD if all unlocks at function end - replaced result with WITH_QEMU_LOCK_GUARD if unlock not at end Signed-off-by: Daniel Brodsky <dnbrdsky@gmail.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-id: 20200404042108.389635-3-dnbrdsky@gmail.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 187ac0410c..177cce9e95 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1653,11 +1653,10 @@ static void migrate_fd_cleanup_bh(void *opaque)
void migrate_set_error(MigrationState *s, const Error *error)
{
- qemu_mutex_lock(&s->error_mutex);
+ QEMU_LOCK_GUARD(&s->error_mutex);
if (!s->error) {
s->error = error_copy(error);
}
- qemu_mutex_unlock(&s->error_mutex);
}
void migrate_fd_error(MigrationState *s, const Error *error)