From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>,
Jeff Cody <jcody@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 4/4] block/gluster: add missing QLIST_HEAD_INITIALIZER()
Date: Fri, 27 Jan 2017 10:00:29 +0000 [thread overview]
Message-ID: <20170127100029.11356-5-stefanha@redhat.com> (raw)
In-Reply-To: <20170127100029.11356-1-stefanha@redhat.com>
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 <stefanha@redhat.com>
---
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
next prev parent reply other threads:[~2017-01-27 10:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 10:00 [Qemu-devel] [PATCH 0/4] block/gluster: cleanups for GlfsPreopened Stefan Hajnoczi
2017-01-27 10:00 ` [Qemu-devel] [PATCH 1/4] block/gluster: fix wrong indent in glfs_find_preopened() Stefan Hajnoczi
2017-01-27 10:00 ` [Qemu-devel] [PATCH 2/4] block/gluster: drop intermediate ListElement struct Stefan Hajnoczi
2017-01-27 10:00 ` [Qemu-devel] [PATCH 3/4] block/gluster: use conventional names for GlfsPreopened functions Stefan Hajnoczi
2017-01-27 10:00 ` Stefan Hajnoczi [this message]
2017-01-27 14:23 ` [Qemu-devel] [PATCH 0/4] block/gluster: cleanups for GlfsPreopened Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170127100029.11356-5-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=jcody@redhat.com \
--cc=prasanna.kalever@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).