From 12c707944927b8aa42752198dcf419a0bafe5d33 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 9 Jun 2015 16:49:13 +0200 Subject: qapi: Eliminate superfluous QAPISchema attribute input_dir Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index f96a7772e5..683669ecc0 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -109,7 +109,6 @@ class QAPISchema: input_fname = os.path.abspath(fp.name) if input_relname is None: input_relname = fp.name - self.input_dir = os.path.dirname(input_fname) self.input_file = input_relname self.include_hist = include_hist + [(input_relname, input_fname)] previously_included.append(input_fname) @@ -134,7 +133,8 @@ class QAPISchema: raise QAPIExprError(expr_info, 'Expected a file name (string), got: %s' % include) - include_path = os.path.join(self.input_dir, include) + include_path = os.path.join(os.path.dirname(input_fname), + include) for elem in self.include_hist: if include_path == elem[1]: raise QAPIExprError(expr_info, "Inclusion loop for %s" -- cgit 1.4.1 From 54414047eca5bee7d5ba6e7af5fb251f8635896c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 9 Jun 2015 16:22:45 +0200 Subject: qapi: Improve a couple of confusing variable names old name new name ---------------------------- input_file fname input_relname fname input_fname abs_fname include_path incl_abs_fname parent_info incl_info Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index 683669ecc0..c2eb12ba3a 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -75,7 +75,7 @@ def error_path(parent): class QAPISchemaError(Exception): def __init__(self, schema, msg): - self.input_file = schema.input_file + self.fname = schema.fname self.msg = msg self.col = 1 self.line = schema.line @@ -84,11 +84,11 @@ class QAPISchemaError(Exception): self.col = (self.col + 7) % 8 + 1 else: self.col += 1 - self.info = schema.parent_info + self.info = schema.incl_info def __str__(self): return error_path(self.info) + \ - "%s:%d:%d: %s" % (self.input_file, self.line, self.col, self.msg) + "%s:%d:%d: %s" % (self.fname, self.line, self.col, self.msg) class QAPIExprError(Exception): def __init__(self, expr_info, msg): @@ -101,18 +101,18 @@ class QAPIExprError(Exception): class QAPISchema: - def __init__(self, fp, input_relname=None, include_hist=[], - previously_included=[], parent_info=None): + def __init__(self, fp, fname = None, include_hist = [], + previously_included = [], incl_info = None): """ include_hist is a stack used to detect inclusion cycles previously_included is a global state used to avoid multiple inclusions of the same file""" - input_fname = os.path.abspath(fp.name) - if input_relname is None: - input_relname = fp.name - self.input_file = input_relname - self.include_hist = include_hist + [(input_relname, input_fname)] - previously_included.append(input_fname) - self.parent_info = parent_info + abs_fname = os.path.abspath(fp.name) + if fname is None: + fname = fp.name + self.fname = fname + self.include_hist = include_hist + [(fname, abs_fname)] + previously_included.append(abs_fname) + self.incl_info = incl_info self.src = fp.read() if self.src == '' or self.src[-1] != '\n': self.src += '\n' @@ -123,7 +123,8 @@ class QAPISchema: self.accept() while self.tok != None: - expr_info = {'file': input_relname, 'line': self.line, 'parent': self.parent_info} + expr_info = {'file': fname, 'line': self.line, + 'parent': self.incl_info} expr = self.get_expr(False) if isinstance(expr, dict) and "include" in expr: if len(expr) != 1: @@ -133,17 +134,17 @@ class QAPISchema: raise QAPIExprError(expr_info, 'Expected a file name (string), got: %s' % include) - include_path = os.path.join(os.path.dirname(input_fname), - include) + incl_abs_fname = os.path.join(os.path.dirname(abs_fname), + include) for elem in self.include_hist: - if include_path == elem[1]: + if incl_abs_fname == elem[1]: raise QAPIExprError(expr_info, "Inclusion loop for %s" % include) # skip multiple include of the same file - if include_path in previously_included: + if incl_abs_fname in previously_included: continue try: - fobj = open(include_path, 'r') + fobj = open(incl_abs_fname, 'r') except IOError, e: raise QAPIExprError(expr_info, '%s: %s' % (e.strerror, include)) @@ -651,13 +652,13 @@ def check_keys(expr_elem, meta, required, optional=[]): % (key, meta, name)) -def parse_schema(input_file): +def parse_schema(fname): global all_names exprs = [] # First pass: read entire file into memory try: - schema = QAPISchema(open(input_file, "r")) + schema = QAPISchema(open(fname, "r")) except (QAPISchemaError, QAPIExprError), e: print >>sys.stderr, e exit(1) @@ -1018,9 +1019,9 @@ def parse_command_line(extra_options = "", extra_long_options = []): if len(args) != 1: print >>sys.stderr, "%s: need exactly one argument" % sys.argv[0] sys.exit(1) - input_file = args[0] + fname = args[0] - return (input_file, output_dir, do_c, do_h, prefix, extra_opts) + return (fname, output_dir, do_c, do_h, prefix, extra_opts) def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, c_comment, h_comment): -- cgit 1.4.1 From 8608d2525186062099a38971c276752e7a38903a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 9 Jun 2015 18:32:29 +0200 Subject: qapi: Fix file name in error messages for included files We print the name as it appears in the include expression. Tools processing error messages want it relative to the working directory. Make it so. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 7 +++---- tests/qapi-schema/include-cycle.err | 4 ++-- tests/qapi-schema/include-nested-err.err | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index c2eb12ba3a..716e348a3c 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -101,14 +101,13 @@ class QAPIExprError(Exception): class QAPISchema: - def __init__(self, fp, fname = None, include_hist = [], + def __init__(self, fp, include_hist = [], previously_included = [], incl_info = None): """ include_hist is a stack used to detect inclusion cycles previously_included is a global state used to avoid multiple inclusions of the same file""" abs_fname = os.path.abspath(fp.name) - if fname is None: - fname = fp.name + fname = fp.name self.fname = fname self.include_hist = include_hist + [(fname, abs_fname)] previously_included.append(abs_fname) @@ -148,7 +147,7 @@ class QAPISchema: except IOError, e: raise QAPIExprError(expr_info, '%s: %s' % (e.strerror, include)) - exprs_include = QAPISchema(fobj, include, self.include_hist, + exprs_include = QAPISchema(fobj, self.include_hist, previously_included, expr_info) self.exprs.extend(exprs_include.exprs) else: diff --git a/tests/qapi-schema/include-cycle.err b/tests/qapi-schema/include-cycle.err index 602cf62329..bdcd07dce2 100644 --- a/tests/qapi-schema/include-cycle.err +++ b/tests/qapi-schema/include-cycle.err @@ -1,3 +1,3 @@ In file included from tests/qapi-schema/include-cycle.json:1: -In file included from include-cycle-b.json:1: -include-cycle-c.json:1: Inclusion loop for include-cycle.json +In file included from tests/qapi-schema/include-cycle-b.json:1: +tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json diff --git a/tests/qapi-schema/include-nested-err.err b/tests/qapi-schema/include-nested-err.err index 1dacbda3be..1b7b22706b 100644 --- a/tests/qapi-schema/include-nested-err.err +++ b/tests/qapi-schema/include-nested-err.err @@ -1,2 +1,2 @@ In file included from tests/qapi-schema/include-nested-err.json:1: -missing-colon.json:1:10: Expected ":" +tests/qapi-schema/missing-colon.json:1:10: Expected ":" -- cgit 1.4.1 From a1366087270b312d94ff8c4031395a4218f160d4 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 9 Jun 2015 16:54:09 +0200 Subject: qapi: Simplify inclusion cycle detection We maintain a stack of filenames in include_hist for convenient cycle detection. As error_path() demonstrates, the same information is readily available in the expr_info, so just use that, and drop include_hist. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index 716e348a3c..a24a7e2778 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -101,15 +101,10 @@ class QAPIExprError(Exception): class QAPISchema: - def __init__(self, fp, include_hist = [], - previously_included = [], incl_info = None): - """ include_hist is a stack used to detect inclusion cycles - previously_included is a global state used to avoid multiple - inclusions of the same file""" + def __init__(self, fp, previously_included = [], incl_info = None): abs_fname = os.path.abspath(fp.name) fname = fp.name self.fname = fname - self.include_hist = include_hist + [(fname, abs_fname)] previously_included.append(abs_fname) self.incl_info = incl_info self.src = fp.read() @@ -135,10 +130,13 @@ class QAPISchema: % include) incl_abs_fname = os.path.join(os.path.dirname(abs_fname), include) - for elem in self.include_hist: - if incl_abs_fname == elem[1]: + # catch inclusion cycle + inf = expr_info + while inf: + if incl_abs_fname == os.path.abspath(inf['file']): raise QAPIExprError(expr_info, "Inclusion loop for %s" % include) + inf = inf['parent'] # skip multiple include of the same file if incl_abs_fname in previously_included: continue @@ -147,8 +145,8 @@ class QAPISchema: except IOError, e: raise QAPIExprError(expr_info, '%s: %s' % (e.strerror, include)) - exprs_include = QAPISchema(fobj, self.include_hist, - previously_included, expr_info) + exprs_include = QAPISchema(fobj, previously_included, + expr_info) self.exprs.extend(exprs_include.exprs) else: expr_elem = {'expr': expr, -- cgit 1.4.1 From e565d934d21e3544b820cd03b88061e71ab644a0 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 10 Jun 2015 08:24:58 +0200 Subject: qapi: Fix to reject stray 't', 'f' and 'n' Screwed up in commit e53188a. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index a24a7e2778..6faa897fa6 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -217,20 +217,18 @@ class QAPISchema: return else: string += ch - elif self.tok in "tfn": - val = self.src[self.cursor - 1:] - if val.startswith("true"): - self.val = True - self.cursor += 3 - return - elif val.startswith("false"): - self.val = False - self.cursor += 4 - return - elif val.startswith("null"): - self.val = None - self.cursor += 3 - return + elif self.src.startswith("true", self.pos): + self.val = True + self.cursor += 3 + return + elif self.src.startswith("false", self.pos): + self.val = False + self.cursor += 4 + return + elif self.src.startswith("null", self.pos): + self.val = None + self.cursor += 3 + return elif self.tok == '\n': if self.cursor == len(self.src): self.tok = None -- cgit 1.4.1 From 4d076d67c2c74662db092ecf4f99600b18209b2e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 10 Jun 2015 08:55:21 +0200 Subject: qapi: Move exprs checking from parse_schema() to check_exprs() To have expression semantic analysis in one place rather than two. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 142 ++++++++++++++++++++++++++------------------------------ 1 file changed, 66 insertions(+), 76 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index 6faa897fa6..34a5e8de95 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -603,26 +603,6 @@ def check_struct(expr, expr_info): if expr.get('base'): check_member_clash(expr_info, expr['base'], expr['data']) -def check_exprs(schema): - for expr_elem in schema.exprs: - expr = expr_elem['expr'] - info = expr_elem['info'] - - if expr.has_key('enum'): - check_enum(expr, info) - elif expr.has_key('union'): - check_union(expr, info) - elif expr.has_key('alternate'): - check_alternate(expr, info) - elif expr.has_key('struct'): - check_struct(expr, info) - elif expr.has_key('command'): - check_command(expr, info) - elif expr.has_key('event'): - check_event(expr, info) - else: - assert False, 'unexpected meta type' - def check_keys(expr_elem, meta, required, optional=[]): expr = expr_elem['expr'] info = expr_elem['info'] @@ -646,70 +626,80 @@ def check_keys(expr_elem, meta, required, optional=[]): "Key '%s' is missing from %s '%s'" % (key, meta, name)) - -def parse_schema(fname): +def check_exprs(exprs): global all_names - exprs = [] - # First pass: read entire file into memory - try: - schema = QAPISchema(open(fname, "r")) - except (QAPISchemaError, QAPIExprError), e: - print >>sys.stderr, e - exit(1) + # Learn the types and check for valid expression keys + for builtin in builtin_types.keys(): + all_names[builtin] = 'built-in' + for expr_elem in exprs: + expr = expr_elem['expr'] + info = expr_elem['info'] + if expr.has_key('enum'): + check_keys(expr_elem, 'enum', ['data']) + add_enum(expr['enum'], info, expr['data']) + elif expr.has_key('union'): + check_keys(expr_elem, 'union', ['data'], + ['base', 'discriminator']) + add_union(expr, info) + elif expr.has_key('alternate'): + check_keys(expr_elem, 'alternate', ['data']) + add_name(expr['alternate'], info, 'alternate') + elif expr.has_key('struct'): + check_keys(expr_elem, 'struct', ['data'], ['base']) + add_struct(expr, info) + elif expr.has_key('command'): + check_keys(expr_elem, 'command', [], + ['data', 'returns', 'gen', 'success-response']) + add_name(expr['command'], info, 'command') + elif expr.has_key('event'): + check_keys(expr_elem, 'event', [], ['data']) + add_name(expr['event'], info, 'event') + else: + raise QAPIExprError(expr_elem['info'], + "Expression is missing metatype") - try: - # Next pass: learn the types and check for valid expression keys. At - # this point, top-level 'include' has already been flattened. - for builtin in builtin_types.keys(): - all_names[builtin] = 'built-in' - for expr_elem in schema.exprs: - expr = expr_elem['expr'] - info = expr_elem['info'] - if expr.has_key('enum'): - check_keys(expr_elem, 'enum', ['data']) - add_enum(expr['enum'], info, expr['data']) - elif expr.has_key('union'): - check_keys(expr_elem, 'union', ['data'], - ['base', 'discriminator']) - add_union(expr, info) - elif expr.has_key('alternate'): - check_keys(expr_elem, 'alternate', ['data']) - add_name(expr['alternate'], info, 'alternate') - elif expr.has_key('struct'): - check_keys(expr_elem, 'struct', ['data'], ['base']) - add_struct(expr, info) - elif expr.has_key('command'): - check_keys(expr_elem, 'command', [], - ['data', 'returns', 'gen', 'success-response']) - add_name(expr['command'], info, 'command') - elif expr.has_key('event'): - check_keys(expr_elem, 'event', [], ['data']) - add_name(expr['event'], info, 'event') - else: - raise QAPIExprError(expr_elem['info'], - "Expression is missing metatype") - exprs.append(expr) - - # Try again for hidden UnionKind enum - for expr_elem in schema.exprs: - expr = expr_elem['expr'] - if expr.has_key('union'): - if not discriminator_find_enum_define(expr): - add_enum('%sKind' % expr['union'], expr_elem['info'], - implicit=True) - elif expr.has_key('alternate'): - add_enum('%sKind' % expr['alternate'], expr_elem['info'], + # Try again for hidden UnionKind enum + for expr_elem in exprs: + expr = expr_elem['expr'] + if expr.has_key('union'): + if not discriminator_find_enum_define(expr): + add_enum('%sKind' % expr['union'], expr_elem['info'], implicit=True) + elif expr.has_key('alternate'): + add_enum('%sKind' % expr['alternate'], expr_elem['info'], + implicit=True) + + # Validate that exprs make sense + for expr_elem in exprs: + expr = expr_elem['expr'] + info = expr_elem['info'] - # Final pass - validate that exprs make sense - check_exprs(schema) - except QAPIExprError, e: + if expr.has_key('enum'): + check_enum(expr, info) + elif expr.has_key('union'): + check_union(expr, info) + elif expr.has_key('alternate'): + check_alternate(expr, info) + elif expr.has_key('struct'): + check_struct(expr, info) + elif expr.has_key('command'): + check_command(expr, info) + elif expr.has_key('event'): + check_event(expr, info) + else: + assert False, 'unexpected meta type' + + return map(lambda expr_elem: expr_elem['expr'], exprs) + +def parse_schema(fname): + try: + schema = QAPISchema(open(fname, "r")) + return check_exprs(schema.exprs) + except (QAPISchemaError, QAPIExprError), e: print >>sys.stderr, e exit(1) - return exprs - def parse_args(typeinfo): if isinstance(typeinfo, str): struct = find_struct(typeinfo) -- cgit 1.4.1 From 00e4b285a31d19dcd88bd46729c9e09bfc9cc7fd Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 10 Jun 2015 10:04:36 +0200 Subject: qapi: Better separate the different kinds of helpers Insert comments to separate sections dealing with parsing, semantic analysis, code generation, and so forth. Move helpers to their proper section. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 128 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 54 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index 34a5e8de95..8f2326716c 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -65,6 +65,10 @@ union_types = [] events = [] all_names = {} +# +# Parsing the schema into expressions +# + def error_path(parent): res = "" while parent: @@ -296,6 +300,10 @@ class QAPISchema: raise QAPISchemaError(self, 'Expected "{", "[" or string') return expr +# +# Semantic analysis of schema expressions +# + def find_base_fields(base): base_struct_define = find_struct(base) if not base_struct_define: @@ -356,6 +364,60 @@ def check_name(expr_info, source, name, allow_optional = False, raise QAPIExprError(expr_info, "%s uses invalid name '%s'" % (source, name)) +def add_name(name, info, meta, implicit = False): + global all_names + check_name(info, "'%s'" % meta, name) + if name in all_names: + raise QAPIExprError(info, + "%s '%s' is already defined" + % (all_names[name], name)) + if not implicit and name[-4:] == 'Kind': + raise QAPIExprError(info, + "%s '%s' should not end in 'Kind'" + % (meta, name)) + all_names[name] = meta + +def add_struct(definition, info): + global struct_types + name = definition['struct'] + add_name(name, info, 'struct') + struct_types.append(definition) + +def find_struct(name): + global struct_types + for struct in struct_types: + if struct['struct'] == name: + return struct + return None + +def add_union(definition, info): + global union_types + name = definition['union'] + add_name(name, info, 'union') + union_types.append(definition) + +def find_union(name): + global union_types + for union in union_types: + if union['union'] == name: + return union + return None + +def add_enum(name, info, enum_values = None, implicit = False): + global enum_types + add_name(name, info, 'enum', implicit) + enum_types.append({"enum_name": name, "enum_values": enum_values}) + +def find_enum(name): + global enum_types + for enum in enum_types: + if enum['enum_name'] == name: + return enum + return None + +def is_enum(name): + return find_enum(name) != None + def check_type(expr_info, source, value, allow_array = False, allow_dict = False, allow_optional = False, allow_star = False, allow_metas = []): @@ -700,6 +762,10 @@ def parse_schema(fname): print >>sys.stderr, e exit(1) +# +# Code generation helpers +# + def parse_args(typeinfo): if isinstance(typeinfo, str): struct = find_struct(typeinfo) @@ -817,60 +883,6 @@ def type_name(value): return value return c_name(value) -def add_name(name, info, meta, implicit = False): - global all_names - check_name(info, "'%s'" % meta, name) - if name in all_names: - raise QAPIExprError(info, - "%s '%s' is already defined" - % (all_names[name], name)) - if not implicit and name[-4:] == 'Kind': - raise QAPIExprError(info, - "%s '%s' should not end in 'Kind'" - % (meta, name)) - all_names[name] = meta - -def add_struct(definition, info): - global struct_types - name = definition['struct'] - add_name(name, info, 'struct') - struct_types.append(definition) - -def find_struct(name): - global struct_types - for struct in struct_types: - if struct['struct'] == name: - return struct - return None - -def add_union(definition, info): - global union_types - name = definition['union'] - add_name(name, info, 'union') - union_types.append(definition) - -def find_union(name): - global union_types - for union in union_types: - if union['union'] == name: - return union - return None - -def add_enum(name, info, enum_values = None, implicit = False): - global enum_types - add_name(name, info, 'enum', implicit) - enum_types.append({"enum_name": name, "enum_values": enum_values}) - -def find_enum(name): - global enum_types - for enum in enum_types: - if enum['enum_name'] == name: - return enum - return None - -def is_enum(name): - return find_enum(name) != None - eatspace = '\033EATSPACE.' pointer_suffix = ' *' + eatspace @@ -967,6 +979,10 @@ def guardend(name): ''', name=guardname(name)) +# +# Common command line parsing +# + def parse_command_line(extra_options = "", extra_long_options = []): try: @@ -1008,6 +1024,10 @@ def parse_command_line(extra_options = "", extra_long_options = []): return (fname, output_dir, do_c, do_h, prefix, extra_opts) +# +# Generate output files with boilerplate +# + def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, c_comment, h_comment): c_file = output_dir + prefix + c_file -- cgit 1.4.1 From f9a1427361fe06ac67480d580412dc4ed6f5d03b Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 10 Jun 2015 13:07:43 +0200 Subject: qapi: Catch and reject flat union branch of array type Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 2 +- tests/qapi-schema/flat-union-array-branch.err | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index 8f2326716c..06d7fc2848 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -580,7 +580,7 @@ def check_union(expr, expr_info): # Each value must name a known type; furthermore, in flat unions, # branches must be a struct with no overlapping member names check_type(expr_info, "Member '%s' of union '%s'" % (key, name), - value, allow_array=True, allow_metas=allow_metas) + value, allow_array=not base, allow_metas=allow_metas) if base: branch_struct = find_struct(value) assert branch_struct diff --git a/tests/qapi-schema/flat-union-array-branch.err b/tests/qapi-schema/flat-union-array-branch.err index b45ef43e51..8ea91eadb2 100644 --- a/tests/qapi-schema/flat-union-array-branch.err +++ b/tests/qapi-schema/flat-union-array-branch.err @@ -1,10 +1 @@ -Traceback (most recent call last): - File "tests/qapi-schema/test-qapi.py", line 19, in - exprs = parse_schema(sys.argv[1]) - File "scripts/qapi.py", line 760, in parse_schema - return check_exprs(schema.exprs) - File "scripts/qapi.py", line 743, in check_exprs - check_union(expr, info) - File "scripts/qapi.py", line 586, in check_union - assert branch_struct -AssertionError +tests/qapi-schema/flat-union-array-branch.json:8: Member 'value1' of union 'TestUnion' cannot be an array -- cgit 1.4.1