aboutsummaryrefslogtreecommitdiff
path: root/migration/savevm.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-06-15 17:38:10 +0100
committerKevin Wolf <kwolf@redhat.com>2017-06-26 14:51:13 +0200
commit1575829d2aaced8ce6a5728d8e9fbbdee8f80885 (patch)
tree5fcc0c236c414ca5cd6cfe54863d842755ab4929 /migration/savevm.c
parent0d2fac8ede5623b5bb825bd002633cd65db5159e (diff)
migration: hold AioContext lock for loadvm qemu_fclose()
migration_incoming_state_destroy() uses qemu_fclose() on the vmstate file. Make sure to call it inside an AioContext acquire/release region. This fixes an 'qemu: qemu_mutex_unlock: Operation not permitted' abort in loadvm. This patch closes the vmstate file before ending the drained region. Previously we closed the vmstate file after ending the drained region. The order does not matter. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'migration/savevm.c')
-rw-r--r--migration/savevm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index b08df04d59..c7a49c93c5 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2300,11 +2300,11 @@ int load_snapshot(const char *name, Error **errp)
aio_context_acquire(aio_context);
ret = qemu_loadvm_state(f);
+ migration_incoming_state_destroy();
aio_context_release(aio_context);
bdrv_drain_all_end();
- migration_incoming_state_destroy();
if (ret < 0) {
error_setg(errp, "Error %d while loading VM state", ret);
return ret;