From nobody Sun Apr 28 10:15:33 2024 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 1506519971871518.6367381428604; Wed, 27 Sep 2017 06:46:11 -0700 (PDT) Received: from localhost ([::1]:54899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxCex-0002LZ-HY for importer@patchew.org; Wed, 27 Sep 2017 09:45:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxCdn-0001bH-Sh for qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:44:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxCdi-0003GE-3z for qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:44:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57602) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxCdh-0003Fn-Si for qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:44:38 -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 678E93D948; Wed, 27 Sep 2017 13:44:35 +0000 (UTC) Received: from localhost (ovpn-116-18.gru2.redhat.com [10.97.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4E678310E; Wed, 27 Sep 2017 13:44:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 678E93D948 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com Date: Wed, 27 Sep 2017 10:44:31 -0300 From: Eduardo Habkost To: Fam Zheng Message-ID: <20170927134431.GN21016@localhost.localdomain> References: <20170927130339.21444-1-ehabkost@redhat.com> <20170927130339.21444-5-ehabkost@redhat.com> <20170927133321.GB8521@lemon.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170927133321.GB8521@lemon.lan> X-Fnord: you can see the fnord User-Agent: Mutt/1.8.3 (2017-05-23) 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.30]); Wed, 27 Sep 2017 13:44:35 +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] [PATCH] fixup! 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: =?utf-8?B?THVrw6HFoQ==?= Doktor , Cleber Rosa , Alex =?iso-8859-1?Q?Benn=E9e?= , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Wed, Sep 27, 2017 at 09:33:21PM +0800, Fam Zheng wrote: > On Wed, 09/27 10:03, Eduardo Habkost wrote: > > @@ -51,7 +54,6 @@ class QEMUMonitorProtocol(object): > > """ > > self.__events =3D [] > > self.__address =3D address > > - self._debug =3D debug >=20 > Should you also drop the debug parameter from the method? >=20 > > self.__sock =3D self.__get_sock() > > self.__sockfile =3D None > > if server: > > @@ -83,8 +85,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 +165,7 @@ class QEMUMonitorProtocol(object): > > @return QMP response as a Python dict or None if the connectio= n has > > been closed > > """ > > - if self._debug: > > - print >>sys.stderr, "QMP:>>> %s" % qmp_cmd > > + self.logger.debug("<<< %s", qmp_cmd) >=20 > This should be ">>> %s". >=20 Fixed. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py index be79d7aa80..369d9fef39 100644 --- a/scripts/qmp/qmp.py +++ b/scripts/qmp/qmp.py @@ -40,7 +40,7 @@ class QEMUMonitorProtocol(object): #: 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 @@ -165,7 +165,7 @@ class QEMUMonitorProtocol(object): @return QMP response as a Python dict or None if the connection has been closed """ - self.logger.debug("<<< %s", qmp_cmd) + self.logger.debug(">>> %s", qmp_cmd) try: self.__sock.sendall(json.dumps(qmp_cmd)) except socket.error as err: --=20 2.13.5