Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/819149/?format=api
{ "id": 819149, "url": "http://patchwork.ozlabs.org/api/patches/819149/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170927130339.21444-5-ehabkost@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170927130339.21444-5-ehabkost@redhat.com>", "list_archive_url": null, "date": "2017-09-27T13:03:38", "name": "[4/5] scripts: Remove debug parameter from QEMUMonitorProtocol", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "347230c785fe2fd940d5a94e9d8817cddaf4743f", "submitter": { "id": 195, "url": "http://patchwork.ozlabs.org/api/people/195/?format=api", "name": "Eduardo Habkost", "email": "ehabkost@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170927130339.21444-5-ehabkost@redhat.com/mbox/", "series": [ { "id": 5363, "url": "http://patchwork.ozlabs.org/api/series/5363/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=5363", "date": "2017-09-27T13:03:34", "name": "scripts: Remove 'debug' parameter from QEMUMachine & QEMUMonitorProtocol", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/5363/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/819149/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/819149/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=208.118.235.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=ehabkost@redhat.com" ], "Received": [ "from lists.gnu.org (lists.gnu.org [208.118.235.17])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2J2c5d5Pz9tXf\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 23:05:12 +1000 (AEST)", "from localhost ([::1]:54760 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxC1W-000164-Qk\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 09:05:10 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:52826)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <ehabkost@redhat.com>) id 1dxC0l-00010E-Gy\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:04:28 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <ehabkost@redhat.com>) id 1dxC0f-0006lb-Je\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:04:23 -0400", "from mx1.redhat.com ([209.132.183.28]:44082)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <ehabkost@redhat.com>) id 1dxC0f-0006l8-Be\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:04:17 -0400", "from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 6377EC0860CB;\n\tWed, 27 Sep 2017 13:04:16 +0000 (UTC)", "from localhost (ovpn-116-18.gru2.redhat.com [10.97.116.18])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 7DC6485A2C;\n\tWed, 27 Sep 2017 13:04:15 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 6377EC0860CB", "From": "Eduardo Habkost <ehabkost@redhat.com>", "To": "qemu-devel@nongnu.org", "Date": "Wed, 27 Sep 2017 10:03:38 -0300", "Message-Id": "<20170927130339.21444-5-ehabkost@redhat.com>", "In-Reply-To": "<20170927130339.21444-1-ehabkost@redhat.com>", "References": "<20170927130339.21444-1-ehabkost@redhat.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.13", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tWed, 27 Sep 2017 13:04:16 +0000 (UTC)", "Content-Transfer-Encoding": "quoted-printable", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]", "X-Received-From": "209.132.183.28", "Subject": "[Qemu-devel] [PATCH 4/5] scripts: Remove debug parameter from\n\tQEMUMonitorProtocol", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "=?utf-8?b?THVrw6HFoSBEb2t0b3I=?= <ldoktor@redhat.com>,\n\tFam Zheng <famz@redhat.com>, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?=\n\t<f4bug@amsat.org>, \tCleber Rosa <crosa@redhat.com>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "Use logging module for the QMP debug messages. The only scripts\nthat set debug=True are iotests.py and guestperf/engine.py, and\nthey already call logging.basicConfig() to set up logging.\n\nScripts that don't configure logging are safe as long as they\ndon't need debugging output, because debug messages don't trigger\nthe \"No handlers could be found for logger\" message from the\nPython logging module.\n\nScripts that already configure logging but don't use debug=True\n(e.g. scripts/vm/basevm.py) will get QMP debugging enabled for\nfree.\n\nCc: \"Alex Bennée\" <alex.bennee@linaro.org>\nCc: Fam Zheng <famz@redhat.com>\nCc: \"Philippe Mathieu-Daudé\" <f4bug@amsat.org>\nSigned-off-by: Eduardo Habkost <ehabkost@redhat.com>\n---\n scripts/qemu.py | 3 +--\n scripts/qmp/qmp.py | 13 ++++++-------\n 2 files changed, 7 insertions(+), 9 deletions(-)", "diff": "diff --git a/scripts/qemu.py b/scripts/qemu.py\nindex c9a106fbce..f6d2e68627 100644\n--- a/scripts/qemu.py\n+++ b/scripts/qemu.py\n@@ -177,8 +177,7 @@ class QEMUMachine(object):\n \n def _pre_launch(self):\n self._qmp = qmp.qmp.QEMUMonitorProtocol(self._monitor_address,\n- server=True,\n- debug=self._debug)\n+ server=True)\n \n def _post_launch(self):\n self._qmp.accept()\ndiff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py\nindex ef12e8a1a0..be79d7aa80 100644\n--- a/scripts/qmp/qmp.py\n+++ b/scripts/qmp/qmp.py\n@@ -12,6 +12,7 @@ import json\n import errno\n import socket\n import sys\n+import logging\n \n \n class QMPError(Exception):\n@@ -32,6 +33,8 @@ class QMPTimeoutError(QMPError):\n \n class QEMUMonitorProtocol(object):\n \n+ #: Logger object for debugging messages\n+ logger = logging.getLogger('QMP')\n #: Socket's error class\n error = socket.error\n #: Socket's timeout\n@@ -51,7 +54,6 @@ class QEMUMonitorProtocol(object):\n \"\"\"\n self.__events = []\n self.__address = address\n- self._debug = debug\n self.__sock = self.__get_sock()\n self.__sockfile = None\n if server:\n@@ -83,8 +85,7 @@ class QEMUMonitorProtocol(object):\n return\n resp = json.loads(data)\n if 'event' in resp:\n- if self._debug:\n- print >>sys.stderr, \"QMP:<<< %s\" % resp\n+ self.logger.debug(\"<<< %s\", resp)\n self.__events.append(resp)\n if not only_event:\n continue\n@@ -164,8 +165,7 @@ class QEMUMonitorProtocol(object):\n @return QMP response as a Python dict or None if the connection has\n been closed\n \"\"\"\n- if self._debug:\n- print >>sys.stderr, \"QMP:>>> %s\" % qmp_cmd\n+ self.logger.debug(\"<<< %s\", qmp_cmd)\n try:\n self.__sock.sendall(json.dumps(qmp_cmd))\n except socket.error as err:\n@@ -173,8 +173,7 @@ class QEMUMonitorProtocol(object):\n return\n raise socket.error(err)\n resp = self.__json_read()\n- if self._debug:\n- print >>sys.stderr, \"QMP:<<< %s\" % resp\n+ self.logger.debug(\"<<< %s\", resp)\n return resp\n \n def cmd(self, name, args=None, cmd_id=None):\n", "prefixes": [ "4/5" ] }