From patchwork Tue Jan 16 13:42:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861587 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLX9Z0JjXz9s7v for ; Wed, 17 Jan 2018 01:07:46 +1100 (AEDT) Received: from localhost ([::1]:37323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRtv-0001dT-Tu for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:07:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRW4-0007AS-MZ for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRW1-0000Ty-Fi for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57858) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRW1-0000SD-74 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43:01 -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 452768F30C; Tue, 16 Jan 2018 13:43:00 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68E3C5447F; Tue, 16 Jan 2018 13:42:37 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:04 +0000 Message-Id: <20180116134217.8725-2-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@redhat.com> MIME-Version: 1.0 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.27]); Tue, 16 Jan 2018 13:43:00 +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] [PATCH v5 01/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Signed-off-by: Daniel P. Berrange --- 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. +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=sys.stderr) exit(1) def _def_entity(self, ent): @@ -1931,7 +1932,7 @@ def parse_command_line(extra_options='', extra_long_options=[]): ['source', 'header', 'prefix=', 'output-dir='] + extra_long_options) except getopt.GetoptError as err: - print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err)) + print("%s: %s" % (sys.argv[0], str(err)), file=sys.stderr) sys.exit(1) output_dir = '' @@ -1945,9 +1946,8 @@ def parse_command_line(extra_options='', extra_long_options=[]): if o in ('-p', '--prefix'): match = re.match(r'([A-Za-z_.-][A-Za-z0-9_.-]*)?', a) if match.end() != 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=sys.stderr) sys.exit(1) prefix = a elif o in ('-o', '--output-dir'): @@ -1964,7 +1964,7 @@ def parse_command_line(extra_options='', extra_long_options=[]): do_h = True if len(args) != 1: - print >>sys.stderr, "%s: need exactly one argument" % sys.argv[0] + print("%s: need exactly one argument" % sys.argv[0], file=sys.stderr) sys.exit(1) fname = args[0] 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 format""" +from __future__ import print_function import re import sys @@ -274,15 +275,15 @@ def texi_schema(schema): def main(argv): """Takes schema argument, prints result to stdout""" if len(argv) != 2: - print >>sys.stderr, "%s: need exactly 1 argument: SCHEMA" % argv[0] + print("%s: need exactly 1 argument: SCHEMA" % argv[0], file=sys.stderr) sys.exit(1) schema = 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=sys.stderr) sys.exit(1) - print texi_schema(schema) + print(texi_schema(schema)) if __name__ == '__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. # +from __future__ import print_function from qapi import * from pprint import pprint import os @@ -18,51 +19,51 @@ import sys 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) 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=%s' % \ - (m.name, m.type.name, m.optional) + print(' member %s: %s optional=%s' % \ + (m.name, m.type.name, m.optional)) self._print_variants(variants) def visit_alternate_type(self, name, info, variants): - print 'alternate %s' % name + print('alternate %s' % name) self._print_variants(variants) 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=%s success_response=%s boxed=%s' % \ - (gen, success_response, boxed) + print('command %s %s -> %s' % \ + (name, arg_type and arg_type.name, ret_type and ret_type.name)) + print(' gen=%s success_response=%s boxed=%s' % \ + (gen, success_response, boxed)) def visit_event(self, name, info, arg_type, boxed): - print 'event %s %s' % (name, arg_type and arg_type.name) - print ' boxed=%s' % boxed + print('event %s %s' % (name, arg_type and arg_type.name)) + print(' boxed=%s' % boxed) @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)) schema = QAPISchema(sys.argv[1]) schema.visit(QAPISchemaTestVisitor()) for doc in schema.docs: if doc.symbol: - print 'doc symbol=%s' % doc.symbol + print('doc symbol=%s' % doc.symbol) else: - print 'doc freeform' - print ' body=\n%s' % doc.body.text + print('doc freeform') + print(' body=\n%s' % doc.body.text) for arg, section in doc.args.iteritems(): - print ' arg=%s\n%s' % (arg, section.text) + print(' arg=%s\n%s' % (arg, section.text)) for section in doc.sections: - print ' section=%s\n%s' % (section.name, section.text) + print(' section=%s\n%s' % (section.name, section.text)) From patchwork Tue Jan 16 13:42:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLX6n298Gz9s1h for ; Wed, 17 Jan 2018 01:05:21 +1100 (AEDT) Received: from localhost ([::1]:37307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRrb-00089C-9v for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:05:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRWk-0007kC-0x for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRWg-00010t-Sk for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35098) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRWg-00010U-KA for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43:42 -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 901656B255; Tue, 16 Jan 2018 13:43:41 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D71561F50; Tue, 16 Jan 2018 13:42:59 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:05 +0000 Message-Id: <20180116134217.8725-3-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@redhat.com> MIME-Version: 1.0 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.25]); Tue, 16 Jan 2018 13:43:41 +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] [PATCH v5 02/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Signed-off-by: Daniel P. Berrange --- 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") def check(self): - bogus = [name for name, section in self.args.iteritems() + bogus = [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 = {'expr': expr, @@ -1566,7 +1566,7 @@ class QAPISchema(object): 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()] def _def_struct_type(self, expr, info, doc): name = expr['struct'] @@ -1598,11 +1598,11 @@ class QAPISchema(object): name, info, doc, 'base', self._make_members(base, info))) if tag_name: variants = [self._make_variant(key, value) - for (key, value) in data.iteritems()] + for (key, value) in data.items()] members = [] else: variants = [self._make_simple_variant(key, value, info) - for (key, value) in data.iteritems()] + for (key, value) in data.items()] typ = self._make_implicit_enum_type(name, info, [v.name for v in variants]) tag_member = QAPISchemaObjectTypeMember('type', typ, False) @@ -1617,7 +1617,7 @@ class QAPISchema(object): name = expr['alternate'] data = expr['data'] variants = [self._make_variant(key, value) - for (key, value) in data.iteritems()] + for (key, value) in data.items()] tag_member = 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=''): def texi_members(doc, what, base, variants, member_func): """Format the table of members""" items = '' - for section in doc.args.itervalues(): + for section in doc.args.values(): # TODO Drop fallbacks when undocumented members are outlawed if section.text: desc = 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=\n%s' % doc.body.text) - for arg, section in doc.args.iteritems(): + for arg, section in doc.args.items(): print(' arg=%s\n%s' % (arg, section.text)) for section in doc.sections: print(' section=%s\n%s' % (section.name, section.text)) From patchwork Tue Jan 16 13:42:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLWyq425wz9s1h for ; Wed, 17 Jan 2018 00:58:27 +1100 (AEDT) Received: from localhost ([::1]:37182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRkv-0002V0-Fx for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 08:58:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRWx-0007xT-3y for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRWt-00017Y-UT for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51898) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRWt-00017E-OM for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:43: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 ADC9772FEB; Tue, 16 Jan 2018 13:43:49 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9DB85EDE9; Tue, 16 Jan 2018 13:43:41 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:06 +0000 Message-Id: <20180116134217.8725-4-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@redhat.com> MIME-Version: 1.0 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.38]); Tue, 16 Jan 2018 13:43:49 +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] [PATCH v5 03/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Signed-off-by: Daniel P. Berrange --- 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 builtin_types = { 'null': 'QTYPE_QNULL', From patchwork Tue Jan 16 13:42:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLXF95jjxz9sDB for ; Wed, 17 Jan 2018 01:10:53 +1100 (AEDT) Received: from localhost ([::1]:37467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRwx-0004GY-Sk for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:10:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRX5-00085Q-ON for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRWz-00019w-SX for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42824) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRWz-00019T-Mt for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:01 -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 95C0273B11; Tue, 16 Jan 2018 13:43:55 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE6C65EDE4; Tue, 16 Jan 2018 13:43:49 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:07 +0000 Message-Id: <20180116134217.8725-5-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@redhat.com> MIME-Version: 1.0 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.28]); Tue, 16 Jan 2018 13:44:00 +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] [PATCH v5 04/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrange --- 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 builtin_types = { 'null': 'QTYPE_QNULL', @@ -1995,8 +1999,7 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, if really: return open(name, opt) else: - import StringIO - return StringIO.StringIO() + return StringIO() fdef = maybe_open(do_c, c_file, 'w') fdecl = maybe_open(do_h, h_file, 'w') From patchwork Tue Jan 16 13:42:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLWtd740lz9s1h for ; Wed, 17 Jan 2018 00:54:49 +1100 (AEDT) Received: from localhost ([::1]:36949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRhQ-0007lf-1n for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 08:54:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRX9-00088K-39 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRX6-0001CZ-2s for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35748) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRX5-0001C8-TT for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:08 -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 CA6234205E; Tue, 16 Jan 2018 13:44:01 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id B05EA5EE03; Tue, 16 Jan 2018 13:43:55 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:08 +0000 Message-Id: <20180116134217.8725-6-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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.25]); Tue, 16 Jan 2018 13:44:07 +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] [PATCH v5 05/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange --- 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=None): type_name = prefix return camel_to_upper(type_name) + '_' + c_name(const_name, False).upper() -c_name_trans = string.maketrans('.-', '__') +if hasattr(str, 'maketrans'): + c_name_trans = str.maketrans('.-', '__') +else: + c_name_trans = string.maketrans('.-', '__') # Map @name to a valid C identifier. From patchwork Tue Jan 16 13:42:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861599 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLXBX1znNz9sNV for ; Wed, 17 Jan 2018 01:08:36 +1100 (AEDT) Received: from localhost ([::1]:37356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRuk-0002IF-3b for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:08:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXB-0008Ax-Kc for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRX6-0001Ca-2v for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRX5-0001C9-TR for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:08 -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 E68BD3024B1; Tue, 16 Jan 2018 13:44:06 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6CAE62694; Tue, 16 Jan 2018 13:44:01 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:09 +0000 Message-Id: <20180116134217.8725-7-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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]); Tue, 16 Jan 2018 13:44:07 +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] [PATCH v5 06/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- tests/Makefile.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 39a4b5359d..d65fb4e1b3 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -908,10 +908,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 .PHONY: check-tests/qapi-schema/doc-good.texi check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi From patchwork Tue Jan 16 13:42:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLWyB0BdZz9s1h for ; Wed, 17 Jan 2018 00:57:54 +1100 (AEDT) Received: from localhost ([::1]:37125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRkO-0001yf-1Y for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 08:57:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXG-0008Fo-07 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRX8-0001E3-I8 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51664) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRX8-0001DS-Bd for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:10 -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 727BAC099429; Tue, 16 Jan 2018 13:44:09 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 166FA17B81; Tue, 16 Jan 2018 13:44:06 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:10 +0000 Message-Id: <20180116134217.8725-8-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@redhat.com> MIME-Version: 1.0 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]); Tue, 16 Jan 2018 13:44:09 +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] [PATCH v5 07/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Signed-off-by: Daniel P. Berrange --- 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 def check(self): - for ent in self._entity_dict.values(): + for (name, ent) in sorted(self._entity_dict.items()): ent.check(self) def visit(self, visitor): From patchwork Tue Jan 16 13:42:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861579 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLX1j6Q2Tz9sDB for ; Wed, 17 Jan 2018 01:00:57 +1100 (AEDT) Received: from localhost ([::1]:37192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRnM-0004ly-1a for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:00:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXJ-0008Il-9G for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRXG-0001Hw-IV for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52666) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRXG-0001HF-9V for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:18 -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 4EA65D2EFF; Tue, 16 Jan 2018 13:44:17 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AD805D753; Tue, 16 Jan 2018 13:44:09 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:11 +0000 Message-Id: <20180116134217.8725-9-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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.38]); Tue, 16 Jan 2018 13:44: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] [PATCH v5 08/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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: ordinal not in range(128) Traceback (most recent call last): File "/tmp/qemu-test/src/scripts/qapi-commands.py", line 317, in schema = QAPISchema(input_file) File "/tmp/qemu-test/src/scripts/qapi.py", line 1468, in __init__ parser = 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 = QAPISchemaParser(fobj, previously_included, info) File "/tmp/qemu-test/src/scripts/qapi.py", line 271, in __init__ self.src = 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 Reviewed-by: Eric Blake --- Makefile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index d86ecd2dd4..63767bb11f 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ ifneq ($(wildcard config-host.mak),) all: include config-host.mak +PYTHON_UTF8 = LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 $(PYTHON) + git-submodule-update: .PHONY: git-submodule-update @@ -471,17 +473,17 @@ qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py 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 $(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 qga/qapi-generated -p "qga-" $<, \ "GEN","$@") @@ -502,27 +504,27 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ 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.py \ $(gen-out-type) -o "." $<, \ "GEN","$@") @@ -792,10 +794,10 @@ qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool docs/interop/qemu-qmp-qapi.texi docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py) 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","$@") 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","$@") qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi qemu.1: qemu-option-trace.texi From patchwork Tue Jan 16 13:42:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLXJm1j0sz9sDB for ; Wed, 17 Jan 2018 01:14:00 +1100 (AEDT) Received: from localhost ([::1]:37883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRzx-00074x-5T for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:13:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXM-0008JR-IQ for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRXL-0001LC-Hc for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52822) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRXL-0001Kg-B2 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:23 -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 7166E4E05D; Tue, 16 Jan 2018 13:44:17 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65B2B62675; Tue, 16 Jan 2018 13:44:12 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:12 +0000 Message-Id: <20180116134217.8725-10-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@redhat.com> MIME-Version: 1.0 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.38]); Tue, 16 Jan 2018 13:44:22 +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] [PATCH v5 09/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrange --- 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 = open(sys.argv[1], 'rb') fout = open(sys.argv[2], 'wb') magic = fin.read(2) -if magic != '\x55\xaa': +if magic != b'\x55\xaa': sys.exit("%s: option ROM does not begin with magic 55 aa" % sys.argv[1]) size_byte = 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 = data.ljust(size-1, '\0') + data = data.ljust(size-1, b'\0') else: if ord(data[-1:]) != 0: sys.stderr.write('WARNING: ROM includes nonzero checksum\n') From patchwork Tue Jan 16 13:42:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLX2V6BN1z9t3w for ; Wed, 17 Jan 2018 01:01:38 +1100 (AEDT) Received: from localhost ([::1]:37218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRo0-0005KM-NO for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:01:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXM-0008Jg-Qs for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRXM-0001Lf-3U for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48798) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRXL-0001L3-T8 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:24 -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 E2DE78765D; Tue, 16 Jan 2018 13:44:17 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE71762684; Tue, 16 Jan 2018 13:44:14 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:13 +0000 Message-Id: <20180116134217.8725-11-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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.26]); Tue, 16 Jan 2018 13:44:23 +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] [PATCH v5 10/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Daniel P. Berrange Reviewed-by: Eric Blake --- configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index b272a0336b..60b99f45f6 100755 --- a/configure +++ b/configure @@ -1598,9 +1598,8 @@ fi # 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.version_info >= (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 >= 2.6 or Python 3 is required." \ "Use --python=/path/to/python to specify a supported Python." fi From patchwork Tue Jan 16 13:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLXNL079Gz9s1h for ; Wed, 17 Jan 2018 01:17:06 +1100 (AEDT) Received: from localhost ([::1]:38057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebS2y-0001Mb-04 for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:17:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXO-0008Ln-TZ for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRXL-0001Kv-0j for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRXK-0001KE-RQ for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:22 -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 DD7C02FFEEE; Tue, 16 Jan 2018 13:44:21 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2453561F2B; Tue, 16 Jan 2018 13:44:17 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:14 +0000 Message-Id: <20180116134217.8725-12-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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]); Tue, 16 Jan 2018 13:44: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] [PATCH v5 11/14] 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 , Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Miika S keycodemapdb updated to add the QKeyCodes muhenkan and katakanahiragana Signed-off-by: Miika S Reviewed-by: Eric Blake --- hw/input/virtio-input-hid.c | 7 +++++++ qapi/ui.json | 5 ++++- ui/keycodemapdb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index e78faec0b1..9628d289f9 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -139,6 +139,13 @@ static const unsigned int keymap_qcode[Q_KEY_CODE__MAX] = { [Q_KEY_CODE_META_L] = KEY_LEFTMETA, [Q_KEY_CODE_META_R] = KEY_RIGHTMETA, [Q_KEY_CODE_MENU] = KEY_MENU, + + [Q_KEY_CODE_MUHENKAN] = KEY_MUHENKAN, + [Q_KEY_CODE_HENKAN] = KEY_HENKAN, + [Q_KEY_CODE_KATAKANAHIRAGANA] = KEY_KATAKANAHIRAGANA, + [Q_KEY_CODE_COMPOSE] = KEY_COMPOSE, + [Q_KEY_CODE_RO] = KEY_RO, + [Q_KEY_CODE_YEN] = KEY_YEN, }; static const unsigned int keymap_button[INPUT_BUTTON__MAX] = { 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', 'again', 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut', 'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', - 'ro', 'hiragana', 'henkan', 'yen', + 'ro', 'hiragana', 'henkan', 'yen', 'muhenkan', 'katakanahiragana', '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 From patchwork Tue Jan 16 13:42:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLXSG4Z1Pz9s7M for ; Wed, 17 Jan 2018 01:20:30 +1100 (AEDT) Received: from localhost ([::1]:38408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebS6G-0004Qz-Lj for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:20:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXT-0008Qh-8J for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRXS-0001PB-DG for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38604) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRXS-0001Om-7m for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:30 -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 5B9F9C058EBC; Tue, 16 Jan 2018 13:44:29 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 010DA5EDE9; Tue, 16 Jan 2018 13:44:21 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:15 +0000 Message-Id: <20180116134217.8725-13-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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.32]); Tue, 16 Jan 2018 13:44:29 +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] [PATCH v5 12/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Daniel P. Berrange Reviewed-by: Eric Blake --- 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 From patchwork Tue Jan 16 13:42:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLX5p2Xvtz9s1h for ; Wed, 17 Jan 2018 01:04:30 +1100 (AEDT) Received: from localhost ([::1]:37287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRqm-0007W4-9f for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:04:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXS-0008Pb-5b for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRXQ-0001OS-Ug for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRXQ-0001O4-O3 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:28 -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 B6D53C099422; Tue, 16 Jan 2018 13:44:27 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67C6C61F20; Tue, 16 Jan 2018 13:44:24 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:16 +0000 Message-Id: <20180116134217.8725-14-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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]); Tue, 16 Jan 2018 13:44:27 +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] [PATCH v5 13/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- .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-git-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=clang CXX=clang++-3.9 CC=clang-3.9 - - CONFIG="--disable-linux-user --cc=clang-3.9 --cxx=clang++-3.9" + - CONFIG="--disable-linux-user --cc=clang-3.9 --cxx=clang++-3.9 --python=/usr/bin/python3" before_install: - wget -nv -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-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=clang CXX=clang++-3.9 CC=clang-3.9 - - CONFIG="--disable-system --cc=clang-3.9 --cxx=clang++-3.9" + - CONFIG="--disable-system --cc=clang-3.9 --cxx=clang++-3.9 --python=/usr/bin/python3" before_install: - wget -nv -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-add-repository -y 'deb http://llvm.org/apt/trusty llvm-toolchain-trusty-3.9 main' From patchwork Tue Jan 16 13:42:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 861583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLX6Y31HPz9s7n for ; Wed, 17 Jan 2018 01:05:09 +1100 (AEDT) Received: from localhost ([::1]:37292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRrP-00080R-AE for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 09:05:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRXg-0000D0-A0 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRXd-0001UN-6b for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52588) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRXd-0001Tx-0E for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:44: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 1BF24C07012C; Tue, 16 Jan 2018 13:44:30 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBB2B5D756; Tue, 16 Jan 2018 13:44:27 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:42:17 +0000 Message-Id: <20180116134217.8725-15-berrange@redhat.com> In-Reply-To: <20180116134217.8725-1-berrange@redhat.com> References: <20180116134217.8725-1-berrange@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]); Tue, 16 Jan 2018 13:44: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] [PATCH v5 14/14] 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: Fam Zheng , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- tests/docker/dockerfiles/fedora.docker | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 4b26c3aded..a22fe16157 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 \ @@ -12,6 +12,7 @@ ENV PACKAGES \ mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1 \ mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2 \ mingw64-bzip2 +ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3 RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt