From nobody Mon Feb 9 23:19:52 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.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507747993819847.4422455343284; Wed, 11 Oct 2017 11:53:13 -0700 (PDT) Received: from localhost ([::1]:42228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M7y-0007a4-Sg for importer@patchew.org; Wed, 11 Oct 2017 14:53:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M67-0006Ka-Ve for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2M66-0000kV-V5 for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49766) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2M64-0000hU-RQ; Wed, 11 Oct 2017 14:51:12 -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 BA51DC059B75; Wed, 11 Oct 2017 18:51:11 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 478EB1863D; Wed, 11 Oct 2017 18:51:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BA51DC059B75 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Wed, 11 Oct 2017 15:50:59 -0300 Message-Id: <20171011185103.26259-2-ehabkost@redhat.com> In-Reply-To: <20171011185103.26259-1-ehabkost@redhat.com> References: <20171011185103.26259-1-ehabkost@redhat.com> MIME-Version: 1.0 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.32]); Wed, 11 Oct 2017 18:51:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 1/5] iotests: Set up Python logging 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: Kevin Wolf , Max Reitz , qemu-block@nongnu.org, Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Set up Python logging module instead of relying on QEMUMachine._debug to enable debugging messages. Cc: Kevin Wolf Cc: Max Reitz Cc: qemu-block@nongnu.org Signed-off-by: Eduardo Habkost Message-Id: <20170927130339.21444-3-ehabkost@redhat.com> Reviewed-by: Daniel P. Berrange Reviewed-by: Luk=C3=A1=C5=A1 Doktor Signed-off-by: Eduardo Habkost --- tests/qemu-iotests/iotests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 1af117e37d..36a7757aaf 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -28,6 +28,7 @@ import qtest import struct import json import signal +import logging =20 =20 # This will not work if arguments contain spaces but is necessary if we @@ -467,6 +468,8 @@ def main(supported_fmts=3D[], supported_oses=3D['linux'= ]): else: output =3D StringIO.StringIO() =20 + logging.basicConfig(level=3D(logging.DEBUG if debug else logging.WARN)) + class MyTestRunner(unittest.TextTestRunner): def __init__(self, stream=3Doutput, descriptions=3DTrue, verbosity= =3Dverbosity): unittest.TextTestRunner.__init__(self, stream, descriptions, v= erbosity) --=20 2.13.6 From nobody Mon Feb 9 23:19:52 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.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507748004964482.98752348830794; Wed, 11 Oct 2017 11:53:24 -0700 (PDT) Received: from localhost ([::1]:42229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M8A-0007l7-5Y for importer@patchew.org; Wed, 11 Oct 2017 14:53:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M6D-0006Op-SL for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2M6A-0000o1-Ps for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25445) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2M6A-0000nb-KB for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:18 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 944B97F418; Wed, 11 Oct 2017 18:51:17 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C19C18967; Wed, 11 Oct 2017 18:51:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 944B97F418 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Wed, 11 Oct 2017 15:51:00 -0300 Message-Id: <20171011185103.26259-3-ehabkost@redhat.com> In-Reply-To: <20171011185103.26259-1-ehabkost@redhat.com> References: <20171011185103.26259-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 11 Oct 2017 18:51:17 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 2/5] basevm: Call logging.basicConfig() 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: Fam Zheng , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Just setting level=3DDEBUG when debug is enabled is not enough: we need to set up a log handler if we want debug messages generated using logging.getLogger(...).debug() to be printed. This was not a problem before because logging.debug() calls logging.basicConfig() implicitly, but it's safer to not rely on that. Cc: "Alex Benn=C3=A9e" Cc: Fam Zheng Cc: "Philippe Mathieu-Daud=C3=A9" Signed-off-by: Eduardo Habkost Message-Id: <20170927130339.21444-4-ehabkost@redhat.com> Reviewed-by: Daniel P. Berrange Reviewed-by: Fam Zheng Reviewed-by: Luk=C3=A1=C5=A1 Doktor Signed-off-by: Eduardo Habkost --- tests/vm/basevm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 3c863bc237..686d88decf 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -227,8 +227,8 @@ def main(vmcls): if not argv and not args.build_qemu and not args.build_image: print "Nothing to do?" return 1 - if args.debug: - logging.getLogger().setLevel(logging.DEBUG) + logging.basicConfig(level=3D(logging.DEBUG if args.debug + else logging.WARN)) vm =3D vmcls(debug=3Dargs.debug, vcpus=3Dargs.jobs) if args.build_image: if os.path.exists(args.image) and not args.force: --=20 2.13.6 From nobody Mon Feb 9 23:19:52 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507748129690664.6309601466626; Wed, 11 Oct 2017 11:55:29 -0700 (PDT) Received: from localhost ([::1]:42238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M9x-0000yX-8a for importer@patchew.org; Wed, 11 Oct 2017 14:55:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M6E-0006Pa-Ph for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2M6D-0000pj-Ol for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59390) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2M6D-0000pI-Iy for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:21 -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 89EE17F409; Wed, 11 Oct 2017 18:51:20 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 092A978421; Wed, 11 Oct 2017 18:51:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 89EE17F409 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Wed, 11 Oct 2017 15:51:01 -0300 Message-Id: <20171011185103.26259-4-ehabkost@redhat.com> In-Reply-To: <20171011185103.26259-1-ehabkost@redhat.com> References: <20171011185103.26259-1-ehabkost@redhat.com> MIME-Version: 1.0 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.25]); Wed, 11 Oct 2017 18:51:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 3/5] guestperf: Configure logging on all shell frontends 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The logging module will eventually replace the 'debug' parameter in QEMUMachine and QEMUMonitorProtocol. Cc: Daniel P. Berrange Signed-off-by: Eduardo Habkost Message-Id: <20171005172013.3098-2-ehabkost@redhat.com> Reviewed-by: Luk=C3=A1=C5=A1 Doktor Signed-off-by: Eduardo Habkost --- tests/migration/guestperf/shell.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/migration/guestperf/shell.py b/tests/migration/guestperf= /shell.py index 7992459a97..b272978f47 100644 --- a/tests/migration/guestperf/shell.py +++ b/tests/migration/guestperf/shell.py @@ -26,6 +26,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), import argparse import fnmatch import platform +import logging =20 from guestperf.hardware import Hardware from guestperf.engine import Engine @@ -147,6 +148,10 @@ class Shell(BaseShell): =20 def run(self, argv): args =3D self._parser.parse_args(argv) + logging.basicConfig(level=3D(logging.DEBUG if args.debug else + logging.INFO if args.verbose else + logging.WARN)) + =20 engine =3D self.get_engine(args) hardware =3D self.get_hardware(args) @@ -179,6 +184,10 @@ class BatchShell(BaseShell): =20 def run(self, argv): args =3D self._parser.parse_args(argv) + logging.basicConfig(level=3D(logging.DEBUG if args.debug else + logging.INFO if args.verbose else + logging.WARN)) + =20 engine =3D self.get_engine(args) hardware =3D self.get_hardware(args) @@ -231,6 +240,10 @@ class PlotShell(object): =20 def run(self, argv): args =3D self._parser.parse_args(argv) + logging.basicConfig(level=3D(logging.DEBUG if args.debug else + logging.INFO if args.verbose else + logging.WARN)) + =20 if len(args.reports) =3D=3D 0: print >>sys.stderr, "At least one report required" --=20 2.13.6 From nobody Mon Feb 9 23:19:52 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 1507748129742892.5912000514645; Wed, 11 Oct 2017 11:55:29 -0700 (PDT) Received: from localhost ([::1]:42239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M9z-0000zx-NN for importer@patchew.org; Wed, 11 Oct 2017 14:55:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M6I-0006Sg-45 for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2M6H-0000rj-2N for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28803) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2M6G-0000rC-Pm for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDF607CDFA; Wed, 11 Oct 2017 18:51:23 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1B776EE2D; Wed, 11 Oct 2017 18:51:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BDF607CDFA Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Wed, 11 Oct 2017 15:51:02 -0300 Message-Id: <20171011185103.26259-5-ehabkost@redhat.com> In-Reply-To: <20171011185103.26259-1-ehabkost@redhat.com> References: <20171011185103.26259-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 11 Oct 2017 18:51:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 4/5] scripts: Remove debug parameter from QEMUMonitorProtocol 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: Fam Zheng , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use logging module for the QMP debug messages. The only scripts that set debug=3DTrue are iotests.py and guestperf/engine.py, and they already call logging.basicConfig() to set up logging. Scripts that don't configure logging are safe as long as they don't need debugging output, because debug messages don't trigger the "No handlers could be found for logger" message from the Python logging module. Scripts that already configure logging but don't use debug=3DTrue (e.g. scripts/vm/basevm.py) will get QMP debugging enabled for free. Cc: "Alex Benn=C3=A9e" Cc: Fam Zheng Cc: "Philippe Mathieu-Daud=C3=A9" Signed-off-by: Eduardo Habkost Message-Id: <20171005172013.3098-3-ehabkost@redhat.com> Reviewed-by: Luk=C3=A1=C5=A1 Doktor Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 3 +-- scripts/qmp/qmp.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index c9a106fbce..f6d2e68627 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -177,8 +177,7 @@ class QEMUMachine(object): =20 def _pre_launch(self): self._qmp =3D qmp.qmp.QEMUMonitorProtocol(self._monitor_address, - server=3DTrue, - debug=3Dself._debug) + server=3DTrue) =20 def _post_launch(self): self._qmp.accept() diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py index ef12e8a1a0..07c9632e9e 100644 --- a/scripts/qmp/qmp.py +++ b/scripts/qmp/qmp.py @@ -11,7 +11,7 @@ import json import errno import socket -import sys +import logging =20 =20 class QMPError(Exception): @@ -32,12 +32,14 @@ class QMPTimeoutError(QMPError): =20 class QEMUMonitorProtocol(object): =20 + #: Logger object for debugging messages + logger =3D logging.getLogger('QMP') #: Socket's error class error =3D socket.error #: Socket's timeout timeout =3D socket.timeout =20 - def __init__(self, address, server=3DFalse, debug=3DFalse): + def __init__(self, address, server=3DFalse): """ Create a QEMUMonitorProtocol class. =20 @@ -51,7 +53,6 @@ class QEMUMonitorProtocol(object): """ self.__events =3D [] self.__address =3D address - self._debug =3D debug self.__sock =3D self.__get_sock() self.__sockfile =3D None if server: @@ -83,8 +84,7 @@ class QEMUMonitorProtocol(object): return resp =3D json.loads(data) if 'event' in resp: - if self._debug: - print >>sys.stderr, "QMP:<<< %s" % resp + self.logger.debug("<<< %s", resp) self.__events.append(resp) if not only_event: continue @@ -164,8 +164,7 @@ class QEMUMonitorProtocol(object): @return QMP response as a Python dict or None if the connection has been closed """ - if self._debug: - print >>sys.stderr, "QMP:>>> %s" % qmp_cmd + self.logger.debug(">>> %s", qmp_cmd) try: self.__sock.sendall(json.dumps(qmp_cmd)) except socket.error as err: @@ -173,8 +172,7 @@ class QEMUMonitorProtocol(object): return raise socket.error(err) resp =3D self.__json_read() - if self._debug: - print >>sys.stderr, "QMP:<<< %s" % resp + self.logger.debug("<<< %s", resp) return resp =20 def cmd(self, name, args=3DNone, cmd_id=3DNone): --=20 2.13.6 From nobody Mon Feb 9 23:19:52 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.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150774800494846.85537450909135; Wed, 11 Oct 2017 11:53:24 -0700 (PDT) Received: from localhost ([::1]:42230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M8A-0007lD-4V for importer@patchew.org; Wed, 11 Oct 2017 14:53:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2M6M-0006TG-8t for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2M6J-0000tI-6q for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33578) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2M6I-0000sa-UX for qemu-devel@nongnu.org; Wed, 11 Oct 2017 14:51:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E70347EAB0; Wed, 11 Oct 2017 18:51:25 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A2A36FA97; Wed, 11 Oct 2017 18:51:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E70347EAB0 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Wed, 11 Oct 2017 15:51:03 -0300 Message-Id: <20171011185103.26259-6-ehabkost@redhat.com> In-Reply-To: <20171011185103.26259-1-ehabkost@redhat.com> References: <20171011185103.26259-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 11 Oct 2017 18:51:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 5/5] scripts: Remove debug parameter from QEMUMachine 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" All scripts that use the QEMUMachine and QEMUQtestMachine classes (device-crash-test, tests/migration/*, iotests.py, basevm.py) already configure logging. The basicConfig() call inside QEMUMachine.__init__() is being kept just to make sure a script would still work if it didn't configure logging. Signed-off-by: Eduardo Habkost Message-Id: <20171005172013.3098-4-ehabkost@redhat.com> Reviewed-by: Luk=C3=A1=C5=A1 Doktor Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 6 ++---- tests/migration/guestperf/engine.py | 6 ++---- tests/qemu-iotests/iotests.py | 2 -- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index f6d2e68627..9bfdf6d37d 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -54,7 +54,7 @@ class QEMUMachine(object): =20 def __init__(self, binary, args=3DNone, wrapper=3DNone, name=3DNone, test_dir=3D"/var/tmp", monitor_address=3DNone, - socket_scm_helper=3DNone, debug=3DFalse): + socket_scm_helper=3DNone): ''' Initialize a QEMUMachine =20 @@ -65,7 +65,6 @@ class QEMUMachine(object): @param test_dir: where to create socket and log file @param monitor_address: address for QMP monitor @param socket_scm_helper: helper program, required for send_fd_scm= ()" - @param debug: enable debug mode @note: Qemu process is not started until launch() is used. ''' if args is None: @@ -85,12 +84,11 @@ class QEMUMachine(object): self._events =3D [] self._iolog =3D None self._socket_scm_helper =3D socket_scm_helper - self._debug =3D debug self._qmp =3D None self._qemu_full_args =3D None =20 # just in case logging wasn't configured by the main script: - logging.basicConfig(level=3D(logging.DEBUG if debug else logging.W= ARN)) + logging.basicConfig() =20 def __enter__(self): return self diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestper= f/engine.py index 0a13050bc6..e14d4320b2 100644 --- a/tests/migration/guestperf/engine.py +++ b/tests/migration/guestperf/engine.py @@ -388,15 +388,13 @@ class Engine(object): args=3Dself._get_src_args(hardware), wrapper=3Dself._get_src_wrapper(hardware), name=3D"qemu-src-%d" % os.getpid(), - monitor_address=3Dsrcmonaddr, - debug=3Dself._debug) + monitor_address=3Dsrcmonaddr) =20 dst =3D qemu.QEMUMachine(self._binary, args=3Dself._get_dst_args(hardware, uri), wrapper=3Dself._get_dst_wrapper(hardware), name=3D"qemu-dst-%d" % os.getpid(), - monitor_address=3Ddstmonaddr, - debug=3Dself._debug) + monitor_address=3Ddstmonaddr) =20 try: src.launch() diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 36a7757aaf..6f057904a9 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -195,8 +195,6 @@ class VM(qtest.QEMUQtestMachine): super(VM, self).__init__(qemu_prog, qemu_opts, name=3Dname, test_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper) - if debug: - self._debug =3D True self._num_drives =3D 0 =20 def add_device(self, opts): --=20 2.13.6