aboutsummaryrefslogtreecommitdiff
path: root/qobject/qlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'qobject/qlist.c')
-rw-r--r--qobject/qlist.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/qobject/qlist.c b/qobject/qlist.c
index 3ef57d31d1..268e46c8f0 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.
*