[libvirt] [PATCH] Fix build for SystemTap 1.0

With SystemTap 1.0 a part of the generated macros in probes.h expands to: volatile __typeof__(((name))) arg2 = (name); GCC reports an 'invalid initialize' error when name has type char[]. Therfore, add casts to char* to avoid this. --- daemon/libvirtd.c | 4 ++-- daemon/remote.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 8e88d05..d3f003e 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -1230,11 +1230,11 @@ remoteCheckCertificate(struct qemud_client *client) } } - PROBE(CLIENT_TLS_ALLOW, "fd=%d, name=%s", client->fd, name); + PROBE(CLIENT_TLS_ALLOW, "fd=%d, name=%s", client->fd, (char *)name); return 0; authdeny: - PROBE(CLIENT_TLS_DENY, "fd=%d, name=%s", client->fd, name); + PROBE(CLIENT_TLS_DENY, "fd=%d, name=%s", client->fd, (char *)name); return -1; authfail: diff --git a/daemon/remote.c b/daemon/remote.c index 3b72f98..50ccb3b 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -4223,7 +4223,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server, goto authdeny; } PROBE(CLIENT_AUTH_ALLOW, "fd=%d, auth=%d, username=%s", - client->fd, REMOTE_AUTH_POLKIT, ident); + client->fd, REMOTE_AUTH_POLKIT, (char *)ident); VIR_INFO(_("Policy allowed action %s from pid %d, uid %d"), action, callerPid, callerUid); ret->complete = 1; @@ -4238,7 +4238,7 @@ authfail: authdeny: PROBE(CLIENT_AUTH_DENY, "fd=%d, auth=%d, username=%s", - client->fd, REMOTE_AUTH_POLKIT, ident); + client->fd, REMOTE_AUTH_POLKIT, (char *)ident); goto error; error: -- 1.7.0.4

On 10/22/2010 05:08 PM, Matthias Bolte wrote:
With SystemTap 1.0 a part of the generated macros in probes.h expands to:
volatile __typeof__(((name))) arg2 = (name);
GCC reports an 'invalid initialize' error when name has type char[]. Therfore, add casts to char* to avoid this. --- daemon/libvirtd.c | 4 ++-- daemon/remote.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 8e88d05..d3f003e 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -1230,11 +1230,11 @@ remoteCheckCertificate(struct qemud_client *client) } }
- PROBE(CLIENT_TLS_ALLOW, "fd=%d, name=%s", client->fd, name); + PROBE(CLIENT_TLS_ALLOW, "fd=%d, name=%s", client->fd, (char *)name);
Looks gross, but it doesn't affect too many probes, and expands the range of versions we support. ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/10/23 Justin Clift <jclift@redhat.com>:
On 10/23/2010 10:08 AM, Matthias Bolte wrote:
With SystemTap 1.0 a part of the generated macros in probes.h expands to:
ACK, compiles fine here on Fedora 13 x86_64, when using --with-dtrace and having systemtap-sdt-devel installed. (1.3-2)
Thanks, pushed. Matthias
participants (3)
-
Eric Blake
-
Justin Clift
-
Matthias Bolte