From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872282074681.4408551450268; Mon, 5 Feb 2018 15:11:22 -0800 (PST) Received: from localhost ([::1]:48778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipur-0002u0-MT for importer@patchew.org; Mon, 05 Feb 2018 18:11:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipsp-0001Rr-0B for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipsn-0006Oj-9a for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56130) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipsn-0006Nm-1E for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:05 -0500 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 62C643683C; Mon, 5 Feb 2018 23:09:04 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5AB517CE9; Mon, 5 Feb 2018 23:09:03 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:40 -0200 Message-Id: <20180205230900.11344-2-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> MIME-Version: 1.0 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]); Mon, 05 Feb 2018 23:09:04 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 01/21] qapi: convert to use python print function instead of statement 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Python 3 no longer supports the bare "print" statement, it must be called as a normal function with round brackets. It is possible to opt-in to this new syntax with Python 2.6 onwards by importing the "print_function" from the "__future__" module, making it easy to support Python 2 and 3 in parallel. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-2-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qapi.py | 12 ++++++------ scripts/qapi2texi.py | 9 +++++---- tests/qapi-schema/test-qapi.py | 41 +++++++++++++++++++++-----------------= --- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 43a54bf40f..64fde4b6c5 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -11,6 +11,7 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 +from __future__ import print_function import errno import getopt import os @@ -1467,7 +1468,7 @@ class QAPISchema(object): self._def_exprs() self.check() except QAPIError as err: - print >>sys.stderr, err + print(err, file=3Dsys.stderr) exit(1) =20 def _def_entity(self, ent): @@ -1931,7 +1932,7 @@ def parse_command_line(extra_options=3D'', extra_long= _options=3D[]): ['source', 'header', 'prefix=3D', 'output-dir=3D'] + extra_long_opti= ons) except getopt.GetoptError as err: - print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err)) + print("%s: %s" % (sys.argv[0], str(err)), file=3Dsys.stderr) sys.exit(1) =20 output_dir =3D '' @@ -1945,9 +1946,8 @@ def parse_command_line(extra_options=3D'', extra_long= _options=3D[]): if o in ('-p', '--prefix'): match =3D re.match(r'([A-Za-z_.-][A-Za-z0-9_.-]*)?', a) if match.end() !=3D len(a): - print >>sys.stderr, \ - "%s: 'funny character '%s' in argument of --prefix" \ - % (sys.argv[0], a[match.end()]) + print("%s: 'funny character '%s' in argument of --prefix" \ + % (sys.argv[0], a[match.end()]), file=3Dsys.stderr) sys.exit(1) prefix =3D a elif o in ('-o', '--output-dir'): @@ -1964,7 +1964,7 @@ def parse_command_line(extra_options=3D'', extra_long= _options=3D[]): do_h =3D True =20 if len(args) !=3D 1: - print >>sys.stderr, "%s: need exactly one argument" % sys.argv[0] + print("%s: need exactly one argument" % sys.argv[0], file=3Dsys.st= derr) sys.exit(1) fname =3D args[0] =20 diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index 92e2af2cd6..70e1fe76ef 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -4,6 +4,7 @@ # This work is licensed under the terms of the GNU LGPL, version 2+. # See the COPYING file in the top-level directory. """This script produces the documentation of a qapi schema in texinfo form= at""" +from __future__ import print_function import re import sys =20 @@ -274,15 +275,15 @@ def texi_schema(schema): def main(argv): """Takes schema argument, prints result to stdout""" if len(argv) !=3D 2: - print >>sys.stderr, "%s: need exactly 1 argument: SCHEMA" % argv[0] + print("%s: need exactly 1 argument: SCHEMA" % argv[0], file=3Dsys.= stderr) sys.exit(1) =20 schema =3D qapi.QAPISchema(argv[1]) if not qapi.doc_required: - print >>sys.stderr, ("%s: need pragma 'doc-required' " - "to generate documentation" % argv[0]) + print("%s: need pragma 'doc-required' " + "to generate documentation" % argv[0], file=3Dsys.stderr) sys.exit(1) - print texi_schema(schema) + print(texi_schema(schema)) =20 =20 if __name__ =3D=3D '__main__': diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index fe0ca08d78..a43fa873e1 100644 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -10,6 +10,7 @@ # See the COPYING file in the top-level directory. # =20 +from __future__ import print_function from qapi import * from pprint import pprint import os @@ -18,51 +19,51 @@ import sys =20 class QAPISchemaTestVisitor(QAPISchemaVisitor): def visit_enum_type(self, name, info, values, prefix): - print 'enum %s %s' % (name, values) + print('enum %s %s' % (name, values)) if prefix: - print ' prefix %s' % prefix + print(' prefix %s' % prefix) =20 def visit_object_type(self, name, info, base, members, variants): - print 'object %s' % name + print('object %s' % name) if base: - print ' base %s' % base.name + print(' base %s' % base.name) for m in members: - print ' member %s: %s optional=3D%s' % \ - (m.name, m.type.name, m.optional) + print(' member %s: %s optional=3D%s' % \ + (m.name, m.type.name, m.optional)) self._print_variants(variants) =20 def visit_alternate_type(self, name, info, variants): - print 'alternate %s' % name + print('alternate %s' % name) self._print_variants(variants) =20 def visit_command(self, name, info, arg_type, ret_type, gen, success_response, boxed): - print 'command %s %s -> %s' % \ - (name, arg_type and arg_type.name, ret_type and ret_type.name) - print ' gen=3D%s success_response=3D%s boxed=3D%s' % \ - (gen, success_response, boxed) + print('command %s %s -> %s' % \ + (name, arg_type and arg_type.name, ret_type and ret_type.nam= e)) + print(' gen=3D%s success_response=3D%s boxed=3D%s' % \ + (gen, success_response, boxed)) =20 def visit_event(self, name, info, arg_type, boxed): - print 'event %s %s' % (name, arg_type and arg_type.name) - print ' boxed=3D%s' % boxed + print('event %s %s' % (name, arg_type and arg_type.name)) + print(' boxed=3D%s' % boxed) =20 @staticmethod def _print_variants(variants): if variants: - print ' tag %s' % variants.tag_member.name + print(' tag %s' % variants.tag_member.name) for v in variants.variants: - print ' case %s: %s' % (v.name, v.type.name) + print(' case %s: %s' % (v.name, v.type.name)) =20 schema =3D QAPISchema(sys.argv[1]) schema.visit(QAPISchemaTestVisitor()) =20 for doc in schema.docs: if doc.symbol: - print 'doc symbol=3D%s' % doc.symbol + print('doc symbol=3D%s' % doc.symbol) else: - print 'doc freeform' - print ' body=3D\n%s' % doc.body.text + print('doc freeform') + print(' body=3D\n%s' % doc.body.text) for arg, section in doc.args.iteritems(): - print ' arg=3D%s\n%s' % (arg, section.text) + print(' arg=3D%s\n%s' % (arg, section.text)) for section in doc.sections: - print ' section=3D%s\n%s' % (section.name, section.text) + print(' section=3D%s\n%s' % (section.name, section.text)) --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872456552318.8760574006026; Mon, 5 Feb 2018 15:14:16 -0800 (PST) Received: from localhost ([::1]:48808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipxn-0005R3-A1 for importer@patchew.org; Mon, 05 Feb 2018 18:14:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipsq-0001SY-8q for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipsp-0006Ss-8E for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36712) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipsp-0006Qz-0d for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:07 -0500 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 35B4D81DE7; Mon, 5 Feb 2018 23:09:06 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEB6A179C4; Mon, 5 Feb 2018 23:09:05 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:41 -0200 Message-Id: <20180205230900.11344-3-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> MIME-Version: 1.0 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.25]); Mon, 05 Feb 2018 23:09:06 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 02/21] qapi: use items()/values() intead of iteritems()/itervalues() 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" The iteritems()/itervalues() methods are gone in py3, but the items()/values() methods are still around. The latter are less efficient than the former in py2, but this has unmeasurably small impact on QEMU build time, so taking portability over efficiency is a net win. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-3-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qapi.py | 12 ++++++------ scripts/qapi2texi.py | 2 +- tests/qapi-schema/test-qapi.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 64fde4b6c5..98d7123d27 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -245,7 +245,7 @@ class QAPIDoc(object): "'Returns:' is only valid for commands") =20 def check(self): - bogus =3D [name for name, section in self.args.iteritems() + bogus =3D [name for name, section in self.args.items() if not section.member] if bogus: raise QAPISemError( @@ -300,7 +300,7 @@ class QAPISchemaParser(object): if not isinstance(pragma, dict): raise QAPISemError( info, "Value of 'pragma' must be a dictionary") - for name, value in pragma.iteritems(): + for name, value in pragma.items(): self._pragma(name, value, info) else: expr_elem =3D {'expr': expr, @@ -1566,7 +1566,7 @@ class QAPISchema(object): =20 def _make_members(self, data, info): return [self._make_member(key, value, info) - for (key, value) in data.iteritems()] + for (key, value) in data.items()] =20 def _def_struct_type(self, expr, info, doc): name =3D expr['struct'] @@ -1598,11 +1598,11 @@ class QAPISchema(object): name, info, doc, 'base', self._make_members(base, info))) if tag_name: variants =3D [self._make_variant(key, value) - for (key, value) in data.iteritems()] + for (key, value) in data.items()] members =3D [] else: variants =3D [self._make_simple_variant(key, value, info) - for (key, value) in data.iteritems()] + for (key, value) in data.items()] typ =3D self._make_implicit_enum_type(name, info, [v.name for v in variants]) tag_member =3D QAPISchemaObjectTypeMember('type', typ, False) @@ -1617,7 +1617,7 @@ class QAPISchema(object): name =3D expr['alternate'] data =3D expr['data'] variants =3D [self._make_variant(key, value) - for (key, value) in data.iteritems()] + for (key, value) in data.items()] tag_member =3D QAPISchemaObjectTypeMember('type', 'QType', False) self._def_entity( QAPISchemaAlternateType(name, info, doc, diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index 70e1fe76ef..bf1c57b2e2 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -146,7 +146,7 @@ def texi_member(member, suffix=3D''): def texi_members(doc, what, base, variants, member_func): """Format the table of members""" items =3D '' - for section in doc.args.itervalues(): + for section in doc.args.values(): # TODO Drop fallbacks when undocumented members are outlawed if section.text: desc =3D texi_format(section.text) diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index a43fa873e1..ac43d3458e 100644 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -63,7 +63,7 @@ for doc in schema.docs: else: print('doc freeform') print(' body=3D\n%s' % doc.body.text) - for arg, section in doc.args.iteritems(): + for arg, section in doc.args.items(): print(' arg=3D%s\n%s' % (arg, section.text)) for section in doc.sections: print(' section=3D%s\n%s' % (section.name, section.text)) --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872283529314.61787790496646; Mon, 5 Feb 2018 15:11:23 -0800 (PST) Received: from localhost ([::1]:48779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipuy-0002za-Pg for importer@patchew.org; Mon, 05 Feb 2018 18:11:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipss-0001Ub-5u for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipsr-0006bj-6G for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipsr-0006Y5-0i for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:09 -0500 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 68BC949012; Mon, 5 Feb 2018 23:09:08 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B19718ECF; Mon, 5 Feb 2018 23:09:07 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:42 -0200 Message-Id: <20180205230900.11344-4-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> MIME-Version: 1.0 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.38]); Mon, 05 Feb 2018 23:09:08 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 03/21] qapi: Use OrderedDict from standard library if available 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" The OrderedDict class appeared in the 'collections' module from python 2.7 onwards, so use that in preference to our local backport if available. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-4-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 98d7123d27..514b7bb5a4 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -18,7 +18,10 @@ import os import re import string import sys -from ordereddict import OrderedDict +try: + from collections import OrderedDict +except: + from ordereddict import OrderedDict =20 builtin_types =3D { 'null': 'QTYPE_QNULL', --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872459723506.5246658670843; Mon, 5 Feb 2018 15:14:19 -0800 (PST) Received: from localhost ([::1]:48809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipxq-0005UN-Tc for importer@patchew.org; Mon, 05 Feb 2018 18:14:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipst-0001XY-Ud for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipss-0006l1-Vh for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35384) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipss-0006h6-R1 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:10 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E6AC80465; Mon, 5 Feb 2018 23:09:10 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7A066090A; Mon, 5 Feb 2018 23:09:09 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:43 -0200 Message-Id: <20180205230900.11344-5-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 05 Feb 2018 23:09:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 04/21] qapi: adapt to moved location of StringIO module in py3 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-5-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qapi.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 514b7bb5a4..514cca44bf 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -22,6 +22,10 @@ try: from collections import OrderedDict except: from ordereddict import OrderedDict +try: + from StringIO import StringIO +except ImportError: + from io import StringIO =20 builtin_types =3D { 'null': 'QTYPE_QNULL', @@ -1995,8 +1999,7 @@ def open_output(output_dir, do_c, do_h, prefix, c_fil= e, h_file, if really: return open(name, opt) else: - import StringIO - return StringIO.StringIO() + return StringIO() =20 fdef =3D maybe_open(do_c, c_file, 'w') fdecl =3D maybe_open(do_h, h_file, 'w') --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872644125637.4053632612664; Mon, 5 Feb 2018 15:17:24 -0800 (PST) Received: from localhost ([::1]:49041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq0k-0008UW-DS for importer@patchew.org; Mon, 05 Feb 2018 18:17:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipsx-0001am-6l for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipsu-0006qm-Of for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36748) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipsu-0006ox-It for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:12 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E129B7AE92; Mon, 5 Feb 2018 23:09:11 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76F4C5C88F; Mon, 5 Feb 2018 23:09:11 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:44 -0200 Message-Id: <20180205230900.11344-6-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 05 Feb 2018 23:09:11 +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] [PULL 05/21] qapi: Adapt to moved location of 'maketrans' function in py3 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-6-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 514cca44bf..1fdd189c0d 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1734,7 +1734,10 @@ def c_enum_const(type_name, const_name, prefix=3DNon= e): type_name =3D prefix return camel_to_upper(type_name) + '_' + c_name(const_name, False).upp= er() =20 -c_name_trans =3D string.maketrans('.-', '__') +if hasattr(str, 'maketrans'): + c_name_trans =3D str.maketrans('.-', '__') +else: + c_name_trans =3D string.maketrans('.-', '__') =20 =20 # Map @name to a valid C identifier. --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15178726441251021.1383145389533; Mon, 5 Feb 2018 15:17:24 -0800 (PST) Received: from localhost ([::1]:49043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq0o-00006U-Ne for importer@patchew.org; Mon, 05 Feb 2018 18:17:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipsx-0001bC-K3 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipsw-0006ug-IE for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56196) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipsw-0006t7-Ba for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:14 -0500 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 B55DA2820C; Mon, 5 Feb 2018 23:09:13 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AA594147; Mon, 5 Feb 2018 23:09:13 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:45 -0200 Message-Id: <20180205230900.11344-7-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> 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]); Mon, 05 Feb 2018 23:09:13 +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] [PULL 06/21] qapi: remove '-q' arg to diff when comparing QAPI output 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" When the qapi schema tests fail they merely print that the expected output didn't match the actual output. This is largely useless when trying diagnose what went wrong. Removing the '-q' arg to diff means that it is still silent on successful tests, but when it fails we'll see details of the incorrect output. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-7-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- tests/Makefile.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index ca82e0c0cc..3258b9c22a 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -917,10 +917,10 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check= -%.json: $(SRC_PATH)/%.json $^ >$*.test.out 2>$*.test.err; \ echo $$? >$*.test.exit, \ "TEST","$*.out") - @diff -q $(SRC_PATH)/$*.out $*.test.out + @diff $(SRC_PATH)/$*.out $*.test.out @# Sanitize error messages (make them independent of build directory) - @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.= err - - @diff -q $(SRC_PATH)/$*.exit $*.test.exit + @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff $(SRC_PATH)/$*.err= - + @diff $(SRC_PATH)/$*.exit $*.test.exit =20 .PHONY: check-tests/qapi-schema/doc-good.texi check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872288604395.6783568176585; Mon, 5 Feb 2018 15:11:28 -0800 (PST) Received: from localhost ([::1]:48780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipv5-00034o-BR for importer@patchew.org; Mon, 05 Feb 2018 18:11:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipsz-0001cr-7B for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipsy-0006yc-E7 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41156) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipsy-0006xU-7y for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:16 -0500 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 8F76B61D20; Mon, 5 Feb 2018 23:09:15 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2153C17CE9; Mon, 5 Feb 2018 23:09:14 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:46 -0200 Message-Id: <20180205230900.11344-8-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> MIME-Version: 1.0 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.39]); Mon, 05 Feb 2018 23:09:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 07/21] qapi: ensure stable sort ordering when checking QAPI entities 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Some early python 3.x versions will have different default ordering when calling the 'values()' method on a dict, compared to python 2.x and later 3.x versions. Explicitly sort the items to get a stable ordering. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-8-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 1fdd189c0d..58f995b07f 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1678,7 +1678,7 @@ class QAPISchema(object): assert False =20 def check(self): - for ent in self._entity_dict.values(): + for (name, ent) in sorted(self._entity_dict.items()): ent.check(self) =20 def visit(self, visitor): --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872454913576.0067714337848; Mon, 5 Feb 2018 15:14:14 -0800 (PST) Received: from localhost ([::1]:48807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipxm-0005PY-2L for importer@patchew.org; Mon, 05 Feb 2018 18:14:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipt1-0001fa-Td for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipt0-00072e-8g for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41200) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipt0-000710-0Q for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:18 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E56D61D20; Mon, 5 Feb 2018 23:09:17 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF22622716; Mon, 5 Feb 2018 23:09:16 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:47 -0200 Message-Id: <20180205230900.11344-9-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 05 Feb 2018 23:09:17 +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] [PULL 08/21] qapi: force a UTF-8 locale for running Python 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Python2 did not validate locale correctness when reading input data, so would happily read UTF-8 data in non-UTF-8 locales. Python3 is strict so if you try to read UTF-8 data in the C locale, it will raise an error for any UTF-8 bytes that aren't representable in 7-bit ascii encoding. e.g. UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 54: or= dinal not in range(128) Traceback (most recent call last): File "/tmp/qemu-test/src/scripts/qapi-commands.py", line 317, in schema =3D QAPISchema(input_file) File "/tmp/qemu-test/src/scripts/qapi.py", line 1468, in __init__ parser =3D QAPISchemaParser(open(fname, 'r')) File "/tmp/qemu-test/src/scripts/qapi.py", line 301, in __init__ previously_included) File "/tmp/qemu-test/src/scripts/qapi.py", line 348, in _include exprs_include =3D QAPISchemaParser(fobj, previously_included, info) File "/tmp/qemu-test/src/scripts/qapi.py", line 271, in __init__ self.src =3D fp.read() File "/usr/lib64/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] More background on this can be seen in https://www.python.org/dev/peps/pep-0538/ Many distros support a new C.UTF-8 locale that is like the C locale, but with UTF-8 instead of 7-bit ASCII. That is not entirely portable though. This patch thus sets the LANG to "C", but overrides LC_CTYPE to be en_US.UTF-8 locale. This gets us pretty close to C.UTF-8, but in a way that should be portable to everywhere QEMU builds. This patch only forces UTF-8 for QAPI scripts, since that is the one showing the immediate error under Python3 with C locale, but potentially we ought to force this for all python scripts used in the build process. Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-9-berrange@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Eduardo Habkost --- Makefile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 7d35ea1a06..4ec7a3cb82 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,8 @@ ifneq ($(wildcard config-host.mak),) all: include config-host.mak =20 +PYTHON_UTF8 =3D LC_ALL=3D LANG=3DC LC_CTYPE=3Den_US.UTF-8 $(PYTHON) + git-submodule-update: =20 .PHONY: git-submodule-update @@ -487,17 +489,17 @@ qapi-py =3D $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/s= cripts/ordereddict.py =20 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-= py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-types.py \ $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ "GEN","$@") qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-= py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-visit.py \ $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ "GEN","$@") qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c= :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qa= pi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-commands.py \ $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ "GEN","$@") =20 @@ -518,27 +520,27 @@ qapi-modules =3D $(SRC_PATH)/qapi-schema.json $(SRC_P= ATH)/qapi/common.json \ =20 qapi-types.c qapi-types.h :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-types.py \ $(gen-out-type) -o "." -b $<, \ "GEN","$@") qapi-visit.c qapi-visit.h :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-visit.py \ $(gen-out-type) -o "." -b $<, \ "GEN","$@") qapi-event.c qapi-event.h :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-event.py \ $(gen-out-type) -o "." $<, \ "GEN","$@") qmp-commands.h qmp-marshal.c :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-commands.py \ $(gen-out-type) -o "." $<, \ "GEN","$@") qmp-introspect.h qmp-introspect.c :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \ + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-introspect.p= y \ $(gen-out-type) -o "." $<, \ "GEN","$@") =20 @@ -811,10 +813,10 @@ qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SR= C_PATH)/scripts/hxtool docs/interop/qemu-qmp-qapi.texi docs/interop/qemu-ga-qapi.texi: $(SRC_PATH= )/scripts/qapi2texi.py $(qapi-py) =20 docs/interop/qemu-qmp-qapi.texi: $(qapi-modules) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"= GEN","$@") + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi2texi.py $< >= $@,"GEN","$@") =20 docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"= GEN","$@") + $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi2texi.py $< >= $@,"GEN","$@") =20 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-inf= o.texi qemu.1: qemu-option-trace.texi --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 151787264425511.21096276354615; Mon, 5 Feb 2018 15:17:24 -0800 (PST) Received: from localhost ([::1]:49040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq0j-0008To-Mt for importer@patchew.org; Mon, 05 Feb 2018 18:17:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipt2-0001gJ-Mo for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipt1-00075A-V5 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55904) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipt1-000748-Ow for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:19 -0500 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 2728E776CA; Mon, 5 Feb 2018 23:09:19 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6A8E17CE9; Mon, 5 Feb 2018 23:09:18 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:48 -0200 Message-Id: <20180205230900.11344-10-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> MIME-Version: 1.0 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.27]); Mon, 05 Feb 2018 23:09:19 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 09/21] scripts: ensure signrom treats data as bytes 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-10-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/signrom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/signrom.py b/scripts/signrom.py index d1dabe0240..0497a1c32e 100644 --- a/scripts/signrom.py +++ b/scripts/signrom.py @@ -18,7 +18,7 @@ fin =3D open(sys.argv[1], 'rb') fout =3D open(sys.argv[2], 'wb') =20 magic =3D fin.read(2) -if magic !=3D '\x55\xaa': +if magic !=3D b'\x55\xaa': sys.exit("%s: option ROM does not begin with magic 55 aa" % sys.argv[1= ]) =20 size_byte =3D ord(fin.read(1)) @@ -33,7 +33,7 @@ elif len(data) < size: # Add padding if necessary, rounding the whole input to a multiple of # 512 bytes according to the third byte of the input. # size-1 because a final byte is added below to store the checksum. - data =3D data.ljust(size-1, '\0') + data =3D data.ljust(size-1, b'\0') else: if ord(data[-1:]) !=3D 0: sys.stderr.write('WARNING: ROM includes nonzero checksum\n') --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872464700280.8989108670887; Mon, 5 Feb 2018 15:14:24 -0800 (PST) Received: from localhost ([::1]:48810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipxv-0005aE-OW for importer@patchew.org; Mon, 05 Feb 2018 18:14:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipt7-0001ki-0b for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipt3-00078D-Q8 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36832) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipt3-00077s-KC for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:21 -0500 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 02802793E8; Mon, 5 Feb 2018 23:09:21 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F8FF179C4; Mon, 5 Feb 2018 23:09:20 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:49 -0200 Message-Id: <20180205230900.11344-11-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> 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.25]); Mon, 05 Feb 2018 23:09:21 +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] [PULL 10/21] configure: allow use of python 3 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-11-berrange@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Eduardo Habkost --- configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 302fdc92ff..886abe6a39 100755 --- a/configure +++ b/configure @@ -1604,9 +1604,8 @@ fi =20 # Note that if the Python conditional here evaluates True we will exit # with status 1 which is a shell 'false' value. -if ! $python -c 'import sys; sys.exit(sys.version_info < (2,6) or sys.vers= ion_info >=3D (3,))'; then - error_exit "Cannot use '$python', Python 2.6 or later is required." \ - "Note that Python 3 or later is not yet supported." \ +if ! $python -c 'import sys; sys.exit(sys.version_info < (2,6))'; then + error_exit "Cannot use '$python', Python 2 >=3D 2.6 or Python 3 is requi= red." \ "Use --python=3D/path/to/python to specify a supported Python." fi =20 --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872805232275.1709180710054; Mon, 5 Feb 2018 15:20:05 -0800 (PST) Received: from localhost ([::1]:49119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq3Q-0002Fv-9I for importer@patchew.org; Mon, 05 Feb 2018 18:20:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipt8-0001m8-SC for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eipt8-0007A6-16 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35514) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eipt7-00079n-SF for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:25 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 382478046E; Mon, 5 Feb 2018 23:09:25 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62C8A60462; Mon, 5 Feb 2018 23:09:22 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:50 -0200 Message-Id: <20180205230900.11344-12-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 05 Feb 2018 23:09:25 +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] [PULL 11/21] qemu.py: remove unused import 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: Amador Pahim , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim Removing 'import sys' as it's not used anywhere. Signed-off-by: Amador Pahim Message-Id: <20171114102246.22221-2-apahim@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 9bfdf6d37d..65d9ad688c 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -15,7 +15,6 @@ import errno import logging import os -import sys import subprocess import qmp.qmp =20 --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872803598328.3084347201295; Mon, 5 Feb 2018 15:20:03 -0800 (PST) Received: from localhost ([::1]:49117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq3O-0002EQ-QL for importer@patchew.org; Mon, 05 Feb 2018 18:20:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptG-0001rC-7f for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptC-0007Cu-Vh for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42092) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptC-0007C4-LW for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:30 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04CDAC047B94; Mon, 5 Feb 2018 23:09:30 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DF1260C4E; Mon, 5 Feb 2018 23:09:26 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:51 -0200 Message-Id: <20180205230900.11344-13-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Feb 2018 23:09:30 +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] [PULL 12/21] qemu.py: better control of created files 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: Amador Pahim , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim To launch a VM, we need to create basically two files: the monitor socket (if it's a UNIX socket) and the qemu log file. For the qemu log file, we currently just open the path, which will create the file if it does not exist or overwrite the file if it does exist. For the monitor socket, if it already exists, we are currently removing it, even if it's not created by us. This patch moves to _pre_launch() the responsibility to create a temporary directory to host the files so we can remove the whole directory on _post_shutdown(). Signed-off-by: Amador Pahim Message-Id: <20180122205033.24893-2-apahim@redhat.com> Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 65d9ad688c..8d539206c4 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -17,6 +17,8 @@ import logging import os import subprocess import qmp.qmp +import shutil +import tempfile =20 =20 LOG =3D logging.getLogger(__name__) @@ -72,10 +74,11 @@ class QEMUMachine(object): wrapper =3D [] if name is None: name =3D "qemu-%d" % os.getpid() - if monitor_address is None: - monitor_address =3D os.path.join(test_dir, name + "-monitor.so= ck") + self._name =3D name self._monitor_address =3D monitor_address - self._qemu_log_path =3D os.path.join(test_dir, name + ".log") + self._vm_monitor =3D None + self._qemu_log_path =3D None + self._qemu_log_file =3D None self._popen =3D None self._binary =3D binary self._args =3D list(args) # Force copy args in case we modify = them @@ -85,6 +88,8 @@ class QEMUMachine(object): self._socket_scm_helper =3D socket_scm_helper self._qmp =3D None self._qemu_full_args =3D None + self._test_dir =3D test_dir + self._temp_dir =3D None =20 # just in case logging wasn't configured by the main script: logging.basicConfig() @@ -167,36 +172,50 @@ class QEMUMachine(object): self._monitor_address[0], self._monitor_address[1]) else: - moncdev =3D 'socket,id=3Dmon,path=3D%s' % self._monitor_address + moncdev =3D 'socket,id=3Dmon,path=3D%s' % self._vm_monitor return ['-chardev', moncdev, '-mon', 'chardev=3Dmon,mode=3Dcontrol', '-display', 'none', '-vga', 'none'] =20 def _pre_launch(self): - self._qmp =3D qmp.qmp.QEMUMonitorProtocol(self._monitor_address, + self._temp_dir =3D tempfile.mkdtemp(dir=3Dself._test_dir) + if self._monitor_address is not None: + self._vm_monitor =3D self._monitor_address + else: + self._vm_monitor =3D os.path.join(self._temp_dir, + self._name + "-monitor.sock") + self._qemu_log_path =3D os.path.join(self._temp_dir, self._name + = ".log") + self._qemu_log_file =3D open(self._qemu_log_path, 'wb') + + self._qmp =3D qmp.qmp.QEMUMonitorProtocol(self._vm_monitor, server=3DTrue) =20 def _post_launch(self): self._qmp.accept() =20 def _post_shutdown(self): - if not isinstance(self._monitor_address, tuple): - self._remove_if_exists(self._monitor_address) - self._remove_if_exists(self._qemu_log_path) + if self._qemu_log_file is not None: + self._qemu_log_file.close() + self._qemu_log_file =3D None + + self._qemu_log_path =3D None + + if self._temp_dir is not None: + shutil.rmtree(self._temp_dir) + self._temp_dir =3D None =20 def launch(self): '''Launch the VM and establish a QMP connection''' self._iolog =3D None self._qemu_full_args =3D None devnull =3D open(os.path.devnull, 'rb') - qemulog =3D open(self._qemu_log_path, 'wb') try: self._pre_launch() self._qemu_full_args =3D (self._wrapper + [self._binary] + self._base_args() + self._args) self._popen =3D subprocess.Popen(self._qemu_full_args, stdin=3Ddevnull, - stdout=3Dqemulog, + stdout=3Dself._qemu_log_file, stderr=3Dsubprocess.STDOUT, shell=3DFalse) self._post_launch() --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872958226698.9124768949167; Mon, 5 Feb 2018 15:22:38 -0800 (PST) Received: from localhost ([::1]:49190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq5o-0004Og-Dj for importer@patchew.org; Mon, 05 Feb 2018 18:22:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptI-0001tN-MO for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptH-0007FY-P2 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptH-0007FB-IR for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:35 -0500 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 EA2FC356D2; Mon, 5 Feb 2018 23:09:34 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 618324147; Mon, 5 Feb 2018 23:09:31 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:52 -0200 Message-Id: <20180205230900.11344-14-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> 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]); Mon, 05 Feb 2018 23:09:34 +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] [PULL 13/21] qemu.py: refactor launch() 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: Amador Pahim , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim This is just a refactor to separate the exception handler from the actual launch procedure, improving the readability and making future maintenances in this piece of code easier. Reviewed-by: Fam Zheng Reviewed-by: Eduardo Habkost Signed-off-by: Amador Pahim Message-Id: <20180122205033.24893-3-apahim@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 8d539206c4..0333d1e7fa 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -205,20 +205,14 @@ class QEMUMachine(object): self._temp_dir =3D None =20 def launch(self): - '''Launch the VM and establish a QMP connection''' + """ + Launch the VM and make sure we cleanup and expose the + command line/output in case of exception + """ self._iolog =3D None self._qemu_full_args =3D None - devnull =3D open(os.path.devnull, 'rb') try: - self._pre_launch() - self._qemu_full_args =3D (self._wrapper + [self._binary] + - self._base_args() + self._args) - self._popen =3D subprocess.Popen(self._qemu_full_args, - stdin=3Ddevnull, - stdout=3Dself._qemu_log_file, - stderr=3Dsubprocess.STDOUT, - shell=3DFalse) - self._post_launch() + self._launch() except: if self.is_running(): self._popen.kill() @@ -233,6 +227,19 @@ class QEMUMachine(object): LOG.debug('Output: %r', self._iolog) raise =20 + def _launch(self): + '''Launch the VM and establish a QMP connection''' + devnull =3D open(os.path.devnull, 'rb') + self._pre_launch() + self._qemu_full_args =3D (self._wrapper + [self._binary] + + self._base_args() + self._args) + self._popen =3D subprocess.Popen(self._qemu_full_args, + stdin=3Ddevnull, + stdout=3Dself._qemu_log_file, + stderr=3Dsubprocess.STDOUT, + shell=3DFalse) + self._post_launch() + def wait(self): '''Wait for the VM to power off''' self._popen.wait() --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872807585691.7900526563494; Mon, 5 Feb 2018 15:20:07 -0800 (PST) Received: from localhost ([::1]:49120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq3S-0002I0-Pr for importer@patchew.org; Mon, 05 Feb 2018 18:20:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptK-0001vF-CD for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptJ-0007Gq-JH for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36896) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptJ-0007GR-Dv for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:37 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C511081DE7; Mon, 5 Feb 2018 23:09:36 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5987560C4D; Mon, 5 Feb 2018 23:09:36 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:53 -0200 Message-Id: <20180205230900.11344-15-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 05 Feb 2018 23:09:36 +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] [PULL 14/21] qemu.py: always cleanup on shutdown() 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: Amador Pahim , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim Currently we only cleanup on shutdown() if the VM is running. To make sure we will always cleanup, this patch makes the self._load_io_log() and the self._post_shutdown() to always be called on shutdown(), regardless the VM running state. Reviewed-by: Fam Zheng Reviewed-by: Eduardo Habkost Signed-off-by: Amador Pahim Message-Id: <20180122205033.24893-4-apahim@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 0333d1e7fa..52cf09eebd 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -163,8 +163,9 @@ class QEMUMachine(object): return self._popen.pid =20 def _load_io_log(self): - with open(self._qemu_log_path, "r") as iolog: - self._iolog =3D iolog.read() + if self._qemu_log_path is not None: + with open(self._qemu_log_path, "r") as iolog: + self._iolog =3D iolog.read() =20 def _base_args(self): if isinstance(self._monitor_address, tuple): @@ -257,8 +258,8 @@ class QEMUMachine(object): self._popen.kill() self._popen.wait() =20 - self._load_io_log() - self._post_shutdown() + self._load_io_log() + self._post_shutdown() =20 exitcode =3D self.exitcode() if exitcode is not None and exitcode < 0: --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517872961316541.7676575565589; Mon, 5 Feb 2018 15:22:41 -0800 (PST) Received: from localhost ([::1]:49188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq5n-0004Nk-8P for importer@patchew.org; Mon, 05 Feb 2018 18:22:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptQ-000226-IV for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptN-0007JI-CA for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41430) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptN-0007Ii-6b for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DD7F6146F; Mon, 5 Feb 2018 23:09:40 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 326AB5D6A3; Mon, 5 Feb 2018 23:09:38 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:54 -0200 Message-Id: <20180205230900.11344-16-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 05 Feb 2018 23:09:40 +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] [PULL 15/21] qemu.py: use poll() instead of 'returncode' 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: Amador Pahim , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim The 'returncode' Popen attribute is not guaranteed to be updated. It actually depends on a call to either poll(), wait() or communicate(). On the other hand, poll() will: "Check if child process has terminated. Set and return returncode attribute." Let's use the poll() to check whether the process is running and to get the updated process exit code, when the process is finished. Reviewed-by: Fam Zheng eviewed-by: Eduardo Habkost Signed-off-by: Amador Pahim Message-Id: <20180122205033.24893-5-apahim@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 52cf09eebd..dcb4f0ffe6 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -150,12 +150,12 @@ class QEMUMachine(object): raise =20 def is_running(self): - return self._popen is not None and self._popen.returncode is None + return self._popen is not None and self._popen.poll() is None =20 def exitcode(self): if self._popen is None: return None - return self._popen.returncode + return self._popen.poll() =20 def get_pid(self): if not self.is_running(): --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517873011206408.9042524035765; Mon, 5 Feb 2018 15:23:31 -0800 (PST) Received: from localhost ([::1]:49213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq6k-0005Bv-DF for importer@patchew.org; Mon, 05 Feb 2018 18:23:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptS-00023T-Gn for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptR-0007SG-Kp for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42182) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptR-0007Qb-FJ for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:45 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2052C047B89; Mon, 5 Feb 2018 23:09:44 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id F35E16090A; Mon, 5 Feb 2018 23:09:41 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:55 -0200 Message-Id: <20180205230900.11344-17-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Feb 2018 23:09:44 +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] [PULL 16/21] qemu.py: cleanup redundant calls in launch() 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: Amador Pahim , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim Now that shutdown() is guaranteed to always execute self._load_io_log() and self._post_shutdown(), their calls in 'except' became redundant and we can safely replace it by a call to shutdown(). Reviewed-by: Fam Zheng Reviewed-by: Eduardo Habkost Signed-off-by: Amador Pahim Message-Id: <20180122205033.24893-6-apahim@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index dcb4f0ffe6..09db6249a3 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -215,11 +215,7 @@ class QEMUMachine(object): try: self._launch() except: - if self.is_running(): - self._popen.kill() - self._popen.wait() - self._load_io_log() - self._post_shutdown() + self.shutdown() =20 LOG.debug('Error launching VM') if self._qemu_full_args: --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15178731002651007.2334194118234; Mon, 5 Feb 2018 15:25:00 -0800 (PST) Received: from localhost ([::1]:49260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq8B-0006UU-Fa for importer@patchew.org; Mon, 05 Feb 2018 18:24:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptU-00023h-9P for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptT-0007W5-GT for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42196) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptT-0007Us-9p for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:47 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEFBDC05FEC0; Mon, 5 Feb 2018 23:09:46 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3359D5D6A2; Mon, 5 Feb 2018 23:09:46 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:56 -0200 Message-Id: <20180205230900.11344-18-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Feb 2018 23:09:46 +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] [PULL 17/21] qemu.py: don't launch again before shutdown() 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: Amador Pahim , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim If a VM is launched, files are created and a cleanup is required before a new launch. This cleanup is executed by shutdown(), so shutdown() must be called even if the VM is manually terminated (i.e. using kill). This patch creates a control to make sure launch() will not be executed again if shutdown() is not called after the previous launch(). Signed-off-by: Amador Pahim Message-Id: <20180122205033.24893-7-apahim@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/qemu.py b/scripts/qemu.py index 09db6249a3..305a946562 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -90,6 +90,7 @@ class QEMUMachine(object): self._qemu_full_args =3D None self._test_dir =3D test_dir self._temp_dir =3D None + self._launched =3D False =20 # just in case logging wasn't configured by the main script: logging.basicConfig() @@ -210,10 +211,15 @@ class QEMUMachine(object): Launch the VM and make sure we cleanup and expose the command line/output in case of exception """ + + if self._launched: + raise QEMUMachineError('VM already launched') + self._iolog =3D None self._qemu_full_args =3D None try: self._launch() + self._launched =3D True except: self.shutdown() =20 @@ -266,6 +272,8 @@ class QEMUMachine(object): command =3D '' LOG.warn(msg, exitcode, command) =20 + self._launched =3D False + def qmp(self, cmd, conv_keys=3DTrue, **args): '''Invoke a QMP command and return the response dict''' qmp_args =3D dict() --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517873268090523.29417001758; Mon, 5 Feb 2018 15:27:48 -0800 (PST) Received: from localhost ([::1]:49431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiqAn-0000Pv-2X for importer@patchew.org; Mon, 05 Feb 2018 18:27:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptW-00026u-L8 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptV-0007Zn-MS for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56520) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptV-0007ZT-Fo for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:49 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D31462820C; Mon, 5 Feb 2018 23:09:48 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16B605C25E; Mon, 5 Feb 2018 23:09:47 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:57 -0200 Message-Id: <20180205230900.11344-19-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 05 Feb 2018 23:09:48 +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] [PULL 18/21] input: add missing JIS keys to virtio input 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: Miika S , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Miika S keycodemapdb updated to add the QKeyCodes muhenkan and katakanahiragana Signed-off-by: Miika S Message-Id: <20180116134217.8725-12-berrange@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Eduardo Habkost --- qapi/ui.json | 5 ++++- ui/keycodemapdb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qapi/ui.json b/qapi/ui.json index 07b468f625..d6679aa8f5 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -748,6 +748,9 @@ # @ac_bookmarks: since 2.10 # altgr, altgr_r: dropped in 2.10 # +# @muhenkan: since 2.12 +# @katakanahiragana: since 2.12 +# # 'sysrq' was mistakenly added to hack around the fact that # the ps2 driver was not generating correct scancodes sequences # when 'alt+print' was pressed. This flaw is now fixed and the @@ -775,7 +778,7 @@ 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'ag= ain', 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cu= t', 'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', - 'ro', 'hiragana', 'henkan', 'yen', + 'ro', 'hiragana', 'henkan', 'yen', 'muhenkan', 'katakanahiraga= na', 'kp_comma', 'kp_equals', 'power', 'sleep', 'wake', 'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute= ', 'volumeup', 'volumedown', 'mediaselect', diff --git a/ui/keycodemapdb b/ui/keycodemapdb index 10739aa260..05dad417e9 160000 --- a/ui/keycodemapdb +++ b/ui/keycodemapdb @@ -1 +1 @@ -Subproject commit 10739aa26051a5d49d88132604539d3ed085e72e +Subproject commit 05dad417e9d0b37ee1fba33056d91a6b734b3357 --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517873105097492.68543533592606; Mon, 5 Feb 2018 15:25:05 -0800 (PST) Received: from localhost ([::1]:49258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq89-0006TK-8n for importer@patchew.org; Mon, 05 Feb 2018 18:24:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipta-0002AM-11 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptX-0007b0-Fw for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38312) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptX-0007aY-A7 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:51 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8CFD49036; Mon, 5 Feb 2018 23:09:50 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42B56605D8; Mon, 5 Feb 2018 23:09:50 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:58 -0200 Message-Id: <20180205230900.11344-20-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 05 Feb 2018 23:09:50 +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] [PULL 19/21] ui: update keycodemapdb to get py3 fixes 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-13-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- ui/keycodemapdb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/keycodemapdb b/ui/keycodemapdb index 05dad417e9..6b3d716e2b 160000 --- a/ui/keycodemapdb +++ b/ui/keycodemapdb @@ -1 +1 @@ -Subproject commit 05dad417e9d0b37ee1fba33056d91a6b734b3357 +Subproject commit 6b3d716e2b6472eb7189d3220552280ef3d832ce --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517873163429684.3119484070743; Mon, 5 Feb 2018 15:26:03 -0800 (PST) Received: from localhost ([::1]:49294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiq9C-0007UB-HC for importer@patchew.org; Mon, 05 Feb 2018 18:26:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eipta-0002At-JE for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptZ-0007cD-8n for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49396) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptZ-0007bk-3K for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:53 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 765D8C0587D1; Mon, 5 Feb 2018 23:09:52 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 118AE6134A; Mon, 5 Feb 2018 23:09:51 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:08:59 -0200 Message-Id: <20180205230900.11344-21-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 05 Feb 2018 23:09:52 +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] [PULL 20/21] travis: improve python version test coverage 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Currently travis declares ancient python 2.4 is desired. Update that to 2.6 which is the oldest version any targetted distros still needs. If we just list a python 3 version at the top level this will double the number of travis jobs we run which is unreasonable. So arbitrarily pick the clang test matrix entries to build with python 3.0 and 3.6, to extend coverage of python versions, without increasing job count or build time. Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-14-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f583839755..708c886017 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: c python: - - "2.4" + - "2.6" compiler: - gcc cache: ccache @@ -115,15 +115,17 @@ matrix: - sudo apt-get build-dep -qq qemu - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-g= it-seed.tar.xz | tar -xvJ - git submodule update --init --recursive - # Trusty System build with latest stable clang + # Trusty System build with latest stable clang & python 3.0 - sudo: required addons: dist: trusty language: generic compiler: none + python: + - "3.0" env: - COMPILER_NAME=3Dclang CXX=3Dclang++-3.9 CC=3Dclang-3.9 - - CONFIG=3D"--disable-linux-user --cc=3Dclang-3.9 --cxx=3Dclang++-= 3.9" + - CONFIG=3D"--disable-linux-user --cc=3Dclang-3.9 --cxx=3Dclang++-= 3.9 --python=3D/usr/bin/python3" before_install: - wget -nv -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo a= pt-key add - - sudo apt-add-repository -y 'deb http://llvm.org/apt/trusty llvm-= toolchain-trusty-3.9 main' @@ -134,15 +136,17 @@ matrix: - git submodule update --init --recursive before_script: - ./configure ${CONFIG} || cat config.log - # Trusty Linux User build with latest stable clang + # Trusty Linux User build with latest stable clang & python 3.6 - sudo: required addons: dist: trusty language: generic compiler: none + python: + - "3.6" env: - COMPILER_NAME=3Dclang CXX=3Dclang++-3.9 CC=3Dclang-3.9 - - CONFIG=3D"--disable-system --cc=3Dclang-3.9 --cxx=3Dclang++-3.9" + - CONFIG=3D"--disable-system --cc=3Dclang-3.9 --cxx=3Dclang++-3.9 = --python=3D/usr/bin/python3" before_install: - wget -nv -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo a= pt-key add - - sudo apt-add-repository -y 'deb http://llvm.org/apt/trusty llvm-= toolchain-trusty-3.9 main' --=20 2.14.3 From nobody Mon May 6 06:24:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517873267988914.7712114834802; Mon, 5 Feb 2018 15:27:47 -0800 (PST) Received: from localhost ([::1]:49413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiqAk-0000Ml-S9 for importer@patchew.org; Mon, 05 Feb 2018 18:27:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiptc-0002DN-OA for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiptb-0007e2-S5 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49982) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiptb-0007da-LM for qemu-devel@nongnu.org; Mon, 05 Feb 2018 18:09:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 10331130F; Mon, 5 Feb 2018 23:09:55 +0000 (UTC) Received: from localhost (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id C25785D6A2; Mon, 5 Feb 2018 23:09:53 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 21:09:00 -0200 Message-Id: <20180205230900.11344-22-ehabkost@redhat.com> In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com> References: <20180205230900.11344-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 05 Feb 2018 23:09:55 +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] [PULL 21/21] docker: change Fedora images to run with python3 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: Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Fedora has switched to Python 3 by default, so it makes sense to use that for testing QEMU builds, so we get testing of Python 3 compatibility. Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-15-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- tests/docker/dockerfiles/fedora.docker | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfi= les/fedora.docker index 32de731675..26ede4f1d6 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -1,6 +1,6 @@ FROM fedora:latest ENV PACKAGES \ - ccache gettext git tar PyYAML sparse flex bison python2 bzip2 hostname= \ + ccache gettext git tar PyYAML sparse flex bison python3 bzip2 hostname= \ glib2-devel pixman-devel zlib-devel SDL-devel libfdt-devel \ gcc gcc-c++ clang make perl which bc findutils libaio-devel \ nettle-devel libasan libubsan \ @@ -12,6 +12,7 @@ ENV PACKAGES \ mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtas= n1 \ mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2 \ mingw64-bzip2 +ENV QEMU_CONFIGURE_OPTS --python=3D/usr/bin/python3 =20 RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt --=20 2.14.3