1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

Improve error message diagnosing incorrect XML CPU mode

Tell the user what CPU mode value is wrong
This commit is contained in:
Daniel P. Berrange 2012-06-13 18:21:29 +01:00
parent e0f0131d33
commit 92cbe7ae39

View File

@ -234,13 +234,15 @@ virCPUDefParseXML(const xmlNodePtr node,
goto error;
} else {
def->mode = virCPUModeTypeFromString(cpuMode);
VIR_FREE(cpuMode);
if (def->mode < 0) {
virCPUReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid mode attribute"));
virCPUReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid mode attribute '%s'"),
cpuMode);
VIR_FREE(cpuMode);
goto error;
}
VIR_FREE(cpuMode);
}
} else {
if (def->type == VIR_CPU_TYPE_HOST)