summaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-04-04 17:29:03 +0200
committerKevin Wolf <kwolf@redhat.com>2017-04-07 14:44:05 +0200
commitd35ff5e6b3aa3a706b0aa3bcf11400fac945b67a (patch)
tree69d406988e6ff392367c8703c331003257d5c76a /qmp.c
parent5fe2339e6b09da7d6f48b9bef0f1a7360392b489 (diff)
downloadqemu-d35ff5e6b3aa3a706b0aa3bcf11400fac945b67a.tar.gz
block: Ignore guest dev permissions during incoming migration
Usually guest devices don't like other writers to the same image, so they use blk_set_perm() to prevent this from happening. In the migration phase before the VM is actually running, though, they don't have a problem with writes to the image. On the other hand, storage migration needs to be able to write to the image in this phase, so the restrictive blk_set_perm() call of qdev devices breaks it. This patch flags all BlockBackends with a qdev device as blk->disable_perm during incoming migration, which means that the requested permissions are stored in the BlockBackend, but not actually applied to its root node yet. Once migration has finished and the VM should be resumed, the permissions are applied. If they cannot be applied (e.g. because the NBD server used for block migration hasn't been shut down), resuming the VM fails. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Tested-by: Kashyap Chamarthy <kchamart@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/qmp.c b/qmp.c
index fa82b598c6..a744e44ac6 100644
--- a/qmp.c
+++ b/qmp.c
@@ -207,6 +207,12 @@ void qmp_cont(Error **errp)
}
}
+ blk_resume_after_migration(&local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
if (runstate_check(RUN_STATE_INMIGRATE)) {
autostart = 1;
} else {