diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-05-12 09:01:51 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-05-12 09:01:51 +0100 |
commit | 704eb1c09963149db4a3407d5ba173ba2a9244bb (patch) | |
tree | 8a1a55bf1dcb52891615a51a37c06a1b7b3eefa2 /include | |
parent | 0403b0f539f40a21da60409b825b4653b273ab39 (diff) | |
parent | 1ceca07e48ead0dd2e41576c81d40e6a91cafefd (diff) |
Merge remote-tracking branch 'remotes/qmp-unstable/tags/for-upstream' into staging
QMP pull request
# gpg: Signature made Mon May 11 14:15:19 2015 BST using RSA key ID E24ED5A7
# gpg: Good signature from "Luiz Capitulino <lcapitulino@gmail.com>"
* remotes/qmp-unstable/tags/for-upstream:
scripts: qmp-shell: Add verbose flag
scripts: qmp-shell: add transaction subshell
scripts: qmp-shell: Expand support for QMP expressions
scripts: qmp-shell: refactor helpers
MAINTAINERS: New maintainer for QMP and QAPI
json-parser: Accept 'null' in QMP
qobject: Add a special null QObject
qobject: Clean up around qtype_code
QJSON: Use OBJECT_CHECK
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/qdev-core.h | 2 | ||||
-rw-r--r-- | include/qapi/qmp/qobject.h | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 5b7acf19fa..d4be92fbee 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -226,7 +226,7 @@ struct Property { PropertyInfo *info; int offset; uint8_t bitnr; - uint8_t qtype; + qtype_code qtype; int64_t defval; int arrayoffset; PropertyInfo *arrayinfo; diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h index d0bbc7c4a6..84b2d9fef5 100644 --- a/include/qapi/qmp/qobject.h +++ b/include/qapi/qmp/qobject.h @@ -3,7 +3,7 @@ * * Based on ideas by Avi Kivity <avi@redhat.com> * - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009, 2015 Red Hat Inc. * * Authors: * Luiz Capitulino <lcapitulino@redhat.com> @@ -36,7 +36,8 @@ #include <assert.h> typedef enum { - QTYPE_NONE, + QTYPE_NONE, /* sentinel value, no QObject has this type code */ + QTYPE_QNULL, QTYPE_QINT, QTYPE_QSTRING, QTYPE_QDICT, @@ -110,4 +111,12 @@ static inline qtype_code qobject_type(const QObject *obj) return obj->type->code; } +extern QObject qnull_; + +static inline QObject *qnull(void) +{ + qobject_incref(&qnull_); + return &qnull_; +} + #endif /* QOBJECT_H */ |