Many of our functions start with a DEBUG statement.
Move the statements after declarations to appease
our coding style.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
*/
for (j = i + 1; j < npassFDs; j++) {
if (passFDs[j] == wantfd) {
- VIR_DEBUG("Clash %zu", j);
int newfd = dup(passFDs[j]);
+
+ VIR_DEBUG("Clash %zu", j);
+
if (newfd < 0) {
virReportSystemError(errno,
_("Cannot move fd %d out of the way"),
const char *chainprefixes = opaque;
for (i = 0; lines[i] != NULL; i++) {
- VIR_DEBUG("Considering '%s'", lines[i]);
char *tmp = strstr(lines[i], "-j ");
+
+ VIR_DEBUG("Considering '%s'", lines[i]);
+
if (!tmp)
continue;
tmp = tmp + 3;
char newchain[MAX_CHAINNAME_LENGTH];
for (i = 0; lines[i] != NULL; i++) {
- VIR_DEBUG("Considering '%s'", lines[i]);
char *tmp = strstr(lines[i], "-j ");
+
+ VIR_DEBUG("Considering '%s'", lines[i]);
+
if (!tmp)
continue;
tmp = tmp + 3;
ssize_t qemuDomainLogContextRead(qemuDomainLogContextPtr ctxt,
char **msg)
{
+ char *buf;
+ size_t buflen;
+
VIR_DEBUG("Context read %p manager=%p inode=%llu pos=%llu",
ctxt, ctxt->manager,
(unsigned long long)ctxt->inode,
(unsigned long long)ctxt->pos);
- char *buf;
- size_t buflen;
+
if (ctxt->manager) {
buf = virLogManagerDomainReadLogFile(ctxt->manager,
ctxt->path,
int fd,
const char *fdname)
{
- VIR_DEBUG("device=%s fd=%d fdname=%s", devicestr, fd, NULLSTR(fdname));
int ret;
+ VIR_DEBUG("device=%s fd=%d fdname=%s", devicestr, fd, NULLSTR(fdname));
+
QEMU_CHECK_MONITOR(mon);
if (fd >= 0 && qemuMonitorSendFileHandle(mon, fdname, fd) < 0)
const char *fdname,
bool skipauth)
{
+ int ret;
+
VIR_DEBUG("protocol=%s fd=%d fdname=%s skipauth=%d",
protocol, fd, NULLSTR(fdname), skipauth);
- int ret;
QEMU_CHECK_MONITOR(mon);
qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon,
virHashTablePtr *info)
{
- VIR_DEBUG("info=%p", info);
int ret;
+ VIR_DEBUG("info=%p", info);
+
*info = NULL;
QEMU_CHECK_MONITOR(mon);
void remoteRelayConnectionClosedEvent(virConnectPtr conn G_GNUC_UNUSED, int reason, void *opaque)
{
virNetServerClientPtr client = opaque;
+ remote_connect_event_connection_closed_msg msg = { reason };
VIR_DEBUG("Relaying connection closed event, reason %d", reason);
- remote_connect_event_connection_closed_msg msg = { reason };
remoteDispatchObjectEventSend(client, remoteProgram,
REMOTE_PROC_CONNECT_EVENT_CONNECTION_CLOSED,
(xdrproc_t)xdr_remote_connect_event_connection_closed_msg,
daemonClientStream *stream,
bool transmit)
{
+ daemonClientPrivatePtr priv = virNetServerClientGetPrivateData(client);
+
VIR_DEBUG("client=%p, proc=%d, serial=%u, st=%p, transmit=%d",
client, stream->procedure, stream->serial, stream->st, transmit);
- daemonClientPrivatePtr priv = virNetServerClientGetPrivateData(client);
if (stream->filterID != -1) {
VIR_WARN("Filter already added to client %p", client);
daemonRemoveClientStream(virNetServerClientPtr client,
daemonClientStream *stream)
{
- VIR_DEBUG("client=%p, proc=%d, serial=%u, st=%p",
- client, stream->procedure, stream->serial, stream->st);
daemonClientPrivatePtr priv = virNetServerClientGetPrivateData(client);
daemonClientStream *curr = priv->streams;
daemonClientStream *prev = NULL;
+ VIR_DEBUG("client=%p, proc=%d, serial=%u, st=%p",
+ client, stream->procedure, stream->serial, stream->st);
+
if (stream->filterID != -1) {
virNetServerClientRemoveFilter(client,
stream->filterID);
daemonClientStream *stream,
virNetMessagePtr msg)
{
- VIR_DEBUG("client=%p, stream=%p, proc=%d, serial=%u",
- client, stream, msg->header.proc, msg->header.serial);
int ret;
bool raise_error = false;
+ VIR_DEBUG("client=%p, stream=%p, proc=%d, serial=%u",
+ client, stream, msg->header.proc, msg->header.serial);
+
stream->closed = true;
virStreamEventRemoveCallback(stream->st);
ret = virStreamAbort(stream->st);
const char *data,
size_t nbytes)
{
- VIR_DEBUG("st=%p data=%p nbytes=%zu", st, data, nbytes);
struct private_data *priv = st->conn->privateData;
virNetClientStreamPtr privst = st->privateData;
int rv;
+ VIR_DEBUG("st=%p data=%p nbytes=%zu", st, data, nbytes);
+
remoteDriverLock(priv);
priv->localUses++;
remoteDriverUnlock(priv);
size_t nbytes,
unsigned int flags)
{
- VIR_DEBUG("st=%p data=%p nbytes=%zu flags=0x%x",
- st, data, nbytes, flags);
struct private_data *priv = st->conn->privateData;
virNetClientStreamPtr privst = st->privateData;
int rv;
+ VIR_DEBUG("st=%p data=%p nbytes=%zu flags=0x%x",
+ st, data, nbytes, flags);
+
virCheckFlags(VIR_STREAM_RECV_STOP_AT_HOLE, -1);
remoteDriverLock(priv);
long long length,
unsigned int flags)
{
- VIR_DEBUG("st=%p length=%lld flags=0x%x",
- st, length, flags);
struct private_data *priv = st->conn->privateData;
virNetClientStreamPtr privst = st->privateData;
int rv;
+ VIR_DEBUG("st=%p length=%lld flags=0x%x",
+ st, length, flags);
+
remoteDriverLock(priv);
priv->localUses++;
remoteDriverUnlock(priv);
virNetClientIOEventLoopPassTheBuck(virNetClientPtr client,
virNetClientCallPtr thiscall)
{
- VIR_DEBUG("Giving up the buck %p", thiscall);
virNetClientCallPtr tmp = client->waitDispatch;
+
+ VIR_DEBUG("Giving up the buck %p", thiscall);
+
/* See if someone else is still waiting
* and if so, then pass the buck ! */
while (tmp) {
virStoragePoolSourceDevicePtr dev = &def->source.devices[0];
unsigned long long cylinderSize = (unsigned long long)dev->geometry.heads *
dev->geometry.sectors * SECTOR_SIZE;
+ int partType = virStorageBackendDiskPartTypeToCreate(pool);
VIR_DEBUG("find free area: allocation %llu, cyl size %llu", allocation,
cylinderSize);
- int partType = virStorageBackendDiskPartTypeToCreate(pool);
/* how many extra bytes we have since we allocate
aligned to the cylinder boundary */
static void
virStorageFileBackendFileDeinit(virStorageSourcePtr src)
{
+ virStorageFileBackendFsPrivPtr priv = src->drv->priv;
+
VIR_DEBUG("deinitializing FS storage file %p (%s:%s)", src,
virStorageTypeToString(virStorageSourceGetActualType(src)),
src->path);
- virStorageFileBackendFsPrivPtr priv = src->drv->priv;
VIR_FREE(priv->canonpath);
VIR_FREE(priv);
dbustype *x = (dbustype *)&v.member; \
vargtype *y; \
if (arrayref) { \
- VIR_DEBUG("Use arrayref"); \
vargtype **xptrptr = arrayptr; \
+ VIR_DEBUG("Use arrayref"); \
if (VIR_EXPAND_N(*xptrptr, *narrayptr, 1) < 0) \
goto cleanup; \
y = (*xptrptr + (*narrayptr - 1)); \
VIR_DEBUG("Applying groups for %p", firewall);
for (i = 0; i < firewall->ngroups; i++) {
if (virFirewallApplyGroup(firewall, i) < 0) {
- VIR_DEBUG("Rolling back groups up to %zu for %p", i, firewall);
size_t first = i;
virErrorPtr saved_error;
+ VIR_DEBUG("Rolling back groups up to %zu for %p", i, firewall);
+
virErrorPreserveLast(&saved_error);
/*
/* If we have no valid network address, then use the default one */
if (!addr || !VIR_SOCKET_ADDR_VALID(addr)) {
- VIR_DEBUG("computing default address");
int family = VIR_SOCKET_ADDR_FAMILY(gateway);
+
+ VIR_DEBUG("computing default address");
+
if (family == AF_INET) {
if (virSocketAddrParseIPv4(&defaultAddr, VIR_SOCKET_ADDR_IPV4_ALL) < 0)
return -1;
static void vir_object_finalize(GObject *gobj)
{
- PROBE(OBJECT_DISPOSE, "obj=%p", gobj);
virObjectPtr obj = VIR_OBJECT(gobj);
virObjectPrivate *priv = vir_object_get_instance_private(obj);
-
virClassPtr klass = priv->klass;
+
+ PROBE(OBJECT_DISPOSE, "obj=%p", gobj);
+
while (klass) {
if (klass->dispose)
klass->dispose(obj);
int virProcessSetAffinity(pid_t pid, virBitmapPtr map)
{
size_t i;
- VIR_DEBUG("Set process affinity on %lld", (long long)pid);
int numcpus = 1024;
size_t masklen;
cpu_set_t *mask;
+ VIR_DEBUG("Set process affinity on %lld", (long long)pid);
+
/* Not only may the statically allocated cpu_set_t be too small,
* but there is no way to ask the kernel what size is large enough.
* So you have no option but to pick a size, try, catch EINVAL,
uid_t uid, gid_t gid,
bool report_broken)
{
- VIR_DEBUG("path=%s format=%d uid=%u gid=%u report_broken=%d",
- src->path, src->format, (unsigned int)uid, (unsigned int)gid,
- report_broken);
-
virHashTablePtr cycle = NULL;
virStorageType actualType = virStorageSourceGetActualType(src);
int ret = -1;
+ VIR_DEBUG("path=%s format=%d uid=%u gid=%u report_broken=%d",
+ src->path, src->format, (unsigned int)uid, (unsigned int)gid,
+ report_broken);
+
if (!(cycle = virHashCreate(5, NULL)))
return -1;