[{"id":1776333,"web_url":"http://patchwork.ozlabs.org/comment/1776333/","msgid":"<20170927131741.GH12223@redhat.com>","list_archive_url":null,"date":"2017-09-27T13:17:41","subject":"Re: [Qemu-devel] [PATCH 2/5] iotests: Set up Python logging","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Wed, Sep 27, 2017 at 10:03:36AM -0300, Eduardo Habkost wrote:\n> Set up Python logging module instead of relying on\n> QEMUMachine._debug to enable debugging messages.\n> \n> Cc: Kevin Wolf <kwolf@redhat.com>\n> Cc: Max Reitz <mreitz@redhat.com>\n> Cc: qemu-block@nongnu.org\n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\n> ---\n>  tests/qemu-iotests/iotests.py | 3 +++\n>  1 file changed, 3 insertions(+)\n\nReviewed-by: Daniel P. Berrange <berrange@redhat.com>\n\n\nRegards,\nDaniel","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-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@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 3y2JLr5Xfdz9tXp\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 23:19:16 +1000 (AEST)","from localhost ([::1]:54811 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 1dxCEk-0006pt-BG\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 09:18:50 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56393)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxCE9-0006lk-Cg\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:18:19 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxCE6-00066G-3V\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:18:13 -0400","from mx1.redhat.com ([209.132.183.28]:58922)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>)\n\tid 1dxCDw-00061h-Jh; Wed, 27 Sep 2017 09:18:00 -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 AE54913A5D;\n\tWed, 27 Sep 2017 13:17:59 +0000 (UTC)","from redhat.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 9978E85EE2;\n\tWed, 27 Sep 2017 13:17:44 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com AE54913A5D","Date":"Wed, 27 Sep 2017 14:17:41 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Eduardo Habkost <ehabkost@redhat.com>","Message-ID":"<20170927131741.GH12223@redhat.com>","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-3-ehabkost@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170927130339.21444-3-ehabkost@redhat.com>","User-Agent":"Mutt/1.9.0 (2017-09-02)","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.29]);\n\tWed, 27 Sep 2017 13:17:59 +0000 (UTC)","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":"Re: [Qemu-devel] [PATCH 2/5] iotests: Set up Python logging","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>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"=?utf-8?b?THVrw6HFoQ==?= Doktor <ldoktor@redhat.com>,\n\tKevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org, \n\tqemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>, \n\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>"}},{"id":1776886,"web_url":"http://patchwork.ozlabs.org/comment/1776886/","msgid":"<828133ca-fbb0-e9cf-fca8-65a59ff9ba90@redhat.com>","list_archive_url":null,"date":"2017-09-28T08:54:56","subject":"Re: [Qemu-devel] [PATCH 2/5] iotests: Set up Python logging","submitter":{"id":72013,"url":"http://patchwork.ozlabs.org/api/people/72013/","name":"Lukáš Doktor","email":"ldoktor@redhat.com"},"content":"Dne 27.9.2017 v 15:03 Eduardo Habkost napsal(a):\n> Set up Python logging module instead of relying on\n> QEMUMachine._debug to enable debugging messages.\n> \n> Cc: Kevin Wolf <kwolf@redhat.com>\n> Cc: Max Reitz <mreitz@redhat.com>\n> Cc: qemu-block@nongnu.org\n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\n> ---\n>  tests/qemu-iotests/iotests.py | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py\n> index 1af117e37d..36a7757aaf 100644\n> --- a/tests/qemu-iotests/iotests.py\n> +++ b/tests/qemu-iotests/iotests.py\n> @@ -28,6 +28,7 @@ import qtest\n>  import struct\n>  import json\n>  import signal\n> +import logging\n>  \n>  \n>  # This will not work if arguments contain spaces but is necessary if we\n> @@ -467,6 +468,8 @@ def main(supported_fmts=[], supported_oses=['linux']):\n>      else:\n>          output = StringIO.StringIO()\n>  \n> +    logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))\n> +\n\nStrictly speaking the brackets around ternary operator are not necessary, but given this is not a python project it's probably fine.\n\n>      class MyTestRunner(unittest.TextTestRunner):\n>          def __init__(self, stream=output, descriptions=True, verbosity=verbosity):\n>              unittest.TextTestRunner.__init__(self, stream, descriptions, verbosity)\n> \n\nYes, this is a better solution than the previous logging hotfix.\n\nReviewed-by: Lukáš Doktor <ldoktor@redhat.com>","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=2001:4830:134:3::11; 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=ldoktor@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\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 3y2pS46GVnz9t2Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 18:55:32 +1000 (AEST)","from localhost ([::1]:58037 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 1dxUbT-0003LJ-28\n\tfor incoming@patchwork.ozlabs.org; Thu, 28 Sep 2017 04:55:31 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54862)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <ldoktor@redhat.com>) id 1dxUb7-0003H4-63\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 04:55:11 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <ldoktor@redhat.com>) id 1dxUb6-0003JO-6C\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 04:55:09 -0400","from mx1.redhat.com ([209.132.183.28]:47386)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <ldoktor@redhat.com>)\n\tid 1dxUb0-00037c-Tp; Thu, 28 Sep 2017 04:55:03 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\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 63173C03E7A2;\n\tThu, 28 Sep 2017 08:54:59 +0000 (UTC)","from localhost.localdomain (ovpn-204-104.brq.redhat.com\n\t[10.40.204.104])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 09F925ED44;\n\tThu, 28 Sep 2017 08:54:57 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 63173C03E7A2","To":"Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-3-ehabkost@redhat.com>","From":"=?utf-8?b?THVrw6HFoSBEb2t0b3I=?= <ldoktor@redhat.com>","Message-ID":"<828133ca-fbb0-e9cf-fca8-65a59ff9ba90@redhat.com>","Date":"Thu, 28 Sep 2017 10:54:56 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170927130339.21444-3-ehabkost@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"x97MfmEV2Te1r8IpqL4aEX2ElkqGXKdek\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tThu, 28 Sep 2017 08:54:59 +0000 (UTC)","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","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH 2/5] iotests: Set up Python logging","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":"Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,\n\tqemu-block@nongnu.org, Cleber 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>"}}]