Skip to content

Add "read-only" to the options QDict

Alberto Garcia 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 Latest7 patches 1 replyApplied
  2. v17 patches 16 repliesSuperseded

Changes in v2 from the cover letter

- Patch 2:
- Update description [Kevin]
- Patch 4:
- Inherit the value of "read-only" in bdrv_temp_snapshot_options().

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/7block: Remove bdrv_is_snapshotblock.c include/block/block.h+0 -60 replies
2/7block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flagsblock.c+11 -120 replies
3/7block: Update bs->open_flags earlier in bdrv_open_common()block.c+2 -30 replies
4/7block: Add "read-only" to the options QDictblock.c block/vvfat.c blockdev.c +1 more+45 -130 replies
5/7block: Don't queue the same BDS twice in bdrv_reopen_queue_child()block.c+19 -30 replies
6/7commit: Add 'base' to the reopen queue before 'overlay_bs'block/commit.c+4 -40 replies
7/7block: rename "read-only" to BDRV_OPT_READ_ONLYblockdev.c+5 -50 replies

Reviews trailers per patch

5 of 7 patches have a Reviewed-by or Acked-by.

PatchKevin WolfEric Blake
1/7R-b R-b
2/7
3/7R-b
4/7
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/7] Add "read-only" to the options QDict

This series adds "read-only" to the options QDict, fixing a long-standing problem with the reopening code.

[E] <- [D] <- [C] <- [B] <- [A]

In a normal scenario, the active layer [A] is in read-write mode and everything else is read-only. If we reopen [D] in read-write mode and later reopen [B], then [D] will become read-only when inheriting the flags from its parent (see bdrv_backing_options()). With this series, inheriting options doesn't need to override values that have been explicitly set before.

The BDRV_O_RDWR flag is not removed yet, but its keep in sync with the value of the "read-only" option. Removing the BDRV_O_RDWR flag is not straightforward in all cases and can result in code that is significantly slower and less readable. Therefore it will be dealt with in the future.

Regards,

Berto

v2:
- Patch 2:
- Update description [Kevin]
- Patch 4:
- Inherit the value of "read-only" in bdrv_temp_snapshot_options().

    [Kevin]

- Remove "read-only" from qemu_root_bds_opts and simply set a default value in bds_tree_init(). [Kevin]
- Patch 7:
- Rebase after the changes made to qemu_root_bds_opts in patch 4.

v1: https://lists.gnu.org/archive/html/qemu-block/2016-09/msg00191.html
- Initial release

git backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/7:[----] [--] 'block: Remove bdrv_is_snapshot'
002/7:[----] [--] 'block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags' 003/7:[----] [--] 'block: Update bs->open_flags earlier in bdrv_open_common()' 004/7:[0013] [FC] 'block: Add "read-only" to the options QDict'
005/7:[----] [--] 'block: Don't queue the same BDS twice in bdrv_reopen_queue_child()' 006/7:[----] [--] 'commit: Add 'base' to the reopen queue before 'overlay_bs'' 007/7:[0002] [FC] 'block: rename "read-only" to BDRV_OPT_READ_ONLY'

Alberto Garcia (7):
block: Remove bdrv_is_snapshot
block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the
flags
block: Update bs->open_flags earlier in bdrv_open_common()
block: Add "read-only" to the options QDict
block: Don't queue the same BDS twice in bdrv_reopen_queue_child()
commit: Add 'base' to the reopen queue before 'overlay_bs'
block: rename "read-only" to BDRV_OPT_READ_ONLY

 block.c               | 89 +++++++++++++++++++++++++++++++++++++--------------
 block/commit.c        |  8 ++---
 block/vvfat.c         |  3 +-
 blockdev.c            | 26 +++++++--------
 include/block/block.h |  2 +-
 5 files changed, 84 insertions(+), 44 deletions(-)
Signature · 1 line
2.9.3