mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 20:41:52 -06:00
block: Drop permissions when migration completes
With image locking, permissions affect other qemu processes as well. We want to be sure that the destination can run, so let's drop permissions on the source when migration completes. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
4417ab7adf
commit
cfa1a5723f
3 changed files with 40 additions and 4 deletions
12
block.c
12
block.c
|
@ -4019,7 +4019,7 @@ void bdrv_invalidate_cache_all(Error **errp)
|
|||
static int bdrv_inactivate_recurse(BlockDriverState *bs,
|
||||
bool setting_flag)
|
||||
{
|
||||
BdrvChild *child;
|
||||
BdrvChild *child, *parent;
|
||||
int ret;
|
||||
|
||||
if (!setting_flag && bs->drv->bdrv_inactivate) {
|
||||
|
@ -4038,6 +4038,16 @@ static int bdrv_inactivate_recurse(BlockDriverState *bs,
|
|||
|
||||
if (setting_flag) {
|
||||
bs->open_flags |= BDRV_O_INACTIVE;
|
||||
|
||||
QLIST_FOREACH(parent, &bs->parents, next_parent) {
|
||||
if (parent->role->inactivate) {
|
||||
ret = parent->role->inactivate(parent);
|
||||
if (ret < 0) {
|
||||
bs->open_flags &= ~BDRV_O_INACTIVE;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue