]> git.proxmox.com Git - mirror_qemu.git/commit
block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags
authorAlberto Garcia <berto@igalia.com>
Thu, 15 Sep 2016 14:53:00 +0000 (17:53 +0300)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Sep 2016 11:36:10 +0000 (13:36 +0200)
commit14499ea5413be45bbb3934dd6fd8fa27c54c1dd4
tree1a9eced273e3553c099021ac57a6d41053cf2eba
parent38b5e4c3dc6d713eae340341ee139c12d5c1a21e
block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags

If an image is opened with snapshot=on, its flags are modified by
bdrv_backing_options() and then bs->open_flags is updated accordingly.
This last step is unnecessary if we calculate the new flags before
setting bs->open_flags.

Soon we'll introduce the "read-only" option, and then we'll need to
be able to modify its value in the QDict when snapshot=on. This is
more cumbersome if bs->options is already set. This patch simplifies
that. Other than that, there are no semantic changes. Although it
might seem that bs->options can have a different value now because
it is stored after calling bdrv_backing_options(), this call doesn't
actually modify them in this scenario.

The code that sets BDRV_O_ALLOW_RDWR is also moved for the same
reason.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c