All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, qemu-trivial@nongnu.org,
	armbru@redhat.com, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] block: Use QDict helpers for --force-share
Date: Tue, 16 May 2017 10:08:21 +0800	[thread overview]
Message-ID: <20170516020821.GA30263@lemon.lan> (raw)
In-Reply-To: <20170515195439.17677-1-eblake@redhat.com>

On Mon, 05/15 14:54, Eric Blake wrote:
> Fam's addition of --force-share in commits 459571f7 and 335e9937
> were developed prior to the addition of QDict scalar insertion
> macros, but merged after the general cleanup in commit 46f5ac20.
> Patch created mechanically by rerunning:
> 
>  spatch --sp-file scripts/coccinelle/qobject.cocci \
>         --macro-file scripts/cocci-macro-file.h --dir . --in-place
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> 
> This could go in through Markus' qapi tree (since he took the
> original cleanup), a block maintainer (since it only touches block
> files), or even the trivial patch queue (since it's so small and
> mechanical) - I don't care which, as long as we don't drop it!
> 
>  qemu-img.c | 7 +++----
>  qemu-io.c  | 2 +-
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index b506839..60f1784 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -296,7 +296,7 @@ static BlockBackend *img_open_opts(const char *optstr,
>              error_report("--force-share/-U conflicts with image options");
>              return NULL;
>          }
> -        qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
> +        qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true);
>      }
>      blk = blk_new_open(NULL, NULL, options, flags, &local_err);
>      if (!blk) {
> @@ -326,7 +326,7 @@ static BlockBackend *img_open_file(const char *filename,
>      }
> 
>      if (force_share) {
> -        qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
> +        qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true);
>      }
>      blk = blk_new_open(filename, NULL, options, flags, &local_err);
>      if (!blk) {
> @@ -3156,8 +3156,7 @@ static int img_rebase(int argc, char **argv)
>              if (!options) {
>                  options = qdict_new();
>              }
> -            qdict_put(options, BDRV_OPT_FORCE_SHARE,
> -                      qbool_from_bool(true));
> +            qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true);
>          }
>          bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name));
>          blk_old_backing = blk_new_open(backing_name, NULL,
> diff --git a/qemu-io.c b/qemu-io.c
> index 34fa8a1..8e38b28 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -76,7 +76,7 @@ static int openfile(char *name, int flags, bool writethrough, bool force_share,
>              QDECREF(opts);
>              return 1;
>          }
> -        qdict_put(opts, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
> +        qdict_put_bool(opts, BDRV_OPT_FORCE_SHARE, true);
>      }
>      qemuio_blk = blk_new_open(name, NULL, opts, flags, &local_err);
>      if (!qemuio_blk) {
> -- 
> 2.9.4
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>


WARNING: multiple messages have this Message-ID (diff)
From: Fam Zheng <famz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, qemu-trivial@nongnu.org,
	armbru@redhat.com, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] block: Use QDict helpers for --force-share
Date: Tue, 16 May 2017 10:08:21 +0800	[thread overview]
Message-ID: <20170516020821.GA30263@lemon.lan> (raw)
In-Reply-To: <20170515195439.17677-1-eblake@redhat.com>

On Mon, 05/15 14:54, Eric Blake wrote:
> Fam's addition of --force-share in commits 459571f7 and 335e9937
> were developed prior to the addition of QDict scalar insertion
> macros, but merged after the general cleanup in commit 46f5ac20.
> Patch created mechanically by rerunning:
> 
>  spatch --sp-file scripts/coccinelle/qobject.cocci \
>         --macro-file scripts/cocci-macro-file.h --dir . --in-place
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> 
> This could go in through Markus' qapi tree (since he took the
> original cleanup), a block maintainer (since it only touches block
> files), or even the trivial patch queue (since it's so small and
> mechanical) - I don't care which, as long as we don't drop it!
> 
>  qemu-img.c | 7 +++----
>  qemu-io.c  | 2 +-
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index b506839..60f1784 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -296,7 +296,7 @@ static BlockBackend *img_open_opts(const char *optstr,
>              error_report("--force-share/-U conflicts with image options");
>              return NULL;
>          }
> -        qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
> +        qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true);
>      }
>      blk = blk_new_open(NULL, NULL, options, flags, &local_err);
>      if (!blk) {
> @@ -326,7 +326,7 @@ static BlockBackend *img_open_file(const char *filename,
>      }
> 
>      if (force_share) {
> -        qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
> +        qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true);
>      }
>      blk = blk_new_open(filename, NULL, options, flags, &local_err);
>      if (!blk) {
> @@ -3156,8 +3156,7 @@ static int img_rebase(int argc, char **argv)
>              if (!options) {
>                  options = qdict_new();
>              }
> -            qdict_put(options, BDRV_OPT_FORCE_SHARE,
> -                      qbool_from_bool(true));
> +            qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true);
>          }
>          bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name));
>          blk_old_backing = blk_new_open(backing_name, NULL,
> diff --git a/qemu-io.c b/qemu-io.c
> index 34fa8a1..8e38b28 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -76,7 +76,7 @@ static int openfile(char *name, int flags, bool writethrough, bool force_share,
>              QDECREF(opts);
>              return 1;
>          }
> -        qdict_put(opts, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
> +        qdict_put_bool(opts, BDRV_OPT_FORCE_SHARE, true);
>      }
>      qemuio_blk = blk_new_open(name, NULL, opts, flags, &local_err);
>      if (!qemuio_blk) {
> -- 
> 2.9.4
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

  reply	other threads:[~2017-05-16  2:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 19:54 [Qemu-trivial] [PATCH] block: Use QDict helpers for --force-share Eric Blake
2017-05-15 19:54 ` [Qemu-devel] " Eric Blake
2017-05-16  2:08 ` Fam Zheng [this message]
2017-05-16  2:08   ` Fam Zheng
2017-05-16 11:43 ` [Qemu-trivial] " Markus Armbruster
2017-05-16 11:43   ` Markus Armbruster

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=20170516020821.GA30263@lemon.lan \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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.