On Sat, 2016-07-16 at 11:16 +0100, Justin Clift wrote:
Hi all,
There's a minor compile failure on OSX with libvirt 2.0.0:
CC util/libvirt_util_la-virtime.lo
CC util/libvirt_util_la-virtpm.lo
util/virsystemd.c:524:26: error: use of undeclared identifier 'MSG_NOSIGNAL'
if (sendmsg(fd, &mh, MSG_NOSIGNAL) < 0)
^
1 error generated.
make[3]: *** [util/libvirt_util_la-virsystemd.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
Seems solvable by adding a stub declaration for MSG_NOSIGNAL on
systems that don't implement it.
An initial patch with the declaration, developed by Tomasz Pajor
(CC'd), is below:
--- src/util/virsystemd.h.orig 2016-07-03 21:40:12.000000000 +0200
+++ src/util/virsystemd.h 2016-07-03 21:37:53.000000000 +0200
@@ -57,3 +57,7 @@
char *virSystemdGetMachineNameByPID(pid_t pid);
#endif /* __VIR_SYSTEMD_H__ */
+
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0x0 //Don't request NOSIGNAL on systems where this is not
implemented.
+#endif
It's outside the #endif for __VIR_SYSTEMD_H___ though, so I'm kind of
thinking it would need to be move inside the guard (which also compiles
ok), or is there a better place/file for it instead? :)
I have posted a tentative patch to fix your issue
https://www.redhat.com/archives/libvir-list/2016-July/msg00724.html
Can you please check it out and confirm whether it works or
not? I don't have any OS X host where I can test it myself.
To be honest, I don't see why we're compiling the systemd
support code on OS X at all. But I don't have the time to
dig further right now :)
--
Andrea Bolognani / Red Hat / Virtualization