mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
conf: Improve error messages if parsing of vCPU count fails
This commit is contained in:
parent
c58e1f4de2
commit
23b9502bfc
@ -9087,7 +9087,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
|||||||
def->maxvcpus = count;
|
def->maxvcpus = count;
|
||||||
if (count == 0 || (unsigned short) count != count) {
|
if (count == 0 || (unsigned short) count != count) {
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
_("invalid maxvcpus %lu"), count);
|
_("invalid maximum number of vCPUs '%lu'"), count);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9103,13 +9103,14 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
|||||||
def->vcpus = count;
|
def->vcpus = count;
|
||||||
if (count == 0 || (unsigned short) count != count) {
|
if (count == 0 || (unsigned short) count != count) {
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
_("invalid current vcpus %lu"), count);
|
_("invalid current number of vCPUs '%lu'"), count);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->maxvcpus < count) {
|
if (def->maxvcpus < count) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("maxvcpus must not be less than current vcpus (%d < %lu)"),
|
_("maxvcpus must not be less than current vcpus "
|
||||||
|
"(%d < %lu)"),
|
||||||
def->maxvcpus, count);
|
def->maxvcpus, count);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user