Devel
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- 17 participants
- 40169 discussions
21 Feb '11
Done mechanically with:
$ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'
followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
with a single 'make syntax-check' fallout in the same file, and the
actual deletion in src/util/logging.h.
* src/util/logging.h (DEBUG, DEBUG0): Delete.
* daemon/libvirtd.h (qemudDebug): Likewise.
* global: Change remaining clients over to VIR_DEBUG counterpart.
---
Obviously a post-0.8.8 cleanup, but I might as well get feedback
on it now.
daemon/dispatch.c | 8 +-
daemon/event.c | 12 +-
daemon/libvirtd.c | 32 +-
daemon/libvirtd.h | 4 +-
daemon/mdns.c | 2 +-
daemon/remote.c | 2 +-
daemon/stream.c | 24 +-
.../0004-implement-the-public-APIs.patch | 4 +-
examples/domain-events/events-c/event-test.c | 28 +-
src/datatypes.c | 72 ++--
src/driver.c | 2 +-
src/libvirt-qemu.c | 2 +-
src/libvirt.c | 398 ++++++++++----------
src/lxc/lxc_container.c | 16 +-
src/lxc/lxc_controller.c | 2 +-
src/lxc/lxc_driver.c | 8 +-
src/lxc/veth.c | 10 +-
src/node_device/node_device_hal.c | 18 +-
src/qemu/qemu_driver.c | 44 ++--
src/qemu/qemu_monitor.c | 104 +++---
src/qemu/qemu_monitor_json.c | 2 +-
src/qemu/qemu_monitor_text.c | 18 +-
src/remote/remote_driver.c | 112 +++---
src/security/security_dac.c | 2 +-
src/storage/storage_backend_disk.c | 8 +-
src/test/test_driver.c | 2 +-
src/util/logging.h | 10 +-
src/util/util.c | 6 +-
src/vbox/vbox_driver.c | 16 +-
src/vbox/vbox_tmpl.c | 258 +++++++-------
src/xen/xen_driver.c | 28 +-
src/xen/xen_hypervisor.c | 20 +-
src/xen/xen_inotify.c | 20 +-
src/xen/xend_internal.c | 10 +-
src/xen/xm_internal.c | 12 +-
src/xen/xs_internal.c | 12 +-
36 files changed, 660 insertions(+), 668 deletions(-)
diff --git a/daemon/dispatch.c b/daemon/dispatch.c
index bf2ac73..3397a00 100644
--- a/daemon/dispatch.c
+++ b/daemon/dispatch.c
@@ -141,7 +141,7 @@ remoteSerializeError(struct qemud_client *client,
unsigned int len;
struct qemud_client_message *msg = NULL;
- DEBUG("prog=%d ver=%d proc=%d type=%d serial=%d, msg=%s",
+ VIR_DEBUG("prog=%d ver=%d proc=%d type=%d serial=%d, msg=%s",
program, version, procedure, type, serial,
rerr->message ? *rerr->message : "(none)");
@@ -372,7 +372,7 @@ remoteDispatchClientRequest(struct qemud_server *server,
remote_error rerr;
bool qemu_call;
- DEBUG("prog=%d ver=%d type=%d status=%d serial=%d proc=%d",
+ VIR_DEBUG("prog=%d ver=%d type=%d status=%d serial=%d proc=%d",
msg->hdr.prog, msg->hdr.vers, msg->hdr.type,
msg->hdr.status, msg->hdr.serial, msg->hdr.proc);
@@ -631,7 +631,7 @@ remoteSendStreamData(struct qemud_client *client,
struct qemud_client_message *msg;
XDR xdr;
- DEBUG("client=%p stream=%p data=%p len=%d", client, stream, data, len);
+ VIR_DEBUG("client=%p stream=%p data=%p len=%d", client, stream, data, len);
if (VIR_ALLOC(msg) < 0) {
return -1;
@@ -682,7 +682,7 @@ remoteSendStreamData(struct qemud_client *client,
xdr_destroy (&xdr);
- DEBUG("Total %d", msg->bufferOffset);
+ VIR_DEBUG("Total %d", msg->bufferOffset);
}
if (data)
msg->streamTX = 1;
diff --git a/daemon/event.c b/daemon/event.c
index 4c97fb9..1a31717 100644
--- a/daemon/event.c
+++ b/daemon/event.c
@@ -37,7 +37,7 @@
#include "util.h"
#include "ignore-value.h"
-#define EVENT_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
+#define EVENT_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
static int virEventInterruptLocked(void);
@@ -390,7 +390,7 @@ static int virEventDispatchTimeouts(void) {
int i;
/* Save this now - it may be changed during dispatch */
int ntimeouts = eventLoop.timeoutsCount;
- DEBUG("Dispatch %d", ntimeouts);
+ VIR_DEBUG("Dispatch %d", ntimeouts);
if (gettimeofday(&tv, NULL) < 0) {
return -1;
@@ -435,7 +435,7 @@ static int virEventDispatchTimeouts(void) {
*/
static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
int i, n;
- DEBUG("Dispatch %d", nfds);
+ VIR_DEBUG("Dispatch %d", nfds);
/* NB, use nfds not eventLoop.handlesCount, because new
* fds might be added on end of list, and they're not
@@ -449,7 +449,7 @@ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
if (i == eventLoop.handlesCount)
break;
- DEBUG("i=%d w=%d", i, eventLoop.handles[i].watch);
+ VIR_DEBUG("i=%d w=%d", i, eventLoop.handles[i].watch);
if (eventLoop.handles[i].deleted) {
EVENT_DEBUG("Skip deleted n=%d w=%d f=%d", i,
eventLoop.handles[i].watch, eventLoop.handles[i].fd);
@@ -480,7 +480,7 @@ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
static int virEventCleanupTimeouts(void) {
int i;
size_t gap;
- DEBUG("Cleanup %zu", eventLoop.timeoutsCount);
+ VIR_DEBUG("Cleanup %zu", eventLoop.timeoutsCount);
/* Remove deleted entries, shuffling down remaining
* entries as needed to form contiguous series
@@ -523,7 +523,7 @@ static int virEventCleanupTimeouts(void) {
static int virEventCleanupHandles(void) {
int i;
size_t gap;
- DEBUG("Cleanup %zu", eventLoop.handlesCount);
+ VIR_DEBUG("Cleanup %zu", eventLoop.handlesCount);
/* Remove deleted entries, shuffling down remaining
* entries as needed to form contiguous series
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index f4b3327..b2e5e20 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1,7 +1,7 @@
/*
* libvirtd.c: daemon start of day, guest process & i/o management
*
- * Copyright (C) 2006-2010 Red Hat, Inc.
+ * Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -310,7 +310,7 @@ remoteInitializeGnuTLS (void)
if (remoteCheckCertFile("CA certificate", ca_file) < 0)
return -1;
- qemudDebug ("loading CA cert from %s", ca_file);
+ VIR_DEBUG("loading CA cert from %s", ca_file);
err = gnutls_certificate_set_x509_trust_file (x509_cred, ca_file,
GNUTLS_X509_FMT_PEM);
if (err < 0) {
@@ -324,7 +324,7 @@ remoteInitializeGnuTLS (void)
if (remoteCheckCertFile("CA revocation list", crl_file) < 0)
return -1;
- DEBUG("loading CRL from %s", crl_file);
+ VIR_DEBUG("loading CRL from %s", crl_file);
err = gnutls_certificate_set_x509_crl_file (x509_cred, crl_file,
GNUTLS_X509_FMT_PEM);
if (err < 0) {
@@ -339,7 +339,7 @@ remoteInitializeGnuTLS (void)
return -1;
if (remoteCheckCertFile("server key", key_file) < 0)
return -1;
- DEBUG("loading cert and key from %s and %s", cert_file, key_file);
+ VIR_DEBUG("loading cert and key from %s and %s", cert_file, key_file);
err =
gnutls_certificate_set_x509_key_file (x509_cred,
cert_file, key_file,
@@ -1150,7 +1150,7 @@ remoteCheckDN (const char *dname)
}
/* Print the client's DN. */
- DEBUG(_("remoteCheckDN: failed: client DN is %s"), dname);
+ VIR_DEBUG("remoteCheckDN: failed: client DN is %s", dname);
return 0; /* Not found. */
}
@@ -1531,7 +1531,7 @@ void qemudDispatchClientFailure(struct qemud_client *client) {
for (i = 0 ; i < VIR_DOMAIN_EVENT_ID_LAST ; i++) {
if (client->domainEventCallbackID[i] != -1) {
- DEBUG("Deregistering to relay remote events %d", i);
+ VIR_DEBUG("Deregistering to relay remote events %d", i);
virConnectDomainEventDeregisterAny(client->conn,
client->domainEventCallbackID[i]);
}
@@ -1678,7 +1678,7 @@ static ssize_t qemudClientReadBuf(struct qemud_client *client,
return -1;
}
- /*qemudDebug ("qemudClientRead: len = %d", len);*/
+ /* VIR_DEBUG("qemudClientRead: len = %d", len);*/
if (!client->tlssession) {
char ebuf[1024];
@@ -1812,7 +1812,7 @@ static ssize_t qemudClientRead(struct qemud_client *client) {
*/
static void qemudDispatchClientRead(struct qemud_server *server,
struct qemud_client *client) {
- /*qemudDebug ("qemudDispatchClientRead: mode = %d", client->mode);*/
+ /* VIR_DEBUG("qemudDispatchClientRead: mode = %d", client->mode);*/
readmore:
if (qemudClientRead(client) < 0)
@@ -1830,14 +1830,14 @@ readmore:
if (!xdr_u_int(&x, &len)) {
xdr_destroy (&x);
- DEBUG0("Failed to decode packet length");
+ VIR_DEBUG0("Failed to decode packet length");
qemudDispatchClientFailure(client);
return;
}
xdr_destroy (&x);
if (len < REMOTE_MESSAGE_HEADER_XDR_LEN) {
- DEBUG("Packet length %u too small", len);
+ VIR_DEBUG("Packet length %u too small", len);
qemudDispatchClientFailure(client);
return;
}
@@ -1846,7 +1846,7 @@ readmore:
len -= REMOTE_MESSAGE_HEADER_XDR_LEN;
if (len > REMOTE_MESSAGE_MAX) {
- DEBUG("Packet length %u too large", len);
+ VIR_DEBUG("Packet length %u too large", len);
qemudDispatchClientFailure(client);
return;
}
@@ -2283,10 +2283,10 @@ static void qemudInactiveTimer(int timerid, void *data) {
if (virStateActive() ||
server->clients) {
- DEBUG0("Timer expired but still active, not shutting down");
+ VIR_DEBUG0("Timer expired but still active, not shutting down");
virEventUpdateTimeoutImpl(timerid, -1);
} else {
- DEBUG0("Timer expired and inactive, shutting down");
+ VIR_DEBUG0("Timer expired and inactive, shutting down");
server->quitEventThread = 1;
}
}
@@ -2357,14 +2357,14 @@ static void *qemudRunLoop(void *opaque) {
if (timeout > 0) {
if (timerActive) {
if (server->clients) {
- DEBUG("Deactivating shutdown timer %d", timerid);
+ VIR_DEBUG("Deactivating shutdown timer %d", timerid);
virEventUpdateTimeoutImpl(timerid, -1);
timerActive = 0;
}
} else {
if (!virStateActive() &&
!server->clients) {
- DEBUG("Activating shutdown timer %d", timerid);
+ VIR_DEBUG("Activating shutdown timer %d", timerid);
virEventUpdateTimeoutImpl(timerid, timeout * 1000);
timerActive = 1;
}
@@ -2374,7 +2374,7 @@ static void *qemudRunLoop(void *opaque) {
virMutexUnlock(&server->lock);
if (qemudOneLoop() < 0) {
virMutexLock(&server->lock);
- DEBUG0("Loop iteration error, exiting");
+ VIR_DEBUG0("Loop iteration error, exiting");
break;
}
virMutexLock(&server->lock);
diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h
index af20e56..7da3cfd 100644
--- a/daemon/libvirtd.h
+++ b/daemon/libvirtd.h
@@ -1,7 +1,7 @@
/*
* libvirtd.h: daemon data structure definitions
*
- * Copyright (C) 2006-2010 Red Hat, Inc.
+ * Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -128,8 +128,6 @@
# endif
# endif
-# define qemudDebug DEBUG
-
/* Whether we're passing reads & writes through a sasl SSF */
enum qemud_sasl_ssf {
QEMUD_SASL_SSF_NONE = 0,
diff --git a/daemon/mdns.c b/daemon/mdns.c
index ae8dc40..8be3aa9 100644
--- a/daemon/mdns.c
+++ b/daemon/mdns.c
@@ -42,7 +42,7 @@
#include "event.h"
#include "memory.h"
-#define AVAHI_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
+#define AVAHI_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
struct libvirtd_mdns_entry {
char *type;
diff --git a/daemon/remote.c b/daemon/remote.c
index d53b466..c5509ad 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -62,7 +62,7 @@
#include "libvirt/libvirt-qemu.h"
#define VIR_FROM_THIS VIR_FROM_REMOTE
-#define REMOTE_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
+#define REMOTE_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain);
static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_network network);
diff --git a/daemon/stream.c b/daemon/stream.c
index cac54ea..967aea2 100644
--- a/daemon/stream.c
+++ b/daemon/stream.c
@@ -82,7 +82,7 @@ remoteStreamEvent(virStreamPtr st, int events, void *opaque)
goto cleanup;
}
- DEBUG("st=%p events=%d", st, events);
+ VIR_DEBUG("st=%p events=%d", st, events);
if (events & VIR_STREAM_EVENT_WRITABLE) {
if (remoteStreamHandleWrite(client, stream) < 0) {
@@ -149,7 +149,7 @@ remoteStreamFilter(struct qemud_client *client,
if (msg->hdr.serial == stream->serial &&
msg->hdr.proc == stream->procedure &&
msg->hdr.type == REMOTE_STREAM) {
- DEBUG("Incoming rx=%p serial=%d proc=%d status=%d",
+ VIR_DEBUG("Incoming rx=%p serial=%d proc=%d status=%d",
stream->rx, msg->hdr.proc, msg->hdr.serial, msg->hdr.status);
/* If there are queued packets, we need to queue all further
@@ -207,7 +207,7 @@ remoteCreateClientStream(virConnectPtr conn,
{
struct qemud_client_stream *stream;
- DEBUG("proc=%d serial=%d", hdr->proc, hdr->serial);
+ VIR_DEBUG("proc=%d serial=%d", hdr->proc, hdr->serial);
if (VIR_ALLOC(stream) < 0)
return NULL;
@@ -241,7 +241,7 @@ void remoteFreeClientStream(struct qemud_client *client,
if (!stream)
return;
- DEBUG("proc=%d serial=%d", stream->procedure, stream->serial);
+ VIR_DEBUG("proc=%d serial=%d", stream->procedure, stream->serial);
msg = stream->rx;
while (msg) {
@@ -265,7 +265,7 @@ int remoteAddClientStream(struct qemud_client *client,
{
struct qemud_client_stream *tmp = client->streams;
- DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
+ VIR_DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
if (virStreamEventAddCallback(stream->st, 0,
remoteStreamEvent, client, NULL) < 0)
@@ -328,7 +328,7 @@ int
remoteRemoveClientStream(struct qemud_client *client,
struct qemud_client_stream *stream)
{
- DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
+ VIR_DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
struct qemud_client_stream *curr = client->streams;
struct qemud_client_stream *prev = NULL;
@@ -381,7 +381,7 @@ remoteStreamHandleWriteData(struct qemud_client *client,
remote_error rerr;
int ret;
- DEBUG("stream=%p proc=%d serial=%d len=%d offset=%d",
+ VIR_DEBUG("stream=%p proc=%d serial=%d len=%d offset=%d",
stream, msg->hdr.proc, msg->hdr.serial, msg->bufferLength, msg->bufferOffset);
memset(&rerr, 0, sizeof rerr);
@@ -426,7 +426,7 @@ remoteStreamHandleFinish(struct qemud_client *client,
remote_error rerr;
int ret;
- DEBUG("stream=%p proc=%d serial=%d",
+ VIR_DEBUG("stream=%p proc=%d serial=%d",
stream, msg->hdr.proc, msg->hdr.serial);
memset(&rerr, 0, sizeof rerr);
@@ -460,7 +460,7 @@ remoteStreamHandleAbort(struct qemud_client *client,
{
remote_error rerr;
- DEBUG("stream=%p proc=%d serial=%d",
+ VIR_DEBUG("stream=%p proc=%d serial=%d",
stream, msg->hdr.proc, msg->hdr.serial);
memset(&rerr, 0, sizeof rerr);
@@ -495,7 +495,7 @@ remoteStreamHandleWrite(struct qemud_client *client,
{
struct qemud_client_message *msg, *tmp;
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
msg = stream->rx;
while (msg && !stream->closed) {
@@ -550,7 +550,7 @@ remoteStreamHandleRead(struct qemud_client *client,
size_t bufferLen = REMOTE_MESSAGE_PAYLOAD_MAX;
int ret;
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
/* Shouldn't ever be called unless we're marked able to
* transmit, but doesn't hurt to check */
@@ -603,7 +603,7 @@ remoteStreamMessageFinished(struct qemud_client *client,
stream = stream->next;
}
- DEBUG("Message client=%p stream=%p proc=%d serial=%d", client, stream, msg->hdr.proc, msg->hdr.serial);
+ VIR_DEBUG("Message client=%p stream=%p proc=%d serial=%d", client, stream, msg->hdr.proc, msg->hdr.serial);
if (stream) {
stream->tx = 1;
diff --git a/docs/api_extension/0004-implement-the-public-APIs.patch b/docs/api_extension/0004-implement-the-public-APIs.patch
index 96c3439..7f13f0a 100644
--- a/docs/api_extension/0004-implement-the-public-APIs.patch
+++ b/docs/api_extension/0004-implement-the-public-APIs.patch
@@ -62,7 +62,7 @@ index 629d97b..1b39210 100644
+ 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();
+
@@ -125,7 +125,7 @@ index 629d97b..1b39210 100644
+virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
+{
+ virConnectPtr conn;
-+ DEBUG("domain=%p, flags=%u", domain, flags);
++ VIR_DEBUG("domain=%p, flags=%u", domain, flags);
+
+ virResetLastError();
+
diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c
index 74eabba..6e3a160 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -10,9 +10,9 @@
# 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)
@@ -300,7 +300,7 @@ int myEventAddHandleFunc(int fd, int event,
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;
@@ -311,14 +311,14 @@ int myEventAddHandleFunc(int fd, int event,
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);
@@ -330,7 +330,7 @@ int myEventAddTimeoutFunc(int timeout,
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;
@@ -341,13 +341,13 @@ int myEventAddTimeoutFunc(int timeout,
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);
@@ -408,7 +408,7 @@ int main(int argc, char **argv)
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,
@@ -464,15 +464,15 @@ int main(int argc, char **argv)
}
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;
}
@@ -485,7 +485,7 @@ int main(int argc, char **argv)
}
- DEBUG0("Deregistering event handlers");
+ VIR_DEBUG0("Deregistering event handlers");
virConnectDomainEventDeregister(dconn, myDomainEventCallback1);
virConnectDomainEventDeregisterAny(dconn, callback2ret);
virConnectDomainEventDeregisterAny(dconn, callback3ret);
@@ -495,7 +495,7 @@ int main(int argc, char **argv)
virConnectDomainEventDeregisterAny(dconn, callback7ret);
}
- DEBUG0("Closing connection");
+ VIR_DEBUG0("Closing connection");
if( dconn && virConnectClose(dconn)<0 ) {
printf("error closing\n");
}
diff --git a/src/datatypes.c b/src/datatypes.c
index d870e5d..0e99268 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -243,7 +243,7 @@ failed:
*/
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
@@ -311,7 +311,7 @@ virUnrefConnect(virConnectPtr conn) {
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) {
@@ -389,9 +389,9 @@ virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) {
goto error;
}
conn->refs++;
- DEBUG("New hash entry %p", ret);
+ VIR_DEBUG("New hash entry %p", ret);
} else {
- DEBUG("Existing hash entry %p: refs now %d", ret, ret->refs+1);
+ VIR_DEBUG("Existing hash entry %p: refs now %d", ret, ret->refs+1);
}
ret->refs++;
virMutexUnlock(&conn->lock);
@@ -423,7 +423,7 @@ virReleaseDomain(virDomainPtr domain) {
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);
if (virHashRemoveEntry(conn->domains, uuidstr, NULL) < 0) {
virMutexUnlock(&conn->lock);
@@ -440,7 +440,7 @@ virReleaseDomain(virDomainPtr domain) {
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);
@@ -470,7 +470,7 @@ virUnrefDomain(virDomainPtr domain) {
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) {
@@ -572,7 +572,7 @@ virReleaseNetwork(virNetworkPtr network) {
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);
if (virHashRemoveEntry(conn->networks, uuidstr, NULL) < 0) {
virMutexUnlock(&conn->lock);
@@ -586,7 +586,7 @@ virReleaseNetwork(virNetworkPtr network) {
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);
@@ -617,7 +617,7 @@ virUnrefNetwork(virNetworkPtr network) {
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) {
@@ -756,7 +756,7 @@ virGetInterface(virConnectPtr conn, const char *name, const char *mac) {
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);
if (virHashRemoveEntry(conn->interfaces, iface->name, NULL) < 0) {
/* unlock before reporting error because error report grabs lock */
@@ -773,7 +773,7 @@ virReleaseInterface(virInterfacePtr iface) {
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);
@@ -804,7 +804,7 @@ virUnrefInterface(virInterfacePtr iface) {
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) {
@@ -909,7 +909,7 @@ virReleaseStoragePool(virStoragePoolPtr pool) {
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);
if (virHashRemoveEntry(conn->storagePools, uuidstr, NULL) < 0) {
virMutexUnlock(&conn->lock);
@@ -923,7 +923,7 @@ virReleaseStoragePool(virStoragePoolPtr pool) {
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);
@@ -954,7 +954,7 @@ virUnrefStoragePool(virStoragePoolPtr pool) {
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) {
@@ -1066,7 +1066,7 @@ error:
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);
if (virHashRemoveEntry(conn->storageVols, vol->key, NULL) < 0) {
virMutexUnlock(&conn->lock);
@@ -1081,7 +1081,7 @@ virReleaseStorageVol(virStorageVolPtr vol) {
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);
@@ -1112,7 +1112,7 @@ virUnrefStorageVol(virStorageVolPtr vol) {
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) {
@@ -1205,7 +1205,7 @@ error:
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);
if (virHashRemoveEntry(conn->nodeDevices, dev->name, NULL) < 0) {
virMutexUnlock(&conn->lock);
@@ -1220,7 +1220,7 @@ virReleaseNodeDevice(virNodeDevicePtr dev) {
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);
@@ -1246,7 +1246,7 @@ virUnrefNodeDevice(virNodeDevicePtr dev) {
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) {
@@ -1348,7 +1348,7 @@ virReleaseSecret(virSecretPtr secret) {
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);
if (virHashRemoveEntry(conn->secrets, uuidstr, NULL) < 0) {
virMutexUnlock(&conn->lock);
@@ -1362,7 +1362,7 @@ virReleaseSecret(virSecretPtr secret) {
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);
@@ -1391,7 +1391,7 @@ virUnrefSecret(virSecretPtr secret) {
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) {
@@ -1429,12 +1429,12 @@ error:
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);
@@ -1449,7 +1449,7 @@ int virUnrefStream(virStreamPtr st) {
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) {
@@ -1554,7 +1554,7 @@ virReleaseNWFilter(virNWFilterPtr nwfilter)
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);
if (virHashRemoveEntry(conn->nwfilters, uuidstr, NULL) < 0) {
virMutexUnlock(&conn->lock);
@@ -1568,7 +1568,7 @@ virReleaseNWFilter(virNWFilterPtr nwfilter)
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);
@@ -1600,7 +1600,7 @@ virUnrefNWFilter(virNWFilterPtr nwfilter)
return -1;
}
virMutexLock(&nwfilter->conn->lock);
- DEBUG("unref pool %p %s %d", nwfilter, nwfilter->name, nwfilter->refs);
+ VIR_DEBUG("unref pool %p %s %d", nwfilter, nwfilter->name, nwfilter->refs);
nwfilter->refs--;
refs = nwfilter->refs;
if (refs == 0) {
@@ -1652,9 +1652,9 @@ virGetDomainSnapshot(virDomainPtr domain, const char *name)
goto error;
}
domain->refs++;
- DEBUG("New hash entry %p", ret);
+ VIR_DEBUG("New hash entry %p", ret);
} else {
- DEBUG("Existing hash entry %p: refs now %d", ret, ret->refs+1);
+ VIR_DEBUG("Existing hash entry %p: refs now %d", ret, ret->refs+1);
}
ret->refs++;
virMutexUnlock(&domain->conn->lock);
@@ -1673,7 +1673,7 @@ static void
virReleaseDomainSnapshot(virDomainSnapshotPtr snapshot)
{
virDomainPtr domain = snapshot->domain;
- DEBUG("release snapshot %p %s", snapshot, snapshot->name);
+ VIR_DEBUG("release snapshot %p %s", snapshot, snapshot->name);
if (virHashRemoveEntry(domain->snapshots, snapshot->name, NULL) < 0) {
virMutexUnlock(&domain->conn->lock);
@@ -1687,7 +1687,7 @@ virReleaseDomainSnapshot(virDomainSnapshotPtr snapshot)
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);
@@ -1709,7 +1709,7 @@ virUnrefDomainSnapshot(virDomainSnapshotPtr snapshot)
}
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) {
diff --git a/src/driver.c b/src/driver.c
index 6e4aa9f..f882ea1 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -53,7 +53,7 @@ virDriverLoadModule(const char *name)
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;
diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c
index 2c418f8..d914ac8 100644
--- a/src/libvirt-qemu.c
+++ b/src/libvirt-qemu.c
@@ -42,7 +42,7 @@ virDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
{
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();
diff --git a/src/libvirt.c b/src/libvirt.c
index f65cc24..e4b451e 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -326,7 +326,7 @@ static struct gcry_thread_cbs virTLSThreadImpl = {
_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", "")
@@ -358,7 +358,7 @@ virInitialize(void)
virLogSetFromEnv();
- DEBUG0("register drivers");
+ VIR_DEBUG0("register drivers");
#if HAVE_WINSOCK2_H
if (winsock_init () == -1) return -1;
@@ -529,7 +529,7 @@ virRegisterNetworkDriver(virNetworkDriverPtr driver)
return -1;
}
- DEBUG ("registering %s as network driver %d",
+ VIR_DEBUG ("registering %s as network driver %d",
driver->name, virNetworkDriverTabCount);
virNetworkDriverTab[virNetworkDriverTabCount] = driver;
@@ -562,7 +562,7 @@ virRegisterInterfaceDriver(virInterfaceDriverPtr driver)
return -1;
}
- DEBUG ("registering %s as interface driver %d",
+ VIR_DEBUG ("registering %s as interface driver %d",
driver->name, virInterfaceDriverTabCount);
virInterfaceDriverTab[virInterfaceDriverTabCount] = driver;
@@ -595,7 +595,7 @@ virRegisterStorageDriver(virStorageDriverPtr driver)
return -1;
}
- DEBUG ("registering %s as storage driver %d",
+ VIR_DEBUG ("registering %s as storage driver %d",
driver->name, virStorageDriverTabCount);
virStorageDriverTab[virStorageDriverTabCount] = driver;
@@ -628,7 +628,7 @@ virRegisterDeviceMonitor(virDeviceMonitorPtr driver)
return -1;
}
- DEBUG ("registering %s as device driver %d",
+ VIR_DEBUG ("registering %s as device driver %d",
driver->name, virDeviceMonitorTabCount);
virDeviceMonitorTab[virDeviceMonitorTabCount] = driver;
@@ -661,7 +661,7 @@ virRegisterSecretDriver(virSecretDriverPtr driver)
return -1;
}
- DEBUG ("registering %s as secret driver %d",
+ VIR_DEBUG ("registering %s as secret driver %d",
driver->name, virSecretDriverTabCount);
virSecretDriverTab[virSecretDriverTabCount] = driver;
@@ -694,7 +694,7 @@ virRegisterNWFilterDriver(virNWFilterDriverPtr 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;
@@ -713,7 +713,7 @@ virRegisterNWFilterDriver(virNWFilterDriverPtr 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;
@@ -736,7 +736,7 @@ virRegisterDriver(virDriverPtr driver)
return -1;
}
- DEBUG ("registering %s as driver %d",
+ VIR_DEBUG ("registering %s as driver %d",
driver->name, virDriverTabCount);
virDriverTab[virDriverTabCount] = driver;
@@ -876,7 +876,7 @@ int
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)
@@ -983,7 +983,7 @@ do_open (const char *name,
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;
@@ -1008,7 +1008,7 @@ do_open (const char *name,
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"
@@ -1022,7 +1022,7 @@ do_open (const char *name,
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 */
@@ -1058,10 +1058,10 @@ do_open (const char *name,
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" :
@@ -1083,7 +1083,7 @@ do_open (const char *name,
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" :
@@ -1098,7 +1098,7 @@ do_open (const char *name,
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" :
@@ -1114,7 +1114,7 @@ do_open (const char *name,
/* 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" :
@@ -1130,7 +1130,7 @@ do_open (const char *name,
/* 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" :
@@ -1146,7 +1146,7 @@ do_open (const char *name,
/* 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" :
@@ -1162,7 +1162,7 @@ do_open (const char *name,
/* 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" :
@@ -1213,7 +1213,7 @@ virConnectOpen (const char *name)
if (virInitialize() < 0)
goto error;
- DEBUG("name=%s", name);
+ VIR_DEBUG("name=%s", name);
ret = do_open (name, NULL, 0);
if (!ret)
goto error;
@@ -1247,7 +1247,7 @@ virConnectOpenReadOnly(const char *name)
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;
@@ -1285,7 +1285,7 @@ virConnectOpenAuth(const char *name,
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;
@@ -1311,7 +1311,7 @@ int
virConnectClose(virConnectPtr conn)
{
int ret = -1;
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -1356,7 +1356,7 @@ virConnectRef(virConnectPtr conn)
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;
@@ -1370,7 +1370,7 @@ int
virDrvSupportsFeature (virConnectPtr conn, int feature)
{
int ret;
- DEBUG("conn=%p, feature=%d", conn, feature);
+ VIR_DEBUG("conn=%p, feature=%d", conn, feature);
virResetLastError();
@@ -1406,7 +1406,7 @@ const char *
virConnectGetType(virConnectPtr conn)
{
const char *ret;
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -1439,7 +1439,7 @@ virConnectGetType(virConnectPtr conn)
int
virConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
{
- DEBUG("conn=%p, hvVer=%p", conn, hvVer);
+ VIR_DEBUG("conn=%p, hvVer=%p", conn, hvVer);
virResetLastError();
@@ -1483,7 +1483,7 @@ int
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();
@@ -1528,7 +1528,7 @@ error:
char *
virConnectGetHostname (virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -1571,7 +1571,7 @@ char *
virConnectGetURI (virConnectPtr conn)
{
char *name;
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -1609,7 +1609,7 @@ error:
char *
virConnectGetSysinfo (virConnectPtr conn, unsigned int flags)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -1648,7 +1648,7 @@ int
virConnectGetMaxVcpus(virConnectPtr conn,
const char *type)
{
- DEBUG("conn=%p, type=%s", conn, type);
+ VIR_DEBUG("conn=%p, type=%s", conn, type);
virResetLastError();
@@ -1684,7 +1684,7 @@ error:
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();
@@ -1723,7 +1723,7 @@ error:
int
virConnectNumOfDomains(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -1794,7 +1794,7 @@ virDomainPtr
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();
@@ -1860,7 +1860,7 @@ virDomainCreateLinux(virConnectPtr conn, const char *xmlDesc,
virDomainPtr
virDomainLookupByID(virConnectPtr conn, int id)
{
- DEBUG("conn=%p, id=%d", conn, id);
+ VIR_DEBUG("conn=%p, id=%d", conn, id);
virResetLastError();
@@ -1905,7 +1905,7 @@ virDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
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();
@@ -1948,7 +1948,7 @@ virDomainPtr
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();
@@ -1987,7 +1987,7 @@ error:
virDomainPtr
virDomainLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
@@ -2303,7 +2303,7 @@ int
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();
@@ -2547,7 +2547,7 @@ error:
const char *
virDomainGetName(virDomainPtr domain)
{
- DEBUG("domain=%p", domain);
+ VIR_DEBUG("domain=%p", domain);
virResetLastError();
@@ -3091,7 +3091,7 @@ char *virConnectDomainXMLFromNative(virConnectPtr conn,
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();
@@ -3143,7 +3143,7 @@ char *virConnectDomainXMLToNative(virConnectPtr conn,
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();
@@ -4011,7 +4011,7 @@ error:
int
virNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
{
- DEBUG("conn=%p, info=%p", conn, info);
+ VIR_DEBUG("conn=%p, info=%p", conn, info);
virResetLastError();
@@ -4053,7 +4053,7 @@ error:
char *
virConnectGetCapabilities (virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -4068,7 +4068,7 @@ virConnectGetCapabilities (virConnectPtr conn)
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;
}
@@ -4092,7 +4092,7 @@ error:
unsigned long long
virNodeGetFreeMemory(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -4726,7 +4726,7 @@ error:
*/
virDomainPtr
virDomainDefineXML(virConnectPtr conn, const char *xml) {
- DEBUG("conn=%p, xml=%s", conn, xml);
+ VIR_DEBUG("conn=%p, xml=%s", conn, xml);
virResetLastError();
@@ -4812,7 +4812,7 @@ error:
int
virConnectNumOfDefinedDomains(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -4851,7 +4851,7 @@ error:
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();
@@ -5487,7 +5487,7 @@ error:
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__);
@@ -5807,7 +5807,7 @@ int
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();
@@ -5855,7 +5855,7 @@ error:
virConnectPtr
virNetworkGetConnect (virNetworkPtr net)
{
- DEBUG("net=%p", net);
+ VIR_DEBUG("net=%p", net);
virResetLastError();
@@ -5878,7 +5878,7 @@ virNetworkGetConnect (virNetworkPtr net)
int
virConnectNumOfNetworks(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -5916,7 +5916,7 @@ error:
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();
@@ -5957,7 +5957,7 @@ error:
int
virConnectNumOfDefinedNetworks(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -5996,7 +5996,7 @@ int
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();
@@ -6040,7 +6040,7 @@ error:
virNetworkPtr
virNetworkLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
@@ -6085,7 +6085,7 @@ virNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
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();
@@ -6128,7 +6128,7 @@ virNetworkPtr
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();
@@ -6167,7 +6167,7 @@ error:
virNetworkPtr
virNetworkCreateXML(virConnectPtr conn, const char *xmlDesc)
{
- DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
+ VIR_DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
virResetLastError();
@@ -6212,7 +6212,7 @@ error:
virNetworkPtr
virNetworkDefineXML(virConnectPtr conn, const char *xml)
{
- DEBUG("conn=%p, xml=%s", conn, xml);
+ VIR_DEBUG("conn=%p, xml=%s", conn, xml);
virResetLastError();
@@ -6256,7 +6256,7 @@ error:
int
virNetworkUndefine(virNetworkPtr network) {
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
@@ -6299,7 +6299,7 @@ int
virNetworkCreate(virNetworkPtr network)
{
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
@@ -6344,7 +6344,7 @@ int
virNetworkDestroy(virNetworkPtr network)
{
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
@@ -6387,7 +6387,7 @@ error:
int
virNetworkFree(virNetworkPtr network)
{
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
@@ -6429,7 +6429,7 @@ virNetworkRef(virNetworkPtr network)
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;
@@ -6447,7 +6447,7 @@ virNetworkRef(virNetworkPtr network)
const char *
virNetworkGetName(virNetworkPtr network)
{
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
@@ -6471,7 +6471,7 @@ virNetworkGetName(virNetworkPtr network)
int
virNetworkGetUUID(virNetworkPtr network, unsigned char *uuid)
{
- DEBUG("network=%p, uuid=%p", network, uuid);
+ VIR_DEBUG("network=%p, uuid=%p", network, uuid);
virResetLastError();
@@ -6508,7 +6508,7 @@ int
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();
@@ -6548,7 +6548,7 @@ char *
virNetworkGetXMLDesc(virNetworkPtr network, int flags)
{
virConnectPtr conn;
- DEBUG("network=%p, flags=%d", network, flags);
+ VIR_DEBUG("network=%p, flags=%d", network, flags);
virResetLastError();
@@ -6593,7 +6593,7 @@ char *
virNetworkGetBridgeName(virNetworkPtr network)
{
virConnectPtr conn;
- DEBUG("network=%p", network);
+ VIR_DEBUG("network=%p", network);
virResetLastError();
@@ -6636,7 +6636,7 @@ virNetworkGetAutostart(virNetworkPtr network,
int *autostart)
{
virConnectPtr conn;
- DEBUG("network=%p, autostart=%p", network, autostart);
+ VIR_DEBUG("network=%p, autostart=%p", network, autostart);
virResetLastError();
@@ -6682,7 +6682,7 @@ virNetworkSetAutostart(virNetworkPtr network,
int autostart)
{
virConnectPtr conn;
- DEBUG("network=%p, autostart=%d", network, autostart);
+ VIR_DEBUG("network=%p, autostart=%d", network, autostart);
virResetLastError();
@@ -6731,7 +6731,7 @@ error:
virConnectPtr
virInterfaceGetConnect (virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
@@ -6754,7 +6754,7 @@ virInterfaceGetConnect (virInterfacePtr iface)
int
virConnectNumOfInterfaces(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -6793,7 +6793,7 @@ error:
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();
@@ -6834,7 +6834,7 @@ error:
int
virConnectNumOfDefinedInterfaces(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -6875,7 +6875,7 @@ virConnectListDefinedInterfaces(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();
@@ -6918,7 +6918,7 @@ error:
virInterfacePtr
virInterfaceLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
@@ -6960,7 +6960,7 @@ error:
virInterfacePtr
virInterfaceLookupByMACString(virConnectPtr conn, const char *macstr)
{
- DEBUG("conn=%p, macstr=%s", conn, macstr);
+ VIR_DEBUG("conn=%p, macstr=%s", conn, macstr);
virResetLastError();
@@ -7001,7 +7001,7 @@ error:
const char *
virInterfaceGetName(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
@@ -7027,7 +7027,7 @@ virInterfaceGetName(virInterfacePtr iface)
const char *
virInterfaceGetMACString(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
@@ -7061,7 +7061,7 @@ char *
virInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags)
{
virConnectPtr conn;
- DEBUG("iface=%p, flags=%d", iface, flags);
+ VIR_DEBUG("iface=%p, flags=%d", iface, flags);
virResetLastError();
@@ -7105,7 +7105,7 @@ error:
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();
@@ -7150,7 +7150,7 @@ error:
int
virInterfaceUndefine(virInterfacePtr iface) {
virConnectPtr conn;
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
@@ -7193,7 +7193,7 @@ int
virInterfaceCreate(virInterfacePtr iface, unsigned int flags)
{
virConnectPtr conn;
- DEBUG("iface=%p, flags=%d", iface, flags);
+ VIR_DEBUG("iface=%p, flags=%d", iface, flags);
virResetLastError();
@@ -7238,7 +7238,7 @@ int
virInterfaceDestroy(virInterfacePtr iface, unsigned int flags)
{
virConnectPtr conn;
- DEBUG("iface=%p, flags=%d", iface, flags);
+ VIR_DEBUG("iface=%p, flags=%d", iface, flags);
virResetLastError();
@@ -7295,7 +7295,7 @@ virInterfaceRef(virInterfacePtr iface)
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;
@@ -7313,7 +7313,7 @@ virInterfaceRef(virInterfacePtr iface)
int
virInterfaceFree(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
@@ -7347,7 +7347,7 @@ virInterfaceFree(virInterfacePtr iface)
virConnectPtr
virStoragePoolGetConnect (virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -7370,7 +7370,7 @@ virStoragePoolGetConnect (virStoragePoolPtr pool)
int
virConnectNumOfStoragePools (virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -7412,7 +7412,7 @@ virConnectListStoragePools (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();
@@ -7454,7 +7454,7 @@ error:
int
virConnectNumOfDefinedStoragePools(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -7497,7 +7497,7 @@ virConnectListDefinedStoragePools(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();
@@ -7555,7 +7555,7 @@ virConnectFindStoragePoolSources(virConnectPtr conn,
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();
@@ -7603,7 +7603,7 @@ virStoragePoolPtr
virStoragePoolLookupByName(virConnectPtr conn,
const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
@@ -7646,7 +7646,7 @@ virStoragePoolPtr
virStoragePoolLookupByUUID(virConnectPtr conn,
const unsigned char *uuid)
{
- DEBUG("conn=%p, uuid=%s", conn, uuid);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuid);
virResetLastError();
@@ -7690,7 +7690,7 @@ virStoragePoolLookupByUUIDString(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();
@@ -7728,7 +7728,7 @@ error:
virStoragePoolPtr
virStoragePoolLookupByVolume(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
@@ -7770,7 +7770,7 @@ virStoragePoolCreateXML(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags)
{
- DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
+ VIR_DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
virResetLastError();
@@ -7819,7 +7819,7 @@ virStoragePoolDefineXML(virConnectPtr conn,
const char *xml,
unsigned int flags)
{
- DEBUG("conn=%p, xml=%s", conn, xml);
+ VIR_DEBUG("conn=%p, xml=%s", conn, xml);
virResetLastError();
@@ -7866,7 +7866,7 @@ virStoragePoolBuild(virStoragePoolPtr pool,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
@@ -7909,7 +7909,7 @@ int
virStoragePoolUndefine(virStoragePoolPtr pool)
{
virConnectPtr conn;
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -7954,7 +7954,7 @@ virStoragePoolCreate(virStoragePoolPtr pool,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -8001,7 +8001,7 @@ int
virStoragePoolDestroy(virStoragePoolPtr pool)
{
virConnectPtr conn;
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -8048,7 +8048,7 @@ virStoragePoolDelete(virStoragePoolPtr pool,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
@@ -8092,7 +8092,7 @@ error:
int
virStoragePoolFree(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -8136,7 +8136,7 @@ virStoragePoolRef(virStoragePoolPtr pool)
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;
@@ -8158,7 +8158,7 @@ virStoragePoolRefresh(virStoragePoolPtr pool,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p flags=%u", pool, flags);
virResetLastError();
@@ -8201,7 +8201,7 @@ error:
const char*
virStoragePoolGetName(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -8227,7 +8227,7 @@ int
virStoragePoolGetUUID(virStoragePoolPtr pool,
unsigned char *uuid)
{
- DEBUG("pool=%p, uuid=%p", pool, uuid);
+ VIR_DEBUG("pool=%p, uuid=%p", pool, uuid);
virResetLastError();
@@ -8264,7 +8264,7 @@ virStoragePoolGetUUIDString(virStoragePoolPtr pool,
char *buf)
{
unsigned char uuid[VIR_UUID_BUFLEN];
- DEBUG("pool=%p, buf=%p", pool, buf);
+ VIR_DEBUG("pool=%p, buf=%p", pool, buf);
virResetLastError();
@@ -8305,7 +8305,7 @@ virStoragePoolGetInfo(virStoragePoolPtr pool,
virStoragePoolInfoPtr info)
{
virConnectPtr conn;
- DEBUG("pool=%p, info=%p", pool, info);
+ VIR_DEBUG("pool=%p, info=%p", pool, info);
virResetLastError();
@@ -8355,7 +8355,7 @@ virStoragePoolGetXMLDesc(virStoragePoolPtr pool,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
@@ -8402,7 +8402,7 @@ virStoragePoolGetAutostart(virStoragePoolPtr pool,
int *autostart)
{
virConnectPtr conn;
- DEBUG("pool=%p, autostart=%p", pool, autostart);
+ VIR_DEBUG("pool=%p, autostart=%p", pool, autostart);
virResetLastError();
@@ -8448,7 +8448,7 @@ virStoragePoolSetAutostart(virStoragePoolPtr pool,
int autostart)
{
virConnectPtr conn;
- DEBUG("pool=%p, autostart=%d", pool, autostart);
+ VIR_DEBUG("pool=%p, autostart=%d", pool, autostart);
virResetLastError();
@@ -8492,7 +8492,7 @@ error:
int
virStoragePoolNumOfVolumes(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -8534,7 +8534,7 @@ virStoragePoolListVolumes(virStoragePoolPtr pool,
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();
@@ -8582,7 +8582,7 @@ error:
virConnectPtr
virStorageVolGetConnect (virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
@@ -8609,7 +8609,7 @@ virStorageVolPtr
virStorageVolLookupByName(virStoragePoolPtr pool,
const char *name)
{
- DEBUG("pool=%p, name=%s", pool, name);
+ VIR_DEBUG("pool=%p, name=%s", pool, name);
virResetLastError();
@@ -8654,7 +8654,7 @@ virStorageVolPtr
virStorageVolLookupByKey(virConnectPtr conn,
const char *key)
{
- DEBUG("conn=%p, key=%s", conn, key);
+ VIR_DEBUG("conn=%p, key=%s", conn, key);
virResetLastError();
@@ -8697,7 +8697,7 @@ virStorageVolPtr
virStorageVolLookupByPath(virConnectPtr conn,
const char *path)
{
- DEBUG("conn=%p, path=%s", conn, path);
+ VIR_DEBUG("conn=%p, path=%s", conn, path);
virResetLastError();
@@ -8739,7 +8739,7 @@ error:
const char*
virStorageVolGetName(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
@@ -8765,7 +8765,7 @@ virStorageVolGetName(virStorageVolPtr vol)
const char*
virStorageVolGetKey(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
@@ -8795,7 +8795,7 @@ virStorageVolCreateXML(virStoragePoolPtr pool,
const char *xmldesc,
unsigned int flags)
{
- DEBUG("pool=%p, flags=%u", pool, flags);
+ VIR_DEBUG("pool=%p, flags=%u", pool, flags);
virResetLastError();
@@ -8846,7 +8846,7 @@ virStorageVolCreateXMLFrom(virStoragePoolPtr pool,
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();
@@ -8899,7 +8899,7 @@ virStorageVolDelete(virStorageVolPtr vol,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("vol=%p, flags=%u", vol, flags);
+ VIR_DEBUG("vol=%p, flags=%u", vol, flags);
virResetLastError();
@@ -8990,7 +8990,7 @@ error:
int
virStorageVolFree(virStorageVolPtr vol)
{
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
@@ -9033,7 +9033,7 @@ virStorageVolRef(virStorageVolPtr vol)
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;
@@ -9054,7 +9054,7 @@ virStorageVolGetInfo(virStorageVolPtr vol,
virStorageVolInfoPtr info)
{
virConnectPtr conn;
- DEBUG("vol=%p, info=%p", vol, info);
+ VIR_DEBUG("vol=%p, info=%p", vol, info);
virResetLastError();
@@ -9103,7 +9103,7 @@ virStorageVolGetXMLDesc(virStorageVolPtr vol,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("vol=%p, flags=%u", vol, flags);
+ VIR_DEBUG("vol=%p, flags=%u", vol, flags);
virResetLastError();
@@ -9151,7 +9151,7 @@ char *
virStorageVolGetPath(virStorageVolPtr vol)
{
virConnectPtr conn;
- DEBUG("vol=%p", vol);
+ VIR_DEBUG("vol=%p", vol);
virResetLastError();
@@ -9195,7 +9195,7 @@ error:
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();
@@ -9246,7 +9246,7 @@ virNodeListDevices(virConnectPtr conn,
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();
@@ -9288,7 +9288,7 @@ error:
*/
virNodeDevicePtr virNodeDeviceLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%p", conn, name);
+ VIR_DEBUG("conn=%p, name=%p", conn, name);
virResetLastError();
@@ -9331,7 +9331,7 @@ error:
*/
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();
@@ -9367,7 +9367,7 @@ error:
*/
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__);
@@ -9389,7 +9389,7 @@ const char *virNodeDeviceGetName(virNodeDevicePtr dev)
*/
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();
@@ -9421,7 +9421,7 @@ const char *virNodeDeviceGetParent(virNodeDevicePtr dev)
*/
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();
@@ -9460,7 +9460,7 @@ int virNodeDeviceListCaps(virNodeDevicePtr dev,
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();
@@ -9498,7 +9498,7 @@ error:
*/
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();
@@ -9541,7 +9541,7 @@ virNodeDeviceRef(virNodeDevicePtr dev)
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;
@@ -9569,7 +9569,7 @@ virNodeDeviceRef(virNodeDevicePtr dev)
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();
@@ -9612,7 +9612,7 @@ error:
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();
@@ -9657,7 +9657,7 @@ error:
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();
@@ -9747,7 +9747,7 @@ error:
int
virNodeDeviceDestroy(virNodeDevicePtr dev)
{
- DEBUG("dev=%p", dev);
+ VIR_DEBUG("dev=%p", dev);
virResetLastError();
@@ -9813,7 +9813,7 @@ virConnectDomainEventRegister(virConnectPtr conn,
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)) {
@@ -9858,7 +9858,7 @@ int
virConnectDomainEventDeregister(virConnectPtr conn,
virConnectDomainEventCallback cb)
{
- DEBUG("conn=%p, cb=%p", conn, cb);
+ VIR_DEBUG("conn=%p, cb=%p", conn, cb);
virResetLastError();
@@ -9900,7 +9900,7 @@ error:
virConnectPtr
virSecretGetConnect (virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
@@ -10007,7 +10007,7 @@ error:
virSecretPtr
virSecretLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
{
- DEBUG("conn=%p, uuid=%s", conn, uuid);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuid);
virResetLastError();
@@ -10052,7 +10052,7 @@ virSecretPtr
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();
@@ -10097,7 +10097,7 @@ virSecretLookupByUsage(virConnectPtr conn,
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();
@@ -10227,7 +10227,7 @@ int
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();
@@ -10268,7 +10268,7 @@ error:
int
virSecretGetUsageType(virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
@@ -10299,7 +10299,7 @@ virSecretGetUsageType(virSecretPtr secret)
const char *
virSecretGetUsageID(virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
@@ -10530,7 +10530,7 @@ virSecretRef(virSecretPtr secret)
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;
@@ -10547,7 +10547,7 @@ virSecretRef(virSecretPtr secret)
int
virSecretFree(virSecretPtr secret)
{
- DEBUG("secret=%p", secret);
+ VIR_DEBUG("secret=%p", secret);
virResetLastError();
@@ -10589,7 +10589,7 @@ virStreamNew(virConnectPtr conn,
{
virStreamPtr st;
- DEBUG("conn=%p, flags=%u", conn, flags);
+ VIR_DEBUG("conn=%p, flags=%u", conn, flags);
virResetLastError();
@@ -10627,7 +10627,7 @@ virStreamRef(virStreamPtr stream)
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;
@@ -10702,7 +10702,7 @@ int virStreamSend(virStreamPtr stream,
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();
@@ -10797,7 +10797,7 @@ int virStreamRecv(virStreamPtr stream,
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();
@@ -10873,7 +10873,7 @@ int virStreamSendAll(virStreamPtr stream,
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();
@@ -10970,7 +10970,7 @@ int virStreamRecvAll(virStreamPtr stream,
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();
@@ -11042,7 +11042,7 @@ int virStreamEventAddCallback(virStreamPtr stream,
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();
@@ -11084,7 +11084,7 @@ error:
int virStreamEventUpdateCallback(virStreamPtr stream,
int events)
{
- DEBUG("stream=%p, events=%d", stream, events);
+ VIR_DEBUG("stream=%p, events=%d", stream, events);
virResetLastError();
@@ -11120,7 +11120,7 @@ error:
*/
int virStreamEventRemoveCallback(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
@@ -11163,7 +11163,7 @@ error:
*/
int virStreamFinish(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
@@ -11204,7 +11204,7 @@ error:
*/
int virStreamAbort(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
@@ -11246,7 +11246,7 @@ error:
*/
int virStreamFree(virStreamPtr stream)
{
- DEBUG("stream=%p", stream);
+ VIR_DEBUG("stream=%p", stream);
virResetLastError();
@@ -11276,7 +11276,7 @@ int virStreamFree(virStreamPtr stream)
*/
int virDomainIsActive(virDomainPtr dom)
{
- DEBUG("dom=%p", dom);
+ VIR_DEBUG("dom=%p", dom);
virResetLastError();
@@ -11376,7 +11376,7 @@ error:
*/
int virNetworkIsActive(virNetworkPtr net)
{
- DEBUG("net=%p", net);
+ VIR_DEBUG("net=%p", net);
virResetLastError();
@@ -11411,7 +11411,7 @@ error:
*/
int virNetworkIsPersistent(virNetworkPtr net)
{
- DEBUG("net=%p", net);
+ VIR_DEBUG("net=%p", net);
virResetLastError();
@@ -11445,7 +11445,7 @@ error:
*/
int virStoragePoolIsActive(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -11480,7 +11480,7 @@ error:
*/
int virStoragePoolIsPersistent(virStoragePoolPtr pool)
{
- DEBUG("pool=%p", pool);
+ VIR_DEBUG("pool=%p", pool);
virResetLastError();
@@ -11516,7 +11516,7 @@ error:
int
virConnectNumOfNWFilters(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -11555,7 +11555,7 @@ error:
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();
@@ -11599,7 +11599,7 @@ error:
virNWFilterPtr
virNWFilterLookupByName(virConnectPtr conn, const char *name)
{
- DEBUG("conn=%p, name=%s", conn, name);
+ VIR_DEBUG("conn=%p, name=%s", conn, name);
virResetLastError();
@@ -11641,7 +11641,7 @@ error:
virNWFilterPtr
virNWFilterLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
{
- DEBUG("conn=%p, uuid=%s", conn, uuid);
+ VIR_DEBUG("conn=%p, uuid=%s", conn, uuid);
virResetLastError();
@@ -11684,7 +11684,7 @@ virNWFilterPtr
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();
@@ -11722,7 +11722,7 @@ error:
int
virNWFilterFree(virNWFilterPtr nwfilter)
{
- DEBUG("nwfilter=%p", nwfilter);
+ VIR_DEBUG("nwfilter=%p", nwfilter);
virResetLastError();
@@ -11750,7 +11750,7 @@ virNWFilterFree(virNWFilterPtr nwfilter)
const char *
virNWFilterGetName(virNWFilterPtr nwfilter)
{
- DEBUG("nwfilter=%p", nwfilter);
+ VIR_DEBUG("nwfilter=%p", nwfilter);
virResetLastError();
@@ -11774,7 +11774,7 @@ virNWFilterGetName(virNWFilterPtr nwfilter)
int
virNWFilterGetUUID(virNWFilterPtr nwfilter, unsigned char *uuid)
{
- DEBUG("nwfilter=%p, uuid=%p", nwfilter, uuid);
+ VIR_DEBUG("nwfilter=%p, uuid=%p", nwfilter, uuid);
virResetLastError();
@@ -11811,7 +11811,7 @@ int
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();
@@ -11850,7 +11850,7 @@ error:
virNWFilterPtr
virNWFilterDefineXML(virConnectPtr conn, const char *xmlDesc)
{
- DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
+ VIR_DEBUG("conn=%p, xmlDesc=%s", conn, xmlDesc);
virResetLastError();
@@ -11898,7 +11898,7 @@ int
virNWFilterUndefine(virNWFilterPtr nwfilter)
{
virConnectPtr conn;
- DEBUG("nwfilter=%p", nwfilter);
+ VIR_DEBUG("nwfilter=%p", nwfilter);
virResetLastError();
@@ -11945,7 +11945,7 @@ char *
virNWFilterGetXMLDesc(virNWFilterPtr nwfilter, int flags)
{
virConnectPtr conn;
- DEBUG("nwfilter=%p, flags=%d", nwfilter, flags);
+ VIR_DEBUG("nwfilter=%p, flags=%d", nwfilter, flags);
virResetLastError();
@@ -12003,7 +12003,7 @@ virNWFilterRef(virNWFilterPtr nwfilter)
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;
@@ -12020,7 +12020,7 @@ virNWFilterRef(virNWFilterPtr nwfilter)
*/
int virInterfaceIsActive(virInterfacePtr iface)
{
- DEBUG("iface=%p", iface);
+ VIR_DEBUG("iface=%p", iface);
virResetLastError();
@@ -12054,7 +12054,7 @@ error:
*/
int virConnectIsEncrypted(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -12091,7 +12091,7 @@ error:
*/
int virConnectIsSecure(virConnectPtr conn)
{
- DEBUG("conn=%p", conn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
@@ -12451,7 +12451,7 @@ int
virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID)
{
- DEBUG("conn=%p, callbackID=%d", conn, callbackID);
+ VIR_DEBUG("conn=%p, callbackID=%d", conn, callbackID);
virResetLastError();
@@ -12681,7 +12681,7 @@ virDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virConnectPtr conn;
- DEBUG("snapshot=%p, flags=%d", snapshot, flags);
+ VIR_DEBUG("snapshot=%p, flags=%d", snapshot, flags);
virResetLastError();
@@ -12950,7 +12950,7 @@ virDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
{
virConnectPtr conn;
- DEBUG("snapshot=%p, flags=%u", snapshot, flags);
+ VIR_DEBUG("snapshot=%p, flags=%u", snapshot, flags);
virResetLastError();
@@ -12996,7 +12996,7 @@ virDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
{
virConnectPtr conn;
- DEBUG("snapshot=%p, flags=%u", snapshot, flags);
+ VIR_DEBUG("snapshot=%p, flags=%u", snapshot, flags);
virResetLastError();
@@ -13034,7 +13034,7 @@ error:
int
virDomainSnapshotFree(virDomainSnapshotPtr snapshot)
{
- DEBUG("snapshot=%p", snapshot);
+ VIR_DEBUG("snapshot=%p", snapshot);
virResetLastError();
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index a735eb7..d973984 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -227,7 +227,7 @@ static int lxcContainerWaitForContinue(int control)
}
VIR_FORCE_CLOSE(control);
- DEBUG0("Received container continue message");
+ VIR_DEBUG0("Received container continue message");
return 0;
}
@@ -258,12 +258,12 @@ static int lxcContainerRenameAndEnableInterfaces(unsigned int nveths,
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;
@@ -854,18 +854,18 @@ int lxcContainerStart(virDomainDefPtr def,
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",
@@ -897,7 +897,7 @@ int lxcContainerAvailable(int features)
flags |= CLONE_NEWNET;
if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
- DEBUG0("Unable to allocate stack");
+ VIR_DEBUG0("Unable to allocate stack");
return -1;
}
@@ -907,7 +907,7 @@ int lxcContainerAvailable(int features)
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 {
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 0db6673..b742a33 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -446,7 +446,7 @@ static int lxcControllerMain(int monitor,
++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,
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 0f78579..a17b0b6 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -979,7 +979,7 @@ static int lxcVmCleanup(lxc_driver_t *driver,
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;
}
@@ -1086,18 +1086,18 @@ static int lxcSetupInterfaces(virConnectPtr conn,
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;
diff --git a/src/lxc/veth.c b/src/lxc/veth.c
index 14cfaa2..78e011e 100644
--- a/src/lxc/veth.c
+++ b/src/lxc/veth.c
@@ -99,13 +99,13 @@ int vethCreate(char** veth1, char** veth2)
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;
@@ -118,11 +118,11 @@ int vethCreate(char** veth1, char** veth2)
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 ||
@@ -156,7 +156,7 @@ int vethDelete(const char *veth)
const char *argv[] = {"ip", "link", "del", veth, NULL};
int cmdResult = 0;
- DEBUG("veth: %s", veth);
+ VIR_DEBUG("veth: %s", veth);
rc = virRun(argv, &cmdResult);
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index 547e5ca..3af2bcf 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -483,7 +483,7 @@ static void dev_create(const char *udi)
return;
failure:
- DEBUG("FAILED TO ADD dev %s", name);
+ VIR_DEBUG("FAILED TO ADD dev %s", name);
cleanup:
VIR_FREE(privData);
virNodeDeviceDefFree(def);
@@ -503,7 +503,7 @@ static void dev_refresh(const char *udi)
*/
virNodeDeviceObjRemove(&driverState->devs, dev);
} else
- DEBUG("no device named %s", name);
+ VIR_DEBUG("no device named %s", name);
nodeDeviceUnlock(driverState);
if (dev) {
@@ -514,7 +514,7 @@ static void dev_refresh(const char *udi)
static void device_added(LibHalContext *ctx ATTRIBUTE_UNUSED,
const char *udi)
{
- DEBUG0(hal_name(udi));
+ VIR_DEBUG0(hal_name(udi));
dev_create(udi);
}
@@ -527,11 +527,11 @@ static void device_removed(LibHalContext *ctx ATTRIBUTE_UNUSED,
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);
}
@@ -545,12 +545,12 @@ static void device_cap_added(LibHalContext *ctx,
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);
}
}
@@ -560,7 +560,7 @@ static void device_cap_lost(LibHalContext *ctx ATTRIBUTE_UNUSED,
const char *cap)
{
const char *name = hal_name(udi);
- DEBUG("%s %s", cap, name);
+ VIR_DEBUG("%s %s", cap, name);
dev_refresh(udi);
}
@@ -573,7 +573,7 @@ static void device_prop_modified(LibHalContext *ctx ATTRIBUTE_UNUSED,
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);
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 82a2210..21bb77d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1949,7 +1949,7 @@ qemudInitCpuAffinity(virDomainObjPtr vm)
unsigned char *cpumap;
int cpumaplen;
- DEBUG0("Setting CPU affinity");
+ VIR_DEBUG0("Setting CPU affinity");
if (nodeGetInfo(NULL, &nodeinfo) < 0)
return -1;
@@ -2636,7 +2636,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
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,
@@ -2648,18 +2648,18 @@ static int qemudStartVMDaemon(virConnectPtr conn,
* 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,
qemuPrepareChardevDevice,
@@ -2668,14 +2668,14 @@ static int qemudStartVMDaemon(virConnectPtr conn,
/* 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;
@@ -2686,7 +2686,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
*/
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,
@@ -2700,7 +2700,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
/* 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) {
@@ -2746,17 +2746,17 @@ static int qemudStartVMDaemon(virConnectPtr conn,
goto cleanup;
}
- DEBUG0("Creating domain log file");
+ VIR_DEBUG0("Creating domain log file");
if ((logfile = qemudLogFD(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;
@@ -2765,7 +2765,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
goto cleanup;
}
- DEBUG0("Preparing monitor state");
+ VIR_DEBUG0("Preparing monitor state");
if (qemuPrepareMonitorChr(driver, priv->monConfig, vm->def->name) < 0)
goto cleanup;
@@ -2800,7 +2800,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
* 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);
@@ -2819,7 +2819,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
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,
@@ -2916,27 +2916,27 @@ static int qemudStartVMDaemon(virConnectPtr conn,
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 (qemudWaitForMonitor(driver, vm, pos) < 0)
goto cleanup;
- DEBUG0("Detecting VCPU PIDs");
+ VIR_DEBUG0("Detecting VCPU PIDs");
if (qemuDetectVcpuPIDs(driver, vm) < 0)
goto cleanup;
- DEBUG0("Setting any required VM passwords");
+ VIR_DEBUG0("Setting any required VM passwords");
if (qemuInitPasswords(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 (qemuInitPCIAddresses(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);
@@ -2945,7 +2945,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (!start_paused) {
- DEBUG0("Starting domain CPUs");
+ VIR_DEBUG0("Starting domain CPUs");
/* Allow the CPUS to start executing */
if (doStartCPUs(driver, vm, conn) < 0) {
if (virGetLastError() == NULL)
@@ -2956,7 +2956,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
}
- DEBUG0("Writing domain status to disk");
+ VIR_DEBUG0("Writing domain status to disk");
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
goto cleanup;
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index e3d0a0f..dfb1aad 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -903,7 +903,7 @@ int qemuMonitorEmitGraphics(qemuMonitorPtr mon,
int qemuMonitorSetCapabilities(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -924,7 +924,7 @@ qemuMonitorStartCPUs(qemuMonitorPtr mon,
virConnectPtr conn)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -944,7 +944,7 @@ int
qemuMonitorStopCPUs(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -963,7 +963,7 @@ qemuMonitorStopCPUs(qemuMonitorPtr mon)
int qemuMonitorSystemPowerdown(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -983,7 +983,7 @@ int qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
int **pids)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -1002,7 +1002,7 @@ int qemuMonitorGetBalloonInfo(qemuMonitorPtr mon,
unsigned long *currmem)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -1023,7 +1023,7 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
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",
@@ -1048,7 +1048,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
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",
@@ -1074,7 +1074,7 @@ int qemuMonitorGetBlockExtent(qemuMonitorPtr mon,
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)
@@ -1090,7 +1090,7 @@ int qemuMonitorSetVNCPassword(qemuMonitorPtr mon,
const char *password)
{
int ret;
- DEBUG("mon=%p, password=%p",
+ VIR_DEBUG("mon=%p, password=%p",
mon, password);
if (!mon) {
@@ -1136,7 +1136,7 @@ int qemuMonitorSetPassword(qemuMonitorPtr 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) {
@@ -1168,7 +1168,7 @@ int qemuMonitorExpirePassword(qemuMonitorPtr 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) {
@@ -1191,7 +1191,7 @@ int qemuMonitorSetBalloon(qemuMonitorPtr 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",
@@ -1210,7 +1210,7 @@ int qemuMonitorSetBalloon(qemuMonitorPtr mon,
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",
@@ -1231,7 +1231,7 @@ int qemuMonitorEjectMedia(qemuMonitorPtr mon,
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",
@@ -1253,7 +1253,7 @@ int qemuMonitorChangeMedia(qemuMonitorPtr mon,
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) {
@@ -1276,7 +1276,7 @@ int qemuMonitorSaveVirtualMemory(qemuMonitorPtr 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) {
@@ -1298,7 +1298,7 @@ int qemuMonitorSavePhysicalMemory(qemuMonitorPtr 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) {
@@ -1319,7 +1319,7 @@ int qemuMonitorSetMigrationSpeed(qemuMonitorPtr 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",
@@ -1339,7 +1339,7 @@ int qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon,
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",
@@ -1362,7 +1362,7 @@ int qemuMonitorGetMigrationStatus(qemuMonitorPtr mon,
unsigned long long *total)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -1390,7 +1390,7 @@ int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
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) {
@@ -1412,7 +1412,7 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr 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) {
@@ -1435,7 +1435,7 @@ int qemuMonitorMigrateToFile(qemuMonitorPtr 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) {
@@ -1463,7 +1463,7 @@ int qemuMonitorMigrateToUnix(qemuMonitorPtr 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) {
@@ -1482,7 +1482,7 @@ int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
int qemuMonitorMigrateCancel(qemuMonitorPtr mon)
{
int ret;
- DEBUG("mon=%p", mon);
+ VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -1501,7 +1501,7 @@ int qemuMonitorAddUSBDisk(qemuMonitorPtr mon,
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",
@@ -1522,7 +1522,7 @@ int qemuMonitorAddUSBDeviceExact(qemuMonitorPtr mon,
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",
@@ -1542,7 +1542,7 @@ int qemuMonitorAddUSBDeviceMatch(qemuMonitorPtr mon,
int product)
{
int ret;
- DEBUG("mon=%p vendor=%d product=%d",
+ VIR_DEBUG("mon=%p vendor=%d product=%d",
mon, vendor, product);
if (!mon) {
@@ -1564,7 +1564,7 @@ int qemuMonitorAddPCIHostDevice(qemuMonitorPtr 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);
@@ -1588,7 +1588,7 @@ int qemuMonitorAddPCIDisk(qemuMonitorPtr mon,
virDomainDevicePCIAddress *guestAddr)
{
int ret;
- DEBUG("mon=%p path=%s bus=%s",
+ VIR_DEBUG("mon=%p path=%s bus=%s",
mon, path, bus);
if (!mon) {
@@ -1610,7 +1610,7 @@ int qemuMonitorAddPCINetwork(qemuMonitorPtr 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",
@@ -1630,7 +1630,7 @@ int qemuMonitorRemovePCIDevice(qemuMonitorPtr 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, guestAddr->domain, guestAddr->bus,
guestAddr->slot, guestAddr->function);
@@ -1653,7 +1653,7 @@ int qemuMonitorSendFileHandle(qemuMonitorPtr mon,
int fd)
{
int ret;
- DEBUG("mon=%p, fdname=%s fd=%d",
+ VIR_DEBUG("mon=%p, fdname=%s fd=%d",
mon, fdname, fd);
if (!mon) {
@@ -1674,7 +1674,7 @@ int qemuMonitorCloseFileHandle(qemuMonitorPtr mon,
const char *fdname)
{
int ret;
- DEBUG("mon=%p fdname=%s",
+ VIR_DEBUG("mon=%p fdname=%s",
mon, fdname);
if (!mon) {
@@ -1695,7 +1695,7 @@ int qemuMonitorAddHostNetwork(qemuMonitorPtr mon,
const char *netstr)
{
int ret;
- DEBUG("mon=%p netstr=%s",
+ VIR_DEBUG("mon=%p netstr=%s",
mon, netstr);
if (!mon) {
@@ -1717,7 +1717,7 @@ int qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon,
const char *netname)
{
int ret;
- DEBUG("mon=%p netname=%s",
+ VIR_DEBUG("mon=%p netname=%s",
mon, netname);
if (!mon) {
@@ -1738,7 +1738,7 @@ int qemuMonitorAddNetdev(qemuMonitorPtr mon,
const char *netdevstr)
{
int ret;
- DEBUG("mon=%p netdevstr=%s",
+ VIR_DEBUG("mon=%p netdevstr=%s",
mon, netdevstr);
if (!mon) {
@@ -1759,7 +1759,7 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon,
const char *alias)
{
int ret;
- DEBUG("mon=%p alias=%s",
+ VIR_DEBUG("mon=%p alias=%s",
mon, alias);
if (!mon) {
@@ -1780,7 +1780,7 @@ int qemuMonitorGetPtyPaths(qemuMonitorPtr mon,
virHashTablePtr paths)
{
int ret;
- DEBUG("mon=%p",
+ VIR_DEBUG("mon=%p",
mon);
if (!mon) {
@@ -1801,7 +1801,7 @@ int qemuMonitorAttachPCIDiskController(qemuMonitorPtr 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) {
@@ -1824,7 +1824,7 @@ int qemuMonitorAttachDrive(qemuMonitorPtr 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);
@@ -1847,7 +1847,7 @@ int qemuMonitorAttachDrive(qemuMonitorPtr mon,
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) {
@@ -1866,7 +1866,7 @@ int qemuMonitorGetAllPCIAddresses(qemuMonitorPtr 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) {
@@ -1885,7 +1885,7 @@ int qemuMonitorDriveDel(qemuMonitorPtr 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) {
@@ -1905,7 +1905,7 @@ int qemuMonitorDelDevice(qemuMonitorPtr 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) {
@@ -1924,7 +1924,7 @@ int qemuMonitorAddDevice(qemuMonitorPtr 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) {
@@ -1945,7 +1945,7 @@ int qemuMonitorSetDrivePassphrase(qemuMonitorPtr 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) {
@@ -1965,7 +1965,7 @@ int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name)
{
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",
@@ -1984,7 +1984,7 @@ int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name)
{
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",
@@ -2003,7 +2003,7 @@ int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name)
{
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",
@@ -2025,7 +2025,7 @@ int qemuMonitorArbitraryCommand(qemuMonitorPtr mon,
{
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);
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index d5e8d37..e6903a1 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2326,7 +2326,7 @@ int qemuMonitorJSONDriveDel(qemuMonitorPtr mon,
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
- DEBUG("JSONDriveDel drivestr=%s", drivestr);
+ VIR_DEBUG("JSONDriveDel drivestr=%s", drivestr);
cmd = qemuMonitorJSONMakeCommand("drive_del",
"s:id", drivestr,
NULL);
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 6d0ba4c..9acf65f 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -445,7 +445,7 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
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;
@@ -480,7 +480,7 @@ static int parseMemoryStat(char **text, unsigned int tag,
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;
}
@@ -671,21 +671,21 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
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, ' ');
@@ -2355,7 +2355,7 @@ int qemuMonitorTextDelDevice(qemuMonitorPtr mon,
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);
@@ -2471,7 +2471,7 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon,
char *reply = NULL;
char *safedev;
int ret = -1;
- DEBUG("TextDriveDel drivestr=%s", drivestr);
+ VIR_DEBUG("TextDriveDel drivestr=%s", drivestr);
if (!(safedev = qemuMonitorEscapeArg(drivestr))) {
virReportOOMError();
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 4ca0d3b..0be9c56 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -515,7 +515,7 @@ doRemoteOpen (virConnectPtr conn,
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);
}
}
@@ -571,7 +571,7 @@ doRemoteOpen (virConnectPtr conn,
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) {
@@ -894,7 +894,7 @@ doRemoteOpen (virConnectPtr conn,
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) {
@@ -913,21 +913,21 @@ doRemoteOpen (virConnectPtr conn,
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;
@@ -1076,7 +1076,7 @@ remoteOpen (virConnectPtr conn,
(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"))
@@ -1090,10 +1090,10 @@ remoteOpen (virConnectPtr conn,
* 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"))
@@ -1142,7 +1142,7 @@ check_cert_file(const char *type, const char *file)
static void remote_debug_gnutls_log(int level, const char* str) {
- DEBUG("%d %s", level, str);
+ VIR_DEBUG("%d %s", level, str);
}
static int
@@ -1252,7 +1252,7 @@ initialize_gnutls(char *pkipath, int flags)
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);
@@ -1264,7 +1264,7 @@ initialize_gnutls(char *pkipath, int flags)
}
/* 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,
@@ -1390,7 +1390,7 @@ negotiate_gnutls_on_connection (virConnectPtr conn,
/* 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;
}
@@ -7240,7 +7240,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
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) {
@@ -7305,7 +7305,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
}
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,
@@ -7353,7 +7353,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
}
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,
@@ -7408,7 +7408,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
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);
@@ -7421,7 +7421,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
/* 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...
@@ -7468,7 +7468,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
}
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)
@@ -7480,7 +7480,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
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,
@@ -7493,7 +7493,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
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 */
@@ -7513,7 +7513,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
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);
@@ -7522,7 +7522,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
priv->is_secure = 1;
}
- DEBUG0("SASL authentication complete");
+ VIR_DEBUG0("SASL authentication complete");
priv->saslconn = saslconn;
ret = 0;
@@ -7548,7 +7548,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
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,
@@ -7557,7 +7557,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
return -1; /* virError already set by call */
}
- DEBUG0("PolicyKit-1 authentication complete");
+ VIR_DEBUG0("PolicyKit-1 authentication complete");
return 0;
}
# elif HAVE_POLKIT0
@@ -7577,7 +7577,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
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 */
@@ -7587,7 +7587,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
}
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",
@@ -7595,10 +7595,10 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
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);
@@ -7608,7 +7608,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
return -1; /* virError already set by call */
}
- DEBUG0("PolicyKit-0 authentication complete");
+ VIR_DEBUG0("PolicyKit-0 authentication complete");
return 0;
}
# endif /* HAVE_POLKIT0 */
@@ -8330,7 +8330,7 @@ remoteStreamPacket(virStreamPtr st,
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;
@@ -8475,7 +8475,7 @@ remoteStreamSend(virStreamPtr st,
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;
@@ -8504,7 +8504,7 @@ remoteStreamRecv(virStreamPtr st,
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;
@@ -8519,7 +8519,7 @@ remoteStreamRecv(virStreamPtr st,
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;
}
@@ -8549,7 +8549,7 @@ remoteStreamRecv(virStreamPtr st,
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)
@@ -8569,7 +8569,7 @@ remoteStreamRecv(virStreamPtr st,
remoteStreamEventTimerUpdate(privst);
- DEBUG("Done %d", rv);
+ VIR_DEBUG("Done %d", rv);
cleanup:
if (rv == -1)
@@ -9818,7 +9818,7 @@ remoteIODecodeMessageLength(struct private_data *priv) {
/* 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;
}
@@ -9977,10 +9977,10 @@ processCallDispatchMessage(virConnectPtr conn, struct private_data *priv,
/* 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;
}
@@ -10014,7 +10014,7 @@ processCallDispatchMessage(virConnectPtr conn, struct private_data *priv,
break;
default:
- DEBUG("Unexpected event proc %d", hdr->proc);
+ VIR_DEBUG("Unexpected event proc %d", hdr->proc);
break;
}
@@ -10023,7 +10023,7 @@ processCallDispatchMessage(virConnectPtr conn, struct private_data *priv,
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);
@@ -10271,7 +10271,7 @@ remoteIOEventLoop(virConnectPtr conn,
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",
@@ -10322,7 +10322,7 @@ remoteIOEventLoop(virConnectPtr conn,
* 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;
@@ -10336,11 +10336,11 @@ remoteIOEventLoop(virConnectPtr conn,
* 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;
@@ -10357,11 +10357,11 @@ remoteIOEventLoop(virConnectPtr conn,
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;
@@ -10408,7 +10408,7 @@ remoteIO(virConnectPtr conn,
{
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);
@@ -10439,7 +10439,7 @@ remoteIO(virConnectPtr conn,
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) {
@@ -10458,7 +10458,7 @@ remoteIO(virConnectPtr conn,
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
@@ -10482,7 +10482,7 @@ remoteIO(virConnectPtr conn,
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!
*
@@ -10509,7 +10509,7 @@ remoteIO(virConnectPtr conn,
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
@@ -10641,10 +10641,10 @@ remoteDomainEventFired(int watch,
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;
@@ -10658,7 +10658,7 @@ remoteDomainEventFired(int watch,
}
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);
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 52353a3..1c1a037 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -615,7 +615,7 @@ virSecurityDACSetProcessLabel(virSecurityManagerPtr mgr,
{
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;
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index c7ade6b..ac421c3 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -474,7 +474,7 @@ virStorageBackendDiskPartBoundries(virStoragePoolObjPtr pool,
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);
@@ -528,7 +528,7 @@ virStorageBackendDiskPartBoundries(virStoragePoolObjPtr 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) {
@@ -544,7 +544,7 @@ virStorageBackendDiskPartBoundries(virStoragePoolObjPtr pool,
/* 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;
}
@@ -658,7 +658,7 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
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);
if (!STRPREFIX(devname, srcname)) {
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 1937da0..b168570 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1164,7 +1164,7 @@ static virDrvOpenStatus testOpen(virConnectPtr conn,
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);
}
diff --git a/src/util/logging.h b/src/util/logging.h
index 574f68d..2e2734e 100644
--- a/src/util/logging.h
+++ b/src/util/logging.h
@@ -1,7 +1,7 @@
/*
* 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
@@ -28,7 +28,7 @@
/*
* 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,...) \
@@ -62,12 +62,6 @@
# 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
*/
diff --git a/src/util/util.c b/src/util/util.c
index 6161be6..ca64bf9 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -846,7 +846,7 @@ virRunWithHook(const char *const*argv,
virReportOOMError();
goto error;
}
- DEBUG0(argv_str);
+ VIR_DEBUG0(argv_str);
if ((execret = __virExec(argv, NULL, NULL,
&childpid, -1, &outfd, &errfd,
@@ -862,9 +862,9 @@ virRunWithHook(const char *const*argv,
}
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);
diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index f647eb9..9526ee4 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
@@ -87,7 +87,7 @@ int vboxRegister(void) {
/* 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,
@@ -98,36 +98,36 @@ int vboxRegister(void) {
* 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)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index cf3cbc6..1c4e46f 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -143,14 +143,14 @@ if (strUtf16) {\
\
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,\
@@ -617,7 +617,7 @@ static char *vboxGenerateMediumName(PRUint32 storageBus,
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);
@@ -677,7 +677,7 @@ static bool vboxGetDeviceDetails(const char *deviceName,
*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);
@@ -1027,14 +1027,14 @@ static virDrvOpenStatus vboxOpen(virConnectPtr conn,
#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;
@@ -1044,7 +1044,7 @@ static int vboxClose(virConnectPtr conn) {
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;
@@ -3560,22 +3560,22 @@ vboxSetBootDeviceOrder(virDomainDefPtr def, vboxGlobalData *data,
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) {
@@ -3617,17 +3617,17 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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) {
@@ -3734,15 +3734,15 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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;
@@ -3896,17 +3896,17 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
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 &&
@@ -4017,10 +4017,10 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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");
}
}
@@ -4129,8 +4129,8 @@ vboxAttachNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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;
@@ -4149,20 +4149,20 @@ vboxAttachNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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);
@@ -4263,13 +4263,13 @@ vboxAttachSerial(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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);
@@ -4296,12 +4296,12 @@ vboxAttachSerial(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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);
}
@@ -4342,13 +4342,13 @@ vboxAttachParallel(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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);
@@ -4370,12 +4370,12 @@ vboxAttachParallel(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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);
}
}
@@ -4446,20 +4446,20 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
#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;
@@ -4480,13 +4480,13 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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) {
@@ -4506,7 +4506,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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);
@@ -4639,7 +4639,7 @@ vboxAttachUSB(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
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;
@@ -6322,7 +6322,7 @@ vboxCallbackOnMachineStateChange(IVirtualBoxCallback *pThis,
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) {
@@ -6389,7 +6389,7 @@ static nsresult PR_COM_METHOD
vboxCallbackOnMachineDataChange(IVirtualBoxCallback *pThis,
PRUnichar *machineId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
return NS_OK;
@@ -6402,7 +6402,7 @@ vboxCallbackOnExtraDataCanChange(IVirtualBoxCallback *pThis,
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);
@@ -6414,7 +6414,7 @@ static nsresult PR_COM_METHOD
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);
@@ -6427,8 +6427,8 @@ static nsresult PR_COM_METHOD
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;
@@ -6447,7 +6447,7 @@ vboxCallbackOnMachineRegistered(IVirtualBoxCallback *pThis,
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) {
@@ -6499,7 +6499,7 @@ static nsresult PR_COM_METHOD
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;
@@ -6509,7 +6509,7 @@ static nsresult PR_COM_METHOD
vboxCallbackOnSnapshotTaken(IVirtualBoxCallback *pThis, PRUnichar *machineId,
PRUnichar *snapshotId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("snapshotId", snapshotId);
@@ -6520,7 +6520,7 @@ static nsresult PR_COM_METHOD
vboxCallbackOnSnapshotDiscarded(IVirtualBoxCallback *pThis, PRUnichar *machineId,
PRUnichar *snapshotId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("snapshotId", snapshotId);
@@ -6531,7 +6531,7 @@ static nsresult PR_COM_METHOD
vboxCallbackOnSnapshotChange(IVirtualBoxCallback *pThis, PRUnichar *machineId,
PRUnichar *snapshotId)
{
- DEBUG("IVirtualBoxCallback: %p", pThis);
+ VIR_DEBUG("IVirtualBoxCallback: %p", pThis);
DEBUGPRUnichar("machineId", machineId);
DEBUGPRUnichar("snapshotId", snapshotId);
@@ -6543,7 +6543,7 @@ vboxCallbackOnGuestPropertyChange(IVirtualBoxCallback *pThis,
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);
@@ -6559,7 +6559,7 @@ vboxCallbackAddRef(nsISupports *pThis)
c = ++g_pVBoxGlobalData->vboxCallBackRefCount;
- DEBUG("pThis: %p, vboxCallback AddRef: %d", pThis, c);
+ VIR_DEBUG("pThis: %p, vboxCallback AddRef: %d", pThis, c);
return c;
}
@@ -6576,7 +6576,7 @@ vboxCallbackRelease(nsISupports *pThis)
VIR_FREE(pThis);
}
- DEBUG("pThis: %p, vboxCallback Release: %d", pThis, c);
+ VIR_DEBUG("pThis: %p, vboxCallback Release: %d", pThis, c);
return c;
}
@@ -6594,13 +6594,13 @@ vboxCallbackQueryInterface(nsISupports *pThis, const nsID *iid, void **resultp)
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;
@@ -6708,7 +6708,7 @@ static int vboxDomainEventRegister (virConnectPtr conn,
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);
@@ -6809,7 +6809,7 @@ static int vboxDomainEventRegisterAny(virConnectPtr conn,
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);
@@ -6881,7 +6881,7 @@ static virDrvOpenStatus vboxNetworkOpen(virConnectPtr conn,
(data->vboxSession == NULL))
goto cleanup;
- DEBUG0("network initialized");
+ VIR_DEBUG0("network initialized");
/* conn->networkPrivateData = some network specific data */
return VIR_DRV_OPEN_SUCCESS;
@@ -6890,7 +6890,7 @@ cleanup:
}
static int vboxNetworkClose(virConnectPtr conn) {
- DEBUG0("network uninitialized");
+ VIR_DEBUG0("network uninitialized");
conn->networkPrivateData = NULL;
return 0;
}
@@ -6924,7 +6924,7 @@ static int vboxNumOfNetworks(virConnectPtr conn) {
VBOX_RELEASE(host);
- DEBUG("numActive: %d", ret);
+ VIR_DEBUG("numActive: %d", ret);
return ret;
}
@@ -6955,7 +6955,7 @@ static int vboxListNetworks(virConnectPtr conn, char **const names, int nnames)
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();
@@ -7006,7 +7006,7 @@ static int vboxNumOfDefinedNetworks(virConnectPtr conn) {
VBOX_RELEASE(host);
- DEBUG("numActive: %d", ret);
+ VIR_DEBUG("numActive: %d", ret);
return ret;
}
@@ -7037,7 +7037,7 @@ static int vboxListDefinedNetworks(virConnectPtr conn, char **const names, int n
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();
@@ -7087,7 +7087,7 @@ vboxNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
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);
@@ -7124,7 +7124,7 @@ static virNetworkPtr vboxNetworkLookupByName(virConnectPtr conn, const char *nam
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);
@@ -7232,7 +7232,7 @@ static virNetworkPtr vboxNetworkDefineCreateXML(virConnectPtr conn, const char *
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;
@@ -7692,7 +7692,7 @@ static virDrvOpenStatus vboxStorageOpen (virConnectPtr conn,
(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;
@@ -7701,7 +7701,7 @@ cleanup:
}
static int vboxStorageClose (virConnectPtr conn) {
- DEBUG0("vbox storage uninitialized");
+ VIR_DEBUG0("vbox storage uninitialized");
conn->storagePrivateData = NULL;
return 0;
}
@@ -7807,7 +7807,7 @@ static int vboxStoragePoolListVolumes(virStoragePoolPtr pool, char **const names
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();
@@ -7874,10 +7874,10 @@ static virStorageVolPtr vboxStorageVolLookupByName(virStoragePoolPtr pool, const
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);
@@ -7934,15 +7934,15 @@ static virStorageVolPtr vboxStorageVolLookupByKey(virConnectPtr conn, const char
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);
@@ -8007,9 +8007,9 @@ static virStorageVolPtr vboxStorageVolLookupByPath(virConnectPtr conn, const cha
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);
@@ -8241,12 +8241,12 @@ static int vboxStorageVolDelete(virStorageVolPtr vol,
#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)
@@ -8341,10 +8341,10 @@ static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info
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);
@@ -8435,7 +8435,7 @@ static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags A
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;
@@ -8505,9 +8505,9 @@ static char *vboxStorageVolGetPath(virStorageVolPtr vol) {
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);
}
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index b14c8db..f6d281e 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -323,35 +323,35 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
/* 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())
@@ -361,7 +361,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
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;
}
@@ -370,16 +370,16 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
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;
}
}
@@ -390,7 +390,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
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);
@@ -2163,7 +2163,7 @@ xenUnifiedAddDomainInfo(xenUnifiedDomainInfoListPtr list,
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;
}
}
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 4a0924f..9cb8e8c 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -1989,7 +1989,7 @@ xenHypervisorInit(void)
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;
@@ -2005,7 +2005,7 @@ xenHypervisorInit(void)
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;
@@ -2042,13 +2042,13 @@ xenHypervisorInit(void)
/* 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;
}
}
@@ -2058,7 +2058,7 @@ xenHypervisorInit(void)
/* 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;
}
}
@@ -2068,7 +2068,7 @@ xenHypervisorInit(void)
/* 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;
}
}
@@ -2078,7 +2078,7 @@ xenHypervisorInit(void)
/* 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;
}
}
@@ -2087,14 +2087,14 @@ xenHypervisorInit(void)
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;
}
@@ -2102,7 +2102,7 @@ xenHypervisorInit(void)
* 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);
diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
index 1067769..7d4ba4c 100644
--- a/src/xen/xen_inotify.c
+++ b/src/xen/xen_inotify.c
@@ -97,7 +97,7 @@ xenInotifyXenCacheLookup(virConnectPtr conn,
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;
}
@@ -105,7 +105,7 @@ xenInotifyXenCacheLookup(virConnectPtr conn,
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;
}
@@ -135,7 +135,7 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char *filename,
/* 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.
@@ -149,7 +149,7 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char *filename,
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;
}
}
@@ -288,7 +288,7 @@ xenInotifyEvent(int watch ATTRIBUTE_UNUSED,
virConnectPtr conn = data;
xenUnifiedPrivatePtr priv = NULL;
- DEBUG0("got inotify event");
+ VIR_DEBUG0("got inotify event");
if( conn && conn->privateData ) {
priv = conn->privateData;
@@ -437,7 +437,7 @@ xenInotifyOpen(virConnectPtr conn,
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 |
@@ -449,18 +449,18 @@ xenInotifyOpen(virConnectPtr conn,
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;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index bc23595..da8269d 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -522,7 +522,7 @@ xend_op_ext(virConnectPtr xend, const char *path, const char *key, va_list ap)
}
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);
@@ -4603,7 +4603,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
}
}
- 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
@@ -4626,7 +4626,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
if (ret == 0 && undefined_source)
xenDaemonDomainUndefine (domain);
- DEBUG0("migration done");
+ VIR_DEBUG0("migration done");
return ret;
}
@@ -5805,7 +5805,7 @@ xenDaemonFormatSxpr(virConnectPtr conn,
char *bufout;
int hvm = 0, i;
- DEBUG0("Formatting domain sexpr");
+ VIR_DEBUG0("Formatting domain sexpr");
virBufferAddLit(&buf, "(vm ");
virBufferEscapeSexpr(&buf, "(name '%s')", def->name);
@@ -6058,7 +6058,7 @@ xenDaemonFormatSxpr(virConnectPtr conn,
}
bufout = virBufferContentAndReset(&buf);
- DEBUG("Formatted sexpr: \n%s", bufout);
+ VIR_DEBUG("Formatted sexpr: \n%s", bufout);
return bufout;
error:
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 865805c..242a7de 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -363,13 +363,13 @@ xenXMConfigCacheRemoveFile(virConnectPtr conn,
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;
}
@@ -387,7 +387,7 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename)
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)) {
@@ -400,7 +400,7 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename)
/* 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;
}
@@ -436,7 +436,7 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename)
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);
@@ -465,7 +465,7 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename)
VIR_FREE(entry);
}
}
- DEBUG("Added config %s %s", entry->def->name, filename);
+ VIR_DEBUG("Added config %s %s", entry->def->name, filename);
return 0;
}
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 7fff560..d9aad1f 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -327,7 +327,7 @@ xenStoreOpen(virConnectPtr conn,
xenStoreWatchEvent,
conn,
NULL)) < 0)
- DEBUG0("Failed to add event handle, disabling events");
+ VIR_DEBUG0("Failed to add event handle, disabling events");
return 0;
}
@@ -353,12 +353,12 @@ xenStoreClose(virConnectPtr conn)
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 */
}
@@ -1196,7 +1196,7 @@ int xenStoreRemoveWatch(virConnectPtr conn,
list->watches[i]->path,
list->watches[i]->token))
{
- DEBUG0("WARNING: Could not remove watch");
+ VIR_DEBUG0("WARNING: Could not remove watch");
/* Not fatal, continue */
}
@@ -1351,7 +1351,7 @@ retry:
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;
}
@@ -1426,7 +1426,7 @@ retry:
VIR_FREE(new_domids);
if (!removed && retries--) {
- DEBUG0("No domains removed, retrying");
+ VIR_DEBUG0("No domains removed, retrying");
usleep(100 * 1000);
goto retry;
}
--
1.7.4
2
2
Two-argument free functions are uncommon; match the style elsewhere
by caching the callback at creation.
* src/util/hash.h (virHashCreate, virHashFree): Move deallocator
argument to creation.
* cfg.mk (useless_free_options): Add virHashFree.
* src/util/hash.c (_virHashTable): Track deallocator.
(virHashCreate, virHashFree): Update to new signature.
* src/conf/domain_conf.c (virDomainObjListDeinit)
(virDomainObjListInit, virDomainDiskDefForeachPath)
(virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
Update callers.
* src/conf/nwfilter_params.c (virNWFilterHashTableFree)
(virNWFilterHashTableCreate): Likewise.
* src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
Likewise.
* src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
Likewise.
* src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
* src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
(virNWFilterLearnShutdown): Likewise.
* src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
(qemuDomainPCIAddressSetFree): Likewise.
* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
---
Requires that this be applied first:
https://www.redhat.com/archives/libvir-list/2011-February/msg00784.html
cfg.mk | 1 +
src/conf/domain_conf.c | 49 ++++++++++++++++++----------------
src/conf/nwfilter_conf.c | 6 ++--
src/conf/nwfilter_params.c | 5 ++-
src/cpu/cpu_generic.c | 10 +++---
src/nwfilter/nwfilter_learnipaddr.c | 9 +++---
src/qemu/qemu_command.c | 16 ++++++-----
src/qemu/qemu_process.c | 4 +-
src/util/hash.c | 14 +++++----
src/util/hash.h | 9 +++---
src/xen/xm_internal.c | 12 ++++----
11 files changed, 73 insertions(+), 62 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index f870723..1bb9cbb 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -106,6 +106,7 @@ useless_free_options = \
--name=virDomainSoundDefFree \
--name=virDomainVideoDefFree \
--name=virDomainWatchdogDefFree \
+ --name=virHashFree \
--name=virInterfaceDefFree \
--name=virInterfaceIpDefFree \
--name=virInterfaceObjFree \
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e7c3409..b97c1f0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -391,26 +391,27 @@ VIR_ENUM_IMPL(virDomainTimerMode, VIR_DOMAIN_TIMER_MODE_LAST,
#define VIR_DOMAIN_XML_WRITE_FLAGS VIR_DOMAIN_XML_SECURE
#define VIR_DOMAIN_XML_READ_FLAGS VIR_DOMAIN_XML_INACTIVE
+static void
+virDomainObjListDeallocator(void *payload, const char *name ATTRIBUTE_UNUSED)
+{
+ virDomainObjPtr obj = payload;
+ virDomainObjLock(obj);
+ if (virDomainObjUnref(obj) > 0)
+ virDomainObjUnlock(obj);
+}
+
int virDomainObjListInit(virDomainObjListPtr doms)
{
- doms->objs = virHashCreate(50);
+ doms->objs = virHashCreate(50, virDomainObjListDeallocator);
if (!doms->objs)
return -1;
return 0;
}
-static void virDomainObjListDeallocator(void *payload, const char *name ATTRIBUTE_UNUSED)
-{
- virDomainObjPtr obj = payload;
- virDomainObjLock(obj);
- if (virDomainObjUnref(obj) > 0)
- virDomainObjUnlock(obj);
-}
-
void virDomainObjListDeinit(virDomainObjListPtr doms)
{
- virHashFree(doms->objs, virDomainObjListDeallocator);
+ virHashFree(doms->objs);
}
@@ -8751,25 +8752,27 @@ virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr s
}
/* Snapshot Obj List functions */
+static void
+virDomainSnapshotObjListDeallocator(void *payload,
+ const char *name ATTRIBUTE_UNUSED)
+{
+ virDomainSnapshotObjPtr obj = payload;
+
+ virDomainSnapshotObjUnref(obj);
+}
+
int virDomainSnapshotObjListInit(virDomainSnapshotObjListPtr snapshots)
{
- snapshots->objs = virHashCreate(50);
+ snapshots->objs = virHashCreate(50, virDomainSnapshotObjListDeallocator);
if (!snapshots->objs)
return -1;
return 0;
}
-static void virDomainSnapshotObjListDeallocator(void *payload,
- const char *name ATTRIBUTE_UNUSED)
-{
- virDomainSnapshotObjPtr obj = payload;
-
- virDomainSnapshotObjUnref(obj);
-}
-
-static void virDomainSnapshotObjListDeinit(virDomainSnapshotObjListPtr snapshots)
+static void
+virDomainSnapshotObjListDeinit(virDomainSnapshotObjListPtr snapshots)
{
- virHashFree(snapshots->objs, virDomainSnapshotObjListDeallocator);
+ virHashFree(snapshots->objs);
}
struct virDomainSnapshotNameData {
@@ -9002,7 +9005,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
}
}
- paths = virHashCreate(5);
+ paths = virHashCreate(5, NULL);
do {
virStorageFileMetadata meta;
@@ -9070,7 +9073,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
ret = 0;
cleanup:
- virHashFree(paths, NULL);
+ virHashFree(paths);
VIR_FREE(nextpath);
return ret;
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index c6a4d6f..1f250e9 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -2,7 +2,7 @@
* nwfilter_conf.c: network filter XML processing
* (derived from storage_conf.c)
*
- * Copyright (C) 2006-2010 Red Hat, Inc.
+ * Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* Copyright (C) 2010 IBM Corporation
@@ -2297,7 +2297,7 @@ virNWFilterTriggerVMFilterRebuild(virConnectPtr conn)
.conn = conn,
.err = 0,
.step = STEP_APPLY_NEW,
- .skipInterfaces = virHashCreate(0),
+ .skipInterfaces = virHashCreate(0, NULL),
};
if (!cb.skipInterfaces)
@@ -2328,7 +2328,7 @@ virNWFilterTriggerVMFilterRebuild(virConnectPtr conn)
&cb);
}
- virHashFree(cb.skipInterfaces, NULL);
+ virHashFree(cb.skipInterfaces);
return err;
}
diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c
index 23423fa..cd94b30 100644
--- a/src/conf/nwfilter_params.c
+++ b/src/conf/nwfilter_params.c
@@ -1,6 +1,7 @@
/*
* nwfilter_params.c: parsing and data maintenance of filter parameters
*
+ * Copyright (C) 2011 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation
*
* This library is free software; you can redistribute it and/or
@@ -102,7 +103,7 @@ virNWFilterHashTableFree(virNWFilterHashTablePtr table)
int i;
if (!table)
return;
- virHashFree(table->hashTable, hashDealloc);
+ virHashFree(table->hashTable);
for (i = 0; i < table->nNames; i++)
VIR_FREE(table->names[i]);
@@ -119,7 +120,7 @@ virNWFilterHashTableCreate(int n) {
virReportOOMError();
return NULL;
}
- ret->hashTable = virHashCreate(n);
+ ret->hashTable = virHashCreate(n, hashDealloc);
if (!ret->hashTable) {
VIR_FREE(ret);
return NULL;
diff --git a/src/cpu/cpu_generic.c b/src/cpu/cpu_generic.c
index a39f262..a98b109 100644
--- a/src/cpu/cpu_generic.c
+++ b/src/cpu/cpu_generic.c
@@ -2,7 +2,7 @@
* cpu_generic.c: CPU manipulation driver for architectures which are not
* handled by their own driver
*
- * Copyright (C) 2009--2010 Red Hat, Inc.
+ * Copyright (C) 2009-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
@@ -39,14 +39,14 @@ genericHashFeatures(virCPUDefPtr cpu)
virHashTablePtr hash;
unsigned int i;
- if ((hash = virHashCreate(cpu->nfeatures)) == NULL)
+ if ((hash = virHashCreate(cpu->nfeatures, NULL)) == NULL)
return NULL;
for (i = 0; i < cpu->nfeatures; i++) {
if (virHashAddEntry(hash,
cpu->features[i].name,
cpu->features + i)) {
- virHashFree(hash, NULL);
+ virHashFree(hash);
return NULL;
}
}
@@ -105,7 +105,7 @@ genericCompare(virCPUDefPtr host,
ret = VIR_CPU_COMPARE_IDENTICAL;
cleanup:
- virHashFree(hash, NULL);
+ virHashFree(hash);
return ret;
}
@@ -178,7 +178,7 @@ genericBaseline(virCPUDefPtr *cpus,
}
}
- virHashFree(hash, NULL);
+ virHashFree(hash);
}
if (VIR_ALLOC_N(cpu->features, count) < 0)
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index 02af918..8bd7b50 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -2,6 +2,7 @@
* nwfilter_learnipaddr.c: support for learning IP address used by a VM
* on an interface
*
+ * Copyright (C) 2011 Red Hat, Inc.
* Copyright (C) 2010 IBM Corp.
* Copyright (C) 2010 Stefan Berger
*
@@ -822,7 +823,7 @@ virNWFilterLearnInit(void) {
threadsTerminate = false;
- pendingLearnReq = virHashCreate(0);
+ pendingLearnReq = virHashCreate(0, freeLearnReqEntry);
if (!pendingLearnReq) {
return 1;
}
@@ -844,7 +845,7 @@ virNWFilterLearnInit(void) {
return 1;
}
- ifaceLockMap = virHashCreate(0);
+ ifaceLockMap = virHashCreate(0, freeIfaceLock);
if (!ifaceLockMap) {
virNWFilterLearnShutdown();
return 1;
@@ -879,12 +880,12 @@ virNWFilterLearnShutdown(void) {
virNWFilterLearnThreadsTerminate(false);
- virHashFree(pendingLearnReq, freeLearnReqEntry);
+ virHashFree(pendingLearnReq);
pendingLearnReq = NULL;
virNWFilterHashTableFree(ipAddressMap);
ipAddressMap = NULL;
- virHashFree(ifaceLockMap, freeIfaceLock);
+ virHashFree(ifaceLockMap);
ifaceLockMap = NULL;
}
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0db2843..a41859c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -745,6 +745,13 @@ cleanup:
}
+static void
+qemuDomainPCIAddressSetFreeEntry(void *payload,
+ const char *name ATTRIBUTE_UNUSED)
+{
+ VIR_FREE(payload);
+}
+
qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def)
{
qemuDomainPCIAddressSetPtr addrs;
@@ -752,7 +759,7 @@ qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def)
if (VIR_ALLOC(addrs) < 0)
goto no_memory;
- if (!(addrs->used = virHashCreate(10)))
+ if (!(addrs->used = virHashCreate(10, qemuDomainPCIAddressSetFreeEntry)))
goto error;
if (virDomainDeviceInfoIterate(def, qemuCollectPCIAddress, addrs) < 0)
@@ -823,11 +830,6 @@ int qemuDomainPCIAddressEnsureAddr(qemuDomainPCIAddressSetPtr addrs,
return ret;
}
-static void qemuDomainPCIAddressSetFreeEntry(void *payload, const char *name ATTRIBUTE_UNUSED)
-{
- VIR_FREE(payload);
-}
-
int qemuDomainPCIAddressReleaseAddr(qemuDomainPCIAddressSetPtr addrs,
virDomainDeviceInfoPtr dev)
@@ -852,7 +854,7 @@ void qemuDomainPCIAddressSetFree(qemuDomainPCIAddressSetPtr addrs)
if (!addrs)
return;
- virHashFree(addrs->used, qemuDomainPCIAddressSetFreeEntry);
+ virHashFree(addrs->used);
VIR_FREE(addrs);
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 31e3c60..9c5ea63 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -994,7 +994,7 @@ qemuProcessWaitForMonitor(struct qemud_driver* driver,
* reliable if it's available.
* Note that the monitor itself can be on a pty, so we still need to try the
* log output method. */
- paths = virHashCreate(0);
+ paths = virHashCreate(0, qemuProcessFreePtyPath);
if (paths == NULL)
goto cleanup;
@@ -1008,7 +1008,7 @@ qemuProcessWaitForMonitor(struct qemud_driver* driver,
ret = qemuProcessFindCharDevicePTYsMonitor(vm, paths);
cleanup:
- virHashFree(paths, qemuProcessFreePtyPath);
+ virHashFree(paths);
if (kill(vm->pid, 0) == -1 && errno == ESRCH) {
/* VM is dead, any other error raised in the interim is probably
diff --git a/src/util/hash.c b/src/util/hash.c
index 9497b60..d7950b9 100644
--- a/src/util/hash.c
+++ b/src/util/hash.c
@@ -55,6 +55,7 @@ struct _virHashTable {
struct _virHashEntry *table;
int size;
int nbElems;
+ virHashDeallocator f;
};
/*
@@ -80,13 +81,14 @@ virHashComputeKey(virHashTablePtr table, const char *name)
/**
* virHashCreate:
* @size: the size of the hash table
+ * @deallocator: function to call on each entry during virHashFree
*
* Create a new virHashTablePtr.
*
* Returns the newly created object, or NULL if an error occured.
*/
virHashTablePtr
-virHashCreate(int size)
+virHashCreate(int size, virHashDeallocator deallocator)
{
virHashTablePtr table = NULL;
@@ -100,6 +102,7 @@ virHashCreate(int size)
table->size = size;
table->nbElems = 0;
+ table->f = deallocator;
if (VIR_ALLOC_N(table->table, size) < 0) {
virReportOOMError();
VIR_FREE(table);
@@ -203,13 +206,12 @@ virHashGrow(virHashTablePtr table, int size)
/**
* virHashFree:
* @table: the hash table
- * @f: the deallocator function for items in the hash
*
* Free the hash @table and its contents. The userdata is
- * deallocated with @f if provided.
+ * deallocated with function provided at creation time.
*/
void
-virHashFree(virHashTablePtr table, virHashDeallocator f)
+virHashFree(virHashTablePtr table)
{
int i;
virHashEntryPtr iter;
@@ -228,8 +230,8 @@ virHashFree(virHashTablePtr table, virHashDeallocator f)
inside_table = 1;
while (iter) {
next = iter->next;
- if ((f != NULL) && (iter->payload != NULL))
- f(iter->payload, iter->name);
+ if ((table->f != NULL) && (iter->payload != NULL))
+ table->f(iter->payload, iter->name);
VIR_FREE(iter->name);
iter->payload = NULL;
if (!inside_table)
diff --git a/src/util/hash.h b/src/util/hash.h
index b0ef441..cf08e1a 100644
--- a/src/util/hash.h
+++ b/src/util/hash.h
@@ -3,7 +3,7 @@
* Description: This module implements the hash table and allocation and
* deallocation of domains and connections
*
- * Copy: Copyright (C) 2005 Red Hat, Inc.
+ * Copy: Copyright (C) 2005, 2011 Red Hat, Inc.
*
* Author: Bjorn Reese <bjorn.reese(a)systematic.dk>
* Daniel Veillard <veillard(a)redhat.com>
@@ -49,13 +49,14 @@ typedef void (*virHashIterator) (void *payload, const char *name, void *data);
* Returns 1 if the hash entry is desired, 0 to move
* to next entry
*/
-typedef int (*virHashSearcher) (const void *payload, const char *name, const void *data);
+typedef int (*virHashSearcher) (const void *payload, const char *name,
+ const void *data);
/*
* Constructor and destructor.
*/
-virHashTablePtr virHashCreate(int size);
-void virHashFree(virHashTablePtr table, virHashDeallocator f);
+virHashTablePtr virHashCreate(int size, virHashDeallocator f);
+void virHashFree(virHashTablePtr table);
int virHashSize(virHashTablePtr table);
/*
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 242a7de..bc304f0 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -1,7 +1,7 @@
/*
* xm_internal.h: helper routines for dealing with inactive domains
*
- * Copyright (C) 2006-2007, 2009-2010 Red Hat, Inc.
+ * Copyright (C) 2006-2007, 2009-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -587,12 +587,12 @@ xenXMOpen (virConnectPtr conn,
priv->configDir = XM_CONFIG_DIR;
- priv->configCache = virHashCreate(50);
+ priv->configCache = virHashCreate(50, xenXMConfigFree);
if (!priv->configCache)
return (-1);
- priv->nameConfigMap = virHashCreate(50);
+ priv->nameConfigMap = virHashCreate(50, NULL);
if (!priv->nameConfigMap) {
- virHashFree(priv->configCache, NULL);
+ virHashFree(priv->configCache);
priv->configCache = NULL;
return (-1);
}
@@ -611,8 +611,8 @@ xenXMOpen (virConnectPtr conn,
int xenXMClose(virConnectPtr conn) {
xenUnifiedPrivatePtr priv = conn->privateData;
- virHashFree(priv->nameConfigMap, NULL);
- virHashFree(priv->configCache, xenXMConfigFree);
+ virHashFree(priv->nameConfigMap);
+ virHashFree(priv->configCache);
return (0);
}
--
1.7.4
2
2
>
> I don't think you're supposed to inline pkg.m4 within aclocal...
I didn't check it carefully.
But it was generated by autoreconf -fi, I'm not quite sure what exactly it
did.
4
3
21 Feb '11
---
docs/Makefile.am | 12 ++++++++----
docs/devhelp/devhelp.xsl | 7 +++++++
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index adf74ee..c4926d4 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -88,7 +88,10 @@ EXTRA_DIST= \
sitemap.html.in \
todo.pl todo.cfg-example
-MAINTAINERCLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
+MAINTAINERCLEANFILES = \
+ $(addprefix $(srcdir)/,$(dot_html)) \
+ $(addprefix $(srcdir)/,$(apihtml)) \
+ $(addprefix $(srcdir)/,$(devhelphtml))
all: web
@@ -146,19 +149,20 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
-@if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML pages from the XML API" ; \
- $(XSLTPROC) --nonet $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi
+ $(XSLTPROC) --nonet -o $(srcdir)/ \
+ $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi
-@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
> /dev/null ; then \
echo "Validating the resulting XHTML pages" ; \
SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
- $(XMLLINT) --catalogs --nonet --valid --noout html/*.html ; \
+ $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
else echo "missing XHTML1 DTD" ; fi ; fi
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
-@echo Rebuilding devhelp files
-@if [ -x $(XSLTPROC) ] ; then \
- $(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \
+ $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
$(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
python_generated_files = \
diff --git a/docs/devhelp/devhelp.xsl b/docs/devhelp/devhelp.xsl
index 6600f5f..add5794 100644
--- a/docs/devhelp/devhelp.xsl
+++ b/docs/devhelp/devhelp.xsl
@@ -13,6 +13,13 @@
<!-- Build keys for all symbols -->
<xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
+ <xsl:template match="/">
+ <xsl:document xmlns="http://www.devhelp.net/book" href="libvirt.devhelp"
+ method="xml" encoding="UTF-8" indent="yes">
+ <xsl:apply-templates/>
+ </xsl:document>
+ </xsl:template>
+
<xsl:template match="/api">
<book title="{@name} Reference Manual" link="index.html" author="" name="{@name}">
<xsl:apply-templates select="files"/>
--
1.7.4.1
3
4
Hi,
I am about to fix https://bugzilla.redhat.com/show_bug.cgi?id=616721
It seems to me that problem is libvirt inserts a new element <mac
address='...'> during parsing interface XML with random mac address
which result in error described in BZ.
I am not sure wheter to fix it just in virsh or in
virDomainDetachDevice() as well. If in virsh, then other application may
fail without knowing why. But isn't the second option too aggressive?
Michal Privoznik
2
1
Hi,
I recently started looking at libvirt code, and while reading hash.c,
I noticed a few buglets and some cleanup that could be done. I was
planning to test them carefully before sending them (ie make sure
there's a unit test for this code), but since I don't know when I have
time for that, and since make check and make syntax-check are passing,
I'm just sending them for an initial review :)
If you prefer the patches inline/in separate mails, just let me know.
Thanks!
Christophe
6
28
Dear libvirt-list,
I want to send my translation to upstream. But I have waited for being
approved in translation site (
https://translate.fedoraproject.org/projects/p/libvirt/access/rq/add/) for a
long time. Does anyone here have the responsibility for approving membership
for libvirt translation? Please help me!
Regards,
HeroP
2
2
Even VPATH make dist succeeds now
---
docs/Makefile.am | 8 ++++----
docs/apibuild.py | 23 +++++++++++++----------
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 473bbbf..8c96e79 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -92,7 +92,7 @@ MAINTAINERCLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
all: web
-api: libvirt-api.xml libvirt-refs.xml
+api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
web: $(dot_html) html/index.html devhelp/index.html
@@ -146,7 +146,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
-@if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML pages from the XML API" ; \
- $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi
+ $(XSLTPROC) --nonet $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi
-@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
> /dev/null ; then \
@@ -159,7 +159,7 @@ $(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
-@echo Rebuilding devhelp files
-@if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \
- $(top_srcdir)/docs/devhelp/devhelp.xsl libvirt-api.xml ; fi
+ $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
python_generated_files = \
$(srcdir)/html/libvirt-libvirt.html \
@@ -179,7 +179,7 @@ clean-local:
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
maintainer-clean-local: clean-local
- rm -rf libvirt-api.xml libvirt-refs.xml todo.html.in
+ rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in
rebuild: api all
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 62b7557..895a313 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -1614,8 +1614,9 @@ class CParser:
class docBuilder:
"""A documentation builder"""
- def __init__(self, name, directories=['.'], includes=[]):
+ def __init__(self, name, path='.', directories=['.'], includes=[]):
self.name = name
+ self.path = path
self.directories = directories
self.includes = includes + included_files.keys()
self.modules = {}
@@ -2062,7 +2063,7 @@ class docBuilder:
output.write(" </index>\n")
def serialize(self):
- filename = "%s-api.xml" % self.name
+ filename = "%s/%s-api.xml" % (self.path, self.name)
print "Saving XML description %s" % (filename)
output = open(filename, "w")
output.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
@@ -2098,7 +2099,7 @@ class docBuilder:
output.write("</api>\n")
output.close()
- filename = "%s-refs.xml" % self.name
+ filename = "%s/%s-refs.xml" % (self.path, self.name)
print "Saving XML Cross References %s" % (filename)
output = open(filename, "w")
output.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
@@ -2113,14 +2114,16 @@ def rebuild():
srcdir = os.environ["srcdir"]
if glob.glob(srcdir + "/../src/libvirt.c") != [] :
print "Rebuilding API description for libvirt"
- builder = docBuilder("libvirt",
- [srcdir + "/../src",
- srcdir + "/../src/util",
- srcdir + "/../include/libvirt"],
- [])
+ dirs = [srcdir + "/../src",
+ srcdir + "/../src/util",
+ srcdir + "/../include/libvirt"]
+ if glob.glob(srcdir + "/../include/libvirt/libvirt.h") == [] :
+ dirs.append("../include/libvirt")
+ builder = docBuilder("libvirt", srcdir, dirs, [])
elif glob.glob("src/libvirt.c") != [] :
- print "Rebuilding API description for libvir"
- builder = docBuilder("libvirt", ["src", "src/util", "include/libvirt"],
+ print "Rebuilding API description for libvirt"
+ builder = docBuilder("libvirt", srcdir,
+ ["src", "src/util", "include/libvirt"],
[])
else:
print "rebuild() failed, unable to guess the module"
--
1.7.4.1
3
11
windows7 connect to linux/kvm by libvirt that is always failure.sothere, I want to know why? Why use qemu+tcp:// connect to linux/kvm is failure.
4
4
Hi
This patchset adds blkio cgroup support for qemu and lxc.
[PATCH 1/6] cgroup: Enable cgroup hierarchy for blkio cgroup
[PATCH 2/6 v3] cgroup: Implement blkio.weight tuning API.
[PATCH 3/6] Update XML Schema for new entries.
[PATCH 4/6 v3] qemu: Implement blkio tunable XML configuration and parsing.
[PATCH 5/6 v3] LXC: LXC Blkio weight configuration support.
[PATCH 6/6] Add documentation for blkiotune elements.
Will post a patchset to implement virsh command "blkiotune" to tune blkio
cgroup parameter later on.
v2 -> v3 Changes:
o Remove an unused local variable
o Rename virCgroup(Set/Get)Weight to virCgroup(Set/Get)BlkioWeight
o Add documentation in docs/formatdomain.html.in
o Update XML Schema for new entries.
docs/formatdomain.html.in | 10 ++++++++++
docs/schemas/domain.rng | 20 ++++++++++++++++++++
src/conf/domain_conf.c | 13 +++++++++++++
src/conf/domain_conf.h | 4 ++++
src/libvirt_private.syms | 2 ++
src/lxc/lxc_controller.c | 10 ++++++++++
src/qemu/qemu_cgroup.c | 16 +++++++++++++++-
src/qemu/qemu_conf.c | 3 ++-
src/util/cgroup.c | 41 ++++++++++++++++++++++++++++++++++++++++-
src/util/cgroup.h | 4 ++++
10 files changed, 120 insertions(+), 3 deletions(-)
Thanks
Gui
4
29
This patch added following functions for domain:
* integer libvirt_domain_get_autostart(resource $domain)
return 1, 0, and -1 indicates true, false, and error.
* bool libvirt_domain_set_autostart(resource $domain, bool $autosatrt)
return ture on succeess and false on failure.
* integer libvirt_domain_is_active(resource $domain)
return 1, 0, and -1 indicates true, false, and error.
modified: src/libvirt.c
modified: src/php_libvirt.h
---
src/libvirt.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
src/php_libvirt.h | 3 +++
2 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 570511e..748d898 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -63,6 +63,9 @@ static function_entry libvirt_functions[] = {
PHP_FE(libvirt_domain_memory_stats,NULL)
PHP_FE(libvirt_domain_block_stats,NULL)
PHP_FE(libvirt_domain_interface_stats,NULL)
+ PHP_FE(libvirt_domain_get_autostart, NULL)
+ PHP_FE(libvirt_domain_set_autostart, NULL)
+ PHP_FE(libvirt_domain_is_active, NULL)
PHP_FE(libvirt_version,NULL)
PHP_FE(libvirt_domain_get_connect, NULL)
PHP_FE(libvirt_domain_migrate, NULL)
@@ -70,7 +73,7 @@ static function_entry libvirt_functions[] = {
PHP_FE(libvirt_domain_get_job_info, NULL)
PHP_FE(libvirt_domain_xml_xpath, NULL)
PHP_FE(libvirt_domain_get_block_info, NULL)
- PHP_FE(libvirt_domain_get_network_info, NULL)
+ PHP_FE(libvirt_domain_get_network_info, NULL)
PHP_FE(libvirt_list_storagepools,NULL)
PHP_FE(libvirt_storagepool_lookup_by_name,NULL)
PHP_FE(libvirt_storagepool_list_volumes,NULL)
@@ -2200,6 +2203,46 @@ PHP_FUNCTION(libvirt_domain_interface_stats)
LONGLONG_ASSOC(return_value, "tx_drop", stats.tx_drop);
}
+PHP_FUNCTION(libvirt_domain_get_autostart)
+{
+ php_libvirt_domain *domain = NULL;
+ zval *zdomain;
+ int flags = 0;
+
+ GET_DOMAIN_FROM_ARGS ("r", &zdomain);
+
+ if (virDomainGetAutostart (domain->domain, &flags) != 0)
+ {
+ RETURN_LONG (-1);
+ }
+ RETURN_LONG ((long)flags);
+}
+
+PHP_FUNCTION(libvirt_domain_set_autostart)
+{
+ php_libvirt_domain *domain = NULL;
+ zval *zdomain;
+ zend_bool flags = 0;
+
+ GET_DOMAIN_FROM_ARGS ("rb", &zdomain, &flags);
+
+ if (virDomainSetAutostart (domain->domain, flags) != 0)
+ {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+}
+
+PHP_FUNCTION(libvirt_domain_is_active)
+{
+ php_libvirt_domain *domain = NULL;
+ zval *zdomain;
+
+ GET_DOMAIN_FROM_ARGS ("r", &zdomain);
+
+ RETURN_LONG (virDomainIsActive(domain->domain));
+}
+
PHP_FUNCTION(libvirt_version)
{
unsigned long libVer;
diff --git a/src/php_libvirt.h b/src/php_libvirt.h
index 054df46..213d27f 100644
--- a/src/php_libvirt.h
+++ b/src/php_libvirt.h
@@ -107,6 +107,9 @@ PHP_FUNCTION(libvirt_domain_memory_peek);
PHP_FUNCTION(libvirt_domain_memory_stats);
PHP_FUNCTION(libvirt_domain_block_stats);
PHP_FUNCTION(libvirt_domain_interface_stats);
+PHP_FUNCTION(libvirt_domain_get_autostart);
+PHP_FUNCTION(libvirt_domain_set_autostart);
+PHP_FUNCTION(libvirt_domain_is_active);
PHP_FUNCTION(libvirt_version);
PHP_FUNCTION(libvirt_domain_get_connect);
PHP_FUNCTION(libvirt_domain_migrate);
--
1.7.1
1
0
Hi all:
This patch updeted the building system.
* Added necessary checkings in configure.ac
* Cleared up libvirt-php.spec and src/Makefile.am
BTW, I've changed my email to business address.
Lyre (2):
spec file cleanup
Added checkings for tools and libraries
aclocal.m4 | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 12 ++++
libvirt-php.spec | 8 +-
src/Makefile.am | 30 +++------
4 files changed, 216 insertions(+), 23 deletions(-)
4
5
[libvirt] [PATCH] 802.1Qbh: Delay IFF_UP'ing interface until migration final stage
by Roopa Prabhu 19 Feb '11
by Roopa Prabhu 19 Feb '11
19 Feb '11
From: Roopa Prabhu <roprabhu(a)cisco.com>
Current code does an IFF_UP on a 8021Qbh interface immediately after a port
profile set. This is ok in most cases except when its the migration prepare
stage. During migration we want to postpone IFF_UP'ing the interface on the
destination host until the source host has disassociated the interface.
This patch moves IFF_UP of the interface to the final stage of migration.
The motivation for this change is to postpone any addr registrations on the
destination host until the source host has done the addr deregistrations.
While at it, for symmetry with associate move ifDown of a 8021Qbh interface
to before disassociate
Signed-off-by: Roopa Prabhu <roprabhu(a)cisco.com>
Signed-off-by: David Wang <dwang2(a)cisco.com>
Signed-off-by: Christian Benvenuti <benve(a)cisco.com>
---
src/util/macvtap.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/util/macvtap.c b/src/util/macvtap.c
index 8814400..a71db86 100644
--- a/src/util/macvtap.c
+++ b/src/util/macvtap.c
@@ -1470,8 +1470,6 @@ doPortProfileOp8021Qbh(const char *ifname,
NULL,
vf,
PORT_REQUEST_DISASSOCIATE);
- if (!rc)
- ifaceUp(ifname);
break;
case DISASSOCIATE:
@@ -1484,7 +1482,6 @@ doPortProfileOp8021Qbh(const char *ifname,
NULL,
vf,
PORT_REQUEST_DISASSOCIATE);
- ifaceDown(ifname);
break;
default:
@@ -1550,10 +1547,11 @@ vpAssociatePortProfileId(const char *macvtap_ifname,
case VIR_VIRTUALPORT_8021QBH:
/* avoid associating twice */
- if (vmOp == VIR_VM_OP_MIGRATE_IN_FINISH)
- break;
- rc = doPortProfileOp8021Qbh(linkdev, macvtap_macaddr,
- virtPort, vmuuid, ASSOCIATE);
+ if (vmOp != VIR_VM_OP_MIGRATE_IN_FINISH)
+ rc = doPortProfileOp8021Qbh(linkdev, macvtap_macaddr,
+ virtPort, vmuuid, ASSOCIATE);
+ if (vmOp != VIR_VM_OP_MIGRATE_IN_START && !rc)
+ ifaceUp(linkdev);
break;
}
@@ -1600,6 +1598,7 @@ vpDisassociatePortProfileId(const char *macvtap_ifname,
/* avoid disassociating twice */
if (vmOp == VIR_VM_OP_MIGRATE_IN_FINISH)
break;
+ ifaceDown(linkdev);
rc = doPortProfileOp8021Qbh(linkdev, macvtap_macaddr,
virtPort, NULL, DISASSOCIATE);
break;
2
1
This patch adds the possibility to not just drop packets, but to also
have them rejected where iptables at least sends an ICMP msg back to the
originator. On ebtables this again maps into dropping packets since
rejecting is not supported.
I am adding 'since 0.8.9' to the docs assuming this will be the next
version of libvirt.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
docs/formatnwfilter.html.in | 8 +++++---
docs/schemas/nwfilter.rng | 1 +
src/conf/nwfilter_conf.c | 6 ++++--
src/conf/nwfilter_conf.h | 1 +
src/nwfilter/nwfilter_ebiptables_driver.c | 15 +++++++++++++--
5 files changed, 24 insertions(+), 7 deletions(-)
Index: libvirt-acl/src/conf/nwfilter_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.c
+++ libvirt-acl/src/conf/nwfilter_conf.c
@@ -53,11 +53,13 @@
VIR_ENUM_IMPL(virNWFilterRuleAction, VIR_NWFILTER_RULE_ACTION_LAST,
"drop",
- "accept");
+ "accept",
+ "reject");
VIR_ENUM_IMPL(virNWFilterJumpTarget, VIR_NWFILTER_RULE_ACTION_LAST,
"DROP",
- "ACCEPT");
+ "ACCEPT",
+ "REJECT");
VIR_ENUM_IMPL(virNWFilterRuleDirection, VIR_NWFILTER_RULE_DIRECTION_LAST,
"in",
Index: libvirt-acl/src/conf/nwfilter_conf.h
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.h
+++ libvirt-acl/src/conf/nwfilter_conf.h
@@ -291,6 +291,7 @@ struct _udpliteHdrFilterDef {
enum virNWFilterRuleActionType {
VIR_NWFILTER_RULE_ACTION_DROP = 0,
VIR_NWFILTER_RULE_ACTION_ACCEPT,
+ VIR_NWFILTER_RULE_ACTION_REJECT,
VIR_NWFILTER_RULE_ACTION_LAST,
};
Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -1516,7 +1516,7 @@ _iptablesCreateRuleInstance(int directio
if (rule->action == VIR_NWFILTER_RULE_ACTION_ACCEPT)
target = accept_target;
else {
- target = "DROP";
+ target = virNWFilterJumpTargetTypeToString(rule->action);
skipMatch = defMatch;
}
@@ -1880,6 +1880,7 @@ ebtablesCreateRuleInstance(char chainPre
number[20];
char chain[MAX_CHAINNAME_LENGTH];
virBuffer buf = VIR_BUFFER_INITIALIZER;
+ const char *target;
if (!ebtables_cmd_path) {
virNWFilterReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -2295,10 +2296,20 @@ ebtablesCreateRuleInstance(char chainPre
return -1;
}
+ switch (rule->action) {
+ case VIR_NWFILTER_RULE_ACTION_REJECT:
+ /* REJECT not supported */
+ target = virNWFilterJumpTargetTypeToString(
+ VIR_NWFILTER_RULE_ACTION_DROP);
+ break;
+ default:
+ target = virNWFilterJumpTargetTypeToString(rule->action);
+ }
+
virBufferVSprintf(&buf,
" -j %s" CMD_DEF_POST CMD_SEPARATOR
CMD_EXEC,
- virNWFilterJumpTargetTypeToString(rule->action));
+ target);
if (virBufferError(&buf)) {
virBufferFreeAndReset(&buf);
Index: libvirt-acl/docs/schemas/nwfilter.rng
===================================================================
--- libvirt-acl.orig/docs/schemas/nwfilter.rng
+++ libvirt-acl/docs/schemas/nwfilter.rng
@@ -839,6 +839,7 @@
<choice>
<value>drop</value>
<value>accept</value>
+ <value>reject</value>
</choice>
</define>
Index: libvirt-acl/docs/formatnwfilter.html.in
===================================================================
--- libvirt-acl.orig/docs/formatnwfilter.html.in
+++ libvirt-acl/docs/formatnwfilter.html.in
@@ -260,9 +260,11 @@
</p>
<ul>
<li>
- action -- mandatory; must either be <code>drop</code> or
<code>accept</code> if
- the evaluation of the filtering rule is supposed to drop or accept
- a packet
+ action -- mandatory; must either be <code>drop</code>,
+ <code>reject</code><span class="since">(since 0.8.9)</span>,
+ or <code>accept</code> if
+ the evaluation of the filtering rule is supposed to drop,
+ reject (using ICMP message), or accept a packet
</li>
<li>
direction -- mandatory; must either be <code>in</code>,
<code>out</code> or
2
2
18 Feb '11
I missed this one while fixing a similar bug in the domain
transient autostart tests.
Attempting to autostart a transient network results in
ERR_OPERATION_INVALID not ERR_INTERNAL_ERROR.
---
scripts/networks/051-transient-autostart.t | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/networks/051-transient-autostart.t b/scripts/networks/051-transient-autostart.t
index 2b83fbc..2e220d3 100644
--- a/scripts/networks/051-transient-autostart.t
+++ b/scripts/networks/051-transient-autostart.t
@@ -48,7 +48,7 @@ my $auto = $net->get_autostart();
ok(!$auto, "autostart is disabled for transient VMs");
-ok_error(sub { $net->set_autostart(1) }, "Set autostart not supported on transient VMs", Sys::Virt::Error::ERR_INTERNAL_ERROR);
+ok_error(sub { $net->set_autostart(1) }, "Set autostart not supported on transient VMs", Sys::Virt::Error::ERR_OPERATION_INVALID);
diag "Destroying the transient network";
$net->destroy;
--
1.7.3.1
2
2
Hi,
Libvirt currently fails to start with dnsmasq >= 2.56.
since dnsmasq now bails out with empty arguments. See
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613944
for the Debian bug and
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589885
for the upstream reasoning.
Tested with 2.55 and 2.56. O.k. to apply?
Cheers,
-- Guido
3
6
[libvirt] [PATCH] Remove all object hashtable caches from virConnectPtr
by Daniel P. Berrange 18 Feb '11
by Daniel P. Berrange 18 Feb '11
18 Feb '11
A followup to, merely rebased to latest GIT
http://www.redhat.com/archives/libvir-list/2010-October/msg01213.html
The virConnectPtr struct will cache instances of all other
objects. APIs like virDomainLookupByUUID will return a
cached object, so if you do virDomainLookupByUUID twice in
a row, you'll get the same exact virDomainPtr instance.
This does not have any performance benefit, since the actual
logic in virDomainLookupByUUID (and other APIs returning
virDomainPtr, etc instances) is not short-circuited. All
it does is to ensure there is only one single virDomainPtr
in existance for any given UUID.
The caching has a number of downsides though, all relating
to stale data. If APIs aren't careful to always overwrite
the 'id' field in virDomainPtr it may become out of data.
Likewise for the name field, if a guest is renamed, or if
a guest is deleted, and then a new one created with the
same UUID but different name.
This has been an ongoing, endless source of bugs for all
applications using libvirt from languages with garbage
collection, causing them to get virDomainPtr instances
from long ago with stale data.
The caching is also a waste of memory resources, since
both applications, and language bindings often maintain
their own hashtable caches of object instances.
This patch removes all the hash table caching, so all
APIs return brand new virDomainPtr (etc) object instances.
* src/datatypes.h: Delete all hash tables.
* src/datatypes.c: Remove all object caching code
---
src/datatypes.c | 648 +++++++++++++------------------------------------------
src/datatypes.h | 10 -
2 files changed, 151 insertions(+), 507 deletions(-)
diff --git a/src/datatypes.c b/src/datatypes.c
index 1b68f6a..0864349 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -41,117 +41,6 @@
* *
************************************************************************/
-/**
- * virDomainFreeName:
- * @domain: a domain object
- *
- * Destroy the domain object, this is just used by the domain hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virDomainFreeName(virDomainPtr domain, const char *name ATTRIBUTE_UNUSED)
-{
- return (virUnrefDomain(domain));
-}
-
-/**
- * virNetworkFreeName:
- * @network: a network object
- *
- * Destroy the network object, this is just used by the network hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virNetworkFreeName(virNetworkPtr network, const char *name ATTRIBUTE_UNUSED)
-{
- return (virUnrefNetwork(network));
-}
-
-/**
- * virInterfaceFreeName:
- * @interface: an interface object
- *
- * Destroy the interface object, this is just used by the interface hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virInterfaceFreeName(virInterfacePtr iface, const char *name ATTRIBUTE_UNUSED)
-{
- return (virUnrefInterface(iface));
-}
-
-/**
- * virStoragePoolFreeName:
- * @pool: a pool object
- *
- * Destroy the pool object, this is just used by the pool hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virStoragePoolFreeName(virStoragePoolPtr pool, const char *name ATTRIBUTE_UNUSED)
-{
- return (virUnrefStoragePool(pool));
-}
-
-/**
- * virStorageVolFreeName:
- * @vol: a vol object
- *
- * Destroy the vol object, this is just used by the vol hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virStorageVolFreeName(virStorageVolPtr vol, const char *name ATTRIBUTE_UNUSED)
-{
- return (virUnrefStorageVol(vol));
-}
-
-/**
- * virSecretFreeName:
- * @secret: a secret object
- *
- * Destroy the secret object, this is just used by the secret hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virSecretFreeName(virSecretPtr secret, const char *name ATTRIBUTE_UNUSED)
-{
- return virUnrefSecret(secret);
-}
-
-/**
- * virNWFilterFreeName:
- * @nwfilter: a nwfilter object
- *
- * Destroy the nwfilter object, this is just used by the nwfilter hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virNWFilterFreeName(virNWFilterPtr nwfilter, const char *name ATTRIBUTE_UNUSED)
-{
- return virUnrefNWFilter(nwfilter);
-}
-
-/**
- * virDomainSnapshotFreeName:
- * @snapshot: a domain snapshotobject
- *
- * Destroy the domain snapshot object, this is just used by the domain hash callback.
- *
- * Returns 0 in case of success and -1 in case of failure.
- */
-static int
-virDomainSnapshotFreeName(virDomainSnapshotPtr snapshot, const char *name ATTRIBUTE_UNUSED)
-{
- return (virUnrefDomainSnapshot(snapshot));
-}
/**
* virGetConnect:
@@ -179,45 +68,12 @@ virGetConnect(void) {
ret->privateData = NULL;
ret->networkPrivateData = NULL;
ret->interfacePrivateData = NULL;
- ret->domains = virHashCreate(20);
- if (ret->domains == NULL)
- goto failed;
- ret->networks = virHashCreate(20);
- if (ret->networks == NULL)
- goto failed;
- ret->interfaces = virHashCreate(20);
- if (ret->interfaces == NULL)
- goto failed;
- ret->storagePools = virHashCreate(20);
- if (ret->storagePools == NULL)
- goto failed;
- ret->storageVols = virHashCreate(20);
- if (ret->storageVols == NULL)
- goto failed;
- ret->nodeDevices = virHashCreate(256);
- if (ret->nodeDevices == NULL)
- goto failed;
- ret->secrets = virHashCreate(20);
- if (ret->secrets == NULL)
- goto failed;
- ret->nwfilters = virHashCreate(20);
- if (ret->nwfilters == NULL)
- goto failed;
ret->refs = 1;
return(ret);
failed:
if (ret != NULL) {
- virHashFree(ret->domains, (virHashDeallocator) virDomainFreeName);
- virHashFree(ret->networks, (virHashDeallocator) virNetworkFreeName);
- virHashFree(ret->interfaces, (virHashDeallocator) virInterfaceFreeName);
- virHashFree(ret->storagePools, (virHashDeallocator) virStoragePoolFreeName);
- virHashFree(ret->storageVols, (virHashDeallocator) virStorageVolFreeName);
- virHashFree(ret->nodeDevices, (virHashDeallocator) virNodeDeviceFree);
- virHashFree(ret->secrets, (virHashDeallocator) virSecretFreeName);
- virHashFree(ret->nwfilters, (virHashDeallocator) virNWFilterFreeName);
-
virMutexDestroy(&ret->lock);
VIR_FREE(ret);
}
@@ -259,15 +115,6 @@ virReleaseConnect(virConnectPtr conn) {
virMutexLock(&conn->lock);
- virHashFree(conn->domains, (virHashDeallocator) virDomainFreeName);
- virHashFree(conn->networks, (virHashDeallocator) virNetworkFreeName);
- virHashFree(conn->interfaces, (virHashDeallocator) virInterfaceFreeName);
- virHashFree(conn->storagePools, (virHashDeallocator) virStoragePoolFreeName);
- virHashFree(conn->storageVols, (virHashDeallocator) virStorageVolFreeName);
- virHashFree(conn->nodeDevices, (virHashDeallocator) virNodeDeviceFree);
- virHashFree(conn->secrets, (virHashDeallocator) virSecretFreeName);
- virHashFree(conn->nwfilters, (virHashDeallocator) virNWFilterFreeName);
-
virResetError(&conn->err);
xmlFreeURI(conn->uri);
@@ -341,42 +188,23 @@ virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) {
virUUIDFormat(uuid, uuidstr);
- ret = (virDomainPtr) virHashLookup(conn->domains, uuidstr);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->magic = VIR_DOMAIN_MAGIC;
- ret->conn = conn;
- ret->id = -1;
- memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
- ret->snapshots = virHashCreate(20);
- if (ret->snapshots == NULL) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to create domain snapshots hash"));
- goto error;
- }
-
- if (virHashAddEntry(conn->domains, uuidstr, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to add domain to connection hash table"));
- goto error;
- }
- conn->refs++;
- DEBUG("New hash entry %p", ret);
- } else {
- DEBUG("Existing hash entry %p: refs now %d", ret, ret->refs+1);
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
}
+ ret->magic = VIR_DOMAIN_MAGIC;
+ ret->conn = conn;
+ ret->id = -1;
+ memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
+
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return(ret);
@@ -409,17 +237,9 @@ virReleaseDomain(virDomainPtr domain) {
virUUIDFormat(domain->uuid, uuidstr);
DEBUG("release domain %p %s %s", domain, domain->name, uuidstr);
- if (virHashRemoveEntry(conn->domains, uuidstr, NULL) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain missing from connection hash table"));
- conn = NULL;
- }
-
domain->magic = -1;
domain->id = -1;
VIR_FREE(domain->name);
- virHashFree(domain->snapshots, (virHashDeallocator) virDomainSnapshotFreeName);
VIR_FREE(domain);
if (conn) {
@@ -500,31 +320,22 @@ virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid) {
virUUIDFormat(uuid, uuidstr);
- ret = (virNetworkPtr) virHashLookup(conn->networks, uuidstr);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->magic = VIR_NETWORK_MAGIC;
- ret->conn = conn;
- memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
-
- if (virHashAddEntry(conn->networks, uuidstr, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to add network to connection hash table"));
- goto error;
- }
- conn->refs++;
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
}
+ ret->magic = VIR_NETWORK_MAGIC;
+ ret->conn = conn;
+ memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
+
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return(ret);
@@ -557,13 +368,6 @@ virReleaseNetwork(virNetworkPtr network) {
virUUIDFormat(network->uuid, uuidstr);
DEBUG("release network %p %s %s", network, network->name, uuidstr);
- if (virHashRemoveEntry(conn->networks, uuidstr, NULL) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("network missing from connection hash table"));
- conn = NULL;
- }
-
network->magic = -1;
VIR_FREE(network->name);
VIR_FREE(network);
@@ -647,70 +451,28 @@ virGetInterface(virConnectPtr conn, const char *name, const char *mac) {
virMutexLock(&conn->lock);
- ret = (virInterfacePtr) virHashLookup(conn->interfaces, name);
-
- if (ret != NULL) {
- if (STRCASENEQ(ret->mac, mac)) {
- /*
- * If the mac address has changed, try to modify it in
- * place, which will only work if the new mac is the
- * same length as, or shorter than, the old mac.
- */
- size_t newmaclen = strlen(mac);
- size_t oldmaclen = strlen(ret->mac);
- if (newmaclen <= oldmaclen) {
- strcpy(ret->mac, mac);
- } else {
- /*
- * If it's longer, we're kind of screwed, because we
- * can't add a new hashtable entry (it would clash
- * with the existing entry of same name), and we can't
- * free/re-alloc the existing entry's mac, as some
- * other thread may already be using the existing mac
- * pointer. Fortunately, this should never happen,
- * since the length of the mac address for any
- * interface is determined by the type of the
- * interface, and that is unlikely to change.
- */
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to change interface mac address "
- "from %s to %s due to differing lengths."),
- ret->mac, mac);
- ret = NULL;
- goto error;
- }
- }
- } else {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->mac = strdup(mac);
- if (ret->mac == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->mac = strdup(mac);
+ if (ret->mac == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
- ret->magic = VIR_INTERFACE_MAGIC;
- ret->conn = conn;
+ ret->magic = VIR_INTERFACE_MAGIC;
+ ret->conn = conn;
- if (virHashAddEntry(conn->interfaces, name, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to add interface to connection hash table"));
- goto error;
- }
- conn->refs++;
- }
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return(ret);
@@ -741,15 +503,6 @@ virReleaseInterface(virInterfacePtr iface) {
virConnectPtr conn = iface->conn;
DEBUG("release interface %p %s", iface, iface->name);
- if (virHashRemoveEntry(conn->interfaces, iface->name, NULL) < 0) {
- /* unlock before reporting error because error report grabs lock */
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("interface missing from connection hash table"));
- /* don't decr the conn refct if we weren't connected to it */
- conn = NULL;
- }
-
iface->magic = -1;
VIR_FREE(iface->name);
VIR_FREE(iface->mac);
@@ -836,31 +589,22 @@ virGetStoragePool(virConnectPtr conn, const char *name,
virUUIDFormat(uuid, uuidstr);
- ret = (virStoragePoolPtr) virHashLookup(conn->storagePools, uuidstr);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->magic = VIR_STORAGE_POOL_MAGIC;
- ret->conn = conn;
- memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
-
- if (virHashAddEntry(conn->storagePools, uuidstr, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to add storage pool to connection hash table"));
- goto error;
- }
- conn->refs++;
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
}
+ ret->magic = VIR_STORAGE_POOL_MAGIC;
+ ret->conn = conn;
+ memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
+
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return(ret);
@@ -894,13 +638,6 @@ virReleaseStoragePool(virStoragePoolPtr pool) {
virUUIDFormat(pool->uuid, uuidstr);
DEBUG("release pool %p %s %s", pool, pool->name, uuidstr);
- if (virHashRemoveEntry(conn->storagePools, uuidstr, NULL) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("pool missing from connection hash table"));
- conn = NULL;
- }
-
pool->magic = -1;
VIR_FREE(pool->name);
VIR_FREE(pool);
@@ -984,42 +721,33 @@ virGetStorageVol(virConnectPtr conn, const char *pool, const char *name,
}
virMutexLock(&conn->lock);
- ret = (virStorageVolPtr) virHashLookup(conn->storageVols, key);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->pool = strdup(pool);
- if (ret->pool == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- if (virStrcpyStatic(ret->key, key) == NULL) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
- _("Volume key %s too large for destination"), key);
- goto error;
- }
- ret->magic = VIR_STORAGE_VOL_MAGIC;
- ret->conn = conn;
-
- if (virHashAddEntry(conn->storageVols, key, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to add storage vol to connection hash table"));
- goto error;
- }
- conn->refs++;
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->pool = strdup(pool);
+ if (ret->pool == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ if (virStrcpyStatic(ret->key, key) == NULL) {
+ virMutexUnlock(&conn->lock);
+ virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ _("Volume key %s too large for destination"), key);
+ goto error;
}
+ ret->magic = VIR_STORAGE_VOL_MAGIC;
+ ret->conn = conn;
+
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return(ret);
@@ -1051,13 +779,6 @@ virReleaseStorageVol(virStorageVolPtr vol) {
virConnectPtr conn = vol->conn;
DEBUG("release vol %p %s", vol, vol->name);
- if (virHashRemoveEntry(conn->storageVols, vol->key, NULL) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("vol missing from connection hash table"));
- conn = NULL;
- }
-
vol->magic = -1;
VIR_FREE(vol->name);
VIR_FREE(vol->pool);
@@ -1136,30 +857,21 @@ virGetNodeDevice(virConnectPtr conn, const char *name)
}
virMutexLock(&conn->lock);
- ret = (virNodeDevicePtr) virHashLookup(conn->nodeDevices, name);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->magic = VIR_NODE_DEVICE_MAGIC;
- ret->conn = conn;
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
-
- if (virHashAddEntry(conn->nodeDevices, name, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to add node dev to conn hash table"));
- goto error;
- }
- conn->refs++;
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
}
+ ret->magic = VIR_NODE_DEVICE_MAGIC;
+ ret->conn = conn;
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return(ret);
@@ -1190,13 +902,6 @@ virReleaseNodeDevice(virNodeDevicePtr dev) {
virConnectPtr conn = dev->conn;
DEBUG("release dev %p %s", dev, dev->name);
- if (virHashRemoveEntry(conn->nodeDevices, dev->name, NULL) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("dev missing from connection hash table"));
- conn = NULL;
- }
-
dev->magic = -1;
VIR_FREE(dev->name);
VIR_FREE(dev->parent);
@@ -1278,30 +983,21 @@ virGetSecret(virConnectPtr conn, const unsigned char *uuid,
virUUIDFormat(uuid, uuidstr);
- ret = virHashLookup(conn->secrets, uuidstr);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->magic = VIR_SECRET_MAGIC;
- ret->conn = conn;
- memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
- ret->usageType = usageType;
- if (!(ret->usageID = strdup(usageID))) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- if (virHashAddEntry(conn->secrets, uuidstr, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to add secret to conn hash table"));
- goto error;
- }
- conn->refs++;
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->magic = VIR_SECRET_MAGIC;
+ ret->conn = conn;
+ memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
+ ret->usageType = usageType;
+ if (!(ret->usageID = strdup(usageID))) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
}
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return ret;
@@ -1333,13 +1029,6 @@ virReleaseSecret(virSecretPtr secret) {
virUUIDFormat(secret->uuid, uuidstr);
DEBUG("release secret %p %s", secret, uuidstr);
- if (virHashRemoveEntry(conn->secrets, uuidstr, NULL) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("secret missing from connection hash table"));
- conn = NULL;
- }
-
VIR_FREE(secret->usageID);
secret->magic = -1;
VIR_FREE(secret);
@@ -1480,31 +1169,22 @@ virGetNWFilter(virConnectPtr conn, const char *name, const unsigned char *uuid)
virUUIDFormat(uuid, uuidstr);
- ret = (virNWFilterPtr) virHashLookup(conn->nwfilters, uuidstr);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->magic = VIR_NWFILTER_MAGIC;
- ret->conn = conn;
- memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
-
- if (virHashAddEntry(conn->nwfilters, uuidstr, ret) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to add network filter to connection hash table"));
- goto error;
- }
- conn->refs++;
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&conn->lock);
+ virReportOOMError();
+ goto error;
}
+ ret->magic = VIR_NWFILTER_MAGIC;
+ ret->conn = conn;
+ memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN);
+
+ conn->refs++;
ret->refs++;
virMutexUnlock(&conn->lock);
return(ret);
@@ -1539,13 +1219,6 @@ virReleaseNWFilter(virNWFilterPtr nwfilter)
virUUIDFormat(nwfilter->uuid, uuidstr);
DEBUG("release nwfilter %p %s %s", nwfilter, nwfilter->name, uuidstr);
- if (virHashRemoveEntry(conn->nwfilters, uuidstr, NULL) < 0) {
- virMutexUnlock(&conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("pool missing from connection hash table"));
- conn = NULL;
- }
-
nwfilter->magic = -1;
VIR_FREE(nwfilter->name);
VIR_FREE(nwfilter);
@@ -1565,7 +1238,7 @@ virReleaseNWFilter(virNWFilterPtr nwfilter)
/**
* virUnrefNWFilter:
- * @pool: the nwfilter to unreference
+ * @nwfilter: the nwfilter to unreference
*
* Unreference the networkf itler. If the use count drops to zero, the
* structure is actually freed.
@@ -1583,7 +1256,7 @@ virUnrefNWFilter(virNWFilterPtr nwfilter)
return -1;
}
virMutexLock(&nwfilter->conn->lock);
- DEBUG("unref pool %p %s %d", nwfilter, nwfilter->name, nwfilter->refs);
+ DEBUG("unref nwfilter %p %s %d", nwfilter, nwfilter->name, nwfilter->refs);
nwfilter->refs--;
refs = nwfilter->refs;
if (refs == 0) {
@@ -1612,33 +1285,21 @@ virGetDomainSnapshot(virDomainPtr domain, const char *name)
}
virMutexLock(&domain->conn->lock);
- ret = (virDomainSnapshotPtr) virHashLookup(domain->snapshots, name);
- if (ret == NULL) {
- if (VIR_ALLOC(ret) < 0) {
- virMutexUnlock(&domain->conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->name = strdup(name);
- if (ret->name == NULL) {
- virMutexUnlock(&domain->conn->lock);
- virReportOOMError();
- goto error;
- }
- ret->magic = VIR_SNAPSHOT_MAGIC;
- ret->domain = domain;
-
- if (virHashAddEntry(domain->snapshots, name, ret) < 0) {
- virMutexUnlock(&domain->conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to add snapshot to domain hash table"));
- goto error;
- }
- domain->refs++;
- DEBUG("New hash entry %p", ret);
- } else {
- DEBUG("Existing hash entry %p: refs now %d", ret, ret->refs+1);
+ if (VIR_ALLOC(ret) < 0) {
+ virMutexUnlock(&domain->conn->lock);
+ virReportOOMError();
+ goto error;
+ }
+ ret->name = strdup(name);
+ if (ret->name == NULL) {
+ virMutexUnlock(&domain->conn->lock);
+ virReportOOMError();
+ goto error;
}
+ ret->magic = VIR_SNAPSHOT_MAGIC;
+ ret->domain = domain;
+
+ domain->refs++;
ret->refs++;
virMutexUnlock(&domain->conn->lock);
return(ret);
@@ -1658,13 +1319,6 @@ virReleaseDomainSnapshot(virDomainSnapshotPtr snapshot)
virDomainPtr domain = snapshot->domain;
DEBUG("release snapshot %p %s", snapshot, snapshot->name);
- if (virHashRemoveEntry(domain->snapshots, snapshot->name, NULL) < 0) {
- virMutexUnlock(&domain->conn->lock);
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("snapshot missing from domain hash table"));
- domain = NULL;
- }
-
snapshot->magic = -1;
VIR_FREE(snapshot->name);
VIR_FREE(snapshot);
diff --git a/src/datatypes.h b/src/datatypes.h
index 38f76a7..ebda992 100644
--- a/src/datatypes.h
+++ b/src/datatypes.h
@@ -24,7 +24,6 @@
# include "internal.h"
-# include "hash.h"
# include "driver.h"
# include "threads.h"
@@ -188,14 +187,6 @@ struct _virConnect {
virErrorFunc handler; /* associated handlet */
void *userData; /* the user data */
- virHashTablePtr domains; /* hash table for known domains */
- virHashTablePtr networks; /* hash table for known domains */
- virHashTablePtr interfaces; /* hash table for known interfaces */
- virHashTablePtr storagePools;/* hash table for known storage pools */
- virHashTablePtr storageVols;/* hash table for known storage vols */
- virHashTablePtr nodeDevices; /* hash table for known node devices */
- virHashTablePtr secrets; /* hash table for known secrets */
- virHashTablePtr nwfilters; /* hash table for known nw filters */
int refs; /* reference count */
};
@@ -211,7 +202,6 @@ struct _virDomain {
char *name; /* the domain external name */
int id; /* the domain ID */
unsigned char uuid[VIR_UUID_BUFLEN]; /* the domain unique identifier */
- virHashTablePtr snapshots; /* hash table for known snapshots */
};
/**
--
1.7.4
2
1
[libvirt] [PATCH] check device-mapper when building without storage mpath
by Wen Congyang 18 Feb '11
by Wen Congyang 18 Feb '11
18 Feb '11
When I build libvirt without libvirtd, I receive the following errors:
GEN virsh.1
CCLD virsh
../src/.libs/libvirt.so: undefined reference to `dm_is_dm_major'
collect2: ld returned 1 exit status
make[3]: *** [virsh] Error 1
My build step:
# ./autogen.sh --without-libvirtd
# make dist
# rpmbuild --nodeps --define "_sourcedir `pwd`" --define "_without_libvirtd 1" -ba libvirt.spec
This bug was caused by commit df1011ca.
Signed-off-by: Wen Congyang <wency(a)cn.fujitsu.com>
---
configure.ac | 35 ++++++++++++++++-------------------
1 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2bb6918..0f81484 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1697,25 +1697,22 @@ if test "$with_storage_mpath" = "check" && test "$with_linux" = "yes"; then
fi
AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"])
-if test "$with_storage_mpath" = "yes"; then
- DEVMAPPER_CFLAGS=
- DEVMAPPER_LIBS=
- PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no])
- if test "$DEVMAPPER_FOUND" = "no"; then
- # devmapper is missing pkg-config files in ubuntu, suse, etc
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- DEVMAPPER_FOUND=yes
- AC_CHECK_HEADER([libdevmapper.h],,[DEVMAPPER_FOUND=no])
- AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no])
- DEVMAPPER_LIBS="-ldevmapper"
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
- fi
- if test "$DEVMAPPER_FOUND" = "no" ; then
- AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt])
- fi
-
+DEVMAPPER_CFLAGS=
+DEVMAPPER_LIBS=
+PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no])
+if test "$DEVMAPPER_FOUND" = "no"; then
+ # devmapper is missing pkg-config files in ubuntu, suse, etc
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ DEVMAPPER_FOUND=yes
+ AC_CHECK_HEADER([libdevmapper.h],,[DEVMAPPER_FOUND=no])
+ AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no])
+ DEVMAPPER_LIBS="-ldevmapper"
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+if test "$DEVMAPPER_FOUND" = "no" ; then
+ AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt])
fi
AC_SUBST([DEVMAPPER_CFLAGS])
AC_SUBST([DEVMAPPER_LIBS])
--
1.7.1
6
11
[libvirt] [TCK] [PATCH] follow reordering of match extensions relative to state match
by Stefan Berger 18 Feb '11
by Stefan Berger 18 Feb '11
18 Feb '11
This patch adjusts the tck test cases following the reordering of the
match extensions relative to the state match in libvirt.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall | 30
+++++++--------
scripts/nwfilter/nwfilterxml2fwallout/example-2.fwall | 14 +++----
2 files changed, 22 insertions(+), 22 deletions(-)
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall
===================================================================
---
libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/comment-test.fwall
@@ -11,15 +11,15 @@
#iptables -L FI-vnet0 -n
Chain FI-vnet0 (1 references)
target prot opt source destination
-RETURN udp -- 0.0.0.0/0 10.1.2.3 MAC
01:02:03:04:05:06 DSCP match 0x22/* udp rule */ udp spts:291:400
dpts:564:1092 state NEW,ESTABLISHED ctdir REPLY
+RETURN udp -- 0.0.0.0/0 10.1.2.3 MAC
01:02:03:04:05:06 DSCP match 0x22udp spts:291:400 dpts:564:1092 state
NEW,ESTABLISHED ctdir REPLY/* udp rule */
#iptables -L FO-vnet0 -n
Chain FO-vnet0 (1 references)
target prot opt source destination
-ACCEPT udp -- 10.1.2.3 0.0.0.0/0 DSCP match
0x22/* udp rule */ udp spts:564:1092 dpts:291:400 state ESTABLISHED
ctdir ORIGINAL
+ACCEPT udp -- 10.1.2.3 0.0.0.0/0 DSCP match
0x22udp spts:564:1092 dpts:291:400 state ESTABLISHED ctdir ORIGINAL/*
udp rule */
#iptables -L HI-vnet0 -n
Chain HI-vnet0 (1 references)
target prot opt source destination
-RETURN udp -- 0.0.0.0/0 10.1.2.3 MAC
01:02:03:04:05:06 DSCP match 0x22/* udp rule */ udp spts:291:400
dpts:564:1092 state NEW,ESTABLISHED ctdir REPLY
+RETURN udp -- 0.0.0.0/0 10.1.2.3 MAC
01:02:03:04:05:06 DSCP match 0x22udp spts:291:400 dpts:564:1092 state
NEW,ESTABLISHED ctdir REPLY/* udp rule */
#iptables -L libvirt-host-in -n | grep HI-vnet0 | tr -s " "
HI-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [goto] PHYSDEV match --physdev-in
vnet0
#iptables -L libvirt-in -n | grep FI-vnet0 | tr -s " "
@@ -31,24 +31,24 @@ FO-vnet0 all -- 0.0.0.0/0 0.0.0.0/0 [got
#ip6tables -L FI-vnet0 -n
Chain FI-vnet0 (1 references)
target prot opt source destination
-RETURN tcp ::/0 a:b:c::/128 /*
tcp/ipv6 rule */ tcp spts:256:4369 dpts:32:33 state ESTABLISHED ctdir
ORIGINAL
-RETURN udp ::/0 ::/0 /*
`ls`;${COLUMNS};$(ls);"test";&'3 spaces' */ state ESTABLISHED ctdir
ORIGINAL
-RETURN sctp ::/0 ::/0 /* comment
with lone ', `, ", `, \, $x, and two spaces */ state ESTABLISHED ctdir
ORIGINAL
-RETURN ah ::/0 ::/0 /*
tmp=`mktemp`; echo ${RANDOM} > ${tmp} ; cat < ${tmp}; rm -f ${tmp} */
state ESTABLISHED ctdir ORIGINAL
+RETURN tcp ::/0 a:b:c::/128 tcp
spts:256:4369 dpts:32:33 state ESTABLISHED ctdir ORIGINAL/* tcp/ipv6
rule */
+RETURN udp ::/0 ::/0 state
ESTABLISHED ctdir ORIGINAL/* `ls`;${COLUMNS};$(ls);"test";&'3 spaces' */
+RETURN sctp ::/0 ::/0 state
ESTABLISHED ctdir ORIGINAL/* comment with lone ', `, ", `, \, $x, and
two spaces */
+RETURN ah ::/0 ::/0 state
ESTABLISHED ctdir ORIGINAL/* tmp=`mktemp`; echo ${RANDOM} > ${tmp} ; cat
< ${tmp}; rm -f ${tmp} */
#ip6tables -L FO-vnet0 -n
Chain FO-vnet0 (1 references)
target prot opt source destination
-ACCEPT tcp a:b:c::/128 ::/0 MAC
01:02:03:04:05:06 /* tcp/ipv6 rule */ tcp spts:32:33 dpts:256:4369 state
NEW,ESTABLISHED ctdir REPLY
-ACCEPT udp ::/0 ::/0 /*
`ls`;${COLUMNS};$(ls);"test";&'3 spaces' */ state NEW,ESTABLISHED
ctdir REPLY
-ACCEPT sctp ::/0 ::/0 /* comment
with lone ', `, ", `, \, $x, and two spaces */ state NEW,ESTABLISHED
ctdir REPLY
-ACCEPT ah ::/0 ::/0 /*
tmp=`mktemp`; echo ${RANDOM} > ${tmp} ; cat < ${tmp}; rm -f ${tmp} */
state NEW,ESTABLISHED ctdir REPLY
+ACCEPT tcp a:b:c::/128 ::/0 MAC
01:02:03:04:05:06 tcp spts:32:33 dpts:256:4369 state NEW,ESTABLISHED
ctdir REPLY/* tcp/ipv6 rule */
+ACCEPT udp ::/0 ::/0 state
NEW,ESTABLISHED ctdir REPLY/* `ls`;${COLUMNS};$(ls);"test";&'3 spaces' */
+ACCEPT sctp ::/0 ::/0 state
NEW,ESTABLISHED ctdir REPLY/* comment with lone ', `, ", `, \, $x, and
two spaces */
+ACCEPT ah ::/0 ::/0 state
NEW,ESTABLISHED ctdir REPLY/* tmp=`mktemp`; echo ${RANDOM} > ${tmp} ;
cat < ${tmp}; rm -f ${tmp} */
#ip6tables -L HI-vnet0 -n
Chain HI-vnet0 (1 references)
target prot opt source destination
-RETURN tcp ::/0 a:b:c::/128 /*
tcp/ipv6 rule */ tcp spts:256:4369 dpts:32:33 state ESTABLISHED ctdir
ORIGINAL
-RETURN udp ::/0 ::/0 /*
`ls`;${COLUMNS};$(ls);"test";&'3 spaces' */ state ESTABLISHED ctdir
ORIGINAL
-RETURN sctp ::/0 ::/0 /* comment
with lone ', `, ", `, \, $x, and two spaces */ state ESTABLISHED ctdir
ORIGINAL
-RETURN ah ::/0 ::/0 /*
tmp=`mktemp`; echo ${RANDOM} > ${tmp} ; cat < ${tmp}; rm -f ${tmp} */
state ESTABLISHED ctdir ORIGINAL
+RETURN tcp ::/0 a:b:c::/128 tcp
spts:256:4369 dpts:32:33 state ESTABLISHED ctdir ORIGINAL/* tcp/ipv6
rule */
+RETURN udp ::/0 ::/0 state
ESTABLISHED ctdir ORIGINAL/* `ls`;${COLUMNS};$(ls);"test";&'3 spaces' */
+RETURN sctp ::/0 ::/0 state
ESTABLISHED ctdir ORIGINAL/* comment with lone ', `, ", `, \, $x, and
two spaces */
+RETURN ah ::/0 ::/0 state
ESTABLISHED ctdir ORIGINAL/* tmp=`mktemp`; echo ${RANDOM} > ${tmp} ; cat
< ${tmp}; rm -f ${tmp} */
#ip6tables -L libvirt-host-in -n | grep vnet0 | tr -s " "
HI-vnet0 all ::/0 ::/0 [goto] PHYSDEV match --physdev-in vnet0
#ip6tables -L libvirt-in -n | grep vnet0 | tr -s " "
Index: libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/example-2.fwall
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilterxml2fwallout/example-2.fwall
+++ libvirt-tck/scripts/nwfilter/nwfilterxml2fwallout/example-2.fwall
@@ -1,20 +1,20 @@
#iptables -L FI-vnet0 -n
Chain FI-vnet0 (1 references)
target prot opt source destination
-RETURN all -- 0.0.0.0/0 0.0.0.0/0 /* out:
existing and related (ftp) connections */ state RELATED,ESTABLISHED
-RETURN udp -- 0.0.0.0/0 0.0.0.0/0 /* out:
DNS lookups */ udp dpt:53 state NEW
+RETURN all -- 0.0.0.0/0 0.0.0.0/0 state
RELATED,ESTABLISHED /* out: existing and related (ftp) connections */
+RETURN udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
state NEW /* out: DNS lookups */
DROP all -- 0.0.0.0/0 0.0.0.0/0 /* inout:
drop all non-accepted traffic */
#iptables -L FO-vnet0 -n
Chain FO-vnet0 (1 references)
target prot opt source destination
-ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 /* in:
existing connections */ state ESTABLISHED
-ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 /* in: ftp
and ssh */ tcp dpts:21:22 state NEW
-ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 /* in:
icmp */ state NEW
+ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state
ESTABLISHED /* in: existing connections */
+ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp
dpts:21:22 state NEW /* in: ftp and ssh */
+ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 state NEW
/* in: icmp */
DROP all -- 0.0.0.0/0 0.0.0.0/0 /* inout:
drop all non-accepted traffic */
#iptables -L HI-vnet0 -n
Chain HI-vnet0 (1 references)
target prot opt source destination
-RETURN all -- 0.0.0.0/0 0.0.0.0/0 /* out:
existing and related (ftp) connections */ state RELATED,ESTABLISHED
-RETURN udp -- 0.0.0.0/0 0.0.0.0/0 /* out:
DNS lookups */ udp dpt:53 state NEW
+RETURN all -- 0.0.0.0/0 0.0.0.0/0 state
RELATED,ESTABLISHED /* out: existing and related (ftp) connections */
+RETURN udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
state NEW /* out: DNS lookups */
DROP all -- 0.0.0.0/0 0.0.0.0/0 /* inout:
drop all non-accepted traffic */
2
5
Matthias
3
3
* .gnulib: update to latest gnulib for maint.mk fixes
---
In testing the latest release candidate, I ran 'make syntax-check'
out of habit, and it died miserably (even hanging waiting for
input on stdin). So I fixed maint.mk upstream:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/25340
However, we're so close to the release that I don't know if we want
this now, or if we just document that 0.8.8 is the last release where
'make syntax-check' on the tarball is expected to fail.
* .gnulib ecb020f...aa0f5d7 (30):
> maintainer-makefile: make syntax-check a no-op from tarballs
> longlong: tune, particularly for common case of c99
> getloadavg: set errno
> getloadavg: omit unused var
> autoupdate
> doc: update users.txt
> Consistent macro naming for macros that use GCC __attribute__.
> Don't interfere with a program's definition of __attribute__.
> maint: correct a ChangeLog attribution
> update from texinfo
> mbrtowc: Add more tests for native Windows platforms.
> mbrtowc: Work around native Windows bug.
> mbsinit: Work around mingw bug.
> mbsinit: Don't crash for a NULL argument.
> Don't interfere with a program's definition of __attribute__.
> Fix last ChangeLog entry.
> stdlib: don't get in the way of non-GCC __attribute__
> quotearg test: Avoid test failure on mingw.
> setlocale: Prefer gnulib's override over libintl's override.
> stdlib: support non-GCC __attribute__
> wcsrtombs: Work around bug on native Windows.
> mbsrtowcs: Work around bug on native Windows.
> Avoid setlocale bugs in tests.
> Fix ChangeLog entry.
> setlocale: Workaround native Windows bug.
> Remove unused test-setlocale1 argument.
> Tests for module 'setlocale'.
> New module 'setlocale'.
> Prepare for locale dependent tests on mingw.
> Prepare for locale dependent tests on mingw.
.gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index ecb020f..aa0f5d7 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit ecb020f2b046790d76d05d377ca1e864e2bc9fdc
+Subproject commit aa0f5d7586efe7044f6ca9e07be3f579ee0d5618
--
1.7.4
2
3
[libvirt] [PATCH v3] virsh: freecell --all getting wrong NUMA nodes count
by Michal Privoznik 18 Feb '11
by Michal Privoznik 18 Feb '11
18 Feb '11
Virsh freecell --all was not only getting wrong NUMA nodes count, but
even the NUMA nodes IDs. They doesn't have to be continuous, as I've
found out during testing this. Therefore a modification of
nodeGetCellsFreeMemory() error message.
---
Hope it's good this time :)
src/nodeinfo.c | 3 +-
tools/virsh.c | 68 ++++++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 54 insertions(+), 17 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 22d53e5..f4ea36e 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -468,7 +468,8 @@ nodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
long long mem;
if (numa_node_size64(n, &mem) < 0) {
nodeReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Failed to query NUMA free memory"));
+ _("Failed to query NUMA free memory for node: %d"),
+ n);
goto cleanup;
}
freeMems[numCells++] = mem;
diff --git a/tools/virsh.c b/tools/virsh.c
index 50d5e33..2e7cd72 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2283,9 +2283,15 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
int ret;
int cell, cell_given;
unsigned long long memory;
- unsigned long long *nodes = NULL;
+ xmlNodePtr *nodes = NULL;
+ unsigned long nodes_cnt;
+ unsigned long *nodes_id = NULL;
+ unsigned long long *nodes_free = NULL;
int all_given;
- virNodeInfo info;
+ int i;
+ char *cap_xml = NULL;
+ xmlDocPtr xml = NULL;
+ xmlXPathContextPtr ctxt = NULL;
if (!vshConnectionUsability(ctl, ctl->conn))
@@ -2301,32 +2307,56 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
}
if (all_given) {
- if (virNodeGetInfo(ctl->conn, &info) < 0) {
- vshError(ctl, "%s", _("failed to get NUMA nodes count"));
+ cap_xml = virConnectGetCapabilities(ctl->conn);
+ if (!cap_xml) {
+ vshError(ctl, "%s", _("unable to get node capabilities"));
goto cleanup;
}
- if (!info.nodes) {
- vshError(ctl, "%s", _("no NUMA nodes present"));
- goto cleanup;
- }
+ xml = xmlReadDoc((const xmlChar *) cap_xml, "node.xml", NULL,
+ XML_PARSE_NOENT | XML_PARSE_NONET |
+ XML_PARSE_NOWARNING);
- if (VIR_ALLOC_N(nodes, info.nodes) < 0) {
- vshError(ctl, "%s", _("could not allocate memory"));
+ if (!xml) {
+ vshError(ctl, "%s", _("unable to get node capabilities"));
goto cleanup;
}
- ret = virNodeGetCellsFreeMemory(ctl->conn, nodes, 0, info.nodes);
- if (ret != info.nodes) {
+ ctxt = xmlXPathNewContext(xml);
+ nodes_cnt = virXPathNodeSet("/capabilities/host/topology/cells/cell",
+ ctxt, &nodes);
+
+ if (nodes_cnt == -1) {
vshError(ctl, "%s", _("could not get information about "
- "all NUMA nodes"));
+ "NUMA topology"));
goto cleanup;
}
+ nodes_free = vshCalloc(ctl, nodes_cnt, sizeof(*nodes_free));
+ nodes_id = vshCalloc(ctl, nodes_cnt, sizeof(*nodes_id));
+
+ for (i = 0; i < nodes_cnt; i++) {
+ unsigned long id;
+ char *val = virXMLPropString(nodes[i], "id");
+ if (virStrToLong_ul(val, NULL, 10, &id)) {
+ vshError(ctl, "%s", _("conversion from string failed"));
+ goto cleanup;
+ }
+ VIR_FREE(val);
+ nodes_id[i]=id;
+ ret = virNodeGetCellsFreeMemory(ctl->conn, &(nodes_free[i]), id, 1);
+ if (ret != 1) {
+ vshError(ctl, _("failed to get free memory for NUMA node "
+ "nuber: %lu"), id);
+ goto cleanup;
+ }
+ }
+
memory = 0;
- for (cell = 0; cell < info.nodes; cell++) {
- vshPrint(ctl, "%5d: %10llu kB\n", cell, (nodes[cell]/1024));
- memory += nodes[cell];
+ for (cell = 0; cell < nodes_cnt; cell++) {
+ vshPrint(ctl, "%5lu: %10llu kB\n", nodes_id[cell],
+ (nodes_free[cell]/1024));
+ memory += nodes_free[cell];
}
vshPrintExtra(ctl, "--------------------\n");
@@ -2351,7 +2381,13 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
func_ret = TRUE;
cleanup:
+ xmlXPathFreeContext(ctxt);
+ if (xml)
+ xmlFreeDoc(xml);
VIR_FREE(nodes);
+ VIR_FREE(nodes_free);
+ VIR_FREE(nodes_id);
+ VIR_FREE(cap_xml);
return func_ret;
}
--
1.7.3.5
2
1
18 Feb '11
Consider this sequence of commands
$ ./configure
...
$ make
...
GEN libvirt.syms
...
$ ./configure --with-driver-modules
...
$ make
...
libvirt.syms doesn't get regenerated but it should as it should
contain virDriverLoadModule now.
make clean after a configure run doesn't help, as make clean dosen't
remove libvirt.syms.
So either the libvirt.syms rule needs to depend on something that
triggers a regeneration of libvirt.syms after a reconfiguration or
make clean needs to remove libvirt.syms.
I'm not sure about the correct solution here. Any suggestions?
Matthias
2
3
* configure.ac (gl_ASSERT_NO_GNULIB_POSIXCHECK): Use to reduce
time spent in configure.
---
This skips out on the bulk of the 'declared without a macro' checks
during configure time (they are only useful if you are going to
run with CFLAGS=-DGNULIB_POSIXCHECK=1, but that's a maintainer action);
it also results in a smaller config.h (no HAVE_RAW_DECL substitutions).
Worth including in 0.8.8?
configure.ac | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3cd824a..7172b92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,6 +9,11 @@ dnl Make automake keep quiet about wildcards & other GNUmake-isms
AM_INIT_AUTOMAKE([-Wno-portability])
AM_MAINTAINER_MODE([enable])
+# Maintainer note - comment this line out if you plan to rerun
+# GNULIB_POSIXCHECK testing to see if libvirt should be using more modules.
+# Leave it uncommented for normal releases, for faster ./configure.
+gl_ASSERT_NO_GNULIB_POSIXCHECK
+
# Use the silent-rules feature when possible.
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
AM_SILENT_RULES([yes])
--
1.7.4
2
2
Hi,
I am currently working on a project where I must develop a function to
clone domain for the driver ESX.
I immediately saw that the function cloneVM_Task () from VMware API was
not supported for standalone ESX.
Does anyone know the best way to still implement this function or a
workaround ?
Why is it not already implemented ?
Thank you in advance,
Cédric
2
2