[PATCH 01/16] conf: Improve core dump config error message

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

 



The message didn't seem to be much helpful
---
 src/conf/domain_conf.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f2887c6..bd1ea25 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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
-- 
1.8.1.1

--
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]