]> git.proxmox.com Git - mirror_qemu.git/blobdiff - scripts/qapi-types.py
rbd: Fix to cleanly reject -drive without pool or image
[mirror_qemu.git] / scripts / qapi-types.py
index 5ace2cf065d4da4332b941b3ce0d8af94e5d6816..b45e7b5634f0c6eada5097e13321535bfc9aa702 100644 (file)
@@ -91,7 +91,7 @@ struct %(c_name)s {
     # potential issues with attempting to malloc space for zero-length
     # structs in C, and also incompatibility with C++ (where an empty
     # struct is size 1).
-    if not (base and base.members) and not members and not variants:
+    if (not base or base.is_empty()) and not members and not variants:
         ret += mcgen('''
     char qapi_dummy_for_empty_struct;
 ''')
@@ -244,10 +244,10 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
 do_builtins = False
 
 (input_file, output_dir, do_c, do_h, prefix, opts) = \
-    parse_command_line("b", ["builtins"])
+    parse_command_line('b', ['builtins'])
 
 for o, a in opts:
-    if o in ("-b", "--builtins"):
+    if o in ('-b', '--builtins'):
         do_builtins = True
 
 c_comment = '''