diff --git a/cfg.mk b/cfg.mk
index 3ae4c5a5d5..0f62a89575 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -513,7 +513,6 @@ msg_gen_function += PHYP_ERROR
msg_gen_function += VIR_ERROR
msg_gen_function += VMX_ERROR
msg_gen_function += XENXS_ERROR
-msg_gen_function += eventReportError
msg_gen_function += interfaceReportError
msg_gen_function += lxcError
msg_gen_function += libxlError
@@ -531,9 +530,7 @@ msg_gen_function += vah_warning
msg_gen_function += vboxError
msg_gen_function += virConfError
msg_gen_function += virCPUReportError
-msg_gen_function += virDomainReportError
msg_gen_function += virGenericReportError
-msg_gen_function += virInterfaceReportError
msg_gen_function += virLibConnError
msg_gen_function += virLibDomainError
msg_gen_function += virLibDomainSnapshotError
@@ -544,7 +541,6 @@ msg_gen_function += virLibNWFilterError
msg_gen_function += virLibSecretError
msg_gen_function += virLibStoragePoolError
msg_gen_function += virLibStorageVolError
-msg_gen_function += virNetworkReportError
msg_gen_function += virNodeDeviceReportError
msg_gen_function += virNWFilterReportError
msg_gen_function += virRaiseError
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 7fe3c1ef97..175a7ed33c 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -32,10 +32,6 @@
#define VIR_FROM_THIS VIR_FROM_CPU
-#define virCPUReportError(code, ...) \
- virReportErrorHelper(VIR_FROM_CPU, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
VIR_ENUM_IMPL(virCPU, VIR_CPU_TYPE_LAST,
"host", "guest", "auto")
@@ -201,9 +197,9 @@ virCPUDefParseXML(const xmlNodePtr node,
char *cpuMode;
if (!xmlStrEqual(node->name, BAD_CAST "cpu")) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s",
- _("XML does not contain expected 'cpu' element"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s",
+ _("XML does not contain expected 'cpu' element"));
return NULL;
}
@@ -215,9 +211,9 @@ virCPUDefParseXML(const xmlNodePtr node,
if (mode == VIR_CPU_TYPE_AUTO) {
if (virXPathBoolean("boolean(./arch)", ctxt)) {
if (virXPathBoolean("boolean(./@match)", ctxt)) {
- virCPUReportError(VIR_ERR_XML_ERROR, "%s",
- _("'arch' element element cannot be used inside 'cpu'"
- " element with 'match' attribute'"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("'arch' element element cannot be used inside 'cpu'"
+ " element with 'match' attribute'"));
goto error;
}
def->type = VIR_CPU_TYPE_HOST;
@@ -231,16 +227,16 @@ virCPUDefParseXML(const xmlNodePtr node,
if ((cpuMode = virXMLPropString(node, "mode"))) {
if (def->type == VIR_CPU_TYPE_HOST) {
VIR_FREE(cpuMode);
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Attribute mode is only allowed for guest CPU"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Attribute mode is only allowed for guest CPU"));
goto error;
} else {
def->mode = virCPUModeTypeFromString(cpuMode);
if (def->mode < 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid mode attribute '%s'"),
- cpuMode);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid mode attribute '%s'"),
+ cpuMode);
VIR_FREE(cpuMode);
goto error;
}
@@ -266,8 +262,8 @@ virCPUDefParseXML(const xmlNodePtr node,
VIR_FREE(match);
if (def->match < 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Invalid match attribute for CPU specification"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Invalid match attribute for CPU specification"));
goto error;
}
}
@@ -276,16 +272,16 @@ virCPUDefParseXML(const xmlNodePtr node,
if (def->type == VIR_CPU_TYPE_HOST) {
def->arch = virXPathString("string(./arch[1])", ctxt);
if (!def->arch) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing CPU architecture"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing CPU architecture"));
goto error;
}
}
if (!(def->model = virXPathString("string(./model[1])", ctxt)) &&
def->type == VIR_CPU_TYPE_HOST) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing CPU model name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing CPU model name"));
goto error;
}
@@ -300,8 +296,8 @@ virCPUDefParseXML(const xmlNodePtr node,
def->fallback = virCPUFallbackTypeFromString(fallback);
VIR_FREE(fallback);
if (def->fallback < 0) {
- virCPUReportError(VIR_ERR_XML_ERROR, "%s",
- _("Invalid fallback attribute"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Invalid fallback attribute"));
goto error;
}
}
@@ -313,18 +309,18 @@ virCPUDefParseXML(const xmlNodePtr node,
ctxt);
if (!vendor_id ||
strlen(vendor_id) != VIR_CPU_VENDOR_ID_LENGTH) {
- virCPUReportError(VIR_ERR_XML_ERROR,
- _("vendor_id must be exactly"
- " %d characters long"),
- VIR_CPU_VENDOR_ID_LENGTH);
+ virReportError(VIR_ERR_XML_ERROR,
+ _("vendor_id must be exactly"
+ " %d characters long"),
+ VIR_CPU_VENDOR_ID_LENGTH);
VIR_FREE(vendor_id);
goto error;
}
/* ensure that the string can be passed to qemu*/
for (i = 0; i < strlen(vendor_id); i++) {
if (vendor_id[i]==',') {
- virCPUReportError(VIR_ERR_XML_ERROR, "%s",
- _("vendor id is invalid"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("vendor id is invalid"));
VIR_FREE(vendor_id);
goto error;
}
@@ -336,8 +332,8 @@ virCPUDefParseXML(const xmlNodePtr node,
def->vendor = virXPathString("string(./vendor[1])", ctxt);
if (def->vendor && !def->model) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("CPU vendor specified without CPU model"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("CPU vendor specified without CPU model"));
goto error;
}
@@ -348,8 +344,8 @@ virCPUDefParseXML(const xmlNodePtr node,
ret = virXPathULong("string(./topology[1]/@sockets)",
ctxt, &ul);
if (ret < 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing 'sockets' attribute in CPU topology"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing 'sockets' attribute in CPU topology"));
goto error;
}
def->sockets = (unsigned int) ul;
@@ -357,8 +353,8 @@ virCPUDefParseXML(const xmlNodePtr node,
ret = virXPathULong("string(./topology[1]/@cores)",
ctxt, &ul);
if (ret < 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing 'cores' attribute in CPU topology"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing 'cores' attribute in CPU topology"));
goto error;
}
def->cores = (unsigned int) ul;
@@ -366,15 +362,15 @@ virCPUDefParseXML(const xmlNodePtr node,
ret = virXPathULong("string(./topology[1]/@threads)",
ctxt, &ul);
if (ret < 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing 'threads' attribute in CPU topology"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing 'threads' attribute in CPU topology"));
goto error;
}
def->threads = (unsigned int) ul;
if (!def->sockets || !def->cores || !def->threads) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Invalid CPU topology"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Invalid CPU topology"));
goto error;
}
}
@@ -385,8 +381,8 @@ virCPUDefParseXML(const xmlNodePtr node,
if (n > 0) {
if (!def->model) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Non-empty feature list specified without CPU model"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Non-empty feature list specified without CPU model"));
goto error;
}
@@ -412,8 +408,8 @@ virCPUDefParseXML(const xmlNodePtr node,
VIR_FREE(strpolicy);
if (policy < 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Invalid CPU feature policy"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Invalid CPU feature policy"));
goto error;
}
} else {
@@ -422,16 +418,16 @@ virCPUDefParseXML(const xmlNodePtr node,
if (!(name = virXMLPropString(nodes[i], "name")) || *name == 0) {
VIR_FREE(name);
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Invalid CPU feature name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Invalid CPU feature name"));
goto error;
}
for (j = 0 ; j < i ; j++) {
if (STREQ(name, def->features[j].name)) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("CPU feature `%s' specified more than once"),
- name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("CPU feature `%s' specified more than once"),
+ name);
VIR_FREE(name);
goto error;
}
@@ -445,8 +441,8 @@ virCPUDefParseXML(const xmlNodePtr node,
VIR_FREE(nodes);
n = virXPathNodeSet("./numa[1]/cell", ctxt, &nodes);
if (n <= 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("NUMA topology defined without NUMA cells"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("NUMA topology defined without NUMA cells"));
goto error;
}
@@ -464,8 +460,8 @@ virCPUDefParseXML(const xmlNodePtr node,
def->cells[i].cellid = i;
cpus = virXMLPropString(nodes[i], "cpus");
if (!cpus) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing 'cpus' attribute in NUMA cell"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing 'cpus' attribute in NUMA cell"));
goto error;
}
def->cells[i].cpustr = cpus;
@@ -481,15 +477,15 @@ virCPUDefParseXML(const xmlNodePtr node,
memory = virXMLPropString(nodes[i], "memory");
if (!memory) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing 'memory' attribute in NUMA cell"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing 'memory' attribute in NUMA cell"));
goto error;
}
ret = virStrToLong_ui(memory, NULL, 10, &def->cells[i].mem);
if (ret == -1) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Invalid 'memory' attribute in NUMA cell"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Invalid 'memory' attribute in NUMA cell"));
VIR_FREE(memory);
goto error;
}
@@ -547,8 +543,8 @@ virCPUDefFormatBufFull(virBufferPtr buf,
if (def->mode != VIR_CPU_MODE_CUSTOM || def->model) {
if (!(tmp = virCPUModeTypeToString(def->mode))) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected CPU mode %d"), def->mode);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected CPU mode %d"), def->mode);
return -1;
}
virBufferAsprintf(buf, " mode='%s'", tmp);
@@ -558,9 +554,9 @@ virCPUDefFormatBufFull(virBufferPtr buf,
(def->mode == VIR_CPU_MODE_CUSTOM ||
(flags & VIR_DOMAIN_XML_UPDATE_CPU))) {
if (!(tmp = virCPUMatchTypeToString(def->match))) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected CPU match policy %d"),
- def->match);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected CPU match policy %d"),
+ def->match);
return -1;
}
virBufferAsprintf(buf, " match='%s'", tmp);
@@ -600,8 +596,8 @@ virCPUDefFormatBuf(virBufferPtr buf,
(def->mode == VIR_CPU_MODE_CUSTOM && def->model)));
if (!def->model && def->nfeatures) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Non-empty feature list specified without CPU model"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Non-empty feature list specified without CPU model"));
return -1;
}
@@ -612,9 +608,9 @@ virCPUDefFormatBuf(virBufferPtr buf,
fallback = virCPUFallbackTypeToString(def->fallback);
if (!fallback) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected CPU fallback value: %d"),
- def->fallback);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected CPU fallback value: %d"),
+ def->fallback);
return -1;
}
virBufferAsprintf(buf, " fallback='%s'", fallback);
@@ -644,8 +640,8 @@ virCPUDefFormatBuf(virBufferPtr buf,
virCPUFeatureDefPtr feature = def->features + i;
if (!feature->name) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing CPU feature name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing CPU feature name"));
return -1;
}
@@ -654,9 +650,9 @@ virCPUDefFormatBuf(virBufferPtr buf,
policy = virCPUFeaturePolicyTypeToString(feature->policy);
if (!policy) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected CPU feature policy %d"),
- feature->policy);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected CPU feature policy %d"),
+ feature->policy);
return -1;
}
virBufferAsprintf(buf, "\n",
@@ -691,8 +687,8 @@ virCPUDefAddFeature(virCPUDefPtr def,
for (i = 0 ; i < def->nfeatures ; i++) {
if (STREQ(name, def->features[i].name)) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("CPU feature `%s' specified more than once"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("CPU feature `%s' specified more than once"), name);
return -1;
}
}
@@ -728,96 +724,96 @@ virCPUDefIsEqual(virCPUDefPtr src,
return true;
if ((src && !dst) || (!src && dst)) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Target CPU does not match source"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Target CPU does not match source"));
goto cleanup;
}
if (src->type != dst->type) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU type %s does not match source %s"),
- virCPUTypeToString(dst->type),
- virCPUTypeToString(src->type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU type %s does not match source %s"),
+ virCPUTypeToString(dst->type),
+ virCPUTypeToString(src->type));
goto cleanup;
}
if (src->mode != dst->mode) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU mode %s does not match source %s"),
- virCPUModeTypeToString(dst->mode),
- virCPUModeTypeToString(src->mode));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU mode %s does not match source %s"),
+ virCPUModeTypeToString(dst->mode),
+ virCPUModeTypeToString(src->mode));
goto cleanup;
}
if (STRNEQ_NULLABLE(src->arch, dst->arch)) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU arch %s does not match source %s"),
- NULLSTR(dst->arch), NULLSTR(src->arch));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU arch %s does not match source %s"),
+ NULLSTR(dst->arch), NULLSTR(src->arch));
goto cleanup;
}
if (STRNEQ_NULLABLE(src->model, dst->model)) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU model %s does not match source %s"),
- NULLSTR(dst->model), NULLSTR(src->model));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU model %s does not match source %s"),
+ NULLSTR(dst->model), NULLSTR(src->model));
goto cleanup;
}
if (STRNEQ_NULLABLE(src->vendor, dst->vendor)) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU vendor %s does not match source %s"),
- NULLSTR(dst->vendor), NULLSTR(src->vendor));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU vendor %s does not match source %s"),
+ NULLSTR(dst->vendor), NULLSTR(src->vendor));
goto cleanup;
}
if (STRNEQ_NULLABLE(src->vendor_id, dst->vendor_id)) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU model %s does not match source %s"),
- NULLSTR(dst->vendor_id), NULLSTR(src->vendor_id));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU model %s does not match source %s"),
+ NULLSTR(dst->vendor_id), NULLSTR(src->vendor_id));
goto cleanup;
}
if (src->sockets != dst->sockets) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU sockets %d does not match source %d"),
- dst->sockets, src->sockets);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU sockets %d does not match source %d"),
+ dst->sockets, src->sockets);
goto cleanup;
}
if (src->cores != dst->cores) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU cores %d does not match source %d"),
- dst->cores, src->cores);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU cores %d does not match source %d"),
+ dst->cores, src->cores);
goto cleanup;
}
if (src->threads != dst->threads) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU threads %d does not match source %d"),
- dst->threads, src->threads);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU threads %d does not match source %d"),
+ dst->threads, src->threads);
goto cleanup;
}
if (src->nfeatures != dst->nfeatures) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU feature count %zu does not match source %zu"),
- dst->nfeatures, src->nfeatures);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU feature count %zu does not match source %zu"),
+ dst->nfeatures, src->nfeatures);
goto cleanup;
}
for (i = 0 ; i < src->nfeatures ; i++) {
if (STRNEQ(src->features[i].name, dst->features[i].name)) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU feature %s does not match source %s"),
- dst->features[i].name, src->features[i].name);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU feature %s does not match source %s"),
+ dst->features[i].name, src->features[i].name);
goto cleanup;
}
if (src->features[i].policy != dst->features[i].policy) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target CPU feature policy %s does not match source %s"),
- virCPUFeaturePolicyTypeToString(dst->features[i].policy),
- virCPUFeaturePolicyTypeToString(src->features[i].policy));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU feature policy %s does not match source %s"),
+ virCPUFeaturePolicyTypeToString(dst->features[i].policy),
+ virCPUFeaturePolicyTypeToString(src->features[i].policy));
goto cleanup;
}
}
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 398f630a17..1b5dad95bf 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -655,10 +655,6 @@ VIR_ENUM_IMPL(virDomainNumatuneMemPlacementMode,
"static",
"auto");
-#define virDomainReportError(code, ...) \
- virReportErrorHelper(VIR_FROM_DOMAIN, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
#define VIR_DOMAIN_XML_WRITE_FLAGS VIR_DOMAIN_XML_SECURE
#define VIR_DOMAIN_XML_READ_FLAGS VIR_DOMAIN_XML_INACTIVE
@@ -699,9 +695,9 @@ virDomainBlkioDeviceWeightParseXML(xmlNodePtr root,
} else if (xmlStrEqual(node->name, BAD_CAST "weight")) {
c = (char *)xmlNodeGetContent(node);
if (virStrToLong_ui(c, NULL, 10, &dw->weight) < 0) {
- virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("could not parse weight %s"),
- c);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("could not parse weight %s"),
+ c);
VIR_FREE(c);
VIR_FREE(dw->path);
return -1;
@@ -712,8 +708,8 @@ virDomainBlkioDeviceWeightParseXML(xmlNodePtr root,
node = node->next;
}
if (!dw->path) {
- virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("missing per-device path"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("missing per-device path"));
return -1;
}
@@ -1697,8 +1693,8 @@ static virDomainObjPtr virDomainObjNew(virCapsPtr caps)
domain->privateDataFreeFunc = caps->privateDataFreeFunc;
if (virMutexInit(&domain->lock) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot initialize mutex"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot initialize mutex"));
if (domain->privateDataFreeFunc)
(domain->privateDataFreeFunc)(domain->privateData);
VIR_FREE(domain);
@@ -1854,21 +1850,21 @@ virDomainLiveConfigHelperMethod(virCapsPtr caps,
}
if (!isActive && (*flags & VIR_DOMAIN_AFFECT_LIVE)) {
- virDomainReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain is not running"));
goto cleanup;
}
if (*flags & VIR_DOMAIN_AFFECT_CONFIG) {
if (!dom->persistent) {
- virDomainReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("cannot change persistent config of a "
- "transient domain"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("cannot change persistent config of a "
+ "transient domain"));
goto cleanup;
}
if (!(*persistentDef = virDomainObjGetPersistentDef(caps, dom))) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Get persistent config failed"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Get persistent config failed"));
goto cleanup;
}
}
@@ -2121,9 +2117,9 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
const char *rombar = virDomainPciRombarModeTypeToString(info->rombar);
if (!rombar) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected rom bar value %d"),
- info->rombar);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected rom bar value %d"),
+ info->rombar);
return -1;
}
virBufferAsprintf(buf, " bar='%s'", rombar);
@@ -2187,8 +2183,8 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
break;
default:
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown address type '%d'"), info->type);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown address type '%d'"), info->type);
return -1;
}
@@ -2214,43 +2210,43 @@ virDomainDevicePCIAddressParseXML(xmlNodePtr node,
if (domain &&
virStrToLong_ui(domain, NULL, 0, &addr->domain) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse
'domain' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'domain' attribute"));
goto cleanup;
}
if (bus &&
virStrToLong_ui(bus, NULL, 0, &addr->bus) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'bus' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'bus' attribute"));
goto cleanup;
}
if (slot &&
virStrToLong_ui(slot, NULL, 0, &addr->slot) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'slot' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'slot' attribute"));
goto cleanup;
}
if (function &&
virStrToLong_ui(function, NULL, 0, &addr->function) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'function' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'function' attribute"));
goto cleanup;
}
if (multi &&
((addr->multi = virDomainDeviceAddressPciMultiTypeFromString(multi)) <= 0)) {
- virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unknown value '%s' for 'multifunction' attribute"),
- multi);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unknown value '%s' for 'multifunction' attribute"),
+ multi);
goto cleanup;
}
if (!virDomainDevicePCIAddressIsValid(addr)) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Insufficient specification for PCI address"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Insufficient specification for PCI address"));
goto cleanup;
}
@@ -2282,29 +2278,29 @@ virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
if (controller &&
virStrToLong_ui(controller, NULL, 10, &addr->controller) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'controller' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'controller' attribute"));
goto cleanup;
}
if (bus &&
virStrToLong_ui(bus, NULL, 10, &addr->bus) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'bus' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'bus' attribute"));
goto cleanup;
}
if (target &&
virStrToLong_ui(target, NULL, 10, &addr->target) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'target' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'target' attribute"));
goto cleanup;
}
if (unit &&
virStrToLong_ui(unit, NULL, 10, &addr->unit) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'unit' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'unit' attribute"));
goto cleanup;
}
@@ -2336,22 +2332,22 @@ virDomainDeviceVirtioSerialAddressParseXML(
if (controller &&
virStrToLong_ui(controller, NULL, 10, &addr->controller) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'controller' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'controller' attribute"));
goto cleanup;
}
if (bus &&
virStrToLong_ui(bus, NULL, 10, &addr->bus) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'bus' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'bus' attribute"));
goto cleanup;
}
if (port &&
virStrToLong_ui(port, NULL, 10, &addr->port) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'port' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'port' attribute"));
goto cleanup;
}
@@ -2378,15 +2374,15 @@ virDomainDeviceCcidAddressParseXML(xmlNodePtr node,
if (controller &&
virStrToLong_ui(controller, NULL, 10, &addr->controller) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'controller' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'controller' attribute"));
goto cleanup;
}
if (slot &&
virStrToLong_ui(slot, NULL, 10, &addr->slot) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'slot' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'slot' attribute"));
goto cleanup;
}
@@ -2416,8 +2412,8 @@ virDomainDeviceUSBAddressParseXML(xmlNodePtr node,
(*tmp == '.' && (virStrToLong_ui(tmp + 1, &tmp, 10, &p) < 0 || (*tmp != '\0' && *tmp != '.'))) ||
(*tmp == '.' && (virStrToLong_ui(tmp + 1, &tmp, 10, &p) < 0 || (*tmp != '\0' && *tmp != '.'))) ||
(*tmp == '.' && (virStrToLong_ui(tmp + 1, &tmp, 10, &p) < 0 || (*tmp != '\0'))))) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'port' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'port' attribute"));
goto cleanup;
}
@@ -2426,8 +2422,8 @@ virDomainDeviceUSBAddressParseXML(xmlNodePtr node,
if (bus &&
virStrToLong_ui(bus, NULL, 10, &addr->bus) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'bus' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'bus' attribute"));
goto cleanup;
}
@@ -2451,8 +2447,8 @@ virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node,
reg = virXMLPropString(node, "reg");
if (reg) {
if (virStrToLong_ull(reg, NULL, 16, &addr->reg) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'reg' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'reg' attribute"));
ret = -1;
goto cleanup;
}
@@ -2479,8 +2475,8 @@ virDomainDeviceUSBMasterParseXML(xmlNodePtr node,
if (startport &&
virStrToLong_ui(startport, NULL, 10, &master->startport) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot parse 'startport' attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse 'startport' attribute"));
goto cleanup;
}
@@ -2502,26 +2498,26 @@ virDomainDeviceBootParseXML(xmlNodePtr node,
order = virXMLPropString(node, "order");
if (!order) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing boot order attribute"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing boot order attribute"));
goto cleanup;
} else if (virStrToLong_i(order, NULL, 10, &boot) < 0 ||
boot <= 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("incorrect boot order '%s', expecting positive integer"),
- order);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("incorrect boot order '%s', expecting positive integer"),
+ order);
goto cleanup;
}
if (bootMap) {
bool set;
if (virBitmapGetBit(bootMap, boot - 1, &set) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("boot orders have to be contiguous and starting from 1"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("boot orders have to be contiguous and starting from 1"));
goto cleanup;
} else if (set) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("boot order %d used for more than one device"), boot);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("boot order %d used for more than one device"), boot);
goto cleanup;
}
ignore_value(virBitmapSetBit(bootMap, boot - 1));
@@ -2599,8 +2595,8 @@ virDomainDeviceInfoParseXML(xmlNodePtr node,
char *rombar = virXMLPropString(rom, "bar");
if (rombar &&
((info->rombar = virDomainPciRombarModeTypeFromString(rombar)) <= 0)) {
- virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown rom bar value '%s'"), rombar);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown rom bar value '%s'"), rombar);
VIR_FREE(rombar);
goto cleanup;
}
@@ -2615,13 +2611,13 @@ virDomainDeviceInfoParseXML(xmlNodePtr node,
if (type) {
if ((info->type = virDomainDeviceAddressTypeFromString(type)) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown address type '%s'"), type);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown address type '%s'"), type);
goto cleanup;
}
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("No type specified for device address"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("No type specified for device address"));
goto cleanup;
}
@@ -2659,8 +2655,8 @@ virDomainDeviceInfoParseXML(xmlNodePtr node,
default:
/* Should not happen */
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Unknown device address type"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Unknown device address type"));
goto cleanup;
}
@@ -2715,15 +2711,15 @@ virDomainHostdevSubsysUsbDefParseXML(const xmlNodePtr node,
got_vendor = 1;
if (virStrToLong_ui(vendor, NULL, 0,
&def->source.subsys.u.usb.vendor) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse vendor id %s"), vendor);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse vendor id %s"), vendor);
VIR_FREE(vendor);
goto out;
}
VIR_FREE(vendor);
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("usb vendor needs id"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("usb vendor needs id"));
goto out;
}
} else if (xmlStrEqual(cur->name, BAD_CAST "product")) {
@@ -2733,16 +2729,16 @@ virDomainHostdevSubsysUsbDefParseXML(const xmlNodePtr node,
got_product = 1;
if (virStrToLong_ui(product, NULL, 0,
&def->source.subsys.u.usb.product) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse product %s"),
- product);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse product %s"),
+ product);
VIR_FREE(product);
goto out;
}
VIR_FREE(product);
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("usb product needs id"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("usb product needs id"));
goto out;
}
} else if (xmlStrEqual(cur->name, BAD_CAST "address")) {
@@ -2752,15 +2748,15 @@ virDomainHostdevSubsysUsbDefParseXML(const xmlNodePtr node,
if (bus) {
if (virStrToLong_ui(bus, NULL, 0,
&def->source.subsys.u.usb.bus) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse bus %s"), bus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse bus %s"), bus);
VIR_FREE(bus);
goto out;
}
VIR_FREE(bus);
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("usb address needs bus id"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("usb address needs bus id"));
goto out;
}
@@ -2768,22 +2764,22 @@ virDomainHostdevSubsysUsbDefParseXML(const xmlNodePtr node,
if (device) {
if (virStrToLong_ui(device, NULL, 0,
&def->source.subsys.u.usb.device) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse device %s"),
- device);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse device %s"),
+ device);
VIR_FREE(device);
goto out;
}
VIR_FREE(device);
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("usb address needs device id"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("usb address needs device id"));
goto out;
}
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown usb source type '%s'"),
- cur->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown usb source type '%s'"),
+ cur->name);
goto out;
}
}
@@ -2791,19 +2787,19 @@ virDomainHostdevSubsysUsbDefParseXML(const xmlNodePtr node,
}
if (got_vendor && def->source.subsys.u.usb.vendor == 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("vendor cannot be 0."));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("vendor cannot be 0."));
goto out;
}
if (!got_vendor && got_product) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing vendor"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing vendor"));
goto out;
}
if (got_vendor && !got_product) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing product"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing product"));
goto out;
}
@@ -2836,9 +2832,9 @@ virDomainHostdevSubsysPciOrigStatesDefParseXML(const xmlNodePtr node,
} else if (xmlStrEqual(cur->name, BAD_CAST "reprobe")) {
def->states.pci.reprobe = 1;
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unsupported element '%s' of 'origstates'"),
- cur->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unsupported element '%s' of 'origstates'"),
+ cur->name);
return -1;
}
}
@@ -2872,9 +2868,9 @@ virDomainHostdevSubsysPciDefParseXML(const xmlNodePtr node,
if (devaddr &&
virDomainParseLegacyDeviceAddress(devaddr,
&def->info->addr.pci) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to parse devaddr parameter '%s'"),
- devaddr);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to parse devaddr parameter '%s'"),
+ devaddr);
VIR_FREE(devaddr);
goto out;
}
@@ -2885,9 +2881,9 @@ virDomainHostdevSubsysPciDefParseXML(const xmlNodePtr node,
if (virDomainHostdevSubsysPciOrigStatesDefParseXML(cur, states) < 0)
goto out;
} else {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown pci source type '%s'"),
- cur->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown pci source type '%s'"),
+ cur->name);
goto out;
}
}
@@ -2917,8 +2913,8 @@ virDomainHostdevPartsParse(xmlNodePtr node,
*/
if (mode) {
if ((def->mode=virDomainHostdevModeTypeFromString(mode)) < 0) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown hostdev mode '%s'"), mode);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown hostdev mode '%s'"), mode);
goto error;
}
} else {
@@ -2946,20 +2942,20 @@ virDomainHostdevPartsParse(xmlNodePtr node,
if (type) {
if ((def->source.subsys.type
= virDomainHostdevSubsysTypeFromString(type)) < 0) {
- virDomainReportError(VIR_ERR_XML_ERROR,
- _("unknown host device source address type '%s'"),
- type);
+ virReportError(VIR_ERR_XML_ERROR,
+ _("unknown host device source address type '%s'"),
+ type);
goto error;
}
} else {
- virDomainReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing source address type"));
+ virReportError(VIR_ERR_XML_ERROR,
+ "%s", _("missing source address type"));
goto error;
}
if (!(sourcenode = virXPathNode("./source", ctxt))) {
- virDomainReportError(VIR_ERR_XML_ERROR, "%s",
- _("Missing