[libvirt] [PATCH] Fix compile errors in remote.c and newly added audit code

--- I pushed this under the trivial complie error fix rule :) Matthias daemon/remote.c | 4 ++-- src/util/virtaudit.c | 4 ++-- src/util/virtaudit.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index 44609c7..75df9b5 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2233,8 +2233,6 @@ remoteDispatchDomainReboot (struct qemud_server *server ATTRIBUTE_UNUSED, void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom; - char uuidstr[VIR_UUID_STRING_BUFLEN]; - int r; dom = get_nonnull_domain (conn, args->dom); if (dom == NULL) { @@ -2286,6 +2284,8 @@ remoteDispatchDomainResume (struct qemud_server *server ATTRIBUTE_UNUSED, void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom; + char uuidstr[VIR_UUID_STRING_BUFLEN]; + int r; dom = get_nonnull_domain (conn, args->dom); if (dom == NULL) { diff --git a/src/util/virtaudit.c b/src/util/virtaudit.c index 036a8b9..965a6e8 100644 --- a/src/util/virtaudit.c +++ b/src/util/virtaudit.c @@ -1,5 +1,5 @@ /* - * audit.h: auditing support + * virtaudit.c: auditing support * * Copyright (C) 2010 Red Hat, Inc. * @@ -80,7 +80,7 @@ void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t li void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, const char *clienttty ATTRIBUTE_UNUSED, const char *clientaddr ATTRIBUTE_UNUSED, - enum virAuditRecordType type, bool success, + enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success, const char *fmt, ...) #endif { diff --git a/src/util/virtaudit.h b/src/util/virtaudit.h index b0cb707..f0d9cd7 100644 --- a/src/util/virtaudit.h +++ b/src/util/virtaudit.h @@ -1,5 +1,5 @@ /* - * audit.h: auditing support + * virtaudit.h: auditing support * * Copyright (C) 2010 Red Hat, Inc. * -- 1.7.0.4

On 10/19/2010 11:06 AM, Matthias Bolte wrote:
---
I pushed this under the trivial complie error fix rule :)
Thanks.
@@ -80,7 +80,7 @@ void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t li void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, const char *clienttty ATTRIBUTE_UNUSED, const char *clientaddr ATTRIBUTE_UNUSED, - enum virAuditRecordType type, bool success, + enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success, const char *fmt, ...) #endif
Hmm - ATTRIBUTE_UNUSED is an indication that on some paths, the variable might not be used; and not a requirement that it must not be used. Would anyone object to this followup, for one less #ifdef? diff --git i/src/util/virtaudit.c w/src/util/virtaudit.c index 965a6e8..3226961 100644 --- i/src/util/virtaudit.c +++ w/src/util/virtaudit.c @@ -71,18 +71,12 @@ void virAuditLog(int logging) } -#if HAVE_AUDIT -void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, - const char *clienttty, const char *clientaddr, - enum virAuditRecordType type, bool success, - const char *fmt, ...) -#else -void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, +void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, + size_t linenr, const char *clienttty ATTRIBUTE_UNUSED, const char *clientaddr ATTRIBUTE_UNUSED, enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success, const char *fmt, ...) -#endif { char *str = NULL; va_list args; -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/10/19 Eric Blake <eblake@redhat.com>:
On 10/19/2010 11:06 AM, Matthias Bolte wrote:
---
I pushed this under the trivial complie error fix rule :)
Thanks.
@@ -80,7 +80,7 @@ void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t li void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, const char *clienttty ATTRIBUTE_UNUSED, const char *clientaddr ATTRIBUTE_UNUSED, - enum virAuditRecordType type, bool success, + enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success, const char *fmt, ...) #endif
Hmm - ATTRIBUTE_UNUSED is an indication that on some paths, the variable might not be used; and not a requirement that it must not be used. Would anyone object to this followup, for one less #ifdef?
diff --git i/src/util/virtaudit.c w/src/util/virtaudit.c index 965a6e8..3226961 100644 --- i/src/util/virtaudit.c +++ w/src/util/virtaudit.c @@ -71,18 +71,12 @@ void virAuditLog(int logging) }
-#if HAVE_AUDIT -void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, - const char *clienttty, const char *clientaddr, - enum virAuditRecordType type, bool success, - const char *fmt, ...) -#else -void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, +void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, + size_t linenr, const char *clienttty ATTRIBUTE_UNUSED, const char *clientaddr ATTRIBUTE_UNUSED, enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success, const char *fmt, ...) -#endif { char *str = NULL; va_list args;
ACK. Matthias

On 10/20/2010 03:14 AM, Matthias Bolte wrote:
Hmm - ATTRIBUTE_UNUSED is an indication that on some paths, the variable might not be used; and not a requirement that it must not be used. Would anyone object to this followup, for one less #ifdef?
diff --git i/src/util/virtaudit.c w/src/util/virtaudit.c index 965a6e8..3226961 100644 --- i/src/util/virtaudit.c +++ w/src/util/virtaudit.c @@ -71,18 +71,12 @@ void virAuditLog(int logging) }
-#if HAVE_AUDIT -void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, - const char *clienttty, const char *clientaddr, - enum virAuditRecordType type, bool success, - const char *fmt, ...) -#else -void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, size_t linenr, +void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func, + size_t linenr, const char *clienttty ATTRIBUTE_UNUSED, const char *clientaddr ATTRIBUTE_UNUSED, enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success, const char *fmt, ...) -#endif { char *str = NULL; va_list args;
ACK.
Thanks; applied. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Tue, Oct 19, 2010 at 07:06:05PM +0200, Matthias Bolte wrote:
---
I pushed this under the trivial complie error fix rule :)
Matthias
daemon/remote.c | 4 ++-- src/util/virtaudit.c | 4 ++-- src/util/virtaudit.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c index 44609c7..75df9b5 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2233,8 +2233,6 @@ remoteDispatchDomainReboot (struct qemud_server *server ATTRIBUTE_UNUSED, void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom; - char uuidstr[VIR_UUID_STRING_BUFLEN]; - int r;
dom = get_nonnull_domain (conn, args->dom); if (dom == NULL) { @@ -2286,6 +2284,8 @@ remoteDispatchDomainResume (struct qemud_server *server ATTRIBUTE_UNUSED, void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom; + char uuidstr[VIR_UUID_STRING_BUFLEN]; + int r;
dom = get_nonnull_domain (conn, args->dom); if (dom == NULL) {
Nice, a rare time when 'git rebase' silently fubar's the code :-( Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Matthias Bolte