From nobody Fri May 17 10:34:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553584521374157.1548278082896; Tue, 26 Mar 2019 00:15:21 -0700 (PDT) Received: from localhost ([127.0.0.1]:54074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gIo-00042n-91 for importer@patchew.org; Tue, 26 Mar 2019 03:15:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gGE-0001rn-RP for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8gGE-0004Xk-1Q for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57354) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8gGD-0004X6-P6 for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:37 -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 05587F74C5 for ; Tue, 26 Mar 2019 07:12:37 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D254B5DAAD; Tue, 26 Mar 2019 07:12:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 597581132BB6; Tue, 26 Mar 2019 08:12:33 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 26 Mar 2019 08:12:30 +0100 Message-Id: <20190326071233.1947-2-armbru@redhat.com> In-Reply-To: <20190326071233.1947-1-armbru@redhat.com> References: <20190326071233.1947-1-armbru@redhat.com> MIME-Version: 1.0 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.38]); Tue, 26 Mar 2019 07:12:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/4] util/error: Remove an unnecessary NULL check 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: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 This NULL check was required while introduced in 680d16dcb79f. Later refactor added a NULL check in error_setv(), so this check is now redundant. Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190302223825.11192-2-philmd@redhat.com> Signed-off-by: Markus Armbruster --- util/error.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util/error.c b/util/error.c index b5ccbd8eac..934a78e1b1 100644 --- a/util/error.c +++ b/util/error.c @@ -103,10 +103,6 @@ void error_setg_errno_internal(Error **errp, va_list ap; int saved_errno =3D errno; =20 - if (errp =3D=3D NULL) { - return; - } - va_start(ap, fmt); error_setv(errp, src, line, func, ERROR_CLASS_GENERIC_ERROR, fmt, ap, os_errno !=3D 0 ? strerror(os_errno) : NULL); --=20 2.17.2 From nobody Fri May 17 10:34:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553584584082948.0784072581705; Tue, 26 Mar 2019 00:16:24 -0700 (PDT) Received: from localhost ([127.0.0.1]:54108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gJp-0004yA-3e for importer@patchew.org; Tue, 26 Mar 2019 03:16:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gGD-0001qn-D5 for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8gGC-0004WW-DM for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49674) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8gGC-0004Vp-3I for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:36 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 140E2308FF0E for ; Tue, 26 Mar 2019 07:12:35 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D5A8060C11 for ; Tue, 26 Mar 2019 07:12:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5CDF51132BD3; Tue, 26 Mar 2019 08:12:33 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 26 Mar 2019 08:12:31 +0100 Message-Id: <20190326071233.1947-3-armbru@redhat.com> In-Reply-To: <20190326071233.1947-1-armbru@redhat.com> References: <20190326071233.1947-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 26 Mar 2019 07:12:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/4] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate 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" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Patch created mechanically by rerunning: $ spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h \ --dir hw/block --in-place Signed-off-by: Markus Armbruster Message-Id: <20190313174433.12966-1-armbru@redhat.com> Reviewed-by: Eric Blake Acked-by: Paul Durrant Reviewed-by: Kevin Wolf --- hw/block/xen-block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 70fc2455e8..9c722b9b95 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -771,7 +771,7 @@ static XenBlockDrive *xen_block_drive_create(const char= *id, QDict *cache_qdict =3D qdict_new(); =20 qdict_put_bool(cache_qdict, "direct", true); - qdict_put_obj(file_layer, "cache", QOBJECT(cache_qdict)); + qdict_put(file_layer, "cache", cache_qdict); =20 qdict_put_str(file_layer, "aio", "native"); } @@ -796,7 +796,7 @@ static XenBlockDrive *xen_block_drive_create(const char= *id, qdict_put_str(driver_layer, "driver", driver); g_free(driver); =20 - qdict_put_obj(driver_layer, "file", QOBJECT(file_layer)); + qdict_put(driver_layer, "file", file_layer); =20 g_assert(!drive->node_name); drive->node_name =3D xen_block_blockdev_add(drive->id, driver_layer, --=20 2.17.2 From nobody Fri May 17 10:34:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553584454059683.0900716572553; Tue, 26 Mar 2019 00:14:14 -0700 (PDT) Received: from localhost ([127.0.0.1]:54054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gHi-0002iE-Ud for importer@patchew.org; Tue, 26 Mar 2019 03:14:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gGD-0001r0-Nc for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8gGC-0004Wn-FY for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45946) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8gGC-0004W1-6B for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:36 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19D6289C31; Tue, 26 Mar 2019 07:12:35 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D86141F8; Tue, 26 Mar 2019 07:12:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 606231132B6C; Tue, 26 Mar 2019 08:12:33 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 26 Mar 2019 08:12:32 +0100 Message-Id: <20190326071233.1947-4-armbru@redhat.com> In-Reply-To: <20190326071233.1947-1-armbru@redhat.com> References: <20190326071233.1947-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 26 Mar 2019 07:12:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/4] json: Fix off-by-one assert check in next_state() 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" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Liam Merwick The assert checking if the value of lexer->state in next_state(), which is used as an index to the 'json_lexer' array, incorrectly checks for an index value less than or equal to ARRAY_SIZE(json_lexer). Fix assert so that it just checks for an index less than the array size. Signed-off-by: Liam Merwick Message-Id: <1553169472-25325-1-git-send-email-liam.merwick@oracle.com> Reviewed-by: Markus Armbruster Reviewed-by: Li Qiang Reviewed-by: Stefano Garzarella Signed-off-by: Markus Armbruster --- qobject/json-lexer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c index a7df2093aa..632320d72d 100644 --- a/qobject/json-lexer.c +++ b/qobject/json-lexer.c @@ -266,7 +266,7 @@ static inline uint8_t next_state(JSONLexer *lexer, char= ch, bool flush, { uint8_t next; =20 - assert(lexer->state <=3D ARRAY_SIZE(json_lexer)); + assert(lexer->state < ARRAY_SIZE(json_lexer)); next =3D json_lexer[lexer->state][(uint8_t)ch]; *char_consumed =3D !flush && !(next & LOOKAHEAD); return next & ~LOOKAHEAD; --=20 2.17.2 From nobody Fri May 17 10:34:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553584456784884.8666593551005; Tue, 26 Mar 2019 00:14:16 -0700 (PDT) Received: from localhost ([127.0.0.1]:54058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gHi-0002il-EN for importer@patchew.org; Tue, 26 Mar 2019 03:14:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8gGD-0001qm-Cy for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8gGC-0004Wc-E4 for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13813) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8gGC-0004Vz-45 for qemu-devel@nongnu.org; Tue, 26 Mar 2019 03:12:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CDA4307D923; Tue, 26 Mar 2019 07:12:35 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE3847F48A; Tue, 26 Mar 2019 07:12:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 63E401132B74; Tue, 26 Mar 2019 08:12:33 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 26 Mar 2019 08:12:33 +0100 Message-Id: <20190326071233.1947-5-armbru@redhat.com> In-Reply-To: <20190326071233.1947-1-armbru@redhat.com> References: <20190326071233.1947-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 26 Mar 2019 07:12:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/4] qapi/qmp-dispatch: fix return value in do_qmp_dispatch 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: , Cc: Vladimir Sementsov-Ogievskiy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy There are no harm but just looks weird to return bool in pointer-returning function. Introduced in 69240fe62d1 with the whole failure-checking "if" chunk. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20190325154748.66381-1-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/qmp-dispatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 5f812bb9f2..e2c366e09e 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -111,7 +111,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, Q= Object *request, if (oob && !(cmd->options & QCO_ALLOW_OOB)) { error_setg(errp, "The command %s does not support OOB", command); - return false; + return NULL; } =20 if (runstate_check(RUN_STATE_PRECONFIG) && --=20 2.17.2