On 06/29/2011 05:18 AM, Wen Congyang wrote:
When I build libvirt, I meet the following error:
make[3]: Entering directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.2/daemon'
CC libvirtd-libvirtd.o
CC libvirtd-remote.o
remote.c: In function 'remoteDispatchAuthPolkit':
remote.c:2043: error: invalid initializer
make[3]: *** [libvirtd-remote.o] Error 1
This patch can fix the problem. But I do not know whether it is right.
This sounds highly related to Matthias' issue:
https://www.redhat.com/archives/libvir-list/2011-June/msg01484.html
What version of systemtap headers and gcc are you using, that produce
this error?
+++ b/daemon/remote.c
@@ -2041,7 +2041,7 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
goto authdeny;
}
PROBE(CLIENT_AUTH_ALLOW, "fd=%d, auth=%d, username=%s",
- virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, ident);
+ virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, (char *)ident);
If a cast really helps matters, I'd almost rather hide it within the
#define PROBE() than make callers have to worry about it, but I'm
reluctant to add a cast without knowing exactly why you are hitting
compilation failure.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org