summary refs log tree commit diff stats
path: root/include/qapi/qmp/qlist.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/qapi/qmp/qlist.h')
-rw-r--r--include/qapi/qmp/qlist.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h
index a84117ecb1..5dc4ed9616 100644
--- a/include/qapi/qmp/qlist.h
+++ b/include/qapi/qmp/qlist.h
@@ -29,6 +29,14 @@ typedef 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, qint_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_FOREACH_ENTRY(qlist, var)             \
         for ((var) = ((qlist)->head.tqh_first);     \
             (var);                                  \