maint: kill all remaining uses of old DEBUG macro

Done mechanically with:
$ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'

followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
with a single 'make syntax-check' fallout in the same file, and the
actual deletion in src/util/logging.h.

* src/util/logging.h (DEBUG, DEBUG0): Delete.
* daemon/libvirtd.h (qemudDebug): Likewise.
* global: Change remaining clients over to VIR_DEBUG counterpart.
This commit is contained in:
Eric Blake
2011-02-16 16:37:57 -07:00
parent 03ba07cb73
commit 994e7567b6
36 changed files with 657 additions and 664 deletions

View File

@@ -141,7 +141,7 @@ remoteSerializeError(struct qemud_client *client,
unsigned int len;
struct qemud_client_message *msg = NULL;
DEBUG("prog=%d ver=%d proc=%d type=%d serial=%d, msg=%s",
VIR_DEBUG("prog=%d ver=%d proc=%d type=%d serial=%d, msg=%s",
program, version, procedure, type, serial,
rerr->message ? *rerr->message : "(none)");
@@ -372,7 +372,7 @@ remoteDispatchClientRequest(struct qemud_server *server,
remote_error rerr;
bool qemu_call;
DEBUG("prog=%d ver=%d type=%d status=%d serial=%d proc=%d",
VIR_DEBUG("prog=%d ver=%d type=%d status=%d serial=%d proc=%d",
msg->hdr.prog, msg->hdr.vers, msg->hdr.type,
msg->hdr.status, msg->hdr.serial, msg->hdr.proc);
@@ -631,7 +631,7 @@ remoteSendStreamData(struct qemud_client *client,
struct qemud_client_message *msg;
XDR xdr;
DEBUG("client=%p stream=%p data=%p len=%d", client, stream, data, len);
VIR_DEBUG("client=%p stream=%p data=%p len=%d", client, stream, data, len);
if (VIR_ALLOC(msg) < 0) {
return -1;
@@ -682,7 +682,7 @@ remoteSendStreamData(struct qemud_client *client,
xdr_destroy (&xdr);
DEBUG("Total %d", msg->bufferOffset);
VIR_DEBUG("Total %d", msg->bufferOffset);
}
if (data)
msg->streamTX = 1;

View File

@@ -37,7 +37,7 @@
#include "util.h"
#include "ignore-value.h"
#define EVENT_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
#define EVENT_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
static int virEventInterruptLocked(void);
@@ -390,7 +390,7 @@ static int virEventDispatchTimeouts(void) {
int i;
/* Save this now - it may be changed during dispatch */
int ntimeouts = eventLoop.timeoutsCount;
DEBUG("Dispatch %d", ntimeouts);
VIR_DEBUG("Dispatch %d", ntimeouts);
if (gettimeofday(&tv, NULL) < 0) {
return -1;
@@ -435,7 +435,7 @@ static int virEventDispatchTimeouts(void) {
*/
static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
int i, n;
DEBUG("Dispatch %d", nfds);
VIR_DEBUG("Dispatch %d", nfds);
/* NB, use nfds not eventLoop.handlesCount, because new
* fds might be added on end of list, and they're not
@@ -449,7 +449,7 @@ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
if (i == eventLoop.handlesCount)
break;
DEBUG("i=%d w=%d", i, eventLoop.handles[i].watch);
VIR_DEBUG("i=%d w=%d", i, eventLoop.handles[i].watch);
if (eventLoop.handles[i].deleted) {
EVENT_DEBUG("Skip deleted n=%d w=%d f=%d", i,
eventLoop.handles[i].watch, eventLoop.handles[i].fd);
@@ -480,7 +480,7 @@ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
static int virEventCleanupTimeouts(void) {
int i;
size_t gap;
DEBUG("Cleanup %zu", eventLoop.timeoutsCount);
VIR_DEBUG("Cleanup %zu", eventLoop.timeoutsCount);
/* Remove deleted entries, shuffling down remaining
* entries as needed to form contiguous series
@@ -523,7 +523,7 @@ static int virEventCleanupTimeouts(void) {
static int virEventCleanupHandles(void) {
int i;
size_t gap;
DEBUG("Cleanup %zu", eventLoop.handlesCount);
VIR_DEBUG("Cleanup %zu", eventLoop.handlesCount);
/* Remove deleted entries, shuffling down remaining
* entries as needed to form contiguous series

View File

@@ -1,7 +1,7 @@
/*
* libvirtd.c: daemon start of day, guest process & i/o management
*
* Copyright (C) 2006-2010 Red Hat, Inc.
* Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -310,7 +310,7 @@ remoteInitializeGnuTLS (void)
if (remoteCheckCertFile("CA certificate", ca_file) < 0)
return -1;
qemudDebug ("loading CA cert from %s", ca_file);
VIR_DEBUG("loading CA cert from %s", ca_file);
err = gnutls_certificate_set_x509_trust_file (x509_cred, ca_file,
GNUTLS_X509_FMT_PEM);
if (err < 0) {
@@ -324,7 +324,7 @@ remoteInitializeGnuTLS (void)
if (remoteCheckCertFile("CA revocation list", crl_file) < 0)
return -1;
DEBUG("loading CRL from %s", crl_file);
VIR_DEBUG("loading CRL from %s", crl_file);
err = gnutls_certificate_set_x509_crl_file (x509_cred, crl_file,
GNUTLS_X509_FMT_PEM);
if (err < 0) {
@@ -339,7 +339,7 @@ remoteInitializeGnuTLS (void)
return -1;
if (remoteCheckCertFile("server key", key_file) < 0)
return -1;
DEBUG("loading cert and key from %s and %s", cert_file, key_file);
VIR_DEBUG("loading cert and key from %s and %s", cert_file, key_file);
err =
gnutls_certificate_set_x509_key_file (x509_cred,
cert_file, key_file,
@@ -1150,7 +1150,7 @@ remoteCheckDN (const char *dname)
}
/* Print the client's DN. */
DEBUG(_("remoteCheckDN: failed: client DN is %s"), dname);
VIR_DEBUG("remoteCheckDN: failed: client DN is %s", dname);
return 0; /* Not found. */
}
@@ -1531,7 +1531,7 @@ void qemudDispatchClientFailure(struct qemud_client *client) {
for (i = 0 ; i < VIR_DOMAIN_EVENT_ID_LAST ; i++) {
if (client->domainEventCallbackID[i] != -1) {
DEBUG("Deregistering to relay remote events %d", i);
VIR_DEBUG("Deregistering to relay remote events %d", i);
virConnectDomainEventDeregisterAny(client->conn,
client->domainEventCallbackID[i]);
}
@@ -1678,7 +1678,7 @@ static ssize_t qemudClientReadBuf(struct qemud_client *client,
return -1;
}
/*qemudDebug ("qemudClientRead: len = %d", len);*/
/* VIR_DEBUG("qemudClientRead: len = %d", len);*/
if (!client->tlssession) {
char ebuf[1024];
@@ -1812,7 +1812,7 @@ static ssize_t qemudClientRead(struct qemud_client *client) {
*/
static void qemudDispatchClientRead(struct qemud_server *server,
struct qemud_client *client) {
/*qemudDebug ("qemudDispatchClientRead: mode = %d", client->mode);*/
/* VIR_DEBUG("qemudDispatchClientRead: mode = %d", client->mode);*/
readmore:
if (qemudClientRead(client) < 0)
@@ -1830,14 +1830,14 @@ readmore:
if (!xdr_u_int(&x, &len)) {
xdr_destroy (&x);
DEBUG0("Failed to decode packet length");
VIR_DEBUG0("Failed to decode packet length");
qemudDispatchClientFailure(client);
return;
}
xdr_destroy (&x);
if (len < REMOTE_MESSAGE_HEADER_XDR_LEN) {
DEBUG("Packet length %u too small", len);
VIR_DEBUG("Packet length %u too small", len);
qemudDispatchClientFailure(client);
return;
}
@@ -1846,7 +1846,7 @@ readmore:
len -= REMOTE_MESSAGE_HEADER_XDR_LEN;
if (len > REMOTE_MESSAGE_MAX) {
DEBUG("Packet length %u too large", len);
VIR_DEBUG("Packet length %u too large", len);
qemudDispatchClientFailure(client);
return;
}
@@ -2283,10 +2283,10 @@ static void qemudInactiveTimer(int timerid, void *data) {
if (virStateActive() ||
server->clients) {
DEBUG0("Timer expired but still active, not shutting down");
VIR_DEBUG0("Timer expired but still active, not shutting down");
virEventUpdateTimeoutImpl(timerid, -1);
} else {
DEBUG0("Timer expired and inactive, shutting down");
VIR_DEBUG0("Timer expired and inactive, shutting down");
server->quitEventThread = 1;
}
}
@@ -2357,14 +2357,14 @@ static void *qemudRunLoop(void *opaque) {
if (timeout > 0) {
if (timerActive) {
if (server->clients) {
DEBUG("Deactivating shutdown timer %d", timerid);
VIR_DEBUG("Deactivating shutdown timer %d", timerid);
virEventUpdateTimeoutImpl(timerid, -1);
timerActive = 0;
}
} else {
if (!virStateActive() &&
!server->clients) {
DEBUG("Activating shutdown timer %d", timerid);
VIR_DEBUG("Activating shutdown timer %d", timerid);
virEventUpdateTimeoutImpl(timerid, timeout * 1000);
timerActive = 1;
}
@@ -2374,7 +2374,7 @@ static void *qemudRunLoop(void *opaque) {
virMutexUnlock(&server->lock);
if (qemudOneLoop() < 0) {
virMutexLock(&server->lock);
DEBUG0("Loop iteration error, exiting");
VIR_DEBUG0("Loop iteration error, exiting");
break;
}
virMutexLock(&server->lock);

View File

@@ -1,7 +1,7 @@
/*
* libvirtd.h: daemon data structure definitions
*
* Copyright (C) 2006-2010 Red Hat, Inc.
* Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -128,8 +128,6 @@
# endif
# endif
# define qemudDebug DEBUG
/* Whether we're passing reads & writes through a sasl SSF */
enum qemud_sasl_ssf {
QEMUD_SASL_SSF_NONE = 0,

View File

@@ -42,7 +42,7 @@
#include "event.h"
#include "memory.h"
#define AVAHI_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
#define AVAHI_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
struct libvirtd_mdns_entry {
char *type;

View File

@@ -62,7 +62,7 @@
#include "libvirt/libvirt-qemu.h"
#define VIR_FROM_THIS VIR_FROM_REMOTE
#define REMOTE_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
#define REMOTE_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain);
static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_network network);

View File

@@ -82,7 +82,7 @@ remoteStreamEvent(virStreamPtr st, int events, void *opaque)
goto cleanup;
}
DEBUG("st=%p events=%d", st, events);
VIR_DEBUG("st=%p events=%d", st, events);
if (events & VIR_STREAM_EVENT_WRITABLE) {
if (remoteStreamHandleWrite(client, stream) < 0) {
@@ -149,7 +149,7 @@ remoteStreamFilter(struct qemud_client *client,
if (msg->hdr.serial == stream->serial &&
msg->hdr.proc == stream->procedure &&
msg->hdr.type == REMOTE_STREAM) {
DEBUG("Incoming rx=%p serial=%d proc=%d status=%d",
VIR_DEBUG("Incoming rx=%p serial=%d proc=%d status=%d",
stream->rx, msg->hdr.proc, msg->hdr.serial, msg->hdr.status);
/* If there are queued packets, we need to queue all further
@@ -207,7 +207,7 @@ remoteCreateClientStream(virConnectPtr conn,
{
struct qemud_client_stream *stream;
DEBUG("proc=%d serial=%d", hdr->proc, hdr->serial);
VIR_DEBUG("proc=%d serial=%d", hdr->proc, hdr->serial);
if (VIR_ALLOC(stream) < 0)
return NULL;
@@ -241,7 +241,7 @@ void remoteFreeClientStream(struct qemud_client *client,
if (!stream)
return;
DEBUG("proc=%d serial=%d", stream->procedure, stream->serial);
VIR_DEBUG("proc=%d serial=%d", stream->procedure, stream->serial);
msg = stream->rx;
while (msg) {
@@ -265,7 +265,7 @@ int remoteAddClientStream(struct qemud_client *client,
{
struct qemud_client_stream *tmp = client->streams;
DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
VIR_DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
if (virStreamEventAddCallback(stream->st, 0,
remoteStreamEvent, client, NULL) < 0)
@@ -328,7 +328,7 @@ int
remoteRemoveClientStream(struct qemud_client *client,
struct qemud_client_stream *stream)
{
DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
VIR_DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
struct qemud_client_stream *curr = client->streams;
struct qemud_client_stream *prev = NULL;
@@ -381,7 +381,7 @@ remoteStreamHandleWriteData(struct qemud_client *client,
remote_error rerr;
int ret;
DEBUG("stream=%p proc=%d serial=%d len=%d offset=%d",
VIR_DEBUG("stream=%p proc=%d serial=%d len=%d offset=%d",
stream, msg->hdr.proc, msg->hdr.serial, msg->bufferLength, msg->bufferOffset);
memset(&rerr, 0, sizeof rerr);
@@ -426,7 +426,7 @@ remoteStreamHandleFinish(struct qemud_client *client,
remote_error rerr;
int ret;
DEBUG("stream=%p proc=%d serial=%d",
VIR_DEBUG("stream=%p proc=%d serial=%d",
stream, msg->hdr.proc, msg->hdr.serial);
memset(&rerr, 0, sizeof rerr);
@@ -460,7 +460,7 @@ remoteStreamHandleAbort(struct qemud_client *client,
{
remote_error rerr;
DEBUG("stream=%p proc=%d serial=%d",
VIR_DEBUG("stream=%p proc=%d serial=%d",
stream, msg->hdr.proc, msg->hdr.serial);
memset(&rerr, 0, sizeof rerr);
@@ -495,7 +495,7 @@ remoteStreamHandleWrite(struct qemud_client *client,
{
struct qemud_client_message *msg, *tmp;
DEBUG("stream=%p", stream);
VIR_DEBUG("stream=%p", stream);
msg = stream->rx;
while (msg && !stream->closed) {
@@ -550,7 +550,7 @@ remoteStreamHandleRead(struct qemud_client *client,
size_t bufferLen = REMOTE_MESSAGE_PAYLOAD_MAX;
int ret;
DEBUG("stream=%p", stream);
VIR_DEBUG("stream=%p", stream);
/* Shouldn't ever be called unless we're marked able to
* transmit, but doesn't hurt to check */
@@ -603,7 +603,7 @@ remoteStreamMessageFinished(struct qemud_client *client,
stream = stream->next;
}
DEBUG("Message client=%p stream=%p proc=%d serial=%d", client, stream, msg->hdr.proc, msg->hdr.serial);
VIR_DEBUG("Message client=%p stream=%p proc=%d serial=%d", client, stream, msg->hdr.proc, msg->hdr.serial);
if (stream) {
stream->tx = 1;