Skip to content

block: drop BlockDriverState::read_only

Vladimir Sementsov-Ogievskiy qemu-devel 2 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v13 patches 3 repliesSuperseded

Changes in v2 from the cover letter

01: write "update_header =\n..." in one line
03: only change BlockBackendRootState, don't touch side logic

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3block: consistently use bdrv_is_read_only()block.c block/block-backend.c block/commit.c +6 more+17 -150 replies
2/3block: drop BlockDriverState::read_onlyblock.c include/block/block_int.h tests/unit/test-block-iothread.c+1 -130 replies
3/3block: drop BlockBackendRootState::read_onlyblock/block-backend.c blockdev.c include/block/block_int.h+3 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] block: drop BlockDriverState::read_only

Hi all!

The field duplicates information in .open_flags. We have to carefully sync these two fields everywhere. It's simple to introduce a bug by forgetting it.

Let's drop the field, and fix users to call bdrv_is_read_only() and bdrv_is_writable() instead.

v2:
01: write "update_header =\n..." in one line
03: only change BlockBackendRootState, don't touch side logic

Vladimir Sementsov-Ogievskiy (3):
block: consistently use bdrv_is_read_only()
block: drop BlockDriverState::read_only
block: drop BlockBackendRootState::read_only

 include/block/block_int.h        |  2 --
 block.c                          | 16 +++++++---------
 block/block-backend.c            | 10 ++--------
 block/commit.c                   |  2 +-
 block/io.c                       |  4 ++--
 block/qapi.c                     |  2 +-
 block/qcow2-snapshot.c           |  2 +-
 block/qcow2.c                    |  5 ++---
 block/snapshot.c                 |  2 +-
 block/vhdx-log.c                 |  2 +-
 blockdev.c                       |  3 +--
 tests/unit/test-block-iothread.c |  6 ------
 12 files changed, 19 insertions(+), 37 deletions(-)
Signature · 1 line
2.29.2