All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alberto Garcia <berto@igalia.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Max Reitz <mreitz@redhat.com>, Alberto Garcia <berto@igalia.com>
Subject: [Qemu-devel] [PATCH v2 0/7] Add "read-only" to the options QDict
Date: Thu, 15 Sep 2016 17:52:58 +0300	[thread overview]
Message-ID: <cover.1473950317.git.berto@igalia.com> (raw)

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(-)

-- 
2.9.3

             reply	other threads:[~2016-09-15 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 14:52 Alberto Garcia [this message]
2016-09-15 14:52 ` [Qemu-devel] [PATCH v2 1/7] block: Remove bdrv_is_snapshot Alberto Garcia
2016-09-15 14:53 ` [Qemu-devel] [PATCH v2 2/7] block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags Alberto Garcia
2016-09-15 14:53 ` [Qemu-devel] [PATCH v2 3/7] block: Update bs->open_flags earlier in bdrv_open_common() Alberto Garcia
2016-09-15 14:53 ` [Qemu-devel] [PATCH v2 4/7] block: Add "read-only" to the options QDict Alberto Garcia
2016-09-15 14:53 ` [Qemu-devel] [PATCH v2 5/7] block: Don't queue the same BDS twice in bdrv_reopen_queue_child() Alberto Garcia
2016-09-15 14:53 ` [Qemu-devel] [PATCH v2 6/7] commit: Add 'base' to the reopen queue before 'overlay_bs' Alberto Garcia
2016-09-15 14:53 ` [Qemu-devel] [PATCH v2 7/7] block: rename "read-only" to BDRV_OPT_READ_ONLY Alberto Garcia
2016-09-16 12:51 ` [Qemu-devel] [PATCH v2 0/7] Add "read-only" to the options QDict Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1473950317.git.berto@igalia.com \
    --to=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.