]> Git Repo - qemu.git/commitdiff
qapi: Drop one of two "simple union must not have base" checks
authorMarkus Armbruster <[email protected]>
Mon, 31 Aug 2015 13:37:42 +0000 (15:37 +0200)
committerMarkus Armbruster <[email protected]>
Fri, 4 Sep 2015 13:47:16 +0000 (15:47 +0200)
The first check ensures the second one can't trigger.  Drop the first
one, because the second one is in a more logical place, and emits a
nicer error message.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
scripts/qapi.py
tests/qapi-schema/union-base-no-discriminator.err

index 23c32fe3ddcf0a12308208b21933f12e1177a27d..197db77a9fd81e8d56d5433eaa9e311a3fbe4900 100644 (file)
@@ -526,14 +526,6 @@ def check_union(expr, expr_info):
     members = expr['data']
     values = { 'MAX': '(automatic)' }
 
-    # If the object has a member 'base', its value must name a struct,
-    # and there must be a discriminator.
-    if base is not None:
-        if discriminator is None:
-            raise QAPIExprError(expr_info,
-                                "Union '%s' requires a discriminator to go "
-                                "along with base" %name)
-
     # Two types of unions, determined by discriminator.
 
     # With no discriminator it is a simple union.
index fc8b79c45965ff50d8988d845a00f80744ad69c4..8b7a24260ffa8d900f3ffa73d3af8f5616803be6 100644 (file)
@@ -1 +1 @@
-tests/qapi-schema/union-base-no-discriminator.json:11: Union 'TestUnion' requires a discriminator to go along with base
+tests/qapi-schema/union-base-no-discriminator.json:11: Simple union 'TestUnion' must not have a base
This page took 0.030032 seconds and 4 git commands to generate.