} while (0)
static virHypervisorDriverPtr virHypervisorDriverTab[MAX_DRIVERS];
-static int virHypervisorDriverTabCount = 0;
+static int virHypervisorDriverTabCount;
static virNetworkDriverPtr virNetworkDriverTab[MAX_DRIVERS];
-static int virNetworkDriverTabCount = 0;
+static int virNetworkDriverTabCount;
static virInterfaceDriverPtr virInterfaceDriverTab[MAX_DRIVERS];
-static int virInterfaceDriverTabCount = 0;
+static int virInterfaceDriverTabCount;
static virStorageDriverPtr virStorageDriverTab[MAX_DRIVERS];
-static int virStorageDriverTabCount = 0;
+static int virStorageDriverTabCount;
static virNodeDeviceDriverPtr virNodeDeviceDriverTab[MAX_DRIVERS];
-static int virNodeDeviceDriverTabCount = 0;
+static int virNodeDeviceDriverTabCount;
static virSecretDriverPtr virSecretDriverTab[MAX_DRIVERS];
-static int virSecretDriverTabCount = 0;
+static int virSecretDriverTabCount;
static virNWFilterDriverPtr virNWFilterDriverTab[MAX_DRIVERS];
-static int virNWFilterDriverTabCount = 0;
+static int virNWFilterDriverTabCount;
#ifdef WITH_LIBVIRTD
static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
-static int virStateDriverTabCount = 0;
+static int virStateDriverTabCount;
#endif
#endif /* WITH_GNUTLS_GCRYPT */
-static bool virGlobalError = false;
+static bool virGlobalError;
static virOnceControl virGlobalOnce = VIR_ONCE_CONTROL_INITIALIZER;
static void
VIR_LOG_INIT("util.alloc");
#if TEST_OOM
-static int testMallocNext = 0;
-static int testMallocFailFirst = 0;
-static int testMallocFailLast = 0;
-static void (*testMallocHook)(int, void*) = NULL;
-static void *testMallocHookData = NULL;
+static int testMallocNext;
+static int testMallocFailFirst;
+static int testMallocFailLast;
+static void (*testMallocHook)(int, void*);
+static void *testMallocHookData;
void virAllocTestInit(void)
{
#ifdef WITH_DBUS
static bool sharedBus = true;
-static DBusConnection *systembus = NULL;
-static DBusConnection *sessionbus = NULL;
+static DBusConnection *systembus;
+static DBusConnection *sessionbus;
static virOnceControl systemonce = VIR_ONCE_CONTROL_INITIALIZER;
static virOnceControl sessiononce = VIR_ONCE_CONTROL_INITIALIZER;
static DBusError systemdbuserr;
VIR_LOG_INIT("util.event");
-static virEventAddHandleFunc addHandleImpl = NULL;
-static virEventUpdateHandleFunc updateHandleImpl = NULL;
-static virEventRemoveHandleFunc removeHandleImpl = NULL;
-static virEventAddTimeoutFunc addTimeoutImpl = NULL;
-static virEventUpdateTimeoutFunc updateTimeoutImpl = NULL;
-static virEventRemoveTimeoutFunc removeTimeoutImpl = NULL;
+static virEventAddHandleFunc addHandleImpl;
+static virEventUpdateHandleFunc updateHandleImpl;
+static virEventRemoveHandleFunc removeHandleImpl;
+static virEventAddTimeoutFunc addTimeoutImpl;
+static virEventUpdateTimeoutFunc updateTimeoutImpl;
+static virEventRemoveTimeoutFunc removeTimeoutImpl;
/*****************************************************
* function, as it will block forever if there are no
* registered events.
*
- * static bool quit = false;
+ * static bool quit;
*
* while (!quit) {
* if (virEventRunDefaultImpl() < 0)
char *buf;
unsigned long long remain, bytes;
# ifdef HAVE_MMAP
- static long pagemask = 0;
+ static long pagemask;
off_t map_skip;
/* align offset and length, rounding offset down and length up */
/*
* virlog.c: internal logging and debugging
*
- * Copyright (C) 2008, 2010-2013 Red Hat, Inc.
+ * Copyright (C) 2008, 2010-2014 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
VIR_LOG_INIT("util.log");
-static regex_t *virLogRegex = NULL;
+static regex_t *virLogRegex;
#define VIR_LOG_DATE_REGEX "[0-9]{4}-[0-9]{2}-[0-9]{2}"
typedef virLogFilter *virLogFilterPtr;
static int virLogFiltersSerial = 1;
-static virLogFilterPtr virLogFilters = NULL;
-static int virLogNbFilters = 0;
+static virLogFilterPtr virLogFilters;
+static int virLogNbFilters;
/*
* Outputs are used to emit the messages retained
typedef struct _virLogOutput virLogOutput;
typedef virLogOutput *virLogOutputPtr;
-static virLogOutputPtr virLogOutputs = NULL;
-static int virLogNbOutputs = 0;
+static virLogOutputPtr virLogOutputs;
+static int virLogNbOutputs;
/*
* Default priorities
{
void *array[100];
int size;
- static bool doneWarning = false;
+ static bool doneWarning;
const char *msg = "Stack trace not available on this platform\n";
#define STRIP_DEPTH 3
syslog(virLogPrioritySyslog(priority), "%s", str);
}
-static char *current_ident = NULL;
+static char *current_ident;
static void
/* Linux kernel supports up to MAX_LINKS (32 at the time) individual
* netlink protocols. */
static virNetlinkEventSrvPrivatePtr server[MAX_LINKS] = {NULL};
-static virNetlinkHandle *placeholder_nlhandle = NULL;
+static virNetlinkHandle *placeholder_nlhandle;
/* Function definitions */
int virProcessGetStartTime(pid_t pid,
unsigned long long *timestamp)
{
- static int warned = 0;
+ static int warned;
if (virAtomicIntInc(&warned) == 1) {
VIR_WARN("Process start time of pid %llu not available on this platform",
(unsigned long long)pid);
- warned = true;
}
*timestamp = 0;
return 0;
/*
* virthread.h: basic thread synchronization primitives
*
- * Copyright (C) 2009-2011, 2013 Red Hat, Inc.
+ * Copyright (C) 2009-2011, 2013-2014 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
*/
# define VIR_ONCE_GLOBAL_INIT(classname) \
static virOnceControl classname ## OnceControl = VIR_ONCE_CONTROL_INITIALIZER; \
- static virErrorPtr classname ## OnceError = NULL; \
+ static virErrorPtr classname ## OnceError; \
\
static void classname ## Once(void) \
{ \