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)");
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);
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;
xdr_destroy (&xdr);
- DEBUG("Total %d", msg->bufferOffset);
+ VIR_DEBUG("Total %d", msg->bufferOffset);
}
if (data)
msg->streamTX = 1;
#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);
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;
*/
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
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);
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
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
/*
* 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
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) {
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) {
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,
}
/* 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. */
}
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]);
}
return -1;
}
- /*qemudDebug ("qemudClientRead: len = %d", len);*/
+ /* VIR_DEBUG("qemudClientRead: len = %d", len);*/
if (!client->tlssession) {
char ebuf[1024];
*/
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)
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;
}
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;
}
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;
}
}
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;
}
virMutexUnlock(&server->lock);
if (qemudOneLoop() < 0) {
virMutexLock(&server->lock);
- DEBUG0("Loop iteration error, exiting");
+ VIR_DEBUG0("Loop iteration error, exiting");
break;
}
virMutexLock(&server->lock);
/*
* 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
# endif
# endif
-# define qemudDebug DEBUG
-
/* Whether we're passing reads & writes through a sasl SSF */
enum qemud_sasl_ssf {
QEMUD_SASL_SSF_NONE = 0,
#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;
#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);
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) {
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
{
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;
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) {
{
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)
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;
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);
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);
{
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);
{
struct qemud_client_message *msg, *tmp;
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
msg = stream->rx;
while (msg && !stream->closed) {
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 */
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;
+ unsigned int flags)
+{
+ virConnectPtr conn;
-+ DEBUG("domain=%p, nvcpus=%u, flags=%u", domain, nvcpus, flags);
++ VIR_DEBUG("domain=%p, nvcpus=%u, flags=%u", domain, nvcpus, flags);
+
+ virResetLastError();
+
+virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
+{
+ virConnectPtr conn;
-+ DEBUG("domain=%p, flags=%u", domain, flags);
++ VIR_DEBUG("domain=%p, flags=%u", domain, flags);
+
+ virResetLastError();
+
# include <sys/poll.h>
# include <libvirt/libvirt.h>
-# define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
+# define VIR_DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
__func__, __LINE__)
-# define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
+# define VIR_DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
__func__, __LINE__, __VA_ARGS__)
# define STREQ(a,b) (strcmp(a,b) == 0)
void *opaque,
virFreeCallback ff)
{
- DEBUG("Add handle %d %d %p %p", fd, event, cb, opaque);
+ VIR_DEBUG("Add handle %d %d %p %p", fd, event, cb, opaque);
h_fd = fd;
h_event = myEventHandleTypeToPollEvent(event);
h_cb = cb;
void myEventUpdateHandleFunc(int fd, int event)
{
- DEBUG("Updated Handle %d %d", fd, event);
+ VIR_DEBUG("Updated Handle %d %d", fd, event);
h_event = myEventHandleTypeToPollEvent(event);
return;
}
int myEventRemoveHandleFunc(int fd)
{
- DEBUG("Removed Handle %d", fd);
+ VIR_DEBUG("Removed Handle %d", fd);
h_fd = 0;
if (h_ff)
(h_ff)(h_opaque);
void *opaque,
virFreeCallback ff)
{
- DEBUG("Adding Timeout %d %p %p", timeout, cb, opaque);
+ VIR_DEBUG("Adding Timeout %d %p %p", timeout, cb, opaque);
t_active = 1;
t_timeout = timeout;
t_cb = cb;
void myEventUpdateTimeoutFunc(int timer ATTRIBUTE_UNUSED, int timeout)
{
- /*DEBUG("Timeout updated %d %d", timer, timeout);*/
+ /*VIR_DEBUG("Timeout updated %d %d", timer, timeout);*/
t_timeout = timeout;
}
int myEventRemoveTimeoutFunc(int timer)
{
- DEBUG("Timeout removed %d", timer);
+ VIR_DEBUG("Timeout removed %d", timer);
t_active = 0;
if (t_ff)
(t_ff)(t_opaque);
sigaction(SIGTERM, &action_stop, NULL);
sigaction(SIGINT, &action_stop, NULL);
- DEBUG0("Registering domain event cbs");
+ VIR_DEBUG0("Registering domain event cbs");
/* Add 2 callbacks to prove this works with more than just one */
callback1ret = virConnectDomainEventRegister(dconn, myDomainEventCallback1,
}
if (sts == 0) {
- /* DEBUG0("Poll timeout"); */
+ /* VIR_DEBUG0("Poll timeout"); */
continue;
}
if (sts < 0 ) {
- DEBUG0("Poll failed");
+ VIR_DEBUG0("Poll failed");
continue;
}
if ( pfd.revents & POLLHUP ) {
- DEBUG0("Reset by peer");
+ VIR_DEBUG0("Reset by peer");
return -1;
}
}
- DEBUG0("Deregistering event handlers");
+ VIR_DEBUG0("Deregistering event handlers");
virConnectDomainEventDeregister(dconn, myDomainEventCallback1);
virConnectDomainEventDeregisterAny(dconn, callback2ret);
virConnectDomainEventDeregisterAny(dconn, callback3ret);
virConnectDomainEventDeregisterAny(dconn, callback7ret);
}
- DEBUG0("Closing connection");
+ VIR_DEBUG0("Closing connection");
if( dconn && virConnectClose(dconn)<0 ) {
printf("error closing\n");
}
*/
static void
virReleaseConnect(virConnectPtr conn) {
- DEBUG("release connection %p", conn);
+ VIR_DEBUG("release connection %p", conn);
/* make sure to release the connection lock before we call the
* close callbacks, otherwise we will deadlock if an error
return -1;
}
virMutexLock(&conn->lock);
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
refs = conn->refs;
if (refs == 0) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(domain->uuid, uuidstr);
- DEBUG("release domain %p %s %s", domain, domain->name, uuidstr);
+ VIR_DEBUG("release domain %p %s %s", domain, domain->name, uuidstr);
domain->magic = -1;
domain->id = -1;
VIR_FREE(domain);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
return -1;
}
virMutexLock(&domain->conn->lock);
- DEBUG("unref domain %p %s %d", domain, domain->name, domain->refs);
+ VIR_DEBUG("unref domain %p %s %d", domain, domain->name, domain->refs);
domain->refs--;
refs = domain->refs;
if (refs == 0) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(network->uuid, uuidstr);
- DEBUG("release network %p %s %s", network, network->name, uuidstr);
+ VIR_DEBUG("release network %p %s %s", network, network->name, uuidstr);
network->magic = -1;
VIR_FREE(network->name);
VIR_FREE(network);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
return -1;
}
virMutexLock(&network->conn->lock);
- DEBUG("unref network %p %s %d", network, network->name, network->refs);
+ VIR_DEBUG("unref network %p %s %d", network, network->name, network->refs);
network->refs--;
refs = network->refs;
if (refs == 0) {
static void
virReleaseInterface(virInterfacePtr iface) {
virConnectPtr conn = iface->conn;
- DEBUG("release interface %p %s", iface, iface->name);
+ VIR_DEBUG("release interface %p %s", iface, iface->name);
iface->magic = -1;
VIR_FREE(iface->name);
VIR_FREE(iface);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
return -1;
}
virMutexLock(&iface->conn->lock);
- DEBUG("unref interface %p %s %d", iface, iface->name, iface->refs);
+ VIR_DEBUG("unref interface %p %s %d", iface, iface->name, iface->refs);
iface->refs--;
refs = iface->refs;
if (refs == 0) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(pool->uuid, uuidstr);
- DEBUG("release pool %p %s %s", pool, pool->name, uuidstr);
+ VIR_DEBUG("release pool %p %s %s", pool, pool->name, uuidstr);
pool->magic = -1;
VIR_FREE(pool->name);
VIR_FREE(pool);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
return -1;
}
virMutexLock(&pool->conn->lock);
- DEBUG("unref pool %p %s %d", pool, pool->name, pool->refs);
+ VIR_DEBUG("unref pool %p %s %d", pool, pool->name, pool->refs);
pool->refs--;
refs = pool->refs;
if (refs == 0) {
static void
virReleaseStorageVol(virStorageVolPtr vol) {
virConnectPtr conn = vol->conn;
- DEBUG("release vol %p %s", vol, vol->name);
+ VIR_DEBUG("release vol %p %s", vol, vol->name);
vol->magic = -1;
VIR_FREE(vol->name);
VIR_FREE(vol);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
return -1;
}
virMutexLock(&vol->conn->lock);
- DEBUG("unref vol %p %s %d", vol, vol->name, vol->refs);
+ VIR_DEBUG("unref vol %p %s %d", vol, vol->name, vol->refs);
vol->refs--;
refs = vol->refs;
if (refs == 0) {
static void
virReleaseNodeDevice(virNodeDevicePtr dev) {
virConnectPtr conn = dev->conn;
- DEBUG("release dev %p %s", dev, dev->name);
+ VIR_DEBUG("release dev %p %s", dev, dev->name);
dev->magic = -1;
VIR_FREE(dev->name);
VIR_FREE(dev);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
int refs;
virMutexLock(&dev->conn->lock);
- DEBUG("unref dev %p %s %d", dev, dev->name, dev->refs);
+ VIR_DEBUG("unref dev %p %s %d", dev, dev->name, dev->refs);
dev->refs--;
refs = dev->refs;
if (refs == 0) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(secret->uuid, uuidstr);
- DEBUG("release secret %p %s", secret, uuidstr);
+ VIR_DEBUG("release secret %p %s", secret, uuidstr);
VIR_FREE(secret->usageID);
secret->magic = -1;
VIR_FREE(secret);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
return -1;
}
virMutexLock(&secret->conn->lock);
- DEBUG("unref secret %p %p %d", secret, secret->uuid, secret->refs);
+ VIR_DEBUG("unref secret %p %p %d", secret, secret->uuid, secret->refs);
secret->refs--;
refs = secret->refs;
if (refs == 0) {
static void
virReleaseStream(virStreamPtr st) {
virConnectPtr conn = st->conn;
- DEBUG("release dev %p", st);
+ VIR_DEBUG("release dev %p", st);
st->magic = -1;
VIR_FREE(st);
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
int refs;
virMutexLock(&st->conn->lock);
- DEBUG("unref stream %p %d", st, st->refs);
+ VIR_DEBUG("unref stream %p %d", st, st->refs);
st->refs--;
refs = st->refs;
if (refs == 0) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(nwfilter->uuid, uuidstr);
- DEBUG("release nwfilter %p %s %s", nwfilter, nwfilter->name, uuidstr);
+ VIR_DEBUG("release nwfilter %p %s %s", nwfilter, nwfilter->name, uuidstr);
nwfilter->magic = -1;
VIR_FREE(nwfilter->name);
VIR_FREE(nwfilter);
if (conn) {
- DEBUG("unref connection %p %d", conn, conn->refs);
+ VIR_DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
return -1;
}
virMutexLock(&nwfilter->conn->lock);
- DEBUG("unref nwfilter %p %s %d", nwfilter, nwfilter->name, nwfilter->refs);
+ VIR_DEBUG("unref nwfilter %p %s %d", nwfilter, nwfilter->name,
+ nwfilter->refs);
nwfilter->refs--;
refs = nwfilter->refs;
if (refs == 0) {
virReleaseDomainSnapshot(virDomainSnapshotPtr snapshot)
{
virDomainPtr domain = snapshot->domain;
- DEBUG("release snapshot %p %s", snapshot, snapshot->name);
+ VIR_DEBUG("release snapshot %p %s", snapshot, snapshot->name);
snapshot->magic = -1;
VIR_FREE(snapshot->name);
VIR_FREE(snapshot);
if (domain) {
- DEBUG("unref domain %p %d", domain, domain->refs);
+ VIR_DEBUG("unref domain %p %d", domain, domain->refs);
domain->refs--;
if (domain->refs == 0) {
virReleaseDomain(domain);
}
virMutexLock(&snapshot->domain->conn->lock);
- DEBUG("unref snapshot %p %s %d", snapshot, snapshot->name, snapshot->refs);
+ VIR_DEBUG("unref snapshot %p %s %d", snapshot, snapshot->name, snapshot->refs);
snapshot->refs--;
refs = snapshot->refs;
if (refs == 0) {
if (moddir == NULL)
moddir = DEFAULT_DRIVER_DIR;
- DEBUG("Module load %s", name);
+ VIR_DEBUG("Module load %s", name);
if (virAsprintf(&modfile, "%s/libvirt_driver_%s.so", moddir, name) < 0)
return NULL;
{
virConnectPtr conn;
- DEBUG("domain=%p, cmd=%s, result=%p, flags=%u", domain, cmd, result, flags);
+ VIR_DEBUG("domain=%p, cmd=%s, result=%p, flags=%u", domain, cmd, result, flags);
virResetLastError();
_domname = (dom)->name; \
} \
\
- DEBUG("dom=%p, (VM: name=%s, uuid=%s), " fmt, \
+ VIR_DEBUG("dom=%p, (VM: name=%s, uuid=%s), " fmt, \
dom, NULLSTR(_domname), _uuidstr, __VA_ARGS__)
#define VIR_DOMAIN_DEBUG0(dom) VIR_DOMAIN_DEBUG(dom, "%s", "")
virLogSetFromEnv();
- DEBUG0("register drivers");
+ VIR_DEBUG0("register drivers");
#if HAVE_WINSOCK2_H
if (winsock_init () == -1) return -1;
return -1;
}
- DEBUG ("registering %s as network driver %d",
+ VIR_DEBUG ("registering %s as network driver %d",
driver->name, virNetworkDriverTabCount);
virNetworkDriverTab[virNetworkDriverTabCount] = driver;
return -1;
}
- DEBUG ("registering %s as interface driver %d",
+ VIR_DEBUG ("registering %s as interface driver %d",
driver->name, virInterfaceDriverTabCount);
virInterfaceDriverTab[virInterfaceDriverTabCount] = driver;
return -1;
}
- DEBUG ("registering %s as storage driver %d",
+ VIR_DEBUG ("registering %s as storage driver %d",
driver->name, virStorageDriverTabCount);
virStorageDriverTab[virStorageDriverTabCount] = driver;
return -1;
}
- DEBUG ("registering %s as device driver %d",
+ VIR_DEBUG ("registering %s as device driver %d",
driver->name, virDeviceMonitorTabCount);
virDeviceMonitorTab[virDeviceMonitorTabCount] = driver;
return -1;
}
- DEBUG ("registering %s as secret driver %d",
+ VIR_DEBUG ("registering %s as secret driver %d",
driver->name, virSecretDriverTabCount);
virSecretDriverTab[virSecretDriverTabCount] = driver;
return -1;
}
- DEBUG ("registering %s as network filter driver %d",
+ VIR_DEBUG ("registering %s as network filter driver %d",
driver->name, virNWFilterDriverTabCount);
virNWFilterDriverTab[virNWFilterDriverTabCount] = driver;
int
virRegisterDriver(virDriverPtr driver)
{
- DEBUG("driver=%p name=%s", driver, driver ? NULLSTR(driver->name) : "(null)");
+ VIR_DEBUG("driver=%p name=%s", driver, driver ? NULLSTR(driver->name) : "(null)");
if (virInitialize() < 0)
return -1;
return -1;
}
- DEBUG ("registering %s as driver %d",
+ VIR_DEBUG ("registering %s as driver %d",
driver->name, virDriverTabCount);
virDriverTab[virDriverTabCount] = driver;
virGetVersion(unsigned long *libVer, const char *type,
unsigned long *typeVer)
{
- DEBUG("libVir=%p, type=%s, typeVer=%p", libVer, type, typeVer);
+ VIR_DEBUG("libVir=%p, type=%s, typeVer=%p", libVer, type, typeVer);
if (!initialized)
if (virInitialize() < 0)
if (!name || name[0] == '\0') {
char *defname = getenv("LIBVIRT_DEFAULT_URI");
if (defname && *defname) {
- DEBUG("Using LIBVIRT_DEFAULT_URI %s", defname);
+ VIR_DEBUG("Using LIBVIRT_DEFAULT_URI %s", defname);
name = defname;
} else {
name = NULL;
goto failed;
}
- DEBUG("name \"%s\" to URI components:\n"
+ VIR_DEBUG("name \"%s\" to URI components:\n"
" scheme %s\n"
" opaque %s\n"
" authority %s\n"
NULLSTR(ret->uri->user), ret->uri->port,
NULLSTR(ret->uri->path));
} else {
- DEBUG0("no name, allowing driver auto-select");
+ VIR_DEBUG0("no name, allowing driver auto-select");
}
/* Cleansing flags */
goto failed;
}
- DEBUG("trying driver %d (%s) ...",
+ VIR_DEBUG("trying driver %d (%s) ...",
i, virDriverTab[i]->name);
res = virDriverTab[i]->open (ret, auth, flags);
- DEBUG("driver %d %s returned %s",
+ VIR_DEBUG("driver %d %s returned %s",
i, virDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
for (i = 0; i < virNetworkDriverTabCount; i++) {
res = virNetworkDriverTab[i]->open (ret, auth, flags);
- DEBUG("network driver %d %s returned %s",
+ VIR_DEBUG("network driver %d %s returned %s",
i, virNetworkDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
for (i = 0; i < virInterfaceDriverTabCount; i++) {
res = virInterfaceDriverTab[i]->open (ret, auth, flags);
- DEBUG("interface driver %d %s returned %s",
+ VIR_DEBUG("interface driver %d %s returned %s",
i, virInterfaceDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
/* Secondary driver for storage. Optional */
for (i = 0; i < virStorageDriverTabCount; i++) {
res = virStorageDriverTab[i]->open (ret, auth, flags);
- DEBUG("storage driver %d %s returned %s",
+ VIR_DEBUG("storage driver %d %s returned %s",
i, virStorageDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
/* Node driver (optional) */
for (i = 0; i < virDeviceMonitorTabCount; i++) {
res = virDeviceMonitorTab[i]->open (ret, auth, flags);
- DEBUG("node driver %d %s returned %s",
+ VIR_DEBUG("node driver %d %s returned %s",
i, virDeviceMonitorTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
/* Secret manipulation driver. Optional */
for (i = 0; i < virSecretDriverTabCount; i++) {
res = virSecretDriverTab[i]->open (ret, auth, flags);
- DEBUG("secret driver %d %s returned %s",
+ VIR_DEBUG("secret driver %d %s returned %s",
i, virSecretDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
/* Network filter driver. Optional */
for (i = 0; i < virNWFilterDriverTabCount; i++) {
res = virNWFilterDriverTab[i]->open (ret, auth, flags);
- DEBUG("nwfilter driver %d %s returned %s",
+ VIR_DEBUG("nwfilter driver %d %s returned %s",
i, virNWFilterDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
if (virInitialize() < 0)
goto error;
- DEBUG("name=%s", name);
+ VIR_DEBUG("name=%s", name);
ret = do_open (name, NULL, 0);
if (!ret)
goto error;
if (virInitialize() < 0)
goto error;
- DEBUG("name=%s", name);
+ VIR_DEBUG("name=%s", name);
ret = do_open (name, NULL, VIR_CONNECT_RO);
if (!ret)
goto error;
if (virInitialize() < 0)
goto error;
- DEBUG("name=%s, auth=%p, flags=%d", NULLSTR(name), auth, flags);
+ VIR_DEBUG("name=%s, auth=%p, flags=%d", NULLSTR(name), auth, flags);
ret = do_open (name, auth, flags);
if (!ret)
goto error;
virConnectClose(virConnectPtr conn)
{
int ret = -1;
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
return -1;
}
virMutexLock(&conn->lock);
- DEBUG("conn=%p refs=%d", conn, conn->refs);
+ VIR_DEBUG("conn=%p refs=%d", conn, conn->refs);
conn->refs++;
virMutexUnlock(&conn->lock);
return 0;
virDrvSupportsFeature (virConnectPtr conn, int feature)
{
int ret;
- DEBUG("conn=%p, feature=%d", conn, feature);
+ VIR_DEBUG("conn=%p, feature=%d", conn, feature);
virResetLastError();
virConnectGetType(virConnectPtr conn)
{
const char *ret;
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
int
virConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
{
- DEBUG("conn=%p, hvVer=%p", conn, hvVer);
+ VIR_DEBUG("conn=%p, hvVer=%p", conn, hvVer);
virResetLastError();
virConnectGetLibVersion(virConnectPtr conn, unsigned long *libVer)
{
int ret = -1;
- DEBUG("conn=%p, libVir=%p", conn, libVer);
+ VIR_DEBUG("conn=%p, libVir=%p", conn, libVer);
virResetLastError();
char *
virConnectGetHostname (virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
virConnectGetURI (virConnectPtr conn)
{
char *name;
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
char *
virConnectGetSysinfo (virConnectPtr conn, unsigned int flags)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
virConnectGetMaxVcpus(virConnectPtr conn,
const char *type)
{
- DEBUG("conn=%p, type=%s", conn, type);
+ VIR_DEBUG("conn=%p, type=%s", conn, type);
virResetLastError();
int
virConnectListDomains(virConnectPtr conn, int *ids, int maxids)
{
- DEBUG("conn=%p, ids=%p, maxids=%d", conn, ids, maxids);
+ VIR_DEBUG("conn=%p, ids=%p, maxids=%d", conn, ids, maxids);
virResetLastError();
int
virConnectNumOfDomains(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
virDomainCreateXML(virConnectPtr conn, const char *xmlDesc,
unsigned int flags)
{
- DEBUG("conn=%p, xmlDesc=%s, flags=%d", conn, xmlDesc, flags);
+ VIR_DEBUG("conn=%p, xmlDesc=%s, flags=%d", conn, xmlDesc, flags);
virResetLastError();
virDomainPtr
virDomainLookupByID(virConnectPtr conn, int id)
{
- DEBUG("conn=%p, id=%d", conn, id);
+ VIR_DEBUG("conn=%p, id=%d", conn, id);
virResetLastError();
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(uuid, uuidstr);
- DEBUG("conn=%p, uuid=%s", conn, uuidstr);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuidstr);
virResetLastError();
virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
+ VIR_DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
virResetLastError();
virDomainPtr
virDomainLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
virDomainRestore(virConnectPtr conn, const char *from)
{
char filepath[4096];
- DEBUG("conn=%p, from=%s", conn, from);
+ VIR_DEBUG("conn=%p, from=%s", conn, from);
virResetLastError();
const char *
virDomainGetName(virDomainPtr domain)
{
- DEBUG("domain=%p", domain);
+ VIR_DEBUG("domain=%p", domain);
virResetLastError();
const char *nativeConfig,
unsigned int flags)
{
- DEBUG("conn=%p, format=%s config=%s flags=%u", conn, nativeFormat, nativeConfig, flags);
+ VIR_DEBUG("conn=%p, format=%s config=%s flags=%u", conn, nativeFormat, nativeConfig, flags);
virResetLastError();
const char *domainXml,
unsigned int flags)
{
- DEBUG("conn=%p, format=%s xml=%s flags=%u", conn, nativeFormat, domainXml, flags);
+ VIR_DEBUG("conn=%p, format=%s xml=%s flags=%u", conn, nativeFormat, domainXml, flags);
virResetLastError();
int
virNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
{
- DEBUG("conn=%p, info=%p", conn, info);
+ VIR_DEBUG("conn=%p, info=%p", conn, info);
virResetLastError();
char *
virConnectGetCapabilities (virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
ret = conn->driver->getCapabilities (conn);
if (!ret)
goto error;
- DEBUG("conn=%p ret=%s", conn, ret);
+ VIR_DEBUG("conn=%p ret=%s", conn, ret);
return ret;
}
unsigned long long
virNodeGetFreeMemory(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
*/
virDomainPtr
virDomainDefineXML(virConnectPtr conn, const char *xml) {
- DEBUG("conn=%p, xml=%s", conn, xml);
+ VIR_DEBUG("conn=%p, xml=%s", conn, xml);
virResetLastError();
int
virConnectNumOfDefinedDomains(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
int
virConnectListDefinedDomains(virConnectPtr conn, char **const names,
int maxnames) {
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
int
virNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
{
- DEBUG("conn=%p secmodel=%p", conn, secmodel);
+ VIR_DEBUG("conn=%p secmodel=%p", conn, secmodel);
if (!VIR_IS_CONNECT(conn)) {
virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
virNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems,
int startCell, int maxCells)
{
- DEBUG("conn=%p, freeMems=%p, startCell=%d, maxCells=%d",
+ VIR_DEBUG("conn=%p, freeMems=%p, startCell=%d, maxCells=%d",
conn, freeMems, startCell, maxCells);
virResetLastError();
virConnectPtr
virNetworkGetConnect (virNetworkPtr net)
{
- DEBUG("net=%p", net);
+ VIR_DEBUG("net=%p", net);
virResetLastError();
int
virConnectNumOfNetworks(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
int
virConnectListNetworks(virConnectPtr conn, char **const names, int maxnames)
{
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
int
virConnectNumOfDefinedNetworks(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
virConnectListDefinedNetworks(virConnectPtr conn, char **const names,
int maxnames)
{
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
virNetworkPtr
virNetworkLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(uuid, uuidstr);
- DEBUG("conn=%p, uuid=%s", conn, uuidstr);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuidstr);
virResetLastError();
virNetworkLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
+ VIR_DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
virResetLastError();
virNetworkPtr
virNetworkCreateXML(virConnectPtr conn, const char *xmlDesc)
{
- DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
+ VIR_DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
virResetLastError();
virNetworkPtr
virNetworkDefineXML(virConnectPtr conn, const char *xml)
{
- DEBUG("conn=%p, xml=%s", conn, xml);
+ VIR_DEBUG("conn=%p, xml=%s", conn, xml);
virResetLastError();
int
virNetworkUndefine(virNetworkPtr network) {
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
virNetworkCreate(virNetworkPtr network)
{
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
virNetworkDestroy(virNetworkPtr network)
{
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
int
virNetworkFree(virNetworkPtr network)
{
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
return -1;
}
virMutexLock(&network->conn->lock);
- DEBUG("network=%p refs=%d", network, network->refs);
+ VIR_DEBUG("network=%p refs=%d", network, network->refs);
network->refs++;
virMutexUnlock(&network->conn->lock);
return 0;
const char *
virNetworkGetName(virNetworkPtr network)
{
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
int
virNetworkGetUUID(virNetworkPtr network, unsigned char *uuid)
{
- DEBUG("network=%p, uuid=%p", network, uuid);
+ VIR_DEBUG("network=%p, uuid=%p", network, uuid);
virResetLastError();
virNetworkGetUUIDString(virNetworkPtr network, char *buf)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("network=%p, buf=%p", network, buf);
+ VIR_DEBUG("network=%p, buf=%p", network, buf);
virResetLastError();
virNetworkGetXMLDesc(virNetworkPtr network, int flags)
{
virConnectPtr conn;
- DEBUG("network=%p, flags=%d", network, flags);
+ VIR_DEBUG("network=%p, flags=%d", network, flags);
virResetLastError();
virNetworkGetBridgeName(virNetworkPtr network)
{
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
int *autostart)
{
virConnectPtr conn;
- DEBUG("network=%p, autostart=%p", network, autostart);
+ VIR_DEBUG("network=%p, autostart=%p", network, autostart);
virResetLastError();
int autostart)
{
virConnectPtr conn;
- DEBUG("network=%p, autostart=%d", network, autostart);
+ VIR_DEBUG("network=%p, autostart=%d", network, autostart);
virResetLastError();
virConnectPtr
virInterfaceGetConnect (virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
int
virConnectNumOfInterfaces(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
int
virConnectListInterfaces(virConnectPtr conn, char **const names, int maxnames)
{
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
int
virConnectNumOfDefinedInterfaces(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
char **const names,
int maxnames)
{
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
virInterfacePtr
virInterfaceLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
virInterfacePtr
virInterfaceLookupByMACString(virConnectPtr conn, const char *macstr)
{
- DEBUG("conn=%p, macstr=%s", conn, macstr);
+ VIR_DEBUG("conn=%p, macstr=%s", conn, macstr);
virResetLastError();
const char *
virInterfaceGetName(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
const char *
virInterfaceGetMACString(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
virInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags)
{
virConnectPtr conn;
- DEBUG("iface=%p, flags=%d", iface, flags);
+ VIR_DEBUG("iface=%p, flags=%d", iface, flags);
virResetLastError();
virInterfacePtr
virInterfaceDefineXML(virConnectPtr conn, const char *xml, unsigned int flags)
{
- DEBUG("conn=%p, xml=%s, flags=%d", conn, xml, flags);
+ VIR_DEBUG("conn=%p, xml=%s, flags=%d", conn, xml, flags);
virResetLastError();
int
virInterfaceUndefine(virInterfacePtr iface) {
virConnectPtr conn;
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
virInterfaceCreate(virInterfacePtr iface, unsigned int flags)
{
virConnectPtr conn;
- DEBUG("iface=%p, flags=%d", iface, flags);
+ VIR_DEBUG("iface=%p, flags=%d", iface, flags);
virResetLastError();
virInterfaceDestroy(virInterfacePtr iface, unsigned int flags)
{
virConnectPtr conn;
- DEBUG("iface=%p, flags=%d", iface, flags);
+ VIR_DEBUG("iface=%p, flags=%d", iface, flags);
virResetLastError();
return -1;
}
virMutexLock(&iface->conn->lock);
- DEBUG("iface=%p refs=%d", iface, iface->refs);
+ VIR_DEBUG("iface=%p refs=%d", iface, iface->refs);
iface->refs++;
virMutexUnlock(&iface->conn->lock);
return 0;
int
virInterfaceFree(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
virConnectPtr
virStoragePoolGetConnect (virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
int
virConnectNumOfStoragePools (virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
char **const names,
int maxnames)
{
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
int
virConnectNumOfDefinedStoragePools(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
char **const names,
int maxnames)
{
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
const char *srcSpec,
unsigned int flags)
{
- DEBUG("conn=%p, type=%s, src=%s, flags=%u", conn, type ? type : "", srcSpec ? srcSpec : "", flags);
+ VIR_DEBUG("conn=%p, type=%s, src=%s, flags=%u", conn, type ? type : "", srcSpec ? srcSpec : "", flags);
virResetLastError();
virStoragePoolLookupByName(virConnectPtr conn,
const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
virStoragePoolLookupByUUID(virConnectPtr conn,
const unsigned char *uuid)
{
- DEBUG("conn=%p, uuid=%s", conn, uuid);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuid);
virResetLastError();
const char *uuidstr)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
+ VIR_DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
virResetLastError();
virStoragePoolPtr
virStoragePoolLookupByVolume(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
const char *xmlDesc,
unsigned int flags)
{
- DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
+ VIR_DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
virResetLastError();
const char *xml,
unsigned int flags)
{
- DEBUG("conn=%p, xml=%s", conn, xml);
+ VIR_DEBUG("conn=%p, xml=%s", conn, xml);
virResetLastError();
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
virStoragePoolUndefine(virStoragePoolPtr pool)
{
virConnectPtr conn;
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
virStoragePoolDestroy(virStoragePoolPtr pool)
{
virConnectPtr conn;
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
int
virStoragePoolFree(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
return -1;
}
virMutexLock(&pool->conn->lock);
- DEBUG("pool=%p refs=%d", pool, pool->refs);
+ VIR_DEBUG("pool=%p refs=%d", pool, pool->refs);
pool->refs++;
virMutexUnlock(&pool->conn->lock);
return 0;
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p flags=%u", pool, flags);
virResetLastError();
const char*
virStoragePoolGetName(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
virStoragePoolGetUUID(virStoragePoolPtr pool,
unsigned char *uuid)
{
- DEBUG("pool=%p, uuid=%p", pool, uuid);
+ VIR_DEBUG("pool=%p, uuid=%p", pool, uuid);
virResetLastError();
char *buf)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("pool=%p, buf=%p", pool, buf);
+ VIR_DEBUG("pool=%p, buf=%p", pool, buf);
virResetLastError();
virStoragePoolInfoPtr info)
{
virConnectPtr conn;
- DEBUG("pool=%p, info=%p", pool, info);
+ VIR_DEBUG("pool=%p, info=%p", pool, info);
virResetLastError();
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
int *autostart)
{
virConnectPtr conn;
- DEBUG("pool=%p, autostart=%p", pool, autostart);
+ VIR_DEBUG("pool=%p, autostart=%p", pool, autostart);
virResetLastError();
int autostart)
{
virConnectPtr conn;
- DEBUG("pool=%p, autostart=%d", pool, autostart);
+ VIR_DEBUG("pool=%p, autostart=%d", pool, autostart);
virResetLastError();
int
virStoragePoolNumOfVolumes(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
char **const names,
int maxnames)
{
- DEBUG("pool=%p, names=%p, maxnames=%d", pool, names, maxnames);
+ VIR_DEBUG("pool=%p, names=%p, maxnames=%d", pool, names, maxnames);
virResetLastError();
virConnectPtr
virStorageVolGetConnect (virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
virStorageVolLookupByName(virStoragePoolPtr pool,
const char *name)
{
- DEBUG("pool=%p, name=%s", pool, name);
+ VIR_DEBUG("pool=%p, name=%s", pool, name);
virResetLastError();
virStorageVolLookupByKey(virConnectPtr conn,
const char *key)
{
- DEBUG("conn=%p, key=%s", conn, key);
+ VIR_DEBUG("conn=%p, key=%s", conn, key);
virResetLastError();
virStorageVolLookupByPath(virConnectPtr conn,
const char *path)
{
- DEBUG("conn=%p, path=%s", conn, path);
+ VIR_DEBUG("conn=%p, path=%s", conn, path);
virResetLastError();
const char*
virStorageVolGetName(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
const char*
virStorageVolGetKey(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
const char *xmldesc,
unsigned int flags)
{
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
virStorageVolPtr clonevol,
unsigned int flags)
{
- DEBUG("pool=%p, flags=%u, clonevol=%p", pool, flags, clonevol);
+ VIR_DEBUG("pool=%p, flags=%u, clonevol=%p", pool, flags, clonevol);
virResetLastError();
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("vol=%p, flags=%u", vol, flags);
+ VIR_DEBUG("vol=%p, flags=%u", vol, flags);
virResetLastError();
int
virStorageVolFree(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
return -1;
}
virMutexLock(&vol->conn->lock);
- DEBUG("vol=%p refs=%d", vol, vol->refs);
+ VIR_DEBUG("vol=%p refs=%d", vol, vol->refs);
vol->refs++;
virMutexUnlock(&vol->conn->lock);
return 0;
virStorageVolInfoPtr info)
{
virConnectPtr conn;
- DEBUG("vol=%p, info=%p", vol, info);
+ VIR_DEBUG("vol=%p, info=%p", vol, info);
virResetLastError();
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("vol=%p, flags=%u", vol, flags);
+ VIR_DEBUG("vol=%p, flags=%u", vol, flags);
virResetLastError();
virStorageVolGetPath(virStorageVolPtr vol)
{
virConnectPtr conn;
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
int
virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags)
{
- DEBUG("conn=%p, cap=%s, flags=%d", conn, NULLSTR(cap), flags);
+ VIR_DEBUG("conn=%p, cap=%s, flags=%d", conn, NULLSTR(cap), flags);
virResetLastError();
char **const names, int maxnames,
unsigned int flags)
{
- DEBUG("conn=%p, cap=%s, names=%p, maxnames=%d, flags=%d",
+ VIR_DEBUG("conn=%p, cap=%s, names=%p, maxnames=%d, flags=%d",
conn, cap, names, maxnames, flags);
virResetLastError();
*/
virNodeDevicePtr virNodeDeviceLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%p", conn, name);
+ VIR_DEBUG("conn=%p, name=%p", conn, name);
virResetLastError();
*/
char *virNodeDeviceGetXMLDesc(virNodeDevicePtr dev, unsigned int flags)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
virResetLastError();
*/
const char *virNodeDeviceGetName(virNodeDevicePtr dev)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
*/
const char *virNodeDeviceGetParent(virNodeDevicePtr dev)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
virResetLastError();
*/
int virNodeDeviceNumOfCaps(virNodeDevicePtr dev)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
virResetLastError();
char **const names,
int maxnames)
{
- DEBUG("dev=%p, conn=%p, names=%p, maxnames=%d",
+ VIR_DEBUG("dev=%p, conn=%p, names=%p, maxnames=%d",
dev, dev ? dev->conn : NULL, names, maxnames);
virResetLastError();
*/
int virNodeDeviceFree(virNodeDevicePtr dev)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
virResetLastError();
return -1;
}
virMutexLock(&dev->conn->lock);
- DEBUG("dev=%p refs=%d", dev, dev->refs);
+ VIR_DEBUG("dev=%p refs=%d", dev, dev->refs);
dev->refs++;
virMutexUnlock(&dev->conn->lock);
return 0;
int
virNodeDeviceDettach(virNodeDevicePtr dev)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
virResetLastError();
int
virNodeDeviceReAttach(virNodeDevicePtr dev)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
virResetLastError();
int
virNodeDeviceReset(virNodeDevicePtr dev)
{
- DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
+ VIR_DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
virResetLastError();
int
virNodeDeviceDestroy(virNodeDevicePtr dev)
{
- DEBUG("dev=%p", dev);
+ VIR_DEBUG("dev=%p", dev);
virResetLastError();
void *opaque,
virFreeCallback freecb)
{
- DEBUG("conn=%p, cb=%p, opaque=%p, freecb=%p", conn, cb, opaque, freecb);
+ VIR_DEBUG("conn=%p, cb=%p, opaque=%p, freecb=%p", conn, cb, opaque, freecb);
virResetLastError();
if (!VIR_IS_CONNECT(conn)) {
virConnectDomainEventDeregister(virConnectPtr conn,
virConnectDomainEventCallback cb)
{
- DEBUG("conn=%p, cb=%p", conn, cb);
+ VIR_DEBUG("conn=%p, cb=%p", conn, cb);
virResetLastError();
virConnectPtr
virSecretGetConnect (virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
virSecretPtr
virSecretLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
{
- DEBUG("conn=%p, uuid=%s", conn, uuid);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuid);
virResetLastError();
virSecretLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
+ VIR_DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
virResetLastError();
int usageType,
const char *usageID)
{
- DEBUG("conn=%p, usageType=%d usageID=%s", conn, usageType, NULLSTR(usageID));
+ VIR_DEBUG("conn=%p, usageType=%d usageID=%s", conn, usageType, NULLSTR(usageID));
virResetLastError();
virSecretGetUUIDString(virSecretPtr secret, char *buf)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("secret=%p, buf=%p", secret, buf);
+ VIR_DEBUG("secret=%p, buf=%p", secret, buf);
virResetLastError();
int
virSecretGetUsageType(virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
const char *
virSecretGetUsageID(virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
return -1;
}
virMutexLock(&secret->conn->lock);
- DEBUG("secret=%p refs=%d", secret, secret->refs);
+ VIR_DEBUG("secret=%p refs=%d", secret, secret->refs);
secret->refs++;
virMutexUnlock(&secret->conn->lock);
return 0;
int
virSecretFree(virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
{
virStreamPtr st;
- DEBUG("conn=%p, flags=%u", conn, flags);
+ VIR_DEBUG("conn=%p, flags=%u", conn, flags);
virResetLastError();
return -1;
}
virMutexLock(&stream->conn->lock);
- DEBUG("stream=%p refs=%d", stream, stream->refs);
+ VIR_DEBUG("stream=%p refs=%d", stream, stream->refs);
stream->refs++;
virMutexUnlock(&stream->conn->lock);
return 0;
const char *data,
size_t nbytes)
{
- DEBUG("stream=%p, data=%p, nbytes=%zi", stream, data, nbytes);
+ VIR_DEBUG("stream=%p, data=%p, nbytes=%zi", stream, data, nbytes);
virResetLastError();
char *data,
size_t nbytes)
{
- DEBUG("stream=%p, data=%p, nbytes=%zi", stream, data, nbytes);
+ VIR_DEBUG("stream=%p, data=%p, nbytes=%zi", stream, data, nbytes);
virResetLastError();
char *bytes = NULL;
int want = 1024*64;
int ret = -1;
- DEBUG("stream=%p, handler=%p, opaque=%p", stream, handler, opaque);
+ VIR_DEBUG("stream=%p, handler=%p, opaque=%p", stream, handler, opaque);
virResetLastError();
char *bytes = NULL;
int want = 1024*64;
int ret = -1;
- DEBUG("stream=%p, handler=%p, opaque=%p", stream, handler, opaque);
+ VIR_DEBUG("stream=%p, handler=%p, opaque=%p", stream, handler, opaque);
virResetLastError();
void *opaque,
virFreeCallback ff)
{
- DEBUG("stream=%p, events=%d, cb=%p, opaque=%p, ff=%p", stream, events, cb, opaque, ff);
+ VIR_DEBUG("stream=%p, events=%d, cb=%p, opaque=%p, ff=%p", stream, events, cb, opaque, ff);
virResetLastError();
int virStreamEventUpdateCallback(virStreamPtr stream,
int events)
{
- DEBUG("stream=%p, events=%d", stream, events);
+ VIR_DEBUG("stream=%p, events=%d", stream, events);
virResetLastError();
*/
int virStreamEventRemoveCallback(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
*/
int virStreamFinish(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
*/
int virStreamAbort(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
*/
int virStreamFree(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
*/
int virDomainIsActive(virDomainPtr dom)
{
- DEBUG("dom=%p", dom);
+ VIR_DEBUG("dom=%p", dom);
virResetLastError();
*/
int virNetworkIsActive(virNetworkPtr net)
{
- DEBUG("net=%p", net);
+ VIR_DEBUG("net=%p", net);
virResetLastError();
*/
int virNetworkIsPersistent(virNetworkPtr net)
{
- DEBUG("net=%p", net);
+ VIR_DEBUG("net=%p", net);
virResetLastError();
*/
int virStoragePoolIsActive(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
*/
int virStoragePoolIsPersistent(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
int
virConnectNumOfNWFilters(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
int
virConnectListNWFilters(virConnectPtr conn, char **const names, int maxnames)
{
- DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
+ VIR_DEBUG("conn=%p, names=%p, maxnames=%d", conn, names, maxnames);
virResetLastError();
virNWFilterPtr
virNWFilterLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
virNWFilterPtr
virNWFilterLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
{
- DEBUG("conn=%p, uuid=%s", conn, uuid);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuid);
virResetLastError();
virNWFilterLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
+ VIR_DEBUG("conn=%p, uuidstr=%s", conn, uuidstr);
virResetLastError();
int
virNWFilterFree(virNWFilterPtr nwfilter)
{
- DEBUG("nwfilter=%p", nwfilter);
+ VIR_DEBUG("nwfilter=%p", nwfilter);
virResetLastError();
const char *
virNWFilterGetName(virNWFilterPtr nwfilter)
{
- DEBUG("nwfilter=%p", nwfilter);
+ VIR_DEBUG("nwfilter=%p", nwfilter);
virResetLastError();
int
virNWFilterGetUUID(virNWFilterPtr nwfilter, unsigned char *uuid)
{
- DEBUG("nwfilter=%p, uuid=%p", nwfilter, uuid);
+ VIR_DEBUG("nwfilter=%p, uuid=%p", nwfilter, uuid);
virResetLastError();
virNWFilterGetUUIDString(virNWFilterPtr nwfilter, char *buf)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("nwfilter=%p, buf=%p", nwfilter, buf);
+ VIR_DEBUG("nwfilter=%p, buf=%p", nwfilter, buf);
virResetLastError();
virNWFilterPtr
virNWFilterDefineXML(virConnectPtr conn, const char *xmlDesc)
{
- DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
+ VIR_DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
virResetLastError();
virNWFilterUndefine(virNWFilterPtr nwfilter)
{
virConnectPtr conn;
- DEBUG("nwfilter=%p", nwfilter);
+ VIR_DEBUG("nwfilter=%p", nwfilter);
virResetLastError();
virNWFilterGetXMLDesc(virNWFilterPtr nwfilter, int flags)
{
virConnectPtr conn;
- DEBUG("nwfilter=%p, flags=%d", nwfilter, flags);
+ VIR_DEBUG("nwfilter=%p, flags=%d", nwfilter, flags);
virResetLastError();
return -1;
}
virMutexLock(&nwfilter->conn->lock);
- DEBUG("nwfilter=%p refs=%d", nwfilter, nwfilter->refs);
+ VIR_DEBUG("nwfilter=%p refs=%d", nwfilter, nwfilter->refs);
nwfilter->refs++;
virMutexUnlock(&nwfilter->conn->lock);
return 0;
*/
int virInterfaceIsActive(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
*/
int virConnectIsEncrypted(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
*/
int virConnectIsSecure(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID)
{
- DEBUG("conn=%p, callbackID=%d", conn, callbackID);
+ VIR_DEBUG("conn=%p, callbackID=%d", conn, callbackID);
virResetLastError();
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("snapshot=%p, flags=%d", snapshot, flags);
+ VIR_DEBUG("snapshot=%p, flags=%d", snapshot, flags);
virResetLastError();
{
virConnectPtr conn;
- DEBUG("snapshot=%p, flags=%u", snapshot, flags);
+ VIR_DEBUG("snapshot=%p, flags=%u", snapshot, flags);
virResetLastError();
{
virConnectPtr conn;
- DEBUG("snapshot=%p, flags=%u", snapshot, flags);
+ VIR_DEBUG("snapshot=%p, flags=%u", snapshot, flags);
virResetLastError();
int
virDomainSnapshotFree(virDomainSnapshotPtr snapshot)
{
- DEBUG("snapshot=%p", snapshot);
+ VIR_DEBUG("snapshot=%p", snapshot);
virResetLastError();
}
VIR_FORCE_CLOSE(control);
- DEBUG0("Received container continue message");
+ VIR_DEBUG0("Received container continue message");
return 0;
}
goto error_out;
}
- DEBUG("Renaming %s to %s", veths[i], newname);
+ VIR_DEBUG("Renaming %s to %s", veths[i], newname);
rc = setInterfaceName(veths[i], newname);
if (rc < 0)
goto error_out;
- DEBUG("Enabling %s", newname);
+ VIR_DEBUG("Enabling %s", newname);
rc = vethInterfaceUpOrDown(newname, 1);
if (rc < 0)
goto error_out;
flags = CLONE_NEWPID|CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|SIGCHLD;
if (userns_supported()) {
- DEBUG0("Enable user namespaces");
+ VIR_DEBUG0("Enable user namespaces");
flags |= CLONE_NEWUSER;
}
if (def->nets != NULL) {
- DEBUG0("Enable network namespaces");
+ VIR_DEBUG0("Enable network namespaces");
flags |= CLONE_NEWNET;
}
pid = clone(lxcContainerChild, stacktop, flags, &args);
VIR_FREE(stack);
- DEBUG("clone() completed, new container PID is %d", pid);
+ VIR_DEBUG("clone() completed, new container PID is %d", pid);
if (pid < 0) {
virReportSystemError(errno, "%s",
flags |= CLONE_NEWNET;
if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
- DEBUG0("Unable to allocate stack");
+ VIR_DEBUG0("Unable to allocate stack");
return -1;
}
VIR_FREE(stack);
if (cpid < 0) {
char ebuf[1024];
- DEBUG("clone call returned %s, container support is not enabled",
+ VIR_DEBUG("clone call returned %s, container support is not enabled",
virStrerror(errno, ebuf, sizeof ebuf));
return -1;
} else {
++numActive;
}
} else if (epollEvent.events & EPOLLHUP) {
- DEBUG("EPOLLHUP from fd %d", epollEvent.data.fd);
+ VIR_DEBUG("EPOLLHUP from fd %d", epollEvent.data.fd);
continue;
} else {
lxcError(VIR_ERR_INTERNAL_ERROR,
vm->pid, waitRc);
rc = -1;
} else if (WIFEXITED(childStatus)) {
- DEBUG("container exited with rc: %d", WEXITSTATUS(childStatus));
+ VIR_DEBUG("container exited with rc: %d", WEXITSTATUS(childStatus));
rc = -1;
}
break;
}
- DEBUG("bridge: %s", bridge);
+ VIR_DEBUG("bridge: %s", bridge);
if (NULL == bridge) {
lxcError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Failed to get bridge for interface"));
goto error_exit;
}
- DEBUG0("calling vethCreate()");
+ VIR_DEBUG0("calling vethCreate()");
parentVeth = def->nets[i]->ifname;
if (vethCreate(&parentVeth, &containerVeth) < 0)
goto error_exit;
- DEBUG("parentVeth: %s, containerVeth: %s", parentVeth, containerVeth);
+ VIR_DEBUG("parentVeth: %s, containerVeth: %s", parentVeth, containerVeth);
if (NULL == def->nets[i]->ifname) {
def->nets[i]->ifname = parentVeth;
int vethDev = 0;
bool veth1_alloc = false;
- DEBUG("veth1: %s veth2: %s", NULLSTR(*veth1), NULLSTR(*veth2));
+ VIR_DEBUG("veth1: %s veth2: %s", NULLSTR(*veth1), NULLSTR(*veth2));
if (*veth1 == NULL) {
vethDev = getFreeVethName(veth1, vethDev);
if (vethDev < 0)
return vethDev;
- DEBUG("Assigned veth1: %s", *veth1);
+ VIR_DEBUG("Assigned veth1: %s", *veth1);
veth1_alloc = true;
}
argv[3] = *veth1;
VIR_FREE(*veth1);
return vethDev;
}
- DEBUG("Assigned veth2: %s", *veth2);
+ VIR_DEBUG("Assigned veth2: %s", *veth2);
}
argv[8] = *veth2;
- DEBUG("veth1: %s veth2: %s", *veth1, *veth2);
+ VIR_DEBUG("veth1: %s veth2: %s", *veth1, *veth2);
rc = virRun(argv, &cmdResult);
if (rc != 0 ||
const char *argv[] = {"ip", "link", "del", veth, NULL};
int cmdResult = 0;
- DEBUG("veth: %s", veth);
+ VIR_DEBUG("veth: %s", veth);
rc = virRun(argv, &cmdResult);
return;
failure:
- DEBUG("FAILED TO ADD dev %s", name);
+ VIR_DEBUG("FAILED TO ADD dev %s", name);
cleanup:
VIR_FREE(privData);
virNodeDeviceDefFree(def);
*/
virNodeDeviceObjRemove(&driverState->devs, dev);
} else
- DEBUG("no device named %s", name);
+ VIR_DEBUG("no device named %s", name);
nodeDeviceUnlock(driverState);
if (dev) {
static void device_added(LibHalContext *ctx ATTRIBUTE_UNUSED,
const char *udi)
{
- DEBUG0(hal_name(udi));
+ VIR_DEBUG0(hal_name(udi));
dev_create(udi);
}
nodeDeviceLock(driverState);
dev = virNodeDeviceFindByName(&driverState->devs,name);
- DEBUG0(name);
+ VIR_DEBUG0(name);
if (dev)
virNodeDeviceObjRemove(&driverState->devs, dev);
else
- DEBUG("no device named %s", name);
+ VIR_DEBUG("no device named %s", name);
nodeDeviceUnlock(driverState);
}
nodeDeviceLock(driverState);
dev = virNodeDeviceFindByName(&driverState->devs,name);
nodeDeviceUnlock(driverState);
- DEBUG("%s %s", cap, name);
+ VIR_DEBUG("%s %s", cap, name);
if (dev) {
(void)gather_capability(ctx, udi, cap, &dev->def->caps);
virNodeDeviceObjUnlock(dev);
} else {
- DEBUG("no device named %s", name);
+ VIR_DEBUG("no device named %s", name);
}
}
const char *cap)
{
const char *name = hal_name(udi);
- DEBUG("%s %s", cap, name);
+ VIR_DEBUG("%s %s", cap, name);
dev_refresh(udi);
}
dbus_bool_t is_added ATTRIBUTE_UNUSED)
{
const char *name = hal_name(udi);
- DEBUG("%s %s", name, key);
+ VIR_DEBUG("%s %s", name, key);
dev_refresh(udi);
}
int qemuMonitorSetCapabilities(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virConnectPtr conn)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
qemuMonitorStopCPUs(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
int qemuMonitorSystemPowerdown(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
int **pids)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
unsigned long *currmem)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
unsigned int nr_stats)
{
int ret;
- DEBUG("mon=%p stats=%p nstats=%u", mon, stats, nr_stats);
+ VIR_DEBUG("mon=%p stats=%p nstats=%u", mon, stats, nr_stats);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
long long *errs)
{
int ret;
- DEBUG("mon=%p dev=%s", mon, devname);
+ VIR_DEBUG("mon=%p dev=%s", mon, devname);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
unsigned long long *extent)
{
int ret;
- DEBUG("mon=%p, fd=%d, devname=%p",
+ VIR_DEBUG("mon=%p, fd=%d, devname=%p",
mon, mon->fd, devname);
if (mon->json)
const char *password)
{
int ret;
- DEBUG("mon=%p, password=%p",
+ VIR_DEBUG("mon=%p, password=%p",
mon, password);
if (!mon) {
if (!protocol)
return -1;
- DEBUG("mon=%p, protocol=%s, password=%p, action_if_connected=%s",
+ VIR_DEBUG("mon=%p, protocol=%s, password=%p, action_if_connected=%s",
mon, protocol, password, action_if_connected);
if (!mon) {
if (!protocol)
return -1;
- DEBUG("mon=%p, protocol=%s, expire_time=%s",
+ VIR_DEBUG("mon=%p, protocol=%s, expire_time=%s",
mon, protocol, expire_time);
if (!mon) {
unsigned long newmem)
{
int ret;
- DEBUG("mon=%p newmem=%lu", mon, newmem);
+ VIR_DEBUG("mon=%p newmem=%lu", mon, newmem);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online)
{
int ret;
- DEBUG("mon=%p cpu=%d online=%d", mon, cpu, online);
+ VIR_DEBUG("mon=%p cpu=%d online=%d", mon, cpu, online);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
bool force)
{
int ret;
- DEBUG("mon=%p devname=%s force=%d", mon, devname, force);
+ VIR_DEBUG("mon=%p devname=%s force=%d", mon, devname, force);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
const char *format)
{
int ret;
- DEBUG("mon=%p devname=%s newmedia=%s format=%s",
+ VIR_DEBUG("mon=%p devname=%s newmedia=%s format=%s",
mon, devname, newmedia, format);
if (!mon) {
const char *path)
{
int ret;
- DEBUG("mon=%p offset=%llu length=%zu path=%s",
+ VIR_DEBUG("mon=%p offset=%llu length=%zu path=%s",
mon, offset, length, path);
if (!mon) {
const char *path)
{
int ret;
- DEBUG("mon=%p offset=%llu length=%zu path=%s",
+ VIR_DEBUG("mon=%p offset=%llu length=%zu path=%s",
mon, offset, length, path);
if (!mon) {
unsigned long bandwidth)
{
int ret;
- DEBUG("mon=%p bandwidth=%lu", mon, bandwidth);
+ VIR_DEBUG("mon=%p bandwidth=%lu", mon, bandwidth);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
unsigned long long downtime)
{
int ret;
- DEBUG("mon=%p downtime=%llu", mon, downtime);
+ VIR_DEBUG("mon=%p downtime=%llu", mon, downtime);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
unsigned long long *total)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
int port)
{
int ret;
- DEBUG("mon=%p hostname=%s port=%d flags=%u",
+ VIR_DEBUG("mon=%p hostname=%s port=%d flags=%u",
mon, hostname, port, flags);
if (!mon) {
const char * const *argv)
{
int ret;
- DEBUG("mon=%p argv=%p flags=%u",
+ VIR_DEBUG("mon=%p argv=%p flags=%u",
mon, argv, flags);
if (!mon) {
unsigned long long offset)
{
int ret;
- DEBUG("mon=%p argv=%p target=%s offset=%llu flags=%u",
+ VIR_DEBUG("mon=%p argv=%p target=%s offset=%llu flags=%u",
mon, argv, target, offset, flags);
if (!mon) {
const char *unixfile)
{
int ret;
- DEBUG("mon=%p, unixfile=%s flags=%u",
+ VIR_DEBUG("mon=%p, unixfile=%s flags=%u",
mon, unixfile, flags);
if (!mon) {
int qemuMonitorMigrateCancel(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
const char *path)
{
int ret;
- DEBUG("mon=%p path=%s", mon, path);
+ VIR_DEBUG("mon=%p path=%s", mon, path);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
int dev)
{
int ret;
- DEBUG("mon=%p bus=%d dev=%d", mon, bus, dev);
+ VIR_DEBUG("mon=%p bus=%d dev=%d", mon, bus, dev);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
int product)
{
int ret;
- DEBUG("mon=%p vendor=%d product=%d",
+ VIR_DEBUG("mon=%p vendor=%d product=%d",
mon, vendor, product);
if (!mon) {
virDomainDevicePCIAddress *guestAddr)
{
int ret;
- DEBUG("mon=%p domain=%d bus=%d slot=%d function=%d",
+ VIR_DEBUG("mon=%p domain=%d bus=%d slot=%d function=%d",
mon,
hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function);
virDomainDevicePCIAddress *guestAddr)
{
int ret;
- DEBUG("mon=%p path=%s bus=%s",
+ VIR_DEBUG("mon=%p path=%s bus=%s",
mon, path, bus);
if (!mon) {
virDomainDevicePCIAddress *guestAddr)
{
int ret;
- DEBUG("mon=%p nicstr=%s", mon, nicstr);
+ VIR_DEBUG("mon=%p nicstr=%s", mon, nicstr);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virDomainDevicePCIAddress *guestAddr)
{
int ret;
- DEBUG("mon=%p domain=%d bus=%d slot=%d function=%d",
+ VIR_DEBUG("mon=%p domain=%d bus=%d slot=%d function=%d",
mon, guestAddr->domain, guestAddr->bus,
guestAddr->slot, guestAddr->function);
int fd)
{
int ret;
- DEBUG("mon=%p, fdname=%s fd=%d",
+ VIR_DEBUG("mon=%p, fdname=%s fd=%d",
mon, fdname, fd);
if (!mon) {
const char *fdname)
{
int ret;
- DEBUG("mon=%p fdname=%s",
+ VIR_DEBUG("mon=%p fdname=%s",
mon, fdname);
if (!mon) {
const char *netstr)
{
int ret;
- DEBUG("mon=%p netstr=%s",
+ VIR_DEBUG("mon=%p netstr=%s",
mon, netstr);
if (!mon) {
const char *netname)
{
int ret;
- DEBUG("mon=%p netname=%s",
+ VIR_DEBUG("mon=%p netname=%s",
mon, netname);
if (!mon) {
const char *netdevstr)
{
int ret;
- DEBUG("mon=%p netdevstr=%s",
+ VIR_DEBUG("mon=%p netdevstr=%s",
mon, netdevstr);
if (!mon) {
const char *alias)
{
int ret;
- DEBUG("mon=%p alias=%s",
+ VIR_DEBUG("mon=%p alias=%s",
mon, alias);
if (!mon) {
virHashTablePtr paths)
{
int ret;
- DEBUG("mon=%p",
+ VIR_DEBUG("mon=%p",
mon);
if (!mon) {
const char *bus,
virDomainDevicePCIAddress *guestAddr)
{
- DEBUG("mon=%p type=%s", mon, bus);
+ VIR_DEBUG("mon=%p type=%s", mon, bus);
int ret;
if (!mon) {
virDomainDevicePCIAddress *controllerAddr,
virDomainDeviceDriveAddress *driveAddr)
{
- DEBUG("mon=%p drivestr=%s domain=%d bus=%d slot=%d function=%d",
+ VIR_DEBUG("mon=%p drivestr=%s domain=%d bus=%d slot=%d function=%d",
mon, drivestr,
controllerAddr->domain, controllerAddr->bus,
controllerAddr->slot, controllerAddr->function);
int qemuMonitorGetAllPCIAddresses(qemuMonitorPtr mon,
qemuMonitorPCIAddress **addrs)
{
- DEBUG("mon=%p addrs=%p", mon, addrs);
+ VIR_DEBUG("mon=%p addrs=%p", mon, addrs);
int ret;
if (!mon) {
int qemuMonitorDriveDel(qemuMonitorPtr mon,
const char *drivestr)
{
- DEBUG("mon=%p drivestr=%s", mon, drivestr);
+ VIR_DEBUG("mon=%p drivestr=%s", mon, drivestr);
int ret;
if (!mon) {
int qemuMonitorDelDevice(qemuMonitorPtr mon,
const char *devalias)
{
- DEBUG("mon=%p devalias=%s", mon, devalias);
+ VIR_DEBUG("mon=%p devalias=%s", mon, devalias);
int ret;
if (!mon) {
int qemuMonitorAddDevice(qemuMonitorPtr mon,
const char *devicestr)
{
- DEBUG("mon=%p device=%s", mon, devicestr);
+ VIR_DEBUG("mon=%p device=%s", mon, devicestr);
int ret;
if (!mon) {
int qemuMonitorAddDrive(qemuMonitorPtr mon,
const char *drivestr)
{
- DEBUG("mon=%p drive=%s", mon, drivestr);
+ VIR_DEBUG("mon=%p drive=%s", mon, drivestr);
int ret;
if (!mon) {
const char *alias,
const char *passphrase)
{
- DEBUG("mon=%p alias=%s passphrase=%p(value hidden)", mon, alias, passphrase);
+ VIR_DEBUG("mon=%p alias=%s passphrase=%p(value hidden)", mon, alias, passphrase);
int ret;
if (!mon) {
{
int ret;
- DEBUG("mon=%p, name=%s",mon,name);
+ VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
{
int ret;
- DEBUG("mon=%p, name=%s",mon,name);
+ VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
{
int ret;
- DEBUG("mon=%p, name=%s",mon,name);
+ VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
{
int ret;
- DEBUG("mon=%p, cmd=%s, reply=%p, hmp=%d", mon, cmd, reply, hmp);
+ VIR_DEBUG("mon=%p, cmd=%s, reply=%p, hmp=%d", mon, cmd, reply, hmp);
if (mon->json)
ret = qemuMonitorJSONArbitraryCommand(mon, cmd, reply, hmp);
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
- DEBUG("JSONDriveDel drivestr=%s", drivestr);
+ VIR_DEBUG("JSONDriveDel drivestr=%s", drivestr);
cmd = qemuMonitorJSONMakeCommand("drive_del",
"s:id", drivestr,
NULL);
if (VIR_REALLOC_N(cpupids, ncpupids+1) < 0)
goto error;
- DEBUG("vcpu=%d pid=%d", vcpu, tid);
+ VIR_DEBUG("vcpu=%d pid=%d", vcpu, tid);
cpupids[ncpupids++] = tid;
lastVcpu = vcpu;
if (STRPREFIX (*text, search)) {
*text += strlen(search);
if (virStrToLong_ull (*text, &dummy, 10, &value)) {
- DEBUG ("error reading %s: %s", search, *text);
+ VIR_DEBUG ("error reading %s: %s", search, *text);
return 0;
}
if (STRPREFIX (p, "rd_bytes=")) {
p += 9;
if (virStrToLong_ll (p, &dummy, 10, rd_bytes) == -1)
- DEBUG ("error reading rd_bytes: %s", p);
+ VIR_DEBUG ("error reading rd_bytes: %s", p);
} else if (STRPREFIX (p, "wr_bytes=")) {
p += 9;
if (virStrToLong_ll (p, &dummy, 10, wr_bytes) == -1)
- DEBUG ("error reading wr_bytes: %s", p);
+ VIR_DEBUG ("error reading wr_bytes: %s", p);
} else if (STRPREFIX (p, "rd_operations=")) {
p += 14;
if (virStrToLong_ll (p, &dummy, 10, rd_req) == -1)
- DEBUG ("error reading rd_req: %s", p);
+ VIR_DEBUG ("error reading rd_req: %s", p);
} else if (STRPREFIX (p, "wr_operations=")) {
p += 14;
if (virStrToLong_ll (p, &dummy, 10, wr_req) == -1)
- DEBUG ("error reading wr_req: %s", p);
+ VIR_DEBUG ("error reading wr_req: %s", p);
} else
- DEBUG ("unknown block stat near %s", p);
+ VIR_DEBUG ("unknown block stat near %s", p);
/* Skip to next label. */
p = strchr (p, ' ');
goto cleanup;
}
- DEBUG("TextDelDevice devalias=%s", devalias);
+ VIR_DEBUG("TextDelDevice devalias=%s", devalias);
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("cannot detach %s device"), devalias);
char *reply = NULL;
char *safedev;
int ret = -1;
- DEBUG("TextDriveDel drivestr=%s", drivestr);
+ VIR_DEBUG("TextDriveDel drivestr=%s", drivestr);
if (!(safedev = qemuMonitorEscapeArg(drivestr))) {
virReportOOMError();
unsigned char *cpumap;
int cpumaplen;
- DEBUG0("Setting CPU affinity");
+ VIR_DEBUG0("Setting CPU affinity");
if (nodeGetInfo(NULL, &nodeinfo) < 0)
return -1;
hookData.vm = vm;
hookData.driver = driver;
- DEBUG0("Beginning VM startup process");
+ VIR_DEBUG0("Beginning VM startup process");
if (virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
* runtime state to vm->def that won't be persisted. This let's us
* report implicit runtime defaults in the XML, like vnc listen/socket
*/
- DEBUG0("Setting current domain def as transient");
+ VIR_DEBUG0("Setting current domain def as transient");
if (virDomainObjSetDefTransient(driver->caps, vm, true) < 0)
goto cleanup;
vm->def->id = driver->nextvmid++;
/* Must be run before security labelling */
- DEBUG0("Preparing host devices");
+ VIR_DEBUG0("Preparing host devices");
if (qemuPrepareHostDevices(driver, vm->def) < 0)
goto cleanup;
- DEBUG0("Preparing chr devices");
+ VIR_DEBUG0("Preparing chr devices");
if (virDomainChrDefForeach(vm->def,
true,
qemuProcessPrepareChardevDevice,
/* If you are using a SecurityDriver with dynamic labelling,
then generate a security label for isolation */
- DEBUG0("Generating domain security label (if required)");
+ VIR_DEBUG0("Generating domain security label (if required)");
if (virSecurityManagerGenLabel(driver->securityManager, vm) < 0) {
qemuDomainSecurityLabelAudit(vm, false);
goto cleanup;
}
qemuDomainSecurityLabelAudit(vm, true);
- DEBUG0("Generating setting domain security labels (if required)");
+ VIR_DEBUG0("Generating setting domain security labels (if required)");
if (virSecurityManagerSetAllLabel(driver->securityManager,
vm, stdin_path) < 0)
goto cleanup;
*/
struct stat stdin_sb;
- DEBUG0("setting security label on pipe used for migration");
+ VIR_DEBUG0("setting security label on pipe used for migration");
if (fstat(stdin_fd, &stdin_sb) < 0) {
virReportSystemError(errno,
/* Ensure no historical cgroup for this VM is lying around bogus
* settings */
- DEBUG0("Ensuring no historical cgroup is lying around");
+ VIR_DEBUG0("Ensuring no historical cgroup is lying around");
qemuRemoveCgroup(driver, vm, 1);
if (vm->def->ngraphics == 1) {
goto cleanup;
}
- DEBUG0("Creating domain log file");
+ VIR_DEBUG0("Creating domain log file");
if ((logfile = qemuProcessLogFD(driver, vm->def->name, false)) < 0)
goto cleanup;
- DEBUG0("Determining emulator version");
+ VIR_DEBUG0("Determining emulator version");
if (qemuCapsExtractVersionInfo(vm->def->emulator, vm->def->os.arch,
NULL,
&qemuCmdFlags) < 0)
goto cleanup;
- DEBUG0("Setting up domain cgroup (if required)");
+ VIR_DEBUG0("Setting up domain cgroup (if required)");
if (qemuSetupCgroup(driver, vm) < 0)
goto cleanup;
goto cleanup;
}
- DEBUG0("Preparing monitor state");
+ VIR_DEBUG0("Preparing monitor state");
if (qemuProcessPrepareMonitorChr(driver, priv->monConfig, vm->def->name) < 0)
goto cleanup;
* use in hotplug
*/
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
- DEBUG0("Assigning domain PCI addresses");
+ VIR_DEBUG0("Assigning domain PCI addresses");
/* Populate cache with current addresses */
if (priv->pciaddrs) {
qemuDomainPCIAddressSetFree(priv->pciaddrs);
priv->persistentAddrs = 0;
}
- DEBUG0("Building emulator command line");
+ VIR_DEBUG0("Building emulator command line");
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
priv->monJSON != 0, qemuCmdFlags,
migrateFrom, stdin_fd,
if (ret == -1) /* The VM failed to start */
goto cleanup;
- DEBUG0("Waiting for monitor to show up");
+ VIR_DEBUG0("Waiting for monitor to show up");
if (qemuProcessWaitForMonitor(driver, vm, pos) < 0)
goto cleanup;
- DEBUG0("Detecting VCPU PIDs");
+ VIR_DEBUG0("Detecting VCPU PIDs");
if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
goto cleanup;
- DEBUG0("Setting any required VM passwords");
+ VIR_DEBUG0("Setting any required VM passwords");
if (qemuProcessInitPasswords(conn, driver, vm, qemuCmdFlags) < 0)
goto cleanup;
/* If we have -device, then addresses are assigned explicitly.
* If not, then we have to detect dynamic ones here */
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
- DEBUG0("Determining domain device PCI addresses");
+ VIR_DEBUG0("Determining domain device PCI addresses");
if (qemuProcessInitPCIAddresses(driver, vm) < 0)
goto cleanup;
}
- DEBUG0("Setting initial memory amount");
+ VIR_DEBUG0("Setting initial memory amount");
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuMonitorSetBalloon(priv->mon, vm->def->mem.cur_balloon) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (!start_paused) {
- DEBUG0("Starting domain CPUs");
+ VIR_DEBUG0("Starting domain CPUs");
/* Allow the CPUS to start executing */
if (qemuProcessStartCPUs(driver, vm, conn) < 0) {
if (virGetLastError() == NULL)
}
- DEBUG0("Writing domain status to disk");
+ VIR_DEBUG0("Writing domain status to disk");
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
goto cleanup;
if (!pkipath) goto out_of_memory;
var->ignore = 1;
} else {
- DEBUG("passing through variable '%s' ('%s') to remote end",
+ VIR_DEBUG("passing through variable '%s' ('%s') to remote end",
var->name, var->value);
}
}
goto failed;
}
- DEBUG("proceeding with name = %s", name);
+ VIR_DEBUG("proceeding with name = %s", name);
/* For ext transport, command is required. */
if (transport == trans_ext && !command) {
goto failed;
}
- DEBUG("Auto-probed URI is %s", uriret.uri);
+ VIR_DEBUG("Auto-probed URI is %s", uriret.uri);
conn->uri = xmlParseURI(uriret.uri);
VIR_FREE(uriret.uri);
if (!conn->uri) {
goto failed;
}
- DEBUG0("Adding Handler for remote events");
+ VIR_DEBUG0("Adding Handler for remote events");
/* Set up a callback to listen on the socket data */
if ((priv->watch = virEventAddHandle(priv->sock,
VIR_EVENT_HANDLE_READABLE,
remoteDomainEventFired,
conn, NULL)) < 0) {
- DEBUG0("virEventAddHandle failed: No addHandleImpl defined."
+ VIR_DEBUG0("virEventAddHandle failed: No addHandleImpl defined."
" continuing without events.");
} else {
- DEBUG0("Adding Timeout for remote event queue flushing");
+ VIR_DEBUG0("Adding Timeout for remote event queue flushing");
if ( (priv->eventFlushTimer = virEventAddTimeout(-1,
remoteDomainEventQueueFlush,
conn, NULL)) < 0) {
- DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
+ VIR_DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
"continuing without events.");
virEventRemoveHandle(priv->watch);
priv->watch = -1;
(STREQ(conn->uri->path, "/session") ||
STRPREFIX(conn->uri->scheme, "test+")) &&
getuid() > 0) {
- DEBUG0("Auto-spawn user daemon instance");
+ VIR_DEBUG0("Auto-spawn user daemon instance");
rflags |= VIR_DRV_OPEN_REMOTE_USER;
if (!autostart ||
STRNEQ(autostart, "0"))
* to the UNIX socket anyway.
*/
if (!conn->uri) {
- DEBUG0("Auto-probe remote URI");
+ VIR_DEBUG0("Auto-probe remote URI");
#ifndef __sun
if (getuid() > 0) {
- DEBUG0("Auto-spawn user daemon instance");
+ VIR_DEBUG0("Auto-spawn user daemon instance");
rflags |= VIR_DRV_OPEN_REMOTE_USER;
if (!autostart ||
STRNEQ(autostart, "0"))
static void remote_debug_gnutls_log(int level, const char* str) {
- DEBUG("%d %s", level, str);
+ VIR_DEBUG("%d %s", level, str);
}
static int
goto error;
/* Set the trusted CA cert. */
- DEBUG("loading CA file %s", libvirt_cacert);
+ VIR_DEBUG("loading CA file %s", libvirt_cacert);
err =
gnutls_certificate_set_x509_trust_file (x509_cred, libvirt_cacert,
GNUTLS_X509_FMT_PEM);
}
/* Set the client certificate and private key. */
- DEBUG("loading client cert and key from files %s and %s",
+ VIR_DEBUG("loading client cert and key from files %s and %s",
libvirt_clientcert, libvirt_clientkey);
err =
gnutls_certificate_set_x509_key_file (x509_cred,
/* Verify certificate. */
if (verify_certificate (conn, priv, session) == -1) {
- DEBUG0("failed to verify peer's certificate");
+ VIR_DEBUG0("failed to verify peer's certificate");
if (!no_verify) return NULL;
}
int ret = -1;
const char *mechlist;
- DEBUG0("Client initialize SASL authentication");
+ VIR_DEBUG0("Client initialize SASL authentication");
/* Sets up the SASL library as a whole */
err = sasl_client_init(NULL);
if (err != SASL_OK) {
}
ssf *= 8; /* key size is bytes, sasl wants bits */
- DEBUG("Setting external SSF %d", ssf);
+ VIR_DEBUG("Setting external SSF %d", ssf);
err = sasl_setprop(saslconn, SASL_SSF_EXTERNAL, &ssf);
if (err != SASL_OK) {
remoteError(VIR_ERR_INTERNAL_ERROR,
}
restart:
/* Start the auth negotiation on the client end first */
- DEBUG("Client start negotiation mechlist '%s'", mechlist);
+ VIR_DEBUG("Client start negotiation mechlist '%s'", mechlist);
err = sasl_client_start(saslconn,
mechlist,
&interact,
sargs.data.data_val = (char*)clientout;
sargs.data.data_len = clientoutlen;
sargs.mech = (char*)mech;
- DEBUG("Server start negotiation with mech %s. Data %d bytes %p", mech, clientoutlen, clientout);
+ VIR_DEBUG("Server start negotiation with mech %s. Data %d bytes %p", mech, clientoutlen, clientout);
/* Now send the initial auth data to the server */
memset (&sret, 0, sizeof sret);
/* NB, distinction of NULL vs "" is *critical* in SASL */
serverin = sret.nil ? NULL : sret.data.data_val;
serverinlen = sret.data.data_len;
- DEBUG("Client step result complete: %d. Data %d bytes %p",
+ VIR_DEBUG("Client step result complete: %d. Data %d bytes %p",
complete, serverinlen, serverin);
/* Loop-the-loop...
}
VIR_FREE(serverin);
- DEBUG("Client step result %d. Data %d bytes %p", err, clientoutlen, clientout);
+ VIR_DEBUG("Client step result %d. Data %d bytes %p", err, clientoutlen, clientout);
/* Previous server call showed completion & we're now locally complete too */
if (complete && err == SASL_OK)
pargs.nil = clientout ? 0 : 1;
pargs.data.data_val = (char*)clientout;
pargs.data.data_len = clientoutlen;
- DEBUG("Server step with %d bytes %p", clientoutlen, clientout);
+ VIR_DEBUG("Server step with %d bytes %p", clientoutlen, clientout);
memset (&pret, 0, sizeof pret);
if (call (conn, priv, in_open, REMOTE_PROC_AUTH_SASL_STEP,
serverin = pret.nil ? NULL : pret.data.data_val;
serverinlen = pret.data.data_len;
- DEBUG("Client step result complete: %d. Data %d bytes %p",
+ VIR_DEBUG("Client step result complete: %d. Data %d bytes %p",
complete, serverinlen, serverin);
/* This server call shows complete, and earlier client step was OK */
goto cleanup;
}
ssf = *(const int *)val;
- DEBUG("SASL SSF value %d", ssf);
+ VIR_DEBUG("SASL SSF value %d", ssf);
if (ssf < 56) { /* 56 == DES level, good for Kerberos */
remoteError(VIR_ERR_AUTH_FAILED,
_("negotiation SSF %d was not strong enough"), ssf);
priv->is_secure = 1;
}
- DEBUG0("SASL authentication complete");
+ VIR_DEBUG0("SASL authentication complete");
priv->saslconn = saslconn;
ret = 0;
virConnectAuthPtr auth ATTRIBUTE_UNUSED)
{
remote_auth_polkit_ret ret;
- DEBUG0("Client initialize PolicyKit-1 authentication");
+ VIR_DEBUG0("Client initialize PolicyKit-1 authentication");
memset (&ret, 0, sizeof ret);
if (call (conn, priv, in_open, REMOTE_PROC_AUTH_POLKIT,
return -1; /* virError already set by call */
}
- DEBUG0("PolicyKit-1 authentication complete");
+ VIR_DEBUG0("PolicyKit-1 authentication complete");
return 0;
}
# elif HAVE_POLKIT0
NULL,
0,
};
- DEBUG0("Client initialize PolicyKit-0 authentication");
+ VIR_DEBUG0("Client initialize PolicyKit-0 authentication");
if (auth && auth->cb) {
/* Check if the necessary credential type for PolicyKit is supported */
}
if (allowcb) {
- DEBUG0("Client run callback for PolicyKit authentication");
+ VIR_DEBUG0("Client run callback for PolicyKit authentication");
/* Run the authentication callback */
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
remoteError(VIR_ERR_AUTH_FAILED, "%s",
return -1;
}
} else {
- DEBUG0("Client auth callback does not support PolicyKit");
+ VIR_DEBUG0("Client auth callback does not support PolicyKit");
}
} else {
- DEBUG0("No auth callback provided");
+ VIR_DEBUG0("No auth callback provided");
}
memset (&ret, 0, sizeof ret);
return -1; /* virError already set by call */
}
- DEBUG0("PolicyKit-0 authentication complete");
+ VIR_DEBUG0("PolicyKit-0 authentication complete");
return 0;
}
# endif /* HAVE_POLKIT0 */
const char *data,
size_t nbytes)
{
- DEBUG("st=%p status=%d data=%p nbytes=%zu", st, status, data, nbytes);
+ VIR_DEBUG("st=%p status=%d data=%p nbytes=%zu", st, status, data, nbytes);
struct private_data *priv = st->conn->privateData;
struct private_stream_data *privst = st->privateData;
XDR xdr;
const char *data,
size_t nbytes)
{
- DEBUG("st=%p data=%p nbytes=%zu", st, data, nbytes);
+ VIR_DEBUG("st=%p data=%p nbytes=%zu", st, data, nbytes);
struct private_data *priv = st->conn->privateData;
int rv = -1;
char *data,
size_t nbytes)
{
- DEBUG("st=%p data=%p nbytes=%zu", st, data, nbytes);
+ VIR_DEBUG("st=%p data=%p nbytes=%zu", st, data, nbytes);
struct private_data *priv = st->conn->privateData;
struct private_stream_data *privst = st->privateData;
int rv = -1;
int ret;
if (st->flags & VIR_STREAM_NONBLOCK) {
- DEBUG0("Non-blocking mode and no data available");
+ VIR_DEBUG0("Non-blocking mode and no data available");
rv = -2;
goto cleanup;
}
goto cleanup;
}
- DEBUG("After IO %d", privst->incomingOffset);
+ VIR_DEBUG("After IO %d", privst->incomingOffset);
if (privst->incomingOffset) {
int want = privst->incomingOffset;
if (want > nbytes)
remoteStreamEventTimerUpdate(privst);
- DEBUG("Done %d", rv);
+ VIR_DEBUG("Done %d", rv);
cleanup:
if (rv == -1)
/* Extend our declared buffer length and carry
on reading the header + payload */
priv->bufferLength += len;
- DEBUG("Got length, now need %d total (%d more)", priv->bufferLength, len);
+ VIR_DEBUG("Got length, now need %d total (%d more)", priv->bufferLength, len);
return 0;
}
/* An async message has come in while we were waiting for the
* response. Process it to pull it off the wire, and try again
*/
- DEBUG0("Encountered an event while waiting for a response");
+ VIR_DEBUG0("Encountered an event while waiting for a response");
if (in_open) {
- DEBUG("Ignoring bogus event %d received while in open", hdr->proc);
+ VIR_DEBUG("Ignoring bogus event %d received while in open", hdr->proc);
return -1;
}
break;
default:
- DEBUG("Unexpected event proc %d", hdr->proc);
+ VIR_DEBUG("Unexpected event proc %d", hdr->proc);
break;
}
if (virDomainEventQueuePush(priv->domainEvents,
event) < 0) {
- DEBUG0("Error adding event to queue");
+ VIR_DEBUG0("Error adding event to queue");
virDomainEventFree(event);
}
virEventUpdateTimeout(priv->eventFlushTimer, 0);
if (fds[1].revents) {
ssize_t s;
- DEBUG0("Woken up from poll by other thread");
+ VIR_DEBUG0("Woken up from poll by other thread");
s = saferead(priv->wakeupReadFD, &ignore, sizeof(ignore));
if (s < 0) {
virReportSystemError(errno, "%s",
* we release our mutex a short while
* later...
*/
- DEBUG("Waking up sleep %d %p %p", tmp->proc_nr, tmp, priv->waitDispatch);
+ VIR_DEBUG("Waking up sleep %d %p %p", tmp->proc_nr, tmp, priv->waitDispatch);
virCondSignal(&tmp->cond);
}
prev = tmp;
* remove us
*/
priv->waitDispatch = thiscall->next;
- DEBUG("Giving up the buck %d %p %p", thiscall->proc_nr, thiscall, priv->waitDispatch);
+ VIR_DEBUG("Giving up the buck %d %p %p", thiscall->proc_nr, thiscall, priv->waitDispatch);
/* See if someone else is still waiting
* and if so, then pass the buck ! */
if (priv->waitDispatch) {
- DEBUG("Passing the buck to %d %p", priv->waitDispatch->proc_nr, priv->waitDispatch);
+ VIR_DEBUG("Passing the buck to %d %p", priv->waitDispatch->proc_nr, priv->waitDispatch);
virCondSignal(&priv->waitDispatch->cond);
}
return 0;
error:
priv->waitDispatch = thiscall->next;
- DEBUG("Giving up the buck due to I/O error %d %p %p", thiscall->proc_nr, thiscall, priv->waitDispatch);
+ VIR_DEBUG("Giving up the buck due to I/O error %d %p %p", thiscall->proc_nr, thiscall, priv->waitDispatch);
/* See if someone else is still waiting
* and if so, then pass the buck ! */
if (priv->waitDispatch) {
- DEBUG("Passing the buck to %d %p", priv->waitDispatch->proc_nr, priv->waitDispatch);
+ VIR_DEBUG("Passing the buck to %d %p", priv->waitDispatch->proc_nr, priv->waitDispatch);
virCondSignal(&priv->waitDispatch->cond);
}
return -1;
{
int rv;
- DEBUG("Do proc=%d serial=%d length=%d wait=%p",
+ VIR_DEBUG("Do proc=%d serial=%d length=%d wait=%p",
thiscall->proc_nr, thiscall->serial,
thiscall->bufferLength, priv->waitDispatch);
return -1;
}
- DEBUG("Going to sleep %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
+ VIR_DEBUG("Going to sleep %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
/* Go to sleep while other thread is working... */
if (virCondWait(&thiscall->cond, &priv->lock) < 0) {
if (priv->waitDispatch == thiscall) {
return -1;
}
- DEBUG("Wokeup from sleep %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
+ VIR_DEBUG("Wokeup from sleep %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
/* Two reasons we can be woken up
* 1. Other thread has got our reply ready for us
* 2. Other thread is all done, and it is our turn to
priv->waitDispatch = thiscall;
}
- DEBUG("We have the buck %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
+ VIR_DEBUG("We have the buck %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
/*
* The buck stops here!
*
return -1;
cleanup:
- DEBUG("All done with our call %d %p %p", thiscall->proc_nr,
+ VIR_DEBUG("All done with our call %d %p %p", thiscall->proc_nr,
priv->waitDispatch, thiscall);
if (thiscall->mode == REMOTE_MODE_ERROR) {
/* Interop for virErrorNumber glitch in 0.8.0, if server is
if (priv->waitDispatch)
goto done;
- DEBUG("Event fired %d %d %d %X", watch, fd, event, event);
+ VIR_DEBUG("Event fired %d %d %d %X", watch, fd, event, event);
if (event & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR)) {
- DEBUG("%s : VIR_EVENT_HANDLE_HANGUP or "
+ VIR_DEBUG("%s : VIR_EVENT_HANDLE_HANGUP or "
"VIR_EVENT_HANDLE_ERROR encountered", __FUNCTION__);
virEventRemoveHandle(watch);
priv->watch = -1;
}
if (remoteIOHandleInput(conn, priv, 0) < 0)
- DEBUG0("Something went wrong during async message processing");
+ VIR_DEBUG0("Something went wrong during async message processing");
done:
remoteDriverUnlock(priv);
{
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
- DEBUG("Dropping privileges of VM to %d:%d", priv->user, priv->group);
+ VIR_DEBUG("Dropping privileges of VM to %d:%d", priv->user, priv->group);
if (virSetUIDGID(priv->user, priv->group) < 0)
return -1;
unsigned long long cylinderSize = dev->geometry.heads *
dev->geometry.sectors * SECTOR_SIZE;
- DEBUG("find free area: allocation %llu, cyl size %llu", allocation,
+ VIR_DEBUG("find free area: allocation %llu, cyl size %llu", allocation,
cylinderSize);
int partType = virStorageBackendDiskPartTypeToCreate(pool);
return -1;
}
- DEBUG("aligned alloc %llu", alignedAllocation);
+ VIR_DEBUG("aligned alloc %llu", alignedAllocation);
*start = dev->freeExtents[smallestExtent].start;
if (partType == VIR_STORAGE_VOL_DISK_TYPE_LOGICAL) {
/* counting in byte, we want the last byte of the current sector */
*end -= 1;
- DEBUG("final aligned start %llu, end %llu", *start, *end);
+ VIR_DEBUG("final aligned start %llu, end %llu", *start, *end);
return 0;
}
devname = basename(devpath);
srcname = basename(pool->def->source.devices[0].path);
- DEBUG("devname=%s, srcname=%s", devname, srcname);
+ VIR_DEBUG("devname=%s, srcname=%s", devname, srcname);
isDevMapperDevice = virIsDevMapperDevice(devpath);
if ((privconn->domainEventTimer =
virEventAddTimeout(-1, testDomainEventFlush, privconn, NULL)) < 0)
- DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
+ VIR_DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
"continuing without events.");
testDriverUnlock(privconn);
}
/*
* logging.h: internal logging and debugging
*
- * Copyright (C) 2006-2008 Red Hat, Inc.
+ * Copyright (C) 2006-2008, 2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
/*
* If configured with --enable-debug=yes then library calls
* are printed to stderr for debugging or to an appropriate channel
- * defined at runtime of from the libvirt daemon configuration file
+ * defined at runtime from the libvirt daemon configuration file
*/
# ifdef ENABLE_DEBUG
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
# define VIR_ERROR0(msg) \
VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
-/* Legacy compat */
-# define DEBUG(fmt,...) \
- VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define DEBUG0(msg) \
- VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
-
/*
* To be made public
*/
virReportOOMError();
goto error;
}
- DEBUG0(argv_str);
+ VIR_DEBUG0(argv_str);
if ((execret = __virExec(argv, NULL, NULL,
&childpid, -1, &outfd, &errfd,
}
if (outbuf)
- DEBUG("Command stdout: %s", outbuf);
+ VIR_DEBUG("Command stdout: %s", outbuf);
if (errbuf)
- DEBUG("Command stderr: %s", errbuf);
+ VIR_DEBUG("Command stderr: %s", errbuf);
while ((waitret = waitpid(childpid, &exitstatus, 0) == -1) &&
errno == EINTR);
/* Init the glue and get the API version. */
if (VBoxCGlueInit(&uVersion) == 0) {
- DEBUG("VBoxCGlueInit found API version: %d.%d.%d (%u)",
+ VIR_DEBUG("VBoxCGlueInit found API version: %d.%d.%d (%u)",
uVersion / 1000000,
uVersion % 1000000 / 1000,
uVersion % 1000,
* number 51, thus the version ranges in the if statements below.
*/
if (uVersion >= 2001052 && uVersion < 2002051) {
- DEBUG0("VirtualBox API version: 2.2");
+ VIR_DEBUG0("VirtualBox API version: 2.2");
driver = &vbox22Driver;
networkDriver = &vbox22NetworkDriver;
storageDriver = &vbox22StorageDriver;
} else if (uVersion >= 2002051 && uVersion < 3000051) {
- DEBUG0("VirtualBox API version: 3.0");
+ VIR_DEBUG0("VirtualBox API version: 3.0");
driver = &vbox30Driver;
networkDriver = &vbox30NetworkDriver;
storageDriver = &vbox30StorageDriver;
} else if (uVersion >= 3000051 && uVersion < 3001051) {
- DEBUG0("VirtualBox API version: 3.1");
+ VIR_DEBUG0("VirtualBox API version: 3.1");
driver = &vbox31Driver;
networkDriver = &vbox31NetworkDriver;
storageDriver = &vbox31StorageDriver;
} else if (uVersion >= 3001051 && uVersion < 3002051) {
- DEBUG0("VirtualBox API version: 3.2");
+ VIR_DEBUG0("VirtualBox API version: 3.2");
driver = &vbox32Driver;
networkDriver = &vbox32NetworkDriver;
storageDriver = &vbox32StorageDriver;
} else if (uVersion >= 3002051 && uVersion < 4000051) {
- DEBUG0("VirtualBox API version: 4.0");
+ VIR_DEBUG0("VirtualBox API version: 4.0");
driver = &vbox40Driver;
networkDriver = &vbox40NetworkDriver;
storageDriver = &vbox40StorageDriver;
} else {
- DEBUG0("Unsupport VirtualBox API version");
+ VIR_DEBUG0("Unsupport VirtualBox API version");
}
} else {
- DEBUG0("VBoxCGlueInit failed, using dummy driver");
+ VIR_DEBUG0("VBoxCGlueInit failed, using dummy driver");
}
if (virRegisterDriver(driver) < 0)
\
g_pVBoxGlobalData->pFuncs->pfnUtf16ToUtf8(strUtf16, &strUtf8);\
if (strUtf8) {\
- DEBUG("%s: %s", msg, strUtf8);\
+ VIR_DEBUG("%s: %s", msg, strUtf8);\
g_pVBoxGlobalData->pFuncs->pfnUtf8Free(strUtf8);\
}\
}
#define DEBUGUUID(msg, iid) \
{\
- DEBUG (msg ": {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",\
+ VIR_DEBUG (msg ": {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",\
(unsigned)(iid)->m0,\
(unsigned)(iid)->m1,\
(unsigned)(iid)->m2,\
name = virIndexToDiskName(total, prefix);
- DEBUG("name=%s, total=%d, storageBus=%u, deviceInst=%d, "
+ VIR_DEBUG("name=%s, total=%d, storageBus=%u, deviceInst=%d, "
"devicePort=%d deviceSlot=%d, maxPortPerInst=%u maxSlotPerPort=%u",
NULLSTR(name), total, storageBus, deviceInst, devicePort,
deviceSlot, maxPortPerInst, maxSlotPerPort);
*devicePort = (total % (maxPortPerInst * maxSlotPerPort)) / maxSlotPerPort;
*deviceSlot = (total % (maxPortPerInst * maxSlotPerPort)) % maxSlotPerPort;
- DEBUG("name=%s, total=%d, storageBus=%u, deviceInst=%d, "
+ VIR_DEBUG("name=%s, total=%d, storageBus=%u, deviceInst=%d, "
"devicePort=%d deviceSlot=%d, maxPortPerInst=%u maxSlotPerPort=%u",
deviceName, total, storageBus, *deviceInst, *devicePort,
*deviceSlot, maxPortPerInst, maxSlotPerPort);
#endif /* !(VBOX_API_VERSION == 2002) */
conn->privateData = data;
- DEBUG0("in vboxOpen");
+ VIR_DEBUG0("in vboxOpen");
return VIR_DRV_OPEN_SUCCESS;
}
static int vboxClose(virConnectPtr conn) {
vboxGlobalData *data = conn->privateData;
- DEBUG("%s: in vboxClose",conn->driver->name);
+ VIR_DEBUG("%s: in vboxClose",conn->driver->name);
vboxUninitialize(data);
conn->privateData = NULL;
static int vboxGetVersion(virConnectPtr conn, unsigned long *version) {
vboxGlobalData *data = conn->privateData;
- DEBUG("%s: in vboxGetVersion",conn->driver->name);
+ VIR_DEBUG("%s: in vboxGetVersion",conn->driver->name);
vboxDriverLock(data);
*version = data->version;
PRUint32 maxBootPosition = 0;
int i = 0;
- DEBUG("def->os.type %s", def->os.type);
- DEBUG("def->os.arch %s", def->os.arch);
- DEBUG("def->os.machine %s", def->os.machine);
- DEBUG("def->os.nBootDevs %d", def->os.nBootDevs);
- DEBUG("def->os.bootDevs[0] %d", def->os.bootDevs[0]);
- DEBUG("def->os.bootDevs[1] %d", def->os.bootDevs[1]);
- DEBUG("def->os.bootDevs[2] %d", def->os.bootDevs[2]);
- DEBUG("def->os.bootDevs[3] %d", def->os.bootDevs[3]);
- DEBUG("def->os.init %s", def->os.init);
- DEBUG("def->os.kernel %s", def->os.kernel);
- DEBUG("def->os.initrd %s", def->os.initrd);
- DEBUG("def->os.cmdline %s", def->os.cmdline);
- DEBUG("def->os.root %s", def->os.root);
- DEBUG("def->os.loader %s", def->os.loader);
- DEBUG("def->os.bootloader %s", def->os.bootloader);
- DEBUG("def->os.bootloaderArgs %s", def->os.bootloaderArgs);
+ VIR_DEBUG("def->os.type %s", def->os.type);
+ VIR_DEBUG("def->os.arch %s", def->os.arch);
+ VIR_DEBUG("def->os.machine %s", def->os.machine);
+ VIR_DEBUG("def->os.nBootDevs %d", def->os.nBootDevs);
+ VIR_DEBUG("def->os.bootDevs[0] %d", def->os.bootDevs[0]);
+ VIR_DEBUG("def->os.bootDevs[1] %d", def->os.bootDevs[1]);
+ VIR_DEBUG("def->os.bootDevs[2] %d", def->os.bootDevs[2]);
+ VIR_DEBUG("def->os.bootDevs[3] %d", def->os.bootDevs[3]);
+ VIR_DEBUG("def->os.init %s", def->os.init);
+ VIR_DEBUG("def->os.kernel %s", def->os.kernel);
+ VIR_DEBUG("def->os.initrd %s", def->os.initrd);
+ VIR_DEBUG("def->os.cmdline %s", def->os.cmdline);
+ VIR_DEBUG("def->os.root %s", def->os.root);
+ VIR_DEBUG("def->os.loader %s", def->os.loader);
+ VIR_DEBUG("def->os.bootloader %s", def->os.bootloader);
+ VIR_DEBUG("def->os.bootloaderArgs %s", def->os.bootloaderArgs);
data->vboxObj->vtbl->GetSystemProperties(data->vboxObj, &systemProperties);
if (systemProperties) {
return;
for (i = 0; i < def->ndisks; i++) {
- DEBUG("disk(%d) type: %d", i, def->disks[i]->type);
- DEBUG("disk(%d) device: %d", i, def->disks[i]->device);
- DEBUG("disk(%d) bus: %d", i, def->disks[i]->bus);
- DEBUG("disk(%d) src: %s", i, def->disks[i]->src);
- DEBUG("disk(%d) dst: %s", i, def->disks[i]->dst);
- DEBUG("disk(%d) driverName: %s", i, def->disks[i]->driverName);
- DEBUG("disk(%d) driverType: %s", i, def->disks[i]->driverType);
- DEBUG("disk(%d) cachemode: %d", i, def->disks[i]->cachemode);
- DEBUG("disk(%d) readonly: %s", i, (def->disks[i]->readonly
+ VIR_DEBUG("disk(%d) type: %d", i, def->disks[i]->type);
+ VIR_DEBUG("disk(%d) device: %d", i, def->disks[i]->device);
+ VIR_DEBUG("disk(%d) bus: %d", i, def->disks[i]->bus);
+ VIR_DEBUG("disk(%d) src: %s", i, def->disks[i]->src);
+ VIR_DEBUG("disk(%d) dst: %s", i, def->disks[i]->dst);
+ VIR_DEBUG("disk(%d) driverName: %s", i, def->disks[i]->driverName);
+ VIR_DEBUG("disk(%d) driverType: %s", i, def->disks[i]->driverType);
+ VIR_DEBUG("disk(%d) cachemode: %d", i, def->disks[i]->cachemode);
+ VIR_DEBUG("disk(%d) readonly: %s", i, (def->disks[i]->readonly
? "True" : "False"));
- DEBUG("disk(%d) shared: %s", i, (def->disks[i]->shared
+ VIR_DEBUG("disk(%d) shared: %s", i, (def->disks[i]->shared
? "True" : "False"));
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
if (def->disks[i]->readonly) {
hardDisk->vtbl->SetType(hardDisk,
HardDiskType_Immutable);
- DEBUG0("setting harddisk to readonly");
+ VIR_DEBUG0("setting harddisk to readonly");
} else if (!def->disks[i]->readonly) {
hardDisk->vtbl->SetType(hardDisk,
HardDiskType_Normal);
- DEBUG0("setting harddisk type to normal");
+ VIR_DEBUG0("setting harddisk type to normal");
}
if (def->disks[i]->bus == VIR_DOMAIN_DISK_BUS_IDE) {
if (STREQ(def->disks[i]->dst, "hdc")) {
- DEBUG0("Not connecting harddisk to hdc as hdc"
+ VIR_DEBUG0("Not connecting harddisk to hdc as hdc"
" is taken by CD/DVD Drive");
} else {
PRInt32 channel = 0;
}
for (i = 0; i < def->ndisks && !error; i++) {
- DEBUG("disk(%d) type: %d", i, def->disks[i]->type);
- DEBUG("disk(%d) device: %d", i, def->disks[i]->device);
- DEBUG("disk(%d) bus: %d", i, def->disks[i]->bus);
- DEBUG("disk(%d) src: %s", i, def->disks[i]->src);
- DEBUG("disk(%d) dst: %s", i, def->disks[i]->dst);
- DEBUG("disk(%d) driverName: %s", i, def->disks[i]->driverName);
- DEBUG("disk(%d) driverType: %s", i, def->disks[i]->driverType);
- DEBUG("disk(%d) cachemode: %d", i, def->disks[i]->cachemode);
- DEBUG("disk(%d) readonly: %s", i, (def->disks[i]->readonly
+ VIR_DEBUG("disk(%d) type: %d", i, def->disks[i]->type);
+ VIR_DEBUG("disk(%d) device: %d", i, def->disks[i]->device);
+ VIR_DEBUG("disk(%d) bus: %d", i, def->disks[i]->bus);
+ VIR_DEBUG("disk(%d) src: %s", i, def->disks[i]->src);
+ VIR_DEBUG("disk(%d) dst: %s", i, def->disks[i]->dst);
+ VIR_DEBUG("disk(%d) driverName: %s", i, def->disks[i]->driverName);
+ VIR_DEBUG("disk(%d) driverType: %s", i, def->disks[i]->driverType);
+ VIR_DEBUG("disk(%d) cachemode: %d", i, def->disks[i]->cachemode);
+ VIR_DEBUG("disk(%d) readonly: %s", i, (def->disks[i]->readonly
? "True" : "False"));
- DEBUG("disk(%d) shared: %s", i, (def->disks[i]->shared
+ VIR_DEBUG("disk(%d) shared: %s", i, (def->disks[i]->shared
? "True" : "False"));
if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE &&
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
if (def->disks[i]->readonly) {
medium->vtbl->SetType(medium, MediumType_Immutable);
- DEBUG0("setting harddisk to immutable");
+ VIR_DEBUG0("setting harddisk to immutable");
} else if (!def->disks[i]->readonly) {
medium->vtbl->SetType(medium, MediumType_Normal);
- DEBUG0("setting harddisk type to normal");
+ VIR_DEBUG0("setting harddisk type to normal");
}
}
systemProperties = NULL;
}
- DEBUG("Number of Network Cards to be connected: %d", def->nnets);
- DEBUG("Number of Network Cards available: %d", networkAdapterCount);
+ VIR_DEBUG("Number of Network Cards to be connected: %d", def->nnets);
+ VIR_DEBUG("Number of Network Cards available: %d", networkAdapterCount);
for (i = 0; (i < def->nnets) && (i < networkAdapterCount); i++) {
INetworkAdapter *adapter = NULL;
def->nets[i]->mac[5]);
macaddrvbox[VIR_MAC_STRING_BUFLEN - 6] = '\0';
- DEBUG("NIC(%d): Type: %d", i, def->nets[i]->type);
- DEBUG("NIC(%d): Model: %s", i, def->nets[i]->model);
- DEBUG("NIC(%d): Mac: %s", i, macaddr);
- DEBUG("NIC(%d): ifname: %s", i, def->nets[i]->ifname);
+ VIR_DEBUG("NIC(%d): Type: %d", i, def->nets[i]->type);
+ VIR_DEBUG("NIC(%d): Model: %s", i, def->nets[i]->model);
+ VIR_DEBUG("NIC(%d): Mac: %s", i, macaddr);
+ VIR_DEBUG("NIC(%d): ifname: %s", i, def->nets[i]->ifname);
if (def->nets[i]->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
- DEBUG("NIC(%d): name: %s", i, def->nets[i]->data.network.name);
+ VIR_DEBUG("NIC(%d): name: %s", i, def->nets[i]->data.network.name);
} else if (def->nets[i]->type == VIR_DOMAIN_NET_TYPE_INTERNAL) {
- DEBUG("NIC(%d): name: %s", i, def->nets[i]->data.internal.name);
+ VIR_DEBUG("NIC(%d): name: %s", i, def->nets[i]->data.internal.name);
} else if (def->nets[i]->type == VIR_DOMAIN_NET_TYPE_USER) {
- DEBUG("NIC(%d): NAT.", i);
+ VIR_DEBUG("NIC(%d): NAT.", i);
} else if (def->nets[i]->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
- DEBUG("NIC(%d): brname: %s", i, def->nets[i]->data.bridge.brname);
- DEBUG("NIC(%d): script: %s", i, def->nets[i]->data.bridge.script);
- DEBUG("NIC(%d): ipaddr: %s", i, def->nets[i]->data.bridge.ipaddr);
+ VIR_DEBUG("NIC(%d): brname: %s", i, def->nets[i]->data.bridge.brname);
+ VIR_DEBUG("NIC(%d): script: %s", i, def->nets[i]->data.bridge.script);
+ VIR_DEBUG("NIC(%d): ipaddr: %s", i, def->nets[i]->data.bridge.ipaddr);
}
machine->vtbl->GetNetworkAdapter(machine, i, &adapter);
systemProperties = NULL;
}
- DEBUG("Number of Serial Ports to be connected: %d", def->nserials);
- DEBUG("Number of Serial Ports available: %d", serialPortCount);
+ VIR_DEBUG("Number of Serial Ports to be connected: %d", def->nserials);
+ VIR_DEBUG("Number of Serial Ports available: %d", serialPortCount);
for (i = 0; (i < def->nserials) && (i < serialPortCount); i++) {
ISerialPort *serialPort = NULL;
- DEBUG("SerialPort(%d): Type: %d", i, def->serials[i]->source.type);
- DEBUG("SerialPort(%d): target.port: %d", i,
+ VIR_DEBUG("SerialPort(%d): Type: %d", i, def->serials[i]->source.type);
+ VIR_DEBUG("SerialPort(%d): target.port: %d", i,
def->serials[i]->target.port);
machine->vtbl->GetSerialPort(machine, i, &serialPort);
if (def->serials[i]->target.port == 0) {
serialPort->vtbl->SetIRQ(serialPort, 4);
serialPort->vtbl->SetIOBase(serialPort, 1016);
- DEBUG(" serialPort-%d irq: %d, iobase 0x%x, path: %s",
+ VIR_DEBUG(" serialPort-%d irq: %d, iobase 0x%x, path: %s",
i, 4, 1016, def->serials[i]->source.data.file.path);
} else if (def->serials[i]->target.port == 1) {
serialPort->vtbl->SetIRQ(serialPort, 3);
serialPort->vtbl->SetIOBase(serialPort, 760);
- DEBUG(" serialPort-%d irq: %d, iobase 0x%x, path: %s",
+ VIR_DEBUG(" serialPort-%d irq: %d, iobase 0x%x, path: %s",
i, 3, 760, def->serials[i]->source.data.file.path);
}
systemProperties = NULL;
}
- DEBUG("Number of Parallel Ports to be connected: %d", def->nparallels);
- DEBUG("Number of Parallel Ports available: %d", parallelPortCount);
+ VIR_DEBUG("Number of Parallel Ports to be connected: %d", def->nparallels);
+ VIR_DEBUG("Number of Parallel Ports available: %d", parallelPortCount);
for (i = 0; (i < def->nparallels) && (i < parallelPortCount); i++) {
IParallelPort *parallelPort = NULL;
- DEBUG("ParallelPort(%d): Type: %d", i, def->parallels[i]->source.type);
- DEBUG("ParallelPort(%d): target.port: %d", i,
+ VIR_DEBUG("ParallelPort(%d): Type: %d", i, def->parallels[i]->source.type);
+ VIR_DEBUG("ParallelPort(%d): target.port: %d", i,
def->parallels[i]->target.port);
machine->vtbl->GetParallelPort(machine, i, ¶llelPort);
if (i == 0) {
parallelPort->vtbl->SetIRQ(parallelPort, 7);
parallelPort->vtbl->SetIOBase(parallelPort, 888);
- DEBUG(" parallePort-%d irq: %d, iobase 0x%x, path: %s",
+ VIR_DEBUG(" parallePort-%d irq: %d, iobase 0x%x, path: %s",
i, 7, 888, def->parallels[i]->source.data.file.path);
} else if (i == 1) {
parallelPort->vtbl->SetIRQ(parallelPort, 5);
parallelPort->vtbl->SetIOBase(parallelPort, 632);
- DEBUG(" parallePort-%d irq: %d, iobase 0x%x, path: %s",
+ VIR_DEBUG(" parallePort-%d irq: %d, iobase 0x%x, path: %s",
i, 5, 632, def->parallels[i]->source.data.file.path);
}
}
#endif /* VBOX_API_VERSION >= 4000 */
if (VRDxServer) {
VRDxServer->vtbl->SetEnabled(VRDxServer, PR_TRUE);
- DEBUG0("VRDP Support turned ON.");
+ VIR_DEBUG0("VRDP Support turned ON.");
#if VBOX_API_VERSION < 3001
if (def->graphics[i]->data.rdp.port) {
VRDxServer->vtbl->SetPort(VRDxServer,
def->graphics[i]->data.rdp.port);
- DEBUG("VRDP Port changed to: %d",
+ VIR_DEBUG("VRDP Port changed to: %d",
def->graphics[i]->data.rdp.port);
} else if (def->graphics[i]->data.rdp.autoport) {
/* Setting the port to 0 will reset its value to
* the default one which is 3389 currently
*/
VRDxServer->vtbl->SetPort(VRDxServer, 0);
- DEBUG0("VRDP Port changed to default, which is 3389 currently");
+ VIR_DEBUG0("VRDP Port changed to default, which is 3389 currently");
}
#elif VBOX_API_VERSION < 4000 /* 3001 <= VBOX_API_VERSION < 4000 */
PRUnichar *portUtf16 = NULL;
if (def->graphics[i]->data.rdp.replaceUser) {
VRDxServer->vtbl->SetReuseSingleConnection(VRDxServer,
PR_TRUE);
- DEBUG0("VRDP set to reuse single connection");
+ VIR_DEBUG0("VRDP set to reuse single connection");
}
if (def->graphics[i]->data.rdp.multiUser) {
VRDxServer->vtbl->SetAllowMultiConnection(VRDxServer,
PR_TRUE);
- DEBUG0("VRDP set to allow multiple connection");
+ VIR_DEBUG0("VRDP set to allow multiple connection");
}
if (def->graphics[i]->data.rdp.listenAddr) {
netAddressUtf16);
VBOX_UTF16_FREE(netAddressKey);
#endif /* VBOX_API_VERSION >= 4000 */
- DEBUG("VRDP listen address is set to: %s",
+ VIR_DEBUG("VRDP listen address is set to: %s",
def->graphics[i]->data.rdp.listenAddr);
VBOX_UTF16_FREE(netAddressUtf16);
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
if (def->hostdevs[i]->source.subsys.u.usb.vendor ||
def->hostdevs[i]->source.subsys.u.usb.product) {
- DEBUG("USB Device detected, VendorId:0x%x, ProductId:0x%x",
+ VIR_DEBUG("USB Device detected, VendorId:0x%x, ProductId:0x%x",
def->hostdevs[i]->source.subsys.u.usb.vendor,
def->hostdevs[i]->source.subsys.u.usb.product);
isUSB = true;
g_pVBoxGlobalData->domainEventDispatching = 1;
vboxDriverLock(g_pVBoxGlobalData);
- DEBUG("IVirtualBoxCallback: %p, State: %d", pThis, state);
+ VIR_DEBUG("IVirtualBoxCallback: %p, State: %d", pThis, state);
DEBUGPRUnichar("machineId", machineId);
if (machineId) {
vboxCallbackOnMachineDataChange(IVirtualBoxCallback *pThis,
PRUnichar *machineId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
return NS_OK;
PRUnichar **error ATTRIBUTE_UNUSED,
PRBool *allowChange)
{
- DEBUG("IVirtualBoxCallback: %p, allowChange: %s", pThis, *allowChange ? "true" : "false");
+ VIR_DEBUG("IVirtualBoxCallback: %p, allowChange: %s", pThis, *allowChange ? "true" : "false");
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("key", key);
DEBUGPRUnichar("value", value);
vboxCallbackOnExtraDataChange(IVirtualBoxCallback *pThis, PRUnichar *machineId,
PRUnichar *key, PRUnichar *value)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("key", key);
DEBUGPRUnichar("value", value);
vboxCallbackOnMediaRegistered(IVirtualBoxCallback *pThis, PRUnichar *mediaId,
PRUint32 mediaType, PRBool registered)
{
- DEBUG("IVirtualBoxCallback: %p, registered: %s", pThis, registered ? "true" : "false");
- DEBUG("mediaType: %d", mediaType);
+ VIR_DEBUG("IVirtualBoxCallback: %p, registered: %s", pThis, registered ? "true" : "false");
+ VIR_DEBUG("mediaType: %d", mediaType);
DEBUGPRUnichar("mediaId", mediaId);
return NS_OK;
g_pVBoxGlobalData->domainEventDispatching = 1;
vboxDriverLock(g_pVBoxGlobalData);
- DEBUG("IVirtualBoxCallback: %p, registered: %s", pThis, registered ? "true" : "false");
+ VIR_DEBUG("IVirtualBoxCallback: %p, registered: %s", pThis, registered ? "true" : "false");
DEBUGPRUnichar("machineId", machineId);
if (machineId) {
vboxCallbackOnSessionStateChange(IVirtualBoxCallback *pThis,
PRUnichar *machineId, PRUint32 state)
{
- DEBUG("IVirtualBoxCallback: %p, state: %d", pThis, state);
+ VIR_DEBUG("IVirtualBoxCallback: %p, state: %d", pThis, state);
DEBUGPRUnichar("machineId", machineId);
return NS_OK;
vboxCallbackOnSnapshotTaken(IVirtualBoxCallback *pThis, PRUnichar *machineId,
PRUnichar *snapshotId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("snapshotId", snapshotId);
vboxCallbackOnSnapshotDiscarded(IVirtualBoxCallback *pThis, PRUnichar *machineId,
PRUnichar *snapshotId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("snapshotId", snapshotId);
vboxCallbackOnSnapshotChange(IVirtualBoxCallback *pThis, PRUnichar *machineId,
PRUnichar *snapshotId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("snapshotId", snapshotId);
PRUnichar *machineId, PRUnichar *name,
PRUnichar *value, PRUnichar *flags)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("name", name);
DEBUGPRUnichar("value", value);
c = ++g_pVBoxGlobalData->vboxCallBackRefCount;
- DEBUG("pThis: %p, vboxCallback AddRef: %d", pThis, c);
+ VIR_DEBUG("pThis: %p, vboxCallback AddRef: %d", pThis, c);
return c;
}
VIR_FREE(pThis);
}
- DEBUG("pThis: %p, vboxCallback Release: %d", pThis, c);
+ VIR_DEBUG("pThis: %p, vboxCallback Release: %d", pThis, c);
return c;
}
g_pVBoxGlobalData->vboxCallBackRefCount++;
*resultp = that;
- DEBUG("pThis: %p, vboxCallback QueryInterface: %d", pThis, g_pVBoxGlobalData->vboxCallBackRefCount);
+ VIR_DEBUG("pThis: %p, vboxCallback QueryInterface: %d", pThis, g_pVBoxGlobalData->vboxCallBackRefCount);
return NS_OK;
}
- DEBUG("pThis: %p, vboxCallback QueryInterface didn't find a matching interface", pThis);
+ VIR_DEBUG("pThis: %p, vboxCallback QueryInterface didn't find a matching interface", pThis);
DEBUGUUID("The UUID Callback Interface expects", iid);
DEBUGUUID("The UUID Callback Interface got", &ivirtualboxCallbackUUID);
return NS_NOINTERFACE;
ret = virDomainEventCallbackListAdd(conn, data->domainEventCallbacks,
callback, opaque, freecb);
- DEBUG("virDomainEventCallbackListAdd (ret = %d) ( conn: %p, "
+ VIR_DEBUG("virDomainEventCallbackListAdd (ret = %d) ( conn: %p, "
"data->domainEventCallbacks: %p, callback: %p, opaque: %p, "
"freecb: %p )", ret, conn, data->domainEventCallbacks, callback,
opaque, freecb);
ret = virDomainEventCallbackListAddID(conn, data->domainEventCallbacks,
dom, eventID,
callback, opaque, freecb);
- DEBUG("virDomainEventCallbackListAddID (ret = %d) ( conn: %p, "
+ VIR_DEBUG("virDomainEventCallbackListAddID (ret = %d) ( conn: %p, "
"data->domainEventCallbacks: %p, callback: %p, opaque: %p, "
"freecb: %p )", ret, conn, data->domainEventCallbacks, callback,
opaque, freecb);
(data->vboxSession == NULL))
goto cleanup;
- DEBUG0("network initialized");
+ VIR_DEBUG0("network initialized");
/* conn->networkPrivateData = some network specific data */
return VIR_DRV_OPEN_SUCCESS;
}
static int vboxNetworkClose(virConnectPtr conn) {
- DEBUG0("network uninitialized");
+ VIR_DEBUG0("network uninitialized");
conn->networkPrivateData = NULL;
return 0;
}
VBOX_RELEASE(host);
- DEBUG("numActive: %d", ret);
+ VIR_DEBUG("numActive: %d", ret);
return ret;
}
networkInterface->vtbl->GetName(networkInterface, &nameUtf16);
VBOX_UTF16_TO_UTF8(nameUtf16, &nameUtf8);
- DEBUG("nnames[%d]: %s", ret, nameUtf8);
+ VIR_DEBUG("nnames[%d]: %s", ret, nameUtf8);
names[ret] = strdup(nameUtf8);
if (names[ret] == NULL) {
virReportOOMError();
VBOX_RELEASE(host);
- DEBUG("numActive: %d", ret);
+ VIR_DEBUG("numActive: %d", ret);
return ret;
}
networkInterface->vtbl->GetName(networkInterface, &nameUtf16);
VBOX_UTF16_TO_UTF8(nameUtf16, &nameUtf8);
- DEBUG("nnames[%d]: %s", ret, nameUtf8);
+ VIR_DEBUG("nnames[%d]: %s", ret, nameUtf8);
names[ret] = strdup(nameUtf8);
if (names[ret] == NULL) {
virReportOOMError();
ret = virGetNetwork(conn, nameUtf8, uuid);
- DEBUG("Network Name: %s", nameUtf8);
+ VIR_DEBUG("Network Name: %s", nameUtf8);
DEBUGIID("Network UUID", iid.value);
VBOX_UTF8_FREE(nameUtf8);
networkInterface->vtbl->GetId(networkInterface, &iid.value);
vboxIIDToUUID(&iid, uuid);
ret = virGetNetwork(conn, name, uuid);
- DEBUG("Network Name: %s", name);
+ VIR_DEBUG("Network Name: %s", name);
DEBUGIID("Network UUID", iid.value);
vboxIIDUnalloc(&iid);
data->vboxObj->vtbl->CreateDHCPServer(data->vboxObj,
networkNameUtf16,
&dhcpServer);
- DEBUG0("couldn't find dhcp server so creating one");
+ VIR_DEBUG0("couldn't find dhcp server so creating one");
}
if (dhcpServer) {
PRUnichar *ipAddressUtf16 = NULL;
(data->vboxSession == NULL))
goto cleanup;
- DEBUG0("vbox storage initialized");
+ VIR_DEBUG0("vbox storage initialized");
/* conn->storagePrivateData = some storage specific data */
return VIR_DRV_OPEN_SUCCESS;
}
static int vboxStorageClose (virConnectPtr conn) {
- DEBUG0("vbox storage uninitialized");
+ VIR_DEBUG0("vbox storage uninitialized");
conn->storagePrivateData = NULL;
return 0;
}
VBOX_UTF16_FREE(nameUtf16);
if (nameUtf8) {
- DEBUG("nnames[%d]: %s", numActive, nameUtf8);
+ VIR_DEBUG("nnames[%d]: %s", numActive, nameUtf8);
names[numActive] = strdup(nameUtf8);
if (names[numActive] == NULL) {
virReportOOMError();
ret = virGetStorageVol(pool->conn, pool->name, name, key);
- DEBUG("virStorageVolPtr: %p", ret);
- DEBUG("Storage Volume Name: %s", name);
- DEBUG("Storage Volume key : %s", key);
- DEBUG("Storage Volume Pool: %s", pool->name);
+ VIR_DEBUG("virStorageVolPtr: %p", ret);
+ VIR_DEBUG("Storage Volume Name: %s", name);
+ VIR_DEBUG("Storage Volume key : %s", key);
+ VIR_DEBUG("Storage Volume Pool: %s", pool->name);
}
vboxIIDUnalloc(&hddIID);
if (hddNameUtf8) {
if (vboxStorageNumOfPools(conn) == 1) {
ret = virGetStorageVol(conn, "default-pool", hddNameUtf8, key);
- DEBUG("Storage Volume Pool: %s", "default-pool");
+ VIR_DEBUG("Storage Volume Pool: %s", "default-pool");
} else {
/* TODO: currently only one default pool and thus
* nothing here, change it when pools are supported
*/
}
- DEBUG("Storage Volume Name: %s", key);
- DEBUG("Storage Volume key : %s", hddNameUtf8);
+ VIR_DEBUG("Storage Volume Name: %s", key);
+ VIR_DEBUG("Storage Volume key : %s", hddNameUtf8);
VBOX_UTF8_FREE(hddNameUtf8);
VBOX_UTF16_FREE(hddNameUtf16);
if (vboxStorageNumOfPools(conn) == 1)
ret = virGetStorageVol(conn, "default-pool", hddNameUtf8, key);
- DEBUG("Storage Volume Pool: %s", "default-pool");
- DEBUG("Storage Volume Name: %s", hddNameUtf8);
- DEBUG("Storage Volume key : %s", key);
+ VIR_DEBUG("Storage Volume Pool: %s", "default-pool");
+ VIR_DEBUG("Storage Volume Name: %s", hddNameUtf8);
+ VIR_DEBUG("Storage Volume key : %s", key);
}
vboxIIDUnalloc(&hddIID);
#endif /* VBOX_API_VERSION >= 3001 */
if (NS_SUCCEEDED(rc)) {
rc = machine->vtbl->SaveSettings(machine);
- DEBUG0("saving machine settings");
+ VIR_DEBUG0("saving machine settings");
}
if (NS_SUCCEEDED(rc)) {
deregister++;
- DEBUG("deregistering hdd:%d", deregister);
+ VIR_DEBUG("deregistering hdd:%d", deregister);
}
if (controller)
ret = 0;
- DEBUG("Storage Volume Name: %s", vol->name);
- DEBUG("Storage Volume Type: %s", info->type == VIR_STORAGE_VOL_BLOCK ? "Block" : "File");
- DEBUG("Storage Volume Capacity: %llu", info->capacity);
- DEBUG("Storage Volume Allocation: %llu", info->allocation);
+ VIR_DEBUG("Storage Volume Name: %s", vol->name);
+ VIR_DEBUG("Storage Volume Type: %s", info->type == VIR_STORAGE_VOL_BLOCK ? "Block" : "File");
+ VIR_DEBUG("Storage Volume Capacity: %llu", info->capacity);
+ VIR_DEBUG("Storage Volume Allocation: %llu", info->allocation);
}
VBOX_MEDIUM_RELEASE(hardDisk);
VBOX_UTF16_TO_UTF8(hddFormatUtf16, &hddFormatUtf8);
if (hddFormatUtf8) {
- DEBUG("Storage Volume Format: %s", hddFormatUtf8);
+ VIR_DEBUG("Storage Volume Format: %s", hddFormatUtf8);
if (STRCASEEQ("vmdk", hddFormatUtf8))
def.target.format = VIR_STORAGE_FILE_VMDK;
if (!ret)
virReportOOMError();
- DEBUG("Storage Volume Name: %s", vol->name);
- DEBUG("Storage Volume Path: %s", hddLocationUtf8);
- DEBUG("Storage Volume Pool: %s", vol->pool);
+ VIR_DEBUG("Storage Volume Name: %s", vol->name);
+ VIR_DEBUG("Storage Volume Path: %s", hddLocationUtf8);
+ VIR_DEBUG("Storage Volume Pool: %s", vol->pool);
VBOX_UTF8_FREE(hddLocationUtf8);
}
/* Hypervisor is only run with privilege & required to succeed */
if (xenHavePrivilege()) {
- DEBUG0("Trying hypervisor sub-driver");
+ VIR_DEBUG0("Trying hypervisor sub-driver");
if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
- DEBUG0("Activated hypervisor sub-driver");
+ VIR_DEBUG0("Activated hypervisor sub-driver");
priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
}
}
/* XenD is required to succeed if privileged */
- DEBUG0("Trying XenD sub-driver");
+ VIR_DEBUG0("Trying XenD sub-driver");
if (drivers[XEN_UNIFIED_XEND_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
- DEBUG0("Activated XenD sub-driver");
+ VIR_DEBUG0("Activated XenD sub-driver");
priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
/* XenD is active, so try the xm & xs drivers too, both requird to
* succeed if root, optional otherwise */
if (priv->xendConfigVersion <= 2) {
- DEBUG0("Trying XM sub-driver");
+ VIR_DEBUG0("Trying XM sub-driver");
if (drivers[XEN_UNIFIED_XM_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
- DEBUG0("Activated XM sub-driver");
+ VIR_DEBUG0("Activated XM sub-driver");
priv->opened[XEN_UNIFIED_XM_OFFSET] = 1;
}
}
- DEBUG0("Trying XS sub-driver");
+ VIR_DEBUG0("Trying XS sub-driver");
if (drivers[XEN_UNIFIED_XS_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
- DEBUG0("Activated XS sub-driver");
+ VIR_DEBUG0("Activated XS sub-driver");
priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
} else {
if (xenHavePrivilege())
if (xenHavePrivilege()) {
goto fail; /* XenD is mandatory when privileged */
} else {
- DEBUG0("Handing off for remote driver");
+ VIR_DEBUG0("Handing off for remote driver");
ret = VIR_DRV_OPEN_DECLINED; /* Let remote_driver try instead */
goto clean;
}
xenNumaInit(conn);
if (!(priv->caps = xenHypervisorMakeCapabilities(conn))) {
- DEBUG0("Failed to make capabilities");
+ VIR_DEBUG0("Failed to make capabilities");
goto fail;
}
#if WITH_XEN_INOTIFY
if (xenHavePrivilege()) {
- DEBUG0("Trying Xen inotify sub-driver");
+ VIR_DEBUG0("Trying Xen inotify sub-driver");
if (drivers[XEN_UNIFIED_INOTIFY_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
- DEBUG0("Activated Xen inotify sub-driver");
+ VIR_DEBUG0("Activated Xen inotify sub-driver");
priv->opened[XEN_UNIFIED_INOTIFY_OFFSET] = 1;
}
}
fail:
ret = VIR_DRV_OPEN_ERROR;
clean:
- DEBUG0("Failed to activate a mandatory sub-driver");
+ VIR_DEBUG0("Failed to activate a mandatory sub-driver");
for (i = 0 ; i < XEN_UNIFIED_NR_DRIVERS ; i++)
if (priv->opened[i]) drivers[i]->close(conn);
virMutexDestroy(&priv->lock);
for (n=0; n < list->count; n++) {
if (STREQ(list->doms[n]->name, name) &&
!memcmp(list->doms[n]->uuid, uuid, VIR_UUID_BUFLEN)) {
- DEBUG0("WARNING: dom already tracked");
+ VIR_DEBUG0("WARNING: dom already tracked");
return -1;
}
}
ret = ioctl(fd, cmd, (unsigned long) &hc);
if ((ret != -1) && (ret != 0)) {
- DEBUG("Using new hypervisor call: %X", ret);
+ VIR_DEBUG("Using new hypervisor call: %X", ret);
hv_version = ret;
xen_ioctl_hypercall_cmd = cmd;
goto detect_v2;
cmd = _IOC(_IOC_NONE, 'P', 0, sizeof(v0_hypercall_t));
ret = ioctl(fd, cmd, (unsigned long) &v0_hc);
if ((ret != -1) && (ret != 0)) {
- DEBUG("Using old hypervisor call: %X", ret);
+ VIR_DEBUG("Using old hypervisor call: %X", ret);
hv_version = ret;
xen_ioctl_hypercall_cmd = cmd;
hypervisor_version = 0;
/* RHEL 5.0 */
dom_interface_version = 3; /* XEN_DOMCTL_INTERFACE_VERSION */
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
- DEBUG0("Using hypervisor call v2, sys ver2 dom ver3");
+ VIR_DEBUG0("Using hypervisor call v2, sys ver2 dom ver3");
goto done;
}
/* Fedora 7 */
dom_interface_version = 4; /* XEN_DOMCTL_INTERFACE_VERSION */
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
- DEBUG0("Using hypervisor call v2, sys ver2 dom ver4");
+ VIR_DEBUG0("Using hypervisor call v2, sys ver2 dom ver4");
goto done;
}
}
/* xen-3.1 */
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
- DEBUG0("Using hypervisor call v2, sys ver3 dom ver5");
+ VIR_DEBUG0("Using hypervisor call v2, sys ver3 dom ver5");
goto done;
}
}
/* Fedora 8 */
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
- DEBUG0("Using hypervisor call v2, sys ver4 dom ver5");
+ VIR_DEBUG0("Using hypervisor call v2, sys ver4 dom ver5");
goto done;
}
}
/* Xen 3.2, Fedora 9 */
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
- DEBUG0("Using hypervisor call v2, sys ver6 dom ver5");
+ VIR_DEBUG0("Using hypervisor call v2, sys ver6 dom ver5");
goto done;
}
}
sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */
- DEBUG0("Using hypervisor call v2, sys ver7 dom ver6");
+ VIR_DEBUG0("Using hypervisor call v2, sys ver7 dom ver6");
goto done;
}
hypervisor_version = 1;
sys_interface_version = -1;
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
- DEBUG0("Using hypervisor call v1");
+ VIR_DEBUG0("Using hypervisor call v1");
goto done;
}
* we failed to make the getdomaininfolist hypercall
*/
- DEBUG0("Failed to find any Xen hypervisor method");
+ VIR_DEBUG0("Failed to find any Xen hypervisor method");
hypervisor_version = -1;
virXenError(VIR_ERR_XEN_CALL, " ioctl %lu",
(unsigned long)IOCTL_PRIVCMD_HYPERCALL);
xenXMConfCachePtr entry;
if (!(entry = virHashLookup(priv->configCache, filename))) {
- DEBUG("No config found for %s", filename);
+ VIR_DEBUG("No config found for %s", filename);
return -1;
}
memcpy(uuid, entry->def->uuid, VIR_UUID_BUFLEN);
if (!*name) {
- DEBUG0("Error getting dom from def");
+ VIR_DEBUG0("Error getting dom from def");
virReportOOMError();
return -1;
}
/* call directly into xend here, as driver may not yet
be set during open while we are building our
initial list of domains */
- DEBUG("Looking for dom with uuid: %s", uuid_str);
+ VIR_DEBUG("Looking for dom with uuid: %s", uuid_str);
/* XXX Should not have to go via a virDomainPtr obj instance */
if(!(dom = xenDaemonLookupByUUID(conn, rawuuid))) {
/* If we are here, the domain has gone away.
return -1;
}
memcpy(uuid, priv->configInfoList->doms[i]->uuid, VIR_UUID_BUFLEN);
- DEBUG0("Found dom on list");
+ VIR_DEBUG0("Found dom on list");
return 0;
}
}
virConnectPtr conn = data;
xenUnifiedPrivatePtr priv = NULL;
- DEBUG0("got inotify event");
+ VIR_DEBUG0("got inotify event");
if( conn && conn->privateData ) {
priv = conn->privateData;
return -1;
}
- DEBUG("Adding a watch on %s", priv->configDir);
+ VIR_DEBUG("Adding a watch on %s", priv->configDir);
if (inotify_add_watch(priv->inotifyFD,
priv->configDir,
IN_CREATE |
return -1;
}
- DEBUG0("Building initial config cache");
+ VIR_DEBUG0("Building initial config cache");
if (priv->useXenConfigCache &&
xenXMConfigCacheRefresh (conn) < 0) {
- DEBUG("Failed to enable XM config cache %s", conn->err.message);
+ VIR_DEBUG("Failed to enable XM config cache %s", conn->err.message);
return -1;
}
- DEBUG0("Registering with event loop");
+ VIR_DEBUG0("Registering with event loop");
/* Add the handle for monitoring */
if ((priv->inotifyWatch = virEventAddHandle(priv->inotifyFD, VIR_EVENT_HANDLE_READABLE,
xenInotifyEvent, conn, NULL)) < 0) {
- DEBUG0("Failed to add inotify handle, disabling events");
+ VIR_DEBUG0("Failed to add inotify handle, disabling events");
}
return 0;
}
content = virBufferContentAndReset(&buf);
- DEBUG("xend op: %s\n", content);
+ VIR_DEBUG("xend op: %s\n", content);
ret = http2unix(xend_post(xend, path, content));
VIR_FREE(content);
}
}
- DEBUG("hostname = %s, port = %s", hostname, port);
+ VIR_DEBUG("hostname = %s, port = %s", hostname, port);
/* Make the call.
* NB: xend will fail the operation if any parameters are
if (ret == 0 && undefined_source)
xenDaemonDomainUndefine (domain);
- DEBUG0("migration done");
+ VIR_DEBUG0("migration done");
return ret;
}
char *bufout;
int hvm = 0, i;
- DEBUG0("Formatting domain sexpr");
+ VIR_DEBUG0("Formatting domain sexpr");
virBufferAddLit(&buf, "(vm ");
virBufferEscapeSexpr(&buf, "(name '%s')", def->name);
}
bufout = virBufferContentAndReset(&buf);
- DEBUG("Formatted sexpr: \n%s", bufout);
+ VIR_DEBUG("Formatted sexpr: \n%s", bufout);
return bufout;
error:
entry = virHashLookup(priv->configCache, filename);
if (!entry) {
- DEBUG("No config entry for %s", filename);
+ VIR_DEBUG("No config entry for %s", filename);
return 0;
}
virHashRemoveEntry(priv->nameConfigMap, entry->def->name, NULL);
virHashRemoveEntry(priv->configCache, filename, xenXMConfigFree);
- DEBUG("Removed %s %s", entry->def->name, filename);
+ VIR_DEBUG("Removed %s %s", entry->def->name, filename);
return 0;
}
int newborn = 0;
time_t now = time(NULL);
- DEBUG("Adding file %s", filename);
+ VIR_DEBUG("Adding file %s", filename);
/* Get modified time */
if ((stat(filename, &st) < 0)) {
/* Ignore zero length files, because inotify fires before
any content has actually been created */
if (st.st_size == 0) {
- DEBUG("Ignoring zero length file %s", filename);
+ VIR_DEBUG("Ignoring zero length file %s", filename);
return -1;
}
entry->refreshedAt = now;
if (!(entry->def = xenXMConfigReadFile(conn, entry->filename))) {
- DEBUG("Failed to read %s", entry->filename);
+ VIR_DEBUG("Failed to read %s", entry->filename);
if (!newborn)
virHashRemoveEntry(priv->configCache, filename, NULL);
VIR_FREE(entry);
VIR_FREE(entry);
}
}
- DEBUG("Added config %s %s", entry->def->name, filename);
+ VIR_DEBUG("Added config %s %s", entry->def->name, filename);
return 0;
}
xenStoreWatchEvent,
conn,
NULL)) < 0)
- DEBUG0("Failed to add event handle, disabling events");
+ VIR_DEBUG0("Failed to add event handle, disabling events");
return 0;
}
priv = (xenUnifiedPrivatePtr) conn->privateData;
if (xenStoreRemoveWatch(conn, "@introduceDomain", "introduceDomain") < 0) {
- DEBUG0("Warning, could not remove @introduceDomain watch");
+ VIR_DEBUG0("Warning, could not remove @introduceDomain watch");
/* not fatal */
}
if (xenStoreRemoveWatch(conn, "@releaseDomain", "releaseDomain") < 0) {
- DEBUG0("Warning, could not remove @releaseDomain watch");
+ VIR_DEBUG0("Warning, could not remove @releaseDomain watch");
/* not fatal */
}
list->watches[i]->path,
list->watches[i]->token))
{
- DEBUG0("WARNING: Could not remove watch");
+ VIR_DEBUG0("WARNING: Could not remove watch");
/* Not fatal, continue */
}
VIR_FREE(new_domids);
if (missing && retries--) {
- DEBUG0("Some domains were missing, trying again");
+ VIR_DEBUG0("Some domains were missing, trying again");
usleep(100 * 1000);
goto retry;
}
VIR_FREE(new_domids);
if (!removed && retries--) {
- DEBUG0("No domains removed, retrying");
+ VIR_DEBUG0("No domains removed, retrying");
usleep(100 * 1000);
goto retry;
}