All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, codyprime@gmail.com, armbru@redhat.com,
	fam@euphon.net, stefanha@redhat.com, vsementsov@virtuozzo.com,
	jsnow@redhat.com, mreitz@redhat.com, kwolf@redhat.com
Subject: [PATCH v2 0/3] block: drop BlockDriverState::read_only
Date: Thu, 27 May 2021 18:40:53 +0300	[thread overview]
Message-ID: <20210527154056.70294-1-vsementsov@virtuozzo.com> (raw)

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

-- 
2.29.2



             reply	other threads:[~2021-05-27 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 15:40 Vladimir Sementsov-Ogievskiy [this message]
2021-05-27 15:40 ` [PATCH v2 1/3] block: consistently use bdrv_is_read_only() Vladimir Sementsov-Ogievskiy
2021-05-27 15:40 ` [PATCH v2 2/3] block: drop BlockDriverState::read_only Vladimir Sementsov-Ogievskiy
2021-05-27 15:40 ` [PATCH v2 3/3] block: drop BlockBackendRootState::read_only Vladimir Sementsov-Ogievskiy
2021-05-31 14:45 ` [PATCH v2 0/3] block: drop BlockDriverState::read_only 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=20210527154056.70294-1-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=codyprime@gmail.com \
    --cc=fam@euphon.net \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.