From nobody Tue Feb 10 17:08:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 14955427372601002.0748294534177; Tue, 23 May 2017 05:32:17 -0700 (PDT) Received: from localhost ([::1]:48761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8yz-0006cD-JO for importer@patchew.org; Tue, 23 May 2017 08:32:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xZ-0005ku-52 for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xX-00014a-EM for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49860) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xX-00013g-5n for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:43 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33FA080C0F for ; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0038B7814F; Tue, 23 May 2017 12:30:41 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E868E11386DC; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 33FA080C0F Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 33FA080C0F From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:37 +0200 Message-Id: <1495542638-12335-9-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 May 2017 12:30:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] block: Use QDict helpers for --force-share X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake 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 Message-Id: <20170515195439.17677-1-eblake@redhat.com> Reviewed-by: Fam Zheng Signed-off-by: Markus Armbruster --- 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 =3D blk_new_open(NULL, NULL, options, flags, &local_err); if (!blk) { @@ -326,7 +326,7 @@ static BlockBackend *img_open_file(const char *filename, } =20 if (force_share) { - qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true)); + qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true); } blk =3D 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 =3D 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 =3D 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 writethro= ugh, 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 =3D blk_new_open(name, NULL, opts, flags, &local_err); if (!qemuio_blk) { --=20 2.7.4