qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/4] block/gluster: add missing QLIST_HEAD_INITIALIZ


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PATCH 4/4] block/gluster: add missing QLIST_HEAD_INITIALIZER()
Date: Fri, 27 Jan 2017 10:00:29 +0000

The "qemu/queue.h" data structures provide static initializer macros.
The QLIST version just initializes to NULL so code happens to work when
the initializer is forgotten.  Other types like SLIST are not so
forgiving because they set fields to non-NULL values.

The initializer macro should always be used for consistency and so that
no errors are introduced when switching between list/queue variants.

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 block/gluster.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/gluster.c b/block/gluster.c
index 181b345..3ac9105 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -63,7 +63,8 @@ typedef struct GlfsPreopened {
     QLIST_ENTRY(GlfsPreopened) list;
 } GlfsPreopened;
 
-static QLIST_HEAD(glfs_list, GlfsPreopened) glfs_list;
+static QLIST_HEAD(glfs_list, GlfsPreopened) glfs_list =
+    QLIST_HEAD_INITIALIZER(glfs_list);
 
 static QemuOptsList qemu_gluster_create_opts = {
     .name = "qemu-gluster-create-opts",
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]