]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
conf: Improve core dump config error message
authorPeter Krempa <pkrempa@redhat.com>
Wed, 20 Feb 2013 15:31:14 +0000 (16:31 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 21 Feb 2013 10:04:34 +0000 (11:04 +0100)
The message didn't seem to be much helpful

src/conf/domain_conf.c

index f2887c65b5542328c5411fe8afac8b69cebeaa4e..bd1ea2597b9754456bd9b8b7ef56db3021e917ad 100644 (file)
@@ -9265,16 +9265,13 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
         goto error;
 
     /* and info about it */
-    tmp = virXPathString("string(./memory[1]/@dumpCore)", ctxt);
-    if (tmp) {
-        def->mem.dump_core = virDomainMemDumpTypeFromString(tmp);
-
-        if (def->mem.dump_core <= 0) {
-            virReportError(VIR_ERR_XML_ERROR, _("Bad value '%s'"), tmp);
-            goto error;
-        }
-        VIR_FREE(tmp);
+    if ((tmp = virXPathString("string(./memory[1]/@dumpCore)", ctxt)) &&
+        (def->mem.dump_core = virDomainMemDumpTypeFromString(tmp)) <= 0) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("Invalid memory core dump attribute value '%s'"), tmp);
+        goto error;
     }
+    VIR_FREE(tmp);
 
     if (def->mem.cur_balloon > def->mem.max_balloon) {
         /* Older libvirt could get into this situation due to