block: Fix permissions in image activation
commitdafe096057373d95847e1c99c2fece34be9fc5bb
authorKevin Wolf <kwolf@redhat.com>
Thu, 16 Nov 2017 12:00:01 +0000 (16 13:00 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 17 Nov 2017 17:06:12 +0000 (17 18:06 +0100)
tree53e829136ae173a7b68e1fafd3266e63d43508c5
parentf06033295b51d4868c2b4921ad2287e8f55eb688
block: Fix permissions in image activation

Inactive images generally request less permissions for their image files
than they would if they were active (in particular, write permissions).
Activating the image involves extending the permissions, therefore.

drv->bdrv_invalidate_cache() can already require write access to the
image file, so we have to update the permissions earlier than that.
The current code does it only later, so we have to move up this part.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block.c