From 16619a738e71fdf528fdacc715ae95bca167da27 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 19 Feb 2018 16:29:56 -0500 Subject: [PATCH] qapi: Drop one of two "simple union must not have base" checks 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. Backports commit 65fbe125451da9421070ab03944c9600a264eefc from qemu --- qemu/scripts/qapi.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/qemu/scripts/qapi.py b/qemu/scripts/qapi.py index 11f87eed..7a4a28f0 100644 --- a/qemu/scripts/qapi.py +++ b/qemu/scripts/qapi.py @@ -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.