diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 88945804dc..9acff01d3e 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -897,8 +897,10 @@ def check_union(expr, info): # The value of member 'discriminator' must name a non-optional # member of the base struct. - check_name(discriminator, info, - "discriminator of flat union '%s'" % name) + check_name_is_str(discriminator, info, + "discriminator of flat union '%s'" % name) + check_name_str(discriminator, info, + "discriminator of flat union '%s'" % name) discriminator_value = base_members.get(discriminator) if not discriminator_value: raise QAPISemError(info,