]> git.proxmox.com Git - mirror_qemu.git/commit
block: Ignore guest dev permissions during incoming migration
authorKevin Wolf <kwolf@redhat.com>
Tue, 4 Apr 2017 15:29:03 +0000 (17:29 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 7 Apr 2017 12:44:05 +0000 (14:44 +0200)
commitd35ff5e6b3aa3a706b0aa3bcf11400fac945b67a
tree69d406988e6ff392367c8703c331003257d5c76a
parent5fe2339e6b09da7d6f48b9bef0f1a7360392b489
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>
block/block-backend.c
include/block/block.h
migration/migration.c
qmp.c