aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/bridge.c10
-rw-r--r--src/util/cgroup.c4
-rw-r--r--src/util/command.c18
-rw-r--r--src/util/event.c4
-rw-r--r--src/util/event_poll.c2
-rw-r--r--src/util/hash.c2
-rw-r--r--src/util/json.c8
-rw-r--r--src/util/logging.c10
-rw-r--r--src/util/logging.h24
-rw-r--r--src/util/pci.c4
-rw-r--r--src/util/util.c8
-rw-r--r--src/util/virtaudit.c2
12 files changed, 44 insertions, 52 deletions
diff --git a/src/util/bridge.c b/src/util/bridge.c
index 3ed71be7c..98169ae45 100644
--- a/src/util/bridge.c
+++ b/src/util/bridge.c
@@ -428,13 +428,13 @@ brProbeVnetHdr(int tapfd)
struct ifreq dummy;
if (ioctl(tapfd, TUNGETFEATURES, &features) != 0) {
- VIR_INFO0(_("Not enabling IFF_VNET_HDR; "
+ VIR_INFO(_("Not enabling IFF_VNET_HDR; "
"TUNGETFEATURES ioctl() not implemented"));
return 0;
}
if (!(features & IFF_VNET_HDR)) {
- VIR_INFO0(_("Not enabling IFF_VNET_HDR; "
+ VIR_INFO(_("Not enabling IFF_VNET_HDR; "
"TUNGETFEATURES ioctl() reports no IFF_VNET_HDR"));
return 0;
}
@@ -443,17 +443,17 @@ brProbeVnetHdr(int tapfd)
* If TUNGETIFF is not implemented then errno == EBADFD.
*/
if (ioctl(tapfd, TUNGETIFF, &dummy) != -1 || errno != EBADFD) {
- VIR_INFO0(_("Not enabling IFF_VNET_HDR; "
+ VIR_INFO(_("Not enabling IFF_VNET_HDR; "
"TUNGETIFF ioctl() not implemented"));
return 0;
}
- VIR_INFO0(_("Enabling IFF_VNET_HDR"));
+ VIR_INFO(_("Enabling IFF_VNET_HDR"));
return 1;
# else
(void) tapfd;
- VIR_INFO0(_("Not enabling IFF_VNET_HDR; disabled at build time"));
+ VIR_INFO(_("Not enabling IFF_VNET_HDR; disabled at build time"));
return 0;
# endif
}
diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index 62b371d7c..2e5ef46d3 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -100,7 +100,7 @@ static int virCgroupDetectMounts(virCgroupPtr group)
mounts = fopen("/proc/mounts", "r");
if (mounts == NULL) {
- VIR_ERROR0(_("Unable to open /proc/mounts"));
+ VIR_ERROR(_("Unable to open /proc/mounts"));
return -ENOENT;
}
@@ -152,7 +152,7 @@ static int virCgroupDetectPlacement(virCgroupPtr group)
mapping = fopen("/proc/self/cgroup", "r");
if (mapping == NULL) {
- VIR_ERROR0(_("Unable to open /proc/self/cgroup"));
+ VIR_ERROR(_("Unable to open /proc/self/cgroup"));
return -ENOENT;
}
diff --git a/src/util/command.c b/src/util/command.c
index 78586e815..b488d55a4 100644
--- a/src/util/command.c
+++ b/src/util/command.c
@@ -572,7 +572,7 @@ virCommandSetWorkingDirectory(virCommandPtr cmd, const char *pwd)
if (cmd->pwd) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot set directory twice");
+ VIR_DEBUG("cannot set directory twice");
} else {
cmd->pwd = strdup(pwd);
if (!cmd->pwd)
@@ -592,7 +592,7 @@ virCommandSetInputBuffer(virCommandPtr cmd, const char *inbuf)
if (cmd->infd != -1 || cmd->inbuf) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify input twice");
+ VIR_DEBUG("cannot specify input twice");
return;
}
@@ -617,7 +617,7 @@ virCommandSetOutputBuffer(virCommandPtr cmd, char **outbuf)
if (cmd->outfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify output twice");
+ VIR_DEBUG("cannot specify output twice");
return;
}
@@ -641,7 +641,7 @@ virCommandSetErrorBuffer(virCommandPtr cmd, char **errbuf)
if (cmd->errfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify stderr twice");
+ VIR_DEBUG("cannot specify stderr twice");
return;
}
@@ -661,12 +661,12 @@ virCommandSetInputFD(virCommandPtr cmd, int infd)
if (cmd->infd != -1 || cmd->inbuf) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify input twice");
+ VIR_DEBUG("cannot specify input twice");
return;
}
if (infd < 0) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify invalid input fd");
+ VIR_DEBUG("cannot specify invalid input fd");
return;
}
@@ -685,7 +685,7 @@ virCommandSetOutputFD(virCommandPtr cmd, int *outfd)
if (cmd->outfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify output twice");
+ VIR_DEBUG("cannot specify output twice");
return;
}
@@ -704,7 +704,7 @@ virCommandSetErrorFD(virCommandPtr cmd, int *errfd)
if (cmd->errfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify stderr twice");
+ VIR_DEBUG("cannot specify stderr twice");
return;
}
@@ -725,7 +725,7 @@ virCommandSetPreExecHook(virCommandPtr cmd, virExecHook hook, void *opaque)
if (cmd->hook) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify hook twice");
+ VIR_DEBUG("cannot specify hook twice");
return;
}
cmd->hook = hook;
diff --git a/src/util/event.c b/src/util/event.c
index bc0129cd0..11f025b44 100644
--- a/src/util/event.c
+++ b/src/util/event.c
@@ -145,7 +145,7 @@ void virEventRegisterImpl(virEventAddHandleFunc addHandle,
*/
int virEventRegisterDefaultImpl(void)
{
- VIR_DEBUG0("");
+ VIR_DEBUG("registering default event implementation");
virResetLastError();
@@ -185,7 +185,7 @@ int virEventRegisterDefaultImpl(void)
*/
int virEventRunDefaultImpl(void)
{
- VIR_DEBUG0("");
+ VIR_DEBUG("running default event implementation");
virResetLastError();
if (virEventPollRunOnce() < 0) {
diff --git a/src/util/event_poll.c b/src/util/event_poll.c
index c5eedd3d4..df2b28cd4 100644
--- a/src/util/event_poll.c
+++ b/src/util/event_poll.c
@@ -687,7 +687,7 @@ static int virEventPollInterruptLocked(void)
return 0;
}
- VIR_DEBUG0("Interrupting");
+ VIR_DEBUG("Interrupting");
if (safewrite(eventLoop.wakeupfd[1], &c, sizeof(c)) != sizeof(c))
return -1;
return 0;
diff --git a/src/util/hash.c b/src/util/hash.c
index 5366dd641..b5ec6af91 100644
--- a/src/util/hash.c
+++ b/src/util/hash.c
@@ -37,7 +37,7 @@
#define virHashIterationError(ret) \
do { \
- VIR_ERROR0(_("Hash operation not allowed during iteration")); \
+ VIR_ERROR(_("Hash operation not allowed during iteration")); \
return ret; \
} while (0)
diff --git a/src/util/json.c b/src/util/json.c
index 1ba1ea4a2..db2727d84 100644
--- a/src/util/json.c
+++ b/src/util/json.c
@@ -638,7 +638,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
} else {
virJSONParserStatePtr state;
if (!parser->nstate) {
- VIR_DEBUG0("got a value to insert without a container");
+ VIR_DEBUG("got a value to insert without a container");
return -1;
}
@@ -647,7 +647,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
switch (state->value->type) {
case VIR_JSON_TYPE_OBJECT: {
if (!state->key) {
- VIR_DEBUG0("missing key when inserting object value");
+ VIR_DEBUG("missing key when inserting object value");
return -1;
}
@@ -661,7 +661,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
case VIR_JSON_TYPE_ARRAY: {
if (state->key) {
- VIR_DEBUG0("unexpected key when inserting array value");
+ VIR_DEBUG("unexpected key when inserting array value");
return -1;
}
@@ -671,7 +671,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
} break;
default:
- VIR_DEBUG0("unexpected value type, not a container");
+ VIR_DEBUG("unexpected value type, not a container");
return -1;
}
}
diff --git a/src/util/logging.c b/src/util/logging.c
index 90d5a9953..823e5063b 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -217,7 +217,7 @@ int virLogStartup(void) {
virLogDefaultPriority = VIR_LOG_DEFAULT;
virLogUnlock();
if (pbm)
- VIR_WARN0(pbm);
+ VIR_WARN("%s", pbm);
return 0;
}
@@ -478,7 +478,7 @@ virLogEmergencyDumpAll(int signum) {
*/
int virLogSetDefaultPriority(int priority) {
if ((priority < VIR_LOG_DEBUG) || (priority > VIR_LOG_ERROR)) {
- VIR_WARN0("Ignoring invalid log level setting.");
+ VIR_WARN("Ignoring invalid log level setting.");
return -1;
}
if (!virLogInitialized)
@@ -1007,7 +1007,7 @@ int virLogParseOutputs(const char *outputs) {
ret = count;
cleanup:
if (ret == -1)
- VIR_WARN0("Ignoring invalid log output setting.");
+ VIR_WARN("Ignoring invalid log output setting.");
return ret;
}
@@ -1063,7 +1063,7 @@ int virLogParseFilters(const char *filters) {
ret = count;
cleanup:
if (ret == -1)
- VIR_WARN0("Ignoring invalid log filter setting.");
+ VIR_WARN("Ignoring invalid log filter setting.");
return ret;
}
@@ -1185,7 +1185,7 @@ int virLogParseDefaultPriority(const char *priority) {
else if (STREQ(priority, "4") || STREQ(priority, "error"))
ret = virLogSetDefaultPriority(VIR_LOG_ERROR);
else
- VIR_WARN0("Ignoring invalid log level setting");
+ VIR_WARN("Ignoring invalid log level setting");
return ret;
}
diff --git a/src/util/logging.h b/src/util/logging.h
index 0dba78cda..e948077f1 100644
--- a/src/util/logging.h
+++ b/src/util/logging.h
@@ -32,35 +32,27 @@
*/
# ifdef ENABLE_DEBUG
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
- virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, fmt, __VA_ARGS__)
+ virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, fmt, ##__VA_ARGS__)
# else
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
do { } while (0)
# endif /* !ENABLE_DEBUG */
# define VIR_INFO_INT(category, f, l, fmt,...) \
- virLogMessage(category, VIR_LOG_INFO, f, l, 0, fmt, __VA_ARGS__)
+ virLogMessage(category, VIR_LOG_INFO, f, l, 0, fmt, ##__VA_ARGS__)
# define VIR_WARN_INT(category, f, l, fmt,...) \
- virLogMessage(category, VIR_LOG_WARN, f, l, 0, fmt, __VA_ARGS__)
+ virLogMessage(category, VIR_LOG_WARN, f, l, 0, fmt, ##__VA_ARGS__)
# define VIR_ERROR_INT(category, f, l, fmt,...) \
- virLogMessage(category, VIR_LOG_ERROR, f, l, 0, fmt, __VA_ARGS__)
+ virLogMessage(category, VIR_LOG_ERROR, f, l, 0, fmt, ##__VA_ARGS__)
# define VIR_DEBUG(fmt,...) \
- VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_DEBUG0(msg) \
- VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
# define VIR_INFO(fmt,...) \
- VIR_INFO_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_INFO0(msg) \
- VIR_INFO_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_INFO_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
# define VIR_WARN(fmt,...) \
- VIR_WARN_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_WARN0(msg) \
- VIR_WARN_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_WARN_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
# define VIR_ERROR(fmt,...) \
- VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_ERROR0(msg) \
- VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
/*
* To be made public
diff --git a/src/util/pci.c b/src/util/pci.c
index d7f74f9b7..9cc7b20b6 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -293,7 +293,7 @@ pciIterDevices(pciIterPredicate predicate,
dir = opendir(PCI_SYSFS "devices");
if (!dir) {
- VIR_WARN0("Failed to open " PCI_SYSFS "devices");
+ VIR_WARN("Failed to open " PCI_SYSFS "devices");
return -1;
}
@@ -1195,7 +1195,7 @@ pciWaitForDeviceCleanup(pciDevice *dev, const char *matcher)
* unbind might succeed anyway, and besides, it's very likely we have
* no way to report the error
*/
- VIR_DEBUG0("Failed to open /proc/iomem, trying to continue anyway");
+ VIR_DEBUG("Failed to open /proc/iomem, trying to continue anyway");
return 0;
}
diff --git a/src/util/util.c b/src/util/util.c
index 4c50fcb62..01ba771a2 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -295,7 +295,7 @@ static int virClearCapabilities(void)
# else
static int virClearCapabilities(void)
{
-// VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities");
+// VIR_WARN("libcap-ng support not compiled in, unable to clear capabilities");
return 0;
}
# endif
@@ -682,7 +682,7 @@ __virExec(const char *const*argv,
}
if ((hook)(data) != 0) {
- VIR_DEBUG0("Hook function failed.");
+ VIR_DEBUG("Hook function failed.");
goto fork_error;
}
@@ -761,7 +761,7 @@ virExecWithHook(const char *const*argv,
VIR_DEBUG("%s %s", envp_str, argv_str);
VIR_FREE(envp_str);
} else {
- VIR_DEBUG0(argv_str);
+ VIR_DEBUG("%s", argv_str);
}
VIR_FREE(argv_str);
@@ -871,7 +871,7 @@ virRunWithHook(const char *const*argv,
virReportOOMError();
goto error;
}
- VIR_DEBUG0(argv_str);
+ VIR_DEBUG("%s", argv_str);
if ((execret = __virExec(argv, NULL, NULL,
&childpid, -1, &outfd, &errfd,
diff --git a/src/util/virtaudit.c b/src/util/virtaudit.c
index de7b357d3..2f1a52945 100644
--- a/src/util/virtaudit.c
+++ b/src/util/virtaudit.c
@@ -96,7 +96,7 @@ void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func,
va_start(args, fmt);
if (virVasprintf(&str, fmt, args) < 0) {
- VIR_WARN0("Out of memory while formatting audit message");
+ VIR_WARN("Out of memory while formatting audit message");
str = NULL;
}
va_end(args);