]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2.c
block: consistently use bdrv_is_read_only()
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 27 May 2021 15:40:54 +0000 (18:40 +0300)
committerKevin Wolf <kwolf@redhat.com>
Wed, 2 Jun 2021 12:23:20 +0000 (14:23 +0200)
commit307261b243df2edde538f3ed5c9d80e168529355
tree1658e2f592d19d9fbf5edcd75f98451a12bceffc
parent39df2c6d57b9eaa30d37a34b5a20cbc0474725c0
block: consistently use bdrv_is_read_only()

It's better to use accessor function instead of bs->read_only directly.
In some places use bdrv_is_writable() instead of
checking both BDRV_O_RDWR set and BDRV_O_INACTIVE not set.

In bdrv_open_common() it's a bit strange to add one more variable, but
we are going to drop bs->read_only in the next patch, so new ro local
variable substitutes it here.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210527154056.70294-2-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/block-backend.c
block/commit.c
block/io.c
block/qapi.c
block/qcow2-snapshot.c
block/qcow2.c
block/snapshot.c
block/vhdx-log.c