All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: "Lukáš Doktor" <ldoktor@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org, "Cleber Rosa" <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH] fixup! scripts: Remove debug parameter from QEMUMonitorProtocol
Date: Wed, 27 Sep 2017 10:44:31 -0300	[thread overview]
Message-ID: <20170927134431.GN21016@localhost.localdomain> (raw)
In-Reply-To: <20170927133321.GB8521@lemon.lan>

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 = []
> >          self.__address = address
> > -        self._debug = debug
> 
> Should you also drop the debug parameter from the method?
> 
> >          self.__sock = self.__get_sock()
> >          self.__sockfile = None
> >          if server:
> > @@ -83,8 +85,7 @@ class QEMUMonitorProtocol(object):
> >                  return
> >              resp = 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 connection has
> >                  been closed
> >          """
> > -        if self._debug:
> > -            print >>sys.stderr, "QMP:>>> %s" % qmp_cmd
> > +        self.logger.debug("<<< %s", qmp_cmd)
> 
> This should be ">>> %s".
> 

Fixed.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 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 = socket.timeout
 
-    def __init__(self, address, server=False, debug=False):
+    def __init__(self, address, server=False):
         """
         Create a QEMUMonitorProtocol class.
 
@@ -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:
-- 
2.13.5

  parent reply	other threads:[~2017-09-27 13:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 13:03 [Qemu-devel] [PATCH 0/5] scripts: Remove 'debug' parameter from QEMUMachine & QEMUMonitorProtocol Eduardo Habkost
2017-09-27 13:03 ` [Qemu-devel] [PATCH 1/5] guestperf: Configure logging on all shell frontends Eduardo Habkost
2017-09-27 13:17   ` Daniel P. Berrange
2017-09-28  9:15   ` Lukáš Doktor
2017-09-28 13:19     ` Eduardo Habkost
2017-09-27 13:03 ` [Qemu-devel] [PATCH 2/5] iotests: Set up Python logging Eduardo Habkost
2017-09-27 13:17   ` Daniel P. Berrange
2017-09-28  8:54   ` Lukáš Doktor
2017-09-27 13:03 ` [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig() Eduardo Habkost
2017-09-27 13:19   ` Daniel P. Berrange
2017-09-27 13:35   ` Fam Zheng
2017-09-27 13:40     ` Eduardo Habkost
2017-09-28  9:24   ` Lukáš Doktor
2017-09-27 13:03 ` [Qemu-devel] [PATCH 4/5] scripts: Remove debug parameter from QEMUMonitorProtocol Eduardo Habkost
2017-09-27 13:20   ` Daniel P. Berrange
2017-09-27 13:33   ` Fam Zheng
2017-09-27 13:41     ` Eduardo Habkost
2017-09-27 13:44     ` Eduardo Habkost [this message]
2017-09-28  9:33       ` [Qemu-devel] [PATCH] fixup! " Lukáš Doktor
2017-09-28 14:01         ` Eduardo Habkost
2017-09-27 13:03 ` [Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from QEMUMachine Eduardo Habkost
2017-09-27 13:22   ` Daniel P. Berrange
2017-09-27 13:38     ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170927134431.GN21016@localhost.localdomain \
    --to=ehabkost@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=crosa@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=ldoktor@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.