mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
LXC: throw an error if we failed to get Idmap elements
Throwing an error is much friendly than just "error: An error occurred, but the cause is unknown" Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This commit is contained in:
parent
9036b31aed
commit
5fc1d4ec7e
@ -10983,6 +10983,8 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt,
|
|||||||
if (virXPathUInt("string(./@start)", ctxt, &idmap[i].start) < 0 ||
|
if (virXPathUInt("string(./@start)", ctxt, &idmap[i].start) < 0 ||
|
||||||
virXPathUInt("string(./@target)", ctxt, &idmap[i].target) < 0 ||
|
virXPathUInt("string(./@target)", ctxt, &idmap[i].target) < 0 ||
|
||||||
virXPathUInt("string(./@count)", ctxt, &idmap[i].count) < 0) {
|
virXPathUInt("string(./@count)", ctxt, &idmap[i].count) < 0) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
_("invalid idmap start/target/count settings"));
|
||||||
VIR_FREE(idmap);
|
VIR_FREE(idmap);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user