[PATCH] LXC: throw an error if we failed to get Idmap elements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Throwing an error is much friendly than just
"error: An error occurred, but the cause is unknown"

Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
---
 src/conf/domain_conf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b7aa4f5..fa64dc1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10983,6 +10983,8 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt,
         if (virXPathUInt("string(./@start)", ctxt, &idmap[i].start) < 0 ||
             virXPathUInt("string(./@target)", ctxt, &idmap[i].target) < 0 ||
             virXPathUInt("string(./@count)", ctxt, &idmap[i].count) < 0) {
+            virReportError(VIR_ERR_XML_ERROR, "%s",
+                           _("invalid idmap start/target/count settings"));
             VIR_FREE(idmap);
             goto cleanup;
         }
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]