aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qapi/common.py')
-rw-r--r--scripts/qapi/common.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index c5c71287c3..99db18f3d6 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -920,11 +920,9 @@ def check_alternate(expr, info):
members = expr['data']
types_seen = {}
- # Check every branch; require at least two branches
- if len(members) < 2:
+ if len(members) == 0:
raise QAPISemError(info,
- "Alternate '%s' should have at least two branches "
- "in 'data'" % name)
+ "Alternate '%s' cannot have empty 'data'" % name)
for (key, value) in members.items():
check_name(info, "Member of alternate '%s'" % name, key)
check_known_keys(info,