diff --git a/qemu/include/qapi/qmp/qobject.h b/qemu/include/qapi/qmp/qobject.h index d8f91c3c..6d17b8df 100644 --- a/qemu/include/qapi/qmp/qobject.h +++ b/qemu/include/qapi/qmp/qobject.h @@ -99,9 +99,9 @@ static inline QType qobject_type(const QObject *obj) return obj->type; } -typedef struct QNull { +struct QNull { QObject base; -} QNull; +}; extern QNull qnull_; diff --git a/qemu/include/qemu/typedefs.h b/qemu/include/qemu/typedefs.h index 8c654626..29cb662c 100644 --- a/qemu/include/qemu/typedefs.h +++ b/qemu/include/qemu/typedefs.h @@ -73,6 +73,7 @@ typedef struct QBool QBool; typedef struct QDict QDict; typedef struct QList QList; typedef struct QNum QNum; +typedef struct QNull QNull; typedef struct QObject QObject; typedef struct QString QString; typedef struct RAMBlock RAMBlock; diff --git a/qemu/scripts/qapi.py b/qemu/scripts/qapi.py index 61e97087..45fde2c5 100644 --- a/qemu/scripts/qapi.py +++ b/qemu/scripts/qapi.py @@ -28,6 +28,7 @@ except ImportError: from io import StringIO builtin_types = { + 'null': 'QTYPE_QNULL', 'str': 'QTYPE_QSTRING', 'int': 'QTYPE_QNUM', 'number': 'QTYPE_QNUM', @@ -1064,6 +1065,7 @@ class QAPISchemaType(QAPISchemaEntity): def alternate_qtype(self): json2qtype = { + 'null': 'QTYPE_QNULL', 'string': 'QTYPE_QSTRING', 'number': 'QTYPE_QNUM', 'int': 'QTYPE_QNUM', @@ -1523,7 +1525,8 @@ class QAPISchema(object): ('uint64', 'int', 'uint64_t'), ('size', 'int', 'uint64_t'), ('bool', 'boolean', 'bool'), - ('any', 'value', 'QObject' + pointer_suffix)]: + ('any', 'value', 'QObject' + pointer_suffix), + ('null', 'null', 'QNull' + pointer_suffix)]: self._def_builtin_type(*t) self.the_empty_object_type = QAPISchemaObjectType( 'q_empty', None, None, None, [], None)