From nobody Wed Nov 5 10:51:23 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534317323245978.5626072816868; Wed, 15 Aug 2018 00:15:23 -0700 (PDT) Received: from localhost ([::1]:47648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpq1R-0001dg-Ek for importer@patchew.org; Wed, 15 Aug 2018 03:15:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fppzd-0000k1-CG for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fppzT-00083l-AB for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33962 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fppzS-00082S-SZ for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73DC3CFB77 for ; Wed, 15 Aug 2018 07:13:10 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-62.ams2.redhat.com [10.36.117.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44F732027047; Wed, 15 Aug 2018 07:13:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 06A3A1138651; Wed, 15 Aug 2018 09:13:09 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2018 09:13:04 +0200 Message-Id: <20180815071308.11777-2-armbru@redhat.com> In-Reply-To: <20180815071308.11777-1-armbru@redhat.com> References: <20180815071308.11777-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 15 Aug 2018 07:13:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 15 Aug 2018 07:13:10 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/5] qmp-shell: learn to send commands with quoted arguments 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?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Use shlex to split the CLI command, respecting quoted arguments, and also comments. This allows to call for ex: (QEMU) human-monitor-command command-line=3D"screendump /dev/null" {"execute": "human-monitor-command", "arguments": {"command-line": "screend= ump /dev/null"}} Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180326150916.9602-3-marcandre.lureau@redhat.com> Reviewed-by: Eduardo Habkost Signed-off-by: Markus Armbruster --- scripts/qmp/qmp-shell | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index a42306dd89..770140772d 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -74,6 +74,7 @@ import sys import os import errno import atexit +import shlex =20 class QMPCompleter(list): def complete(self, text, state): @@ -219,7 +220,7 @@ class QMPShell(qmp.QEMUMonitorProtocol): =20 < command-name > [ arg-name1=3Darg1 ] ... [ arg-nameN=3DargN ] """ - cmdargs =3D cmdline.split() + cmdargs =3D shlex.split(cmdline) =20 # Transactional CLI entry/exit: if cmdargs[0] =3D=3D 'transaction(': --=20 2.17.1 From nobody Wed Nov 5 10:51:23 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534317479584884.7056082659535; Wed, 15 Aug 2018 00:17:59 -0700 (PDT) Received: from localhost ([::1]:47662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpq46-0003YK-DJ for importer@patchew.org; Wed, 15 Aug 2018 03:17:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fppzh-0000kZ-I7 for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fppzd-00089A-3M for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41064 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fppzU-00085z-Jw for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42D624023476 for ; Wed, 15 Aug 2018 07:13:12 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-62.ams2.redhat.com [10.36.117.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 450E210F1C1F; Wed, 15 Aug 2018 07:13:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0A3341138656; Wed, 15 Aug 2018 09:13:09 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2018 09:13:05 +0200 Message-Id: <20180815071308.11777-3-armbru@redhat.com> In-Reply-To: <20180815071308.11777-1-armbru@redhat.com> References: <20180815071308.11777-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 15 Aug 2018 07:13:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 15 Aug 2018 07:13:12 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 2/5] tests: change /0.15/* tests to /qmp/* 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?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Presumably 0.15 was the version it was first introduced, but qmp keeps evolving. There is no point in having that version as test prefix, 'qmp' makes more sense here. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake Message-Id: <20180326150916.9602-12-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- tests/test-qmp-cmds.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test-qmp-cmds.c b/tests/test-qmp-cmds.c index ba41a6161e..ab414fa0c9 100644 --- a/tests/test-qmp-cmds.c +++ b/tests/test-qmp-cmds.c @@ -286,11 +286,11 @@ int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); =20 - g_test_add_func("/0.15/dispatch_cmd", test_dispatch_cmd); - g_test_add_func("/0.15/dispatch_cmd_failure", test_dispatch_cmd_failur= e); - g_test_add_func("/0.15/dispatch_cmd_io", test_dispatch_cmd_io); - g_test_add_func("/0.15/dealloc_types", test_dealloc_types); - g_test_add_func("/0.15/dealloc_partial", test_dealloc_partial); + g_test_add_func("/qmp/dispatch_cmd", test_dispatch_cmd); + g_test_add_func("/qmp/dispatch_cmd_failure", test_dispatch_cmd_failure= ); + g_test_add_func("/qmp/dispatch_cmd_io", test_dispatch_cmd_io); + g_test_add_func("/qmp/dealloc_types", test_dealloc_types); + g_test_add_func("/qmp/dealloc_partial", test_dealloc_partial); =20 test_qmp_init_marshal(&qmp_commands); g_test_run(); --=20 2.17.1 From nobody Wed Nov 5 10:51:23 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534317322210929.4573905821744; Wed, 15 Aug 2018 00:15:22 -0700 (PDT) Received: from localhost ([::1]:47647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpq1U-0001cx-8E for importer@patchew.org; Wed, 15 Aug 2018 03:15:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fppzd-0000k0-CF for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fppzT-00084D-H6 for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41062 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fppzS-00082U-St for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 868D2402347F for ; Wed, 15 Aug 2018 07:13:10 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-62.ams2.redhat.com [10.36.117.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44F442026D7E for ; Wed, 15 Aug 2018 07:13:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0D9E21138657; Wed, 15 Aug 2018 09:13:09 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2018 09:13:06 +0200 Message-Id: <20180815071308.11777-4-armbru@redhat.com> In-Reply-To: <20180815071308.11777-1-armbru@redhat.com> References: <20180815071308.11777-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 15 Aug 2018 07:13:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 15 Aug 2018 07:13:10 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/5] qapi: Fix some pycodestyle-3 complaints 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: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fix the following issues: common.py:873:13: E129 visually indented line with same indent as next = logical line common.py:1766:5: E741 ambiguous variable name 'l' common.py:1784:1: E305 expected 2 blank lines after class or function d= efinition, found 1 common.py:1833:1: E305 expected 2 blank lines after class or function d= efinition, found 1 common.py:1843:1: E305 expected 2 blank lines after class or function d= efinition, found 1 visit.py:181:18: E127 continuation line over-indented for visual indent Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180621083551.775-1-armbru@redhat.com> [Fixup squashed in:] Message-ID: <871sd0nzw9.fsf@dusky.pond.sub.org> Reviewed-by: Daniel P. Berrang=C3=A9 --- scripts/qapi/common.py | 15 +++++++++------ scripts/qapi/visit.py | 2 +- tests/qapi-schema/test-qapi.py | 13 +++++++------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 9230a2a3e8..02c5c6767a 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -884,12 +884,12 @@ def check_keys(expr_elem, meta, required, optional=3D= []): if key not in required and key not in optional: raise QAPISemError(info, "Unknown key '%s' in %s '%s'" % (key, meta, name)) - if (key =3D=3D 'gen' or key =3D=3D 'success-response') and value i= s not False: + if key in ['gen', 'success-response'] and value is not False: raise QAPISemError(info, "'%s' of %s '%s' should only use false valu= e" % (key, meta, name)) - if (key =3D=3D 'boxed' or key =3D=3D 'allow-oob' or - key =3D=3D 'allow-preconfig') and value is not True: + if (key in ['boxed', 'allow-oob', 'allow-preconfig'] + and value is not True): raise QAPISemError(info, "'%s' of %s '%s' should only use true value" % (key, meta, name)) @@ -1845,12 +1845,12 @@ def camel_to_upper(value): return c_fun_str =20 new_name =3D '' - l =3D len(c_fun_str) - for i in range(l): + length =3D len(c_fun_str) + for i in range(length): c =3D c_fun_str[i] # When c is upper and no '_' appears before, do more checks if c.isupper() and (i > 0) and c_fun_str[i - 1] !=3D '_': - if i < l - 1 and c_fun_str[i + 1].islower(): + if i < length - 1 and c_fun_str[i + 1].islower(): new_name +=3D '_' elif c_fun_str[i - 1].isdigit(): new_name +=3D '_' @@ -1863,6 +1863,7 @@ def c_enum_const(type_name, const_name, prefix=3DNone= ): type_name =3D prefix return camel_to_upper(type_name) + '_' + c_name(const_name, False).upp= er() =20 + if hasattr(str, 'maketrans'): c_name_trans =3D str.maketrans('.-', '__') else: @@ -1912,6 +1913,7 @@ def c_name(name, protect=3DTrue): return 'q_' + name return name =20 + eatspace =3D '\033EATSPACE.' pointer_suffix =3D ' *' + eatspace =20 @@ -1922,6 +1924,7 @@ def genindent(count): ret +=3D ' ' return ret =20 + indent_level =3D 0 =20 =20 diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index dd5034a66a..460cf12989 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -187,7 +187,7 @@ void visit_type_%(c_name)s(Visitor *v, const char *name= , %(c_name)s **obj, Error } switch ((*obj)->type) { ''', - c_name=3Dc_name(name)) + c_name=3Dc_name(name)) =20 for var in variants.variants: ret +=3D mcgen(''' diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index f514fe71e4..cea21c773a 100644 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -34,8 +34,8 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): if base: print(' base %s' % base.name) for m in members: - print(' member %s: %s optional=3D%s' % \ - (m.name, m.type.name, m.optional)) + print(' member %s: %s optional=3D%s' + % (m.name, m.type.name, m.optional)) self._print_variants(variants) self._print_if(ifcond) =20 @@ -46,10 +46,11 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): =20 def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, success_response, boxed, allow_oob, allow_preconfig): - print('command %s %s -> %s' % \ - (name, arg_type and arg_type.name, ret_type and ret_type.nam= e)) - print(' gen=3D%s success_response=3D%s boxed=3D%s oob=3D%s preco= nfig=3D%s' % \ - (gen, success_response, boxed, allow_oob, allow_preconfig)) + print('command %s %s -> %s' + % (name, arg_type and arg_type.name, + ret_type and ret_type.name)) + print(' gen=3D%s success_response=3D%s boxed=3D%s oob=3D%s preco= nfig=3D%s' + % (gen, success_response, boxed, allow_oob, allow_preconfig)) self._print_if(ifcond) =20 def visit_event(self, name, info, ifcond, arg_type, boxed): --=20 2.17.1 From nobody Wed Nov 5 10:51:23 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534317480651540.4318372887479; Wed, 15 Aug 2018 00:18:00 -0700 (PDT) Received: from localhost ([::1]:47663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpq47-0003Yz-I7 for importer@patchew.org; Wed, 15 Aug 2018 03:17:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fppzh-0000ka-IF for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fppzd-00089K-7S for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41640 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fppzU-00085y-JO for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:12 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 425E07A7ED for ; Wed, 15 Aug 2018 07:13:12 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-62.ams2.redhat.com [10.36.117.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 450031C722; Wed, 15 Aug 2018 07:13:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 10FF01138659; Wed, 15 Aug 2018 09:13:09 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2018 09:13:07 +0200 Message-Id: <20180815071308.11777-5-armbru@redhat.com> In-Reply-To: <20180815071308.11777-1-armbru@redhat.com> References: <20180815071308.11777-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 15 Aug 2018 07:13:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 15 Aug 2018 07:13:12 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 4/5] tests: fix crumple/recursive leak 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?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Spotted by ASAN: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D27907=3D=3DERROR: LeakSanitizer: detected memory leaks Direct leak of 4120 byte(s) in 1 object(s) allocated from: #0 0x7f913458ce50 in calloc (/lib64/libasan.so.5+0xeee50) #1 0x7f9133fd641d in g_malloc0 (/lib64/libglib-2.0.so.0+0x5241d) #2 0x5561c6643c95 in qdict_crumple_test_recursive /home/elmarco/src/qq/= tests/check-block-qdict.c:438 #3 0x7f9133ff7c49 (/lib64/libglib-2.0.so.0+0x73c49) Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180809114417.28718-2-marcandre.lureau@redhat.com> [Screwed up in commit 2860b2b2cb8] Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- tests/check-block-qdict.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/check-block-qdict.c b/tests/check-block-qdict.c index 478807f839..73d3e9f574 100644 --- a/tests/check-block-qdict.c +++ b/tests/check-block-qdict.c @@ -491,6 +491,7 @@ static void qdict_crumple_test_recursive(void) empty_list_0 =3D qobject_to(QDict, qlist_pop(empty_list)); g_assert(empty_list_0); g_assert_cmpint(qdict_size(empty_list_0), =3D=3D, 0); + qobject_unref(empty_list_0); =20 qobject_unref(src); qobject_unref(dst); --=20 2.17.1 From nobody Wed Nov 5 10:51:23 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534317328519772.2956450593192; Wed, 15 Aug 2018 00:15:28 -0700 (PDT) Received: from localhost ([::1]:47649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpq1W-0001gn-Lg for importer@patchew.org; Wed, 15 Aug 2018 03:15:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fppzd-0000k2-CW for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fppzU-00086A-Et for qemu-devel@nongnu.org; Wed, 15 Aug 2018 03:13:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41794 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fppzT-00084m-Uj; Wed, 15 Aug 2018 03:13:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 98A078197020; Wed, 15 Aug 2018 07:13:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-62.ams2.redhat.com [10.36.117.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68DC12166BA0; Wed, 15 Aug 2018 07:13:11 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 14D57113865A; Wed, 15 Aug 2018 09:13:09 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2018 09:13:08 +0200 Message-Id: <20180815071308.11777-6-armbru@redhat.com> In-Reply-To: <20180815071308.11777-1-armbru@redhat.com> References: <20180815071308.11777-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 15 Aug 2018 07:13:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 15 Aug 2018 07:13:11 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 5/5] monitor: fix oob command leak 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?Marc-Andr=C3=A9=20Lureau?= , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Spotted by ASAN, during make check... Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f8e27262c48 in malloc (/lib64/libasan.so.5+0xeec48) #1 0x7f8e26a5f3c5 in g_malloc (/lib64/libglib-2.0.so.0+0x523c5) #2 0x555ab67078a8 in qstring_from_str /home/elmarco/src/qq/qobject/qstr= ing.c:67 #3 0x555ab67071e4 in qstring_new /home/elmarco/src/qq/qobject/qstring.c= :24 #4 0x555ab6713fbf in qstring_from_escaped_str /home/elmarco/src/qq/qobj= ect/json-parser.c:144 #5 0x555ab671738c in parse_literal /home/elmarco/src/qq/qobject/json-pa= rser.c:506 #6 0x555ab67179c3 in parse_value /home/elmarco/src/qq/qobject/json-pars= er.c:569 #7 0x555ab6715123 in parse_pair /home/elmarco/src/qq/qobject/json-parse= r.c:306 #8 0x555ab6715483 in parse_object /home/elmarco/src/qq/qobject/json-par= ser.c:357 #9 0x555ab671798b in parse_value /home/elmarco/src/qq/qobject/json-pars= er.c:561 #10 0x555ab6717a6b in json_parser_parse_err /home/elmarco/src/qq/qobjec= t/json-parser.c:592 #11 0x555ab4fd4dcf in handle_qmp_command /home/elmarco/src/qq/monitor.c= :4257 #12 0x555ab6712c4d in json_message_process_token /home/elmarco/src/qq/q= object/json-streamer.c:105 #13 0x555ab67e01e2 in json_lexer_feed_char /home/elmarco/src/qq/qobject= /json-lexer.c:323 #14 0x555ab67e0af6 in json_lexer_feed /home/elmarco/src/qq/qobject/json= -lexer.c:373 #15 0x555ab6713010 in json_message_parser_feed /home/elmarco/src/qq/qob= ject/json-streamer.c:124 #16 0x555ab4fd58ec in monitor_qmp_read /home/elmarco/src/qq/monitor.c:4= 337 #17 0x555ab6559df2 in qemu_chr_be_write_impl /home/elmarco/src/qq/chard= ev/char.c:175 #18 0x555ab6559e95 in qemu_chr_be_write /home/elmarco/src/qq/chardev/ch= ar.c:187 #19 0x555ab6560127 in fd_chr_read /home/elmarco/src/qq/chardev/char-fd.= c:66 #20 0x555ab65d9c73 in qio_channel_fd_source_dispatch /home/elmarco/src/= qq/io/channel-watch.c:84 #21 0x7f8e26a598ac in g_main_context_dispatch (/lib64/libglib-2.0.so.0+= 0x4c8ac) Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180809114417.28718-4-marcandre.lureau@redhat.com> [Screwed up in commit b27314567d4] Cc: qemu-stable@nongnu.org Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor.c b/monitor.c index 77861e96af..a1999e396c 100644 --- a/monitor.c +++ b/monitor.c @@ -4277,6 +4277,8 @@ static void handle_qmp_command(JSONMessageParser *par= ser, GQueue *tokens) trace_monitor_qmp_cmd_out_of_band(qobject_get_try_str(id) ?: ""); monitor_qmp_dispatch(mon, req, id); + qobject_unref(req); + qobject_unref(id); return; } =20 --=20 2.17.1