Running libvirt using valgrind produced:
Syscall param sendmsg(msg.msg_control) points to uninitialised byte(s)
at ??? (in /lib64/libpthread-2.19.so)
by sendfd (passfd.c:86)
by virNetSocketSendFD (virnetsocket.c:1766)
by virNetServerClientDispatchWrite (virnetserverclient.c:1271)
by virNetServerClientDispatchEvent (virnetserverclient.c:1371)
by virEventPollDispatchHandles (vireventpoll.c:508)
by virEventPollRunOnce (vireventpoll.c:657)
by virEventRunDefaultImpl (virevent.c:308)
by virNetServerRun (virnetserver.c:1139)
by main (libvirtd.c:1491)
Address 0xffefff3f4 is on thread 1's stack
in frame #1, created by sendfd (passfd.c:51)
* lib/passfd.c (sendfd): Reset the msg_controllen of msghdr,
to include just the fd we've initialised, rather than including
the extra space used for alignment.
+2015-02-24 Pavel Hrdina <phrdina@redhat.com>
+
+ passfd: avoid valgrind uninitalised data warning
+ * lib/passfd.c (sendfd): Reset the msg_controllen of msghdr,
+ to include just the fd we've initialised, rather than including
+ the extra space used for alignment.
+
2015-02-23 Paul Eggert <eggert@cs.ucla.edu>
uniwbrk/u32-wordbreaks-tests: fix copyright
cmsg->cmsg_len = CMSG_LEN (sizeof fd);
/* Initialize the payload: */
memcpy (CMSG_DATA (cmsg), &fd, sizeof fd);
+ msg.msg_controllen = cmsg->cmsg_len;
# elif HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
msg.msg_accrights = &fd;
msg.msg_accrightslen = sizeof fd;