[PATCH 04/12] storage_conf: Use xmlStrEqual instead of STREQ

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

 



And improve the error message
---
 src/conf/storage_conf.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 6f89f1c..5c8577e 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -975,9 +975,11 @@ virStoragePoolDefParseNode(xmlDocPtr xml,
     xmlXPathContextPtr ctxt = NULL;
     virStoragePoolDefPtr def = NULL;
 
-    if (STRNEQ((const char *)root->name, "pool")) {
+    if (!xmlStrEqual(root->name, BAD_CAST "pool")) {
         virReportError(VIR_ERR_XML_ERROR,
-                       "%s", _("unknown root element for storage pool"));
+                       _("unexpected root element <%s>, "
+                         "expecting <pool>"),
+                       root->name);
         goto cleanup;
     }
 
@@ -1353,9 +1355,11 @@ virStorageVolDefParseNode(virStoragePoolDefPtr pool,
     xmlXPathContextPtr ctxt = NULL;
     virStorageVolDefPtr def = NULL;
 
-    if (STRNEQ((const char *)root->name, "volume")) {
+    if (!xmlStrEqual(root->name, BAD_CAST "volume")) {
         virReportError(VIR_ERR_XML_ERROR,
-                       "%s", _("unknown root element for storage vol"));
+                       _("unexpected root element <%s>, "
+                         "expecting <volume>"),
+                       root->name);
         goto cleanup;
     }
 
-- 
1.8.1.4

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