qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qapi/qlist: Add qlist_append_null() macro

Besides the macro itself, this patch also adds a corresponding
Coccinelle rule.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20171114180128.17076-3-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>

+6
+3
include/qapi/qmp/qlist.h
··· 15 15 16 16 #include "qapi/qmp/qobject.h" 17 17 #include "qapi/qmp/qnum.h" 18 + #include "qapi/qmp/qnull.h" 18 19 #include "qemu/queue.h" 19 20 20 21 typedef struct QListEntry { ··· 37 38 qlist_append(qlist, qbool_from_bool(value)) 38 39 #define qlist_append_str(qlist, value) \ 39 40 qlist_append(qlist, qstring_from_str(value)) 41 + #define qlist_append_null(qlist) \ 42 + qlist_append(qlist, qnull()) 40 43 41 44 #define QLIST_FOREACH_ENTRY(qlist, var) \ 42 45 for ((var) = ((qlist)->head.tqh_first); \
+3
scripts/coccinelle/qobject.cocci
··· 41 41 | 42 42 - qlist_append(Obj, qstring_from_str(E)); 43 43 + qlist_append_str(Obj, E); 44 + | 45 + - qlist_append(Obj, qnull()); 46 + + qlist_append_null(Obj); 44 47 )