[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 11/25] qapi/qlist: Add qlist_append_null() macro
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 11/25] qapi/qlist: Add qlist_append_null() macro |
Date: |
Fri, 17 Nov 2017 19:16:39 +0100 |
From: Max Reitz <address@hidden>
Besides the macro itself, this patch also adds a corresponding
Coccinelle rule.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
include/qapi/qmp/qlist.h | 3 +++
scripts/coccinelle/qobject.cocci | 3 +++
2 files changed, 6 insertions(+)
diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h
index c4b5fdad9b..59d209bbae 100644
--- a/include/qapi/qmp/qlist.h
+++ b/include/qapi/qmp/qlist.h
@@ -15,6 +15,7 @@
#include "qapi/qmp/qobject.h"
#include "qapi/qmp/qnum.h"
+#include "qapi/qmp/qnull.h"
#include "qemu/queue.h"
typedef struct QListEntry {
@@ -37,6 +38,8 @@ typedef struct QList {
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())
#define QLIST_FOREACH_ENTRY(qlist, var) \
for ((var) = ((qlist)->head.tqh_first); \
diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci
index 1120eb1a42..47bcafe9a9 100644
--- a/scripts/coccinelle/qobject.cocci
+++ b/scripts/coccinelle/qobject.cocci
@@ -41,4 +41,7 @@ expression Obj, E;
|
- qlist_append(Obj, qstring_from_str(E));
+ qlist_append_str(Obj, E);
+|
+- qlist_append(Obj, qnull());
++ qlist_append_null(Obj);
)
--
2.13.6
- [Qemu-block] [PULL 00/25] Block layer patches for 2.11.0-rc2, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 01/25] replication: Fix replication open fail, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 02/25] qemu-iotests: Use -nographic in 182, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 04/25] qcow2: don't permit changing encryption parameters, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 03/25] block: Fix error path in bdrv_backing_update_filename(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 05/25] block: Deprecate bdrv_set_read_only() and users, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 07/25] block: Fix permissions in image activation, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 06/25] qcow2: fix image corruption after committing qcow2 image into base, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 08/25] iotests: test clearing unknown autoclear_features by qcow2, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 11/25] qapi/qlist: Add qlist_append_null() macro,
Kevin Wolf <=
- [Qemu-block] [PULL 10/25] qapi/qnull: Add own header, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 12/25] qapi: Add qobject_is_equal(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 13/25] block: qobject_is_equal() in bdrv_reopen_prepare(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 09/25] qcow2: fix image corruption on commit with persistent bitmap, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 14/25] iotests: Add test for non-string option reopening, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 16/25] iotests: Add test for failing qemu-img commit, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 19/25] qcow2: Unaligned zero cluster in handle_alloc(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 15/25] tests: Add check-qobject for equality tests, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 17/25] qcow2: reject unaligned offsets in write compressed, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 18/25] qcow2: check_errors are fatal, Kevin Wolf, 2017/11/17