diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2021-05-27 18:40:54 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2021-06-02 14:23:20 +0200 |
commit | 307261b243df2edde538f3ed5c9d80e168529355 (patch) | |
tree | 1658e2f592d19d9fbf5edcd75f98451a12bceffc /block/vhdx-log.c | |
parent | 39df2c6d57b9eaa30d37a34b5a20cbc0474725c0 (diff) | |
download | qemu-307261b243df2edde538f3ed5c9d80e168529355.zip qemu-307261b243df2edde538f3ed5c9d80e168529355.tar.gz qemu-307261b243df2edde538f3ed5c9d80e168529355.tar.bz2 |
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>
Diffstat (limited to 'block/vhdx-log.c')
-rw-r--r-- | block/vhdx-log.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/vhdx-log.c b/block/vhdx-log.c index 404fb5f..7672161 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -801,7 +801,7 @@ int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed, } if (logs.valid) { - if (bs->read_only) { + if (bdrv_is_read_only(bs)) { bdrv_refresh_filename(bs); ret = -EPERM; error_setg(errp, |