mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
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>
This commit is contained in:
committed by
Kevin Wolf
parent
39df2c6d57
commit
307261b243
@ -453,7 +453,7 @@ int bdrv_commit(BlockDriverState *bs)
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
ro = backing_file_bs->read_only;
|
||||
ro = bdrv_is_read_only(backing_file_bs);
|
||||
|
||||
if (ro) {
|
||||
if (bdrv_reopen_set_read_only(backing_file_bs, false, NULL)) {
|
||||
|
Reference in New Issue
Block a user