aboutsummaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-07-18 19:26:35 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-07-20 14:39:47 +0100
commitedb768c9ce0055639ee54d371ee7b53268148d9d (patch)
treeec12bb76fb16e6ed67c6e1c77088428d50867352 /daemon
parentReplace use of nodeReportError with virReportError (diff)
downloadlibvirt-edb768c9ce0055639ee54d371ee7b53268148d9d.tar.gz
libvirt-edb768c9ce0055639ee54d371ee7b53268148d9d.tar.bz2
libvirt-edb768c9ce0055639ee54d371ee7b53268148d9d.zip
Replace use of virConfError with virReportError
Update the libvirtd config handling code to use virReportError instead of the virConfError custom macro Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'daemon')
-rw-r--r--daemon/libvirtd-config.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c
index 6781e059e..2875927ca 100644
--- a/daemon/libvirtd-config.c
+++ b/daemon/libvirtd-config.c
@@ -35,10 +35,6 @@
#define VIR_FROM_THIS VIR_FROM_CONF
-#define virConfError(code, ...) \
- virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
/* Allocate an array of malloc'd strings from the config file, filename
* (used only in diagnostics), using handle "conf". Upon error, return -1
* and free any allocated memory. Otherwise, save the array in *list_arg
@@ -56,17 +52,17 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
switch (p->type) {
case VIR_CONF_STRING:
if (VIR_ALLOC_N(list, 2) < 0) {
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("failed to allocate memory for %s config list"),
- key);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("failed to allocate memory for %s config list"),
+ key);
return -1;
}
list[0] = strdup (p->str);
list[1] = NULL;
if (list[0] == NULL) {
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("failed to allocate memory for %s config list value"),
- key);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("failed to allocate memory for %s config list value"),
+ key);
VIR_FREE(list);
return -1;
}
@@ -78,17 +74,17 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
for (pp = p->list; pp; pp = pp->next)
len++;
if (VIR_ALLOC_N(list, 1+len) < 0) {
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("failed to allocate memory for %s config list"),
- key);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("failed to allocate memory for %s config list"),
+ key);
return -1;
}
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
if (pp->type != VIR_CONF_STRING) {
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("remoteReadConfigFile: %s: %s:"
- " must be a string or list of strings"),
- filename, key);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("remoteReadConfigFile: %s: %s:"
+ " must be a string or list of strings"),
+ filename, key);
VIR_FREE(list);
return -1;
}
@@ -98,9 +94,9 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
for (j = 0 ; j < i ; j++)
VIR_FREE(list[j]);
VIR_FREE(list);
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("failed to allocate memory for %s config list value"),
- key);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("failed to allocate memory for %s config list value"),
+ key);
return -1;
}
@@ -110,10 +106,10 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
}
default:
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("remoteReadConfigFile: %s: %s:"
- " must be a string or list of strings"),
- filename, key);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("remoteReadConfigFile: %s: %s:"
+ " must be a string or list of strings"),
+ filename, key);
return -1;
}
@@ -127,11 +123,11 @@ checkType (virConfValuePtr p, const char *filename,
const char *key, virConfType required_type)
{
if (p->type != required_type) {
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("remoteReadConfigFile: %s: %s: invalid type:"
- " got %s; expected %s"), filename, key,
- virConfTypeName (p->type),
- virConfTypeName (required_type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("remoteReadConfigFile: %s: %s: invalid type:"
+ " got %s; expected %s"), filename, key,
+ virConfTypeName (p->type),
+ virConfTypeName (required_type));
return -1;
}
return 0;
@@ -189,9 +185,9 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons
} else if (STREQ(p->str, "polkit")) {
*auth = VIR_NET_SERVER_SERVICE_AUTH_POLKIT;
} else {
- virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("remoteReadConfigFile: %s: %s: unsupported auth %s"),
- filename, key, p->str);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("remoteReadConfigFile: %s: %s: unsupported auth %s"),
+ filename, key, p->str);
return -1;
}