[{"id":1762929,"web_url":"http://patchwork.ozlabs.org/comment/1762929/","msgid":"<20170905030255.GH22515@lemon.lan>","list_archive_url":null,"date":"2017-09-05T03:02:55","subject":"Re: [Qemu-devel] [PATCH v8 04/13] qemu.py: improve message on\n\tnegative exit code","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Fri, 09/01 13:28, Amador Pahim wrote:\n> The current message shows 'self._args', which contains only part of the\n> options used in the Qemu command line.\n> \n> This patch makes the qemu full args list an instance variable and then\n> uses it in the negative exit code message.\n> \n> Message was moved outside the 'if is_running' block to make sure it will\n> be logged if the VM finishes before the call to shutdown().\n> \n> Signed-off-by: Amador Pahim <apahim@redhat.com>\n> ---\n>  scripts/qemu.py | 26 +++++++++++++++++++-------\n>  1 file changed, 19 insertions(+), 7 deletions(-)\n> \n> diff --git a/scripts/qemu.py b/scripts/qemu.py\n> index a6e06291ea..670c048569 100644\n> --- a/scripts/qemu.py\n> +++ b/scripts/qemu.py\n> @@ -49,6 +49,7 @@ class QEMUMachine(object):\n>          self._iolog = None\n>          self._socket_scm_helper = socket_scm_helper\n>          self._debug = debug\n> +        self._qemu_full_args = None\n>  \n>      # This can be used to add an unused monitor instance.\n>      def add_monitor_telnet(self, ip, port):\n> @@ -140,13 +141,18 @@ class QEMUMachine(object):\n>  \n>      def launch(self):\n>          '''Launch the VM and establish a QMP connection'''\n> +        self._qemu_full_args = None\n>          devnull = open(os.path.devnull, 'rb')\n>          qemulog = open(self._qemu_log_path, 'wb')\n>          try:\n>              self._pre_launch()\n> -            args = self._wrapper + [self._binary] + self._base_args() + self._args\n> -            self._popen = subprocess.Popen(args, stdin=devnull, stdout=qemulog,\n> -                                           stderr=subprocess.STDOUT, shell=False)\n> +            self._qemu_full_args = (self._wrapper + [self._binary] +\n> +                                    self._base_args() + self._args)\n\nThe parentheses seem superfluous. With those removed:\n\nReviewed-by: Fam Zheng <famz@redhat.com>\n\n> +            self._popen = subprocess.Popen(self._qemu_full_args,\n> +                                           stdin=devnull,\n> +                                           stdout=qemulog,\n> +                                           stderr=subprocess.STDOUT,\n> +                                           shell=False)\n>              self._post_launch()\n>          except:\n>              if self.is_running():\n> @@ -164,14 +170,20 @@ class QEMUMachine(object):\n>                  self._qmp.close()\n>              except:\n>                  self._popen.kill()\n> +            self._popen.wait()\n>  \n> -            exitcode = self._popen.wait()\n> -            if exitcode < 0:\n> -                LOG.warn('qemu received signal %i: %s', -exitcode,\n> -                          ' '.join(self._args))\n>              self._load_io_log()\n>              self._post_shutdown()\n>  \n> +        exitcode = self.exitcode()\n> +        if exitcode is not None and exitcode < 0:\n> +            msg = 'qemu received signal %i: %s'\n> +            if self._qemu_full_args:\n> +                command = ' '.join(self._qemu_full_args)\n> +            else:\n> +                command = ''\n> +            LOG.warn(msg, exitcode, command)\n> +\n>      underscore_to_dash = string.maketrans('_', '-')\n>      def qmp(self, cmd, conv_keys=True, **args):\n>          '''Invoke a QMP command and return the result dict'''\n> -- \n> 2.13.5\n> \n>","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-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@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 3xmWkk6lvxz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 13:03:42 +1000 (AEST)","from localhost ([::1]:56571 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 1dp49N-0001kF-2t\n\tfor incoming@patchwork.ozlabs.org; Mon, 04 Sep 2017 23:03:41 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53873)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dp48n-0001fw-Cj\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:03:10 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dp48i-0007Os-KZ\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:03:05 -0400","from mx1.redhat.com ([209.132.183.28]:42116)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dp48i-0007OW-Bn\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:03: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 5E54167744;\n\tTue,  5 Sep 2017 03:02:59 +0000 (UTC)","from localhost (ovpn-12-97.pek2.redhat.com [10.72.12.97])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 8C20514FE2B;\n\tTue,  5 Sep 2017 03:02:56 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 5E54167744","Date":"Tue, 5 Sep 2017 11:02:55 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Amador Pahim <apahim@redhat.com>","Message-ID":"<20170905030255.GH22515@lemon.lan>","References":"<20170901112829.2571-1-apahim@redhat.com>\n\t<20170901112829.2571-5-apahim@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170901112829.2571-5-apahim@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","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.26]);\n\tTue, 05 Sep 2017 03:02: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 v8 04/13] qemu.py: improve message on\n\tnegative exit code","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":"kwolf@redhat.com, ldoktor@redhat.com, ehabkost@redhat.com,\n\tstefanha@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com,\n\tcrosa@redhat.com, mreitz@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":1769869,"web_url":"http://patchwork.ozlabs.org/comment/1769869/","msgid":"<20170918051858.GA31915@localhost.localdomain>","list_archive_url":null,"date":"2017-09-18T05:18:58","subject":"Re: [Qemu-devel] [PATCH v8 04/13] qemu.py: improve message on\n\tnegative exit code","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 05.09.2017 um 05:02 hat Fam Zheng geschrieben:\n> On Fri, 09/01 13:28, Amador Pahim wrote:\n> > The current message shows 'self._args', which contains only part of the\n> > options used in the Qemu command line.\n> > \n> > This patch makes the qemu full args list an instance variable and then\n> > uses it in the negative exit code message.\n> > \n> > Message was moved outside the 'if is_running' block to make sure it will\n> > be logged if the VM finishes before the call to shutdown().\n> > \n> > Signed-off-by: Amador Pahim <apahim@redhat.com>\n> > ---\n> >  scripts/qemu.py | 26 +++++++++++++++++++-------\n> >  1 file changed, 19 insertions(+), 7 deletions(-)\n> > \n> > diff --git a/scripts/qemu.py b/scripts/qemu.py\n> > index a6e06291ea..670c048569 100644\n> > --- a/scripts/qemu.py\n> > +++ b/scripts/qemu.py\n> > @@ -49,6 +49,7 @@ class QEMUMachine(object):\n> >          self._iolog = None\n> >          self._socket_scm_helper = socket_scm_helper\n> >          self._debug = debug\n> > +        self._qemu_full_args = None\n> >  \n> >      # This can be used to add an unused monitor instance.\n> >      def add_monitor_telnet(self, ip, port):\n> > @@ -140,13 +141,18 @@ class QEMUMachine(object):\n> >  \n> >      def launch(self):\n> >          '''Launch the VM and establish a QMP connection'''\n> > +        self._qemu_full_args = None\n> >          devnull = open(os.path.devnull, 'rb')\n> >          qemulog = open(self._qemu_log_path, 'wb')\n> >          try:\n> >              self._pre_launch()\n> > -            args = self._wrapper + [self._binary] + self._base_args() + self._args\n> > -            self._popen = subprocess.Popen(args, stdin=devnull, stdout=qemulog,\n> > -                                           stderr=subprocess.STDOUT, shell=False)\n> > +            self._qemu_full_args = (self._wrapper + [self._binary] +\n> > +                                    self._base_args() + self._args)\n> \n> The parentheses seem superfluous. With those removed:\n> \n> Reviewed-by: Fam Zheng <famz@redhat.com>\n\nCongratulations, with this advice you just killed all Python-based\nqemu-iotests and filled up my inbox with CI failure messages. :-)\n\n+Traceback (most recent call last):\n+  File \"194\", line 22, in <module>\n+    import iotests\n+  File \"/home/kwolf/source/qemu/tests/qemu-iotests/iotests.py\", line 27, in <module>\n+    import qtest\n+  File \"/home/kwolf/source/qemu/tests/qemu-iotests/../../scripts/qtest.py\", line 16, in <module>\n+    import qemu\n+  File \"/home/kwolf/source/qemu/tests/qemu-iotests/../../scripts/qemu.py\", line 196\n+    self._qemu_full_args = self._wrapper + [self._binary] +\n+                                                          ^\n+SyntaxError: invalid syntax\n\nKevin","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-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@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 3xwZ7X0BRTz9ryr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 15:19:33 +1000 (AEST)","from localhost ([::1]:34712 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 1dtoSx-00043c-2A\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 01:19:31 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:35782)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dtoSd-00043Q-8C\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 01:19:12 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dtoSa-0000I7-27\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 01:19:11 -0400","from mx1.redhat.com ([209.132.183.28]:49444)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>) id 1dtoSZ-0000HH-Pb\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 01:19:07 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\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 DAFE6285B5;\n\tMon, 18 Sep 2017 05:19:05 +0000 (UTC)","from localhost.localdomain (ovpn-116-105.ams2.redhat.com\n\t[10.36.116.105])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id DDA9660475;\n\tMon, 18 Sep 2017 05:18:59 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DAFE6285B5","Date":"Mon, 18 Sep 2017 07:18:58 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"Fam Zheng <famz@redhat.com>","Message-ID":"<20170918051858.GA31915@localhost.localdomain>","References":"<20170901112829.2571-1-apahim@redhat.com>\n\t<20170901112829.2571-5-apahim@redhat.com>\n\t<20170905030255.GH22515@lemon.lan>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170905030255.GH22515@lemon.lan>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tMon, 18 Sep 2017 05:19:06 +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 v8 04/13] qemu.py: improve message on\n\tnegative exit code","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":"ldoktor@redhat.com, ehabkost@redhat.com, stefanha@gmail.com,\n\tAmador Pahim <apahim@redhat.com>, armbru@redhat.com,\n\tqemu-devel@nongnu.org, crosa@redhat.com, mreitz@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":1769873,"web_url":"http://patchwork.ozlabs.org/comment/1769873/","msgid":"<20170918053913.GD15551@lemon.lan>","list_archive_url":null,"date":"2017-09-18T05:39:13","subject":"Re: [Qemu-devel] [PATCH v8 04/13] qemu.py: improve message on\n\tnegative exit code","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Mon, 09/18 07:18, Kevin Wolf wrote:\n> Am 05.09.2017 um 05:02 hat Fam Zheng geschrieben:\n> > On Fri, 09/01 13:28, Amador Pahim wrote:\n> > > The current message shows 'self._args', which contains only part of the\n> > > options used in the Qemu command line.\n> > > \n> > > This patch makes the qemu full args list an instance variable and then\n> > > uses it in the negative exit code message.\n> > > \n> > > Message was moved outside the 'if is_running' block to make sure it will\n> > > be logged if the VM finishes before the call to shutdown().\n> > > \n> > > Signed-off-by: Amador Pahim <apahim@redhat.com>\n> > > ---\n> > >  scripts/qemu.py | 26 +++++++++++++++++++-------\n> > >  1 file changed, 19 insertions(+), 7 deletions(-)\n> > > \n> > > diff --git a/scripts/qemu.py b/scripts/qemu.py\n> > > index a6e06291ea..670c048569 100644\n> > > --- a/scripts/qemu.py\n> > > +++ b/scripts/qemu.py\n> > > @@ -49,6 +49,7 @@ class QEMUMachine(object):\n> > >          self._iolog = None\n> > >          self._socket_scm_helper = socket_scm_helper\n> > >          self._debug = debug\n> > > +        self._qemu_full_args = None\n> > >  \n> > >      # This can be used to add an unused monitor instance.\n> > >      def add_monitor_telnet(self, ip, port):\n> > > @@ -140,13 +141,18 @@ class QEMUMachine(object):\n> > >  \n> > >      def launch(self):\n> > >          '''Launch the VM and establish a QMP connection'''\n> > > +        self._qemu_full_args = None\n> > >          devnull = open(os.path.devnull, 'rb')\n> > >          qemulog = open(self._qemu_log_path, 'wb')\n> > >          try:\n> > >              self._pre_launch()\n> > > -            args = self._wrapper + [self._binary] + self._base_args() + self._args\n> > > -            self._popen = subprocess.Popen(args, stdin=devnull, stdout=qemulog,\n> > > -                                           stderr=subprocess.STDOUT, shell=False)\n> > > +            self._qemu_full_args = (self._wrapper + [self._binary] +\n> > > +                                    self._base_args() + self._args)\n> > \n> > The parentheses seem superfluous. With those removed:\n> > \n> > Reviewed-by: Fam Zheng <famz@redhat.com>\n> \n> Congratulations, with this advice you just killed all Python-based\n> qemu-iotests and filled up my inbox with CI failure messages. :-)\n\nOops. Why doesn't python understand such multi line expressions impllied by \"+\"\njust like in \"[,]\"?\n\nIotests on patchew is not far away. (The docker test-block pull request was\nbounced a few times, unfortunately, for unrelated reasons)\n\nFam","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-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@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 3xwZZv4r4bz9s78\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 15:39:50 +1000 (AEST)","from localhost ([::1]:34759 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 1dtomX-0008It-Ek\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 01:39:45 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38819)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dtomA-0008Id-3Q\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 01:39:23 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dtom7-0006c4-1r\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 01:39:22 -0400","from mx1.redhat.com ([209.132.183.28]:50304)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dtom6-0006ad-Pm\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 01:39:18 -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 A97274E33D;\n\tMon, 18 Sep 2017 05:39:17 +0000 (UTC)","from localhost (ovpn-12-141.pek2.redhat.com [10.72.12.141])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 10C7918C77;\n\tMon, 18 Sep 2017 05:39:14 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com A97274E33D","Date":"Mon, 18 Sep 2017 13:39:13 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Kevin Wolf <kwolf@redhat.com>","Message-ID":"<20170918053913.GD15551@lemon.lan>","References":"<20170901112829.2571-1-apahim@redhat.com>\n\t<20170901112829.2571-5-apahim@redhat.com>\n\t<20170905030255.GH22515@lemon.lan>\n\t<20170918051858.GA31915@localhost.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170918051858.GA31915@localhost.localdomain>","User-Agent":"Mutt/1.8.3 (2017-05-23)","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.38]);\n\tMon, 18 Sep 2017 05:39:17 +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 v8 04/13] qemu.py: improve message on\n\tnegative exit code","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":"ldoktor@redhat.com, ehabkost@redhat.com, stefanha@gmail.com,\n\tAmador Pahim <apahim@redhat.com>, armbru@redhat.com,\n\tqemu-devel@nongnu.org, crosa@redhat.com, mreitz@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":1769891,"web_url":"http://patchwork.ozlabs.org/comment/1769891/","msgid":"<20170918064439.GB31915@localhost.localdomain>","list_archive_url":null,"date":"2017-09-18T06:44:39","subject":"Re: [Qemu-devel] [PATCH v8 04/13] qemu.py: improve message on\n\tnegative exit code","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 18.09.2017 um 07:39 hat Fam Zheng geschrieben:\n> On Mon, 09/18 07:18, Kevin Wolf wrote:\n> > Am 05.09.2017 um 05:02 hat Fam Zheng geschrieben:\n> > > On Fri, 09/01 13:28, Amador Pahim wrote:\n> > > > The current message shows 'self._args', which contains only part of the\n> > > > options used in the Qemu command line.\n> > > > \n> > > > This patch makes the qemu full args list an instance variable and then\n> > > > uses it in the negative exit code message.\n> > > > \n> > > > Message was moved outside the 'if is_running' block to make sure it will\n> > > > be logged if the VM finishes before the call to shutdown().\n> > > > \n> > > > Signed-off-by: Amador Pahim <apahim@redhat.com>\n> > > > ---\n> > > >  scripts/qemu.py | 26 +++++++++++++++++++-------\n> > > >  1 file changed, 19 insertions(+), 7 deletions(-)\n> > > > \n> > > > diff --git a/scripts/qemu.py b/scripts/qemu.py\n> > > > index a6e06291ea..670c048569 100644\n> > > > --- a/scripts/qemu.py\n> > > > +++ b/scripts/qemu.py\n> > > > @@ -49,6 +49,7 @@ class QEMUMachine(object):\n> > > >          self._iolog = None\n> > > >          self._socket_scm_helper = socket_scm_helper\n> > > >          self._debug = debug\n> > > > +        self._qemu_full_args = None\n> > > >  \n> > > >      # This can be used to add an unused monitor instance.\n> > > >      def add_monitor_telnet(self, ip, port):\n> > > > @@ -140,13 +141,18 @@ class QEMUMachine(object):\n> > > >  \n> > > >      def launch(self):\n> > > >          '''Launch the VM and establish a QMP connection'''\n> > > > +        self._qemu_full_args = None\n> > > >          devnull = open(os.path.devnull, 'rb')\n> > > >          qemulog = open(self._qemu_log_path, 'wb')\n> > > >          try:\n> > > >              self._pre_launch()\n> > > > -            args = self._wrapper + [self._binary] + self._base_args() + self._args\n> > > > -            self._popen = subprocess.Popen(args, stdin=devnull, stdout=qemulog,\n> > > > -                                           stderr=subprocess.STDOUT, shell=False)\n> > > > +            self._qemu_full_args = (self._wrapper + [self._binary] +\n> > > > +                                    self._base_args() + self._args)\n> > > \n> > > The parentheses seem superfluous. With those removed:\n> > > \n> > > Reviewed-by: Fam Zheng <famz@redhat.com>\n> > \n> > Congratulations, with this advice you just killed all Python-based\n> > qemu-iotests and filled up my inbox with CI failure messages. :-)\n> \n> Oops. Why doesn't python understand such multi line expressions\n> impllied by \"+\" just like in \"[,]\"?\n\nTo be honest, I didn't know that either until now. But apparently the\ndifferent kinds of brackets (including those around function arguments)\nare the only things that allow multiline expressions in Python.\n\n> Iotests on patchew is not far away. (The docker test-block pull\n> request was bounced a few times, unfortunately, for unrelated reasons)\n\nNice!\n\nKevin","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-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@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 3xwc2P10sfz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 16:45:16 +1000 (AEST)","from localhost ([::1]:34941 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 1dtpns-0003BG-Sr\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 02:45:12 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47618)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dtpnZ-0003B6-P8\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 02:44:54 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dtpnW-0003Wo-M1\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 02:44:53 -0400","from mx1.redhat.com ([209.132.183.28]:59238)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>) id 1dtpnW-0003Wk-DB\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 02:44:50 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\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 110248763A;\n\tMon, 18 Sep 2017 06:44:49 +0000 (UTC)","from localhost.localdomain (ovpn-116-105.ams2.redhat.com\n\t[10.36.116.105])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id AEC4A5C541;\n\tMon, 18 Sep 2017 06:44:41 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 110248763A","Date":"Mon, 18 Sep 2017 08:44:39 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"Fam Zheng <famz@redhat.com>","Message-ID":"<20170918064439.GB31915@localhost.localdomain>","References":"<20170901112829.2571-1-apahim@redhat.com>\n\t<20170901112829.2571-5-apahim@redhat.com>\n\t<20170905030255.GH22515@lemon.lan>\n\t<20170918051858.GA31915@localhost.localdomain>\n\t<20170918053913.GD15551@lemon.lan>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170918053913.GD15551@lemon.lan>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tMon, 18 Sep 2017 06:44:49 +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 v8 04/13] qemu.py: improve message on\n\tnegative exit code","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":"ldoktor@redhat.com, ehabkost@redhat.com, stefanha@gmail.com,\n\tAmador Pahim <apahim@redhat.com>, armbru@redhat.com,\n\tqemu-devel@nongnu.org, crosa@redhat.com, mreitz@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":1769898,"web_url":"http://patchwork.ozlabs.org/comment/1769898/","msgid":"<20170918070307.GH15551@lemon.lan>","list_archive_url":null,"date":"2017-09-18T07:03:07","subject":"Re: [Qemu-devel] [PATCH v8 04/13] qemu.py: improve message on\n\tnegative exit code","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Mon, 09/18 08:44, Kevin Wolf wrote:\n> > > > > +            self._qemu_full_args = (self._wrapper + [self._binary] +\n> > > > > +                                    self._base_args() + self._args)\n> > > > \n> > > > The parentheses seem superfluous. With those removed:\n> > > > \n> > > > Reviewed-by: Fam Zheng <famz@redhat.com>\n> > > \n> > > Congratulations, with this advice you just killed all Python-based\n> > > qemu-iotests and filled up my inbox with CI failure messages. :-)\n> > \n> > Oops. Why doesn't python understand such multi line expressions\n> > impllied by \"+\" just like in \"[,]\"?\n> \n> To be honest, I didn't know that either until now. But apparently the\n> different kinds of brackets (including those around function arguments)\n> are the only things that allow multiline expressions in Python.\n\nYes, and now I read that PEP recommends using brackets for multilines compared\nto backslashes. I was totally wrong with this advice.\n\nFam","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-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@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 3xwcRk5L0xz9s7G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 17:03:45 +1000 (AEST)","from localhost ([::1]:34978 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 1dtq5n-0006xH-Fh\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 03:03:43 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:50229)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dtq5P-0006x4-9L\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 03:03:20 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dtq5J-0002pl-GE\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 03:03:19 -0400","from mx1.redhat.com ([209.132.183.28]:46262)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dtq5J-0002p4-9L\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 03:03:13 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\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 E0D81C0587DE;\n\tMon, 18 Sep 2017 07:03:11 +0000 (UTC)","from localhost (ovpn-12-141.pek2.redhat.com [10.72.12.141])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 074265D6A9;\n\tMon, 18 Sep 2017 07:03:08 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com E0D81C0587DE","Date":"Mon, 18 Sep 2017 15:03:07 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Kevin Wolf <kwolf@redhat.com>","Message-ID":"<20170918070307.GH15551@lemon.lan>","References":"<20170901112829.2571-1-apahim@redhat.com>\n\t<20170901112829.2571-5-apahim@redhat.com>\n\t<20170905030255.GH22515@lemon.lan>\n\t<20170918051858.GA31915@localhost.localdomain>\n\t<20170918053913.GD15551@lemon.lan>\n\t<20170918064439.GB31915@localhost.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170918064439.GB31915@localhost.localdomain>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tMon, 18 Sep 2017 07:03:12 +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 v8 04/13] qemu.py: improve message on\n\tnegative exit code","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":"ldoktor@redhat.com, ehabkost@redhat.com, stefanha@gmail.com,\n\tAmador Pahim <apahim@redhat.com>, qemu-devel@nongnu.org,\n\tarmbru@redhat.com, crosa@redhat.com, mreitz@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>"}}]