diff options
-rw-r--r-- | block/qapi.c | 1 | ||||
-rw-r--r-- | blockdev.c | 1 | ||||
-rw-r--r-- | hw/i386/acpi-build.c | 1 | ||||
-rw-r--r-- | hw/ppc/spapr_drc.c | 1 | ||||
-rw-r--r-- | include/qapi/qmp/qdict.h | 16 | ||||
-rw-r--r-- | include/qapi/qmp/qlist.h | 15 | ||||
-rw-r--r-- | migration/migration.c | 1 | ||||
-rw-r--r-- | monitor.c | 1 | ||||
-rw-r--r-- | qapi/qapi-dealloc-visitor.c | 1 | ||||
-rw-r--r-- | qapi/qobject-input-visitor.c | 2 | ||||
-rw-r--r-- | qapi/qobject-output-visitor.c | 2 | ||||
-rw-r--r-- | qobject/json-parser.c | 2 | ||||
-rw-r--r-- | qobject/qdict.c | 21 | ||||
-rw-r--r-- | qobject/qjson.c | 1 | ||||
-rw-r--r-- | qobject/qlist.c | 24 | ||||
-rw-r--r-- | qobject/qlit.c | 1 | ||||
-rw-r--r-- | qobject/qobject.c | 2 | ||||
-rw-r--r-- | qom/object.c | 1 | ||||
-rw-r--r-- | target/ppc/translate.c | 1 | ||||
-rw-r--r-- | tests/check-qdict.c | 1 | ||||
-rw-r--r-- | tests/check-qjson.c | 2 | ||||
-rw-r--r-- | tests/check-qobject.c | 2 | ||||
-rw-r--r-- | tests/test-qmp-commands.c | 1 | ||||
-rw-r--r-- | tests/test-qmp-event.c | 1 | ||||
-rw-r--r-- | tests/test-qobject-input-visitor.c | 2 | ||||
-rw-r--r-- | tests/test-qobject-output-visitor.c | 2 | ||||
-rw-r--r-- | util/qemu-option.c | 1 |
27 files changed, 84 insertions, 23 deletions
diff --git a/block/qapi.c b/block/qapi.c index 1ab4372..1e0cb27 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -32,6 +32,7 @@ #include "qapi/error.h" #include "qapi/qobject-output-visitor.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "sysemu/block-backend.h" #include "qemu/cutils.h" @@ -40,6 +40,7 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/config-file.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qapi-visit.h" #include "qapi/error.h" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ed78c4e..deb440f 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -22,6 +22,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qmp/qnum.h" #include "acpi-build.h" #include "qemu-common.h" #include "qemu/bitmap.h" diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index e3b1229..aa25113 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qapi/qmp/qnull.h" #include "cpu.h" #include "qemu/cutils.h" #include "hw/ppc/spapr_drc.h" diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index d0c2981..3c1def0 100644 --- a/include/qapi/qmp/qdict.h +++ b/include/qapi/qmp/qdict.h @@ -15,8 +15,6 @@ #include "qapi/qmp/qobject.h" #include "qapi/qmp/qlist.h" -#include "qapi/qmp/qnull.h" -#include "qapi/qmp/qnum.h" #include "qemu/queue.h" #define QDICT_BUCKET_MAX 512 @@ -55,17 +53,11 @@ void qdict_destroy_obj(QObject *obj); #define qdict_put(qdict, key, obj) \ qdict_put_obj(qdict, key, QOBJECT(obj)) -/* Helpers for int, bool, null, and string */ -#define qdict_put_int(qdict, key, value) \ - qdict_put(qdict, key, qnum_from_int(value)) -#define qdict_put_bool(qdict, key, value) \ - qdict_put(qdict, key, qbool_from_bool(value)) -#define qdict_put_str(qdict, key, value) \ - qdict_put(qdict, key, qstring_from_str(value)) -#define qdict_put_null(qdict, key) \ - qdict_put(qdict, key, qnull()) +void qdict_put_bool(QDict *qdict, const char *key, bool value); +void qdict_put_int(QDict *qdict, const char *key, int64_t value); +void qdict_put_null(QDict *qdict, const char *key); +void qdict_put_str(QDict *qdict, const char *key, const char *value); -/* High level helpers */ double qdict_get_double(const QDict *qdict, const char *key); int64_t qdict_get_int(const QDict *qdict, const char *key); bool qdict_get_bool(const QDict *qdict, const char *key); diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h index 632b7ef..5fd976a 100644 --- a/include/qapi/qmp/qlist.h +++ b/include/qapi/qmp/qlist.h @@ -14,8 +14,6 @@ #define QLIST_H #include "qapi/qmp/qobject.h" -#include "qapi/qmp/qnum.h" -#include "qapi/qmp/qnull.h" #include "qemu/queue.h" typedef struct QListEntry { @@ -31,15 +29,10 @@ struct QList { #define qlist_append(qlist, obj) \ qlist_append_obj(qlist, QOBJECT(obj)) -/* Helpers for int, bool, and string */ -#define qlist_append_int(qlist, value) \ - qlist_append(qlist, qnum_from_int(value)) -#define qlist_append_bool(qlist, value) \ - qlist_append(qlist, qbool_from_bool(value)) -#define qlist_append_str(qlist, value) \ - qlist_append(qlist, qstring_from_str(value)) -#define qlist_append_null(qlist) \ - qlist_append(qlist, qnull()) +void qlist_append_bool(QList *qlist, bool value); +void qlist_append_int(QList *qlist, int64_t value); +void qlist_append_null(QList *qlist); +void qlist_append_str(QList *qlist, const char *value); #define QLIST_FOREACH_ENTRY(qlist, var) \ for ((var) = ((qlist)->head.tqh_first); \ diff --git a/migration/migration.c b/migration/migration.c index 274160e..86d6912 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -32,6 +32,7 @@ #include "block/block.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" +#include "qapi/qmp/qnull.h" #include "qemu/rcu.h" #include "block.h" #include "postcopy-ram.h" @@ -54,6 +54,7 @@ #include "sysemu/tpm.h" #include "qapi/qmp/qerror.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qjson.h" #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/json-parser.h" diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c index c7d5f80..fd23803 100644 --- a/qapi/qapi-dealloc-visitor.c +++ b/qapi/qapi-dealloc-visitor.c @@ -14,6 +14,7 @@ #include "qemu/osdep.h" #include "qapi/dealloc-visitor.h" +#include "qapi/qmp/qnull.h" #include "qemu/queue.h" #include "qemu-common.h" #include "qapi/visitor-impl.h" diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index 8fb34c4..31183dc 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -22,6 +22,8 @@ #include "qapi/qmp/qjson.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qerror.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qemu/cutils.h" #include "qemu/option.h" diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c index 6039876..f0cc46b 100644 --- a/qapi/qobject-output-visitor.c +++ b/qapi/qobject-output-visitor.c @@ -18,6 +18,8 @@ #include "qemu/queue.h" #include "qemu-common.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" typedef struct QStackEntry { diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 30dfb9d..8f4badc 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -16,6 +16,8 @@ #include "qapi/error.h" #include "qemu-common.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp/json-parser.h" #include "qapi/qmp/json-lexer.h" diff --git a/qobject/qdict.c b/qobject/qdict.c index e8f15f1..7e7ac24 100644 --- a/qobject/qdict.c +++ b/qobject/qdict.c @@ -14,6 +14,7 @@ #include "qapi/qmp/qnum.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp/qobject.h" #include "qapi/error.h" @@ -143,6 +144,26 @@ void qdict_put_obj(QDict *qdict, const char *key, QObject *value) } } +void qdict_put_int(QDict *qdict, const char *key, int64_t value) +{ + qdict_put(qdict, key, qnum_from_int(value)); +} + +void qdict_put_bool(QDict *qdict, const char *key, bool value) +{ + qdict_put(qdict, key, qbool_from_bool(value)); +} + +void qdict_put_str(QDict *qdict, const char *key, const char *value) +{ + qdict_put(qdict, key, qstring_from_str(value)); +} + +void qdict_put_null(QDict *qdict, const char *key) +{ + qdict_put(qdict, key, qnull()); +} + /** * qdict_get(): Lookup for a given 'key' * diff --git a/qobject/qjson.c b/qobject/qjson.c index fe89213..7fbb68b 100644 --- a/qobject/qjson.c +++ b/qobject/qjson.c @@ -18,6 +18,7 @@ #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/qjson.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnum.h" #include "qemu/unicode.h" typedef struct JSONParsingState diff --git a/qobject/qlist.c b/qobject/qlist.c index 3ef57d3..268e46c 100644 --- a/qobject/qlist.c +++ b/qobject/qlist.c @@ -11,8 +11,12 @@ */ #include "qemu/osdep.h" +#include "qapi/qmp/qbool.h" #include "qapi/qmp/qlist.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qobject.h" +#include "qapi/qmp/qstring.h" #include "qemu/queue.h" #include "qemu-common.h" @@ -64,6 +68,26 @@ void qlist_append_obj(QList *qlist, QObject *value) QTAILQ_INSERT_TAIL(&qlist->head, entry, next); } +void qlist_append_int(QList *qlist, int64_t value) +{ + qlist_append(qlist, qnum_from_int(value)); +} + +void qlist_append_bool(QList *qlist, bool value) +{ + qlist_append(qlist, qbool_from_bool(value)); +} + +void qlist_append_str(QList *qlist, const char *value) +{ + qlist_append(qlist, qstring_from_str(value)); +} + +void qlist_append_null(QList *qlist) +{ + qlist_append(qlist, qnull()); +} + /** * qlist_iter(): Iterate over all the list's stored values. * diff --git a/qobject/qlit.c b/qobject/qlit.c index dbf1922..c2d0303 100644 --- a/qobject/qlit.c +++ b/qobject/qlit.c @@ -17,6 +17,7 @@ #include "qapi/qmp/qlit.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" diff --git a/qobject/qobject.c b/qobject/qobject.c index 9b61ece..5bbcd04 100644 --- a/qobject/qobject.c +++ b/qobject/qobject.c @@ -10,6 +10,8 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" diff --git a/qom/object.c b/qom/object.c index c58c52d..d97f09c 100644 --- a/qom/object.c +++ b/qom/object.c @@ -27,6 +27,7 @@ #include "qom/qom-qobject.h" #include "qapi/qmp/qobject.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #define MAX_INTERFACES 32 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 4132f67..eeaad9e 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -24,6 +24,7 @@ #include "disas/disas.h" #include "exec/exec-all.h" #include "tcg-op.h" +#include "qapi/qmp/qnull.h" #include "qemu/host-utils.h" #include "exec/cpu_ldst.h" diff --git a/tests/check-qdict.c b/tests/check-qdict.c index 3540577..1b11736 100644 --- a/tests/check-qdict.c +++ b/tests/check-qdict.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qapi/error.h" #include "qemu-common.h" diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 7881009..26f5d44 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -17,6 +17,8 @@ #include "qapi/qmp/qbool.h" #include "qapi/qmp/qjson.h" #include "qapi/qmp/qlit.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qemu-common.h" static void escaped_string(void) diff --git a/tests/check-qobject.c b/tests/check-qobject.c index 06b9c6e..9e1e820 100644 --- a/tests/check-qobject.c +++ b/tests/check-qobject.c @@ -9,6 +9,8 @@ #include "qemu/osdep.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qemu-common.h" diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c index 4794d1a..b5a3d88 100644 --- a/tests/test-qmp-commands.c +++ b/tests/test-qmp-commands.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "test-qmp-commands.h" #include "qapi/error.h" diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c index b197dff..cad9477 100644 --- a/tests/test-qmp-event.c +++ b/tests/test-qmp-event.c @@ -18,6 +18,7 @@ #include "test-qapi-event.h" #include "qapi/error.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qobject.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp-event.h" diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-visitor.c index 9640599..20bf9a5 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -18,6 +18,8 @@ #include "qapi/qobject-input-visitor.h" #include "test-qapi-visit.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qjson.h" #include "test-qmp-introspect.h" #include "qmp-introspect.h" diff --git a/tests/test-qobject-output-visitor.c b/tests/test-qobject-output-visitor.c index a0b7fe6..4a24e12 100644 --- a/tests/test-qobject-output-visitor.c +++ b/tests/test-qobject-output-visitor.c @@ -17,6 +17,8 @@ #include "qapi/qobject-output-visitor.h" #include "test-qapi-visit.h" #include "qapi/qmp/qbool.h" +#include "qapi/qmp/qnull.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qjson.h" typedef struct TestOutputVisitorData { diff --git a/util/qemu-option.c b/util/qemu-option.c index d790c1b..a401e93 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -30,6 +30,7 @@ #include "qemu/error-report.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp/qerror.h" #include "qemu/option_int.h" |