]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
storage_conf: Use xmlStrEqual instead of STREQ
authorOsier Yang <jyang@redhat.com>
Wed, 22 May 2013 12:05:14 +0000 (20:05 +0800)
committerOsier Yang <jyang@redhat.com>
Fri, 24 May 2013 14:33:50 +0000 (22:33 +0800)
And improve the error message

src/conf/storage_conf.c

index 215ce847288a05610c156ffb255f169647a3caa0..60068ccc7c1d5b0625973470f2ae0abc97823e84 100644 (file)
@@ -972,9 +972,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;
     }
 
@@ -1350,9 +1352,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;
     }