qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Alberto Garcia <berto@igalia.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5 05/16] block: Use bdrv_reopen_set_read_only() in stream_start/complete()
Date: Tue, 20 Nov 2018 19:00:29 +0100	[thread overview]
Message-ID: <20181120180029.GD7513@localhost.localdomain> (raw)
In-Reply-To: <ab8395c8926892311948dcfd3f88c598dd74797b.1542031058.git.berto@igalia.com>

Am 12.11.2018 um 15:00 hat Alberto Garcia geschrieben:
> This patch replaces the bdrv_reopen() calls that set and remove the
> BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/stream.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/block/stream.c b/block/stream.c
> index 81a7ec8ece..262d280ccd 100644
> --- a/block/stream.c
> +++ b/block/stream.c
> @@ -34,7 +34,7 @@ typedef struct StreamBlockJob {
>      BlockDriverState *base;
>      BlockdevOnError on_error;
>      char *backing_file_str;
> -    int bs_flags;
> +    bool bs_read_only;
>  } StreamBlockJob;
>  
>  static int coroutine_fn stream_populate(BlockBackend *blk,
> @@ -89,10 +89,10 @@ static void stream_clean(Job *job)
>      BlockDriverState *bs = blk_bs(bjob->blk);
>  
>      /* Reopen the image back in read-only mode if necessary */
> -    if (s->bs_flags != bdrv_get_flags(bs)) {
> +    if (s->bs_read_only) {
>          /* Give up write permissions before making it read-only */
>          blk_set_perm(bjob->blk, 0, BLK_PERM_ALL, &error_abort);
> -        bdrv_reopen(bs, s->bs_flags, NULL);
> +        bdrv_reopen_set_read_only(bs, true, NULL);
>      }
>  
>      g_free(s->backing_file_str);
> @@ -226,12 +226,12 @@ void stream_start(const char *job_id, BlockDriverState *bs,
>  {
>      StreamBlockJob *s;
>      BlockDriverState *iter;
> -    int orig_bs_flags;
> +    int bs_read_only;

bool certainly?

Kevin

  reply	other threads:[~2018-11-20 18:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 14:00 [Qemu-devel] [PATCH v5 00/16] Don't pass flags to bdrv_reopen_queue() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 01/16] block: Add bdrv_reopen_set_read_only() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 02/16] block: Use bdrv_reopen_set_read_only() in bdrv_backing_update_filename() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 03/16] block: Use bdrv_reopen_set_read_only() in commit_start/complete() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 04/16] block: Use bdrv_reopen_set_read_only() in bdrv_commit() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 05/16] block: Use bdrv_reopen_set_read_only() in stream_start/complete() Alberto Garcia
2018-11-20 18:00   ` Kevin Wolf [this message]
2018-11-20 18:31     ` Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 06/16] block: Use bdrv_reopen_set_read_only() in qmp_change_backing_file() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 07/16] block: Use bdrv_reopen_set_read_only() in external_snapshot_commit() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 08/16] block: Use bdrv_reopen_set_read_only() in the mirror driver Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 09/16] block: Drop bdrv_reopen() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 10/16] qemu-io: Put flag changes in the options QDict in reopen_f() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 11/16] block: Clean up reopen_backing_file() in block/replication.c Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 12/16] block: Remove flags parameter from bdrv_reopen_queue() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 13/16] block: Stop passing flags to bdrv_reopen_queue_child() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 14/16] block: Remove assertions from update_flags_from_options() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 15/16] block: Assert that flags are up-to-date in bdrv_reopen_prepare() Alberto Garcia
2018-11-12 14:00 ` [Qemu-devel] [PATCH v5 16/16] block: Fix update of BDRV_O_AUTO_RDONLY in update_flags_from_options() Alberto Garcia
2018-11-20 18:21 ` [Qemu-devel] [PATCH v5 00/16] Don't pass flags to bdrv_reopen_queue() Kevin Wolf
2018-11-20 18:33   ` Alberto Garcia
2018-11-21 16:14 ` 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=20181120180029.GD7513@localhost.localdomain \
    --to=kwolf@redhat.com \
    --cc=berto@igalia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).