From: Osier Yang Date: Wed, 22 May 2013 12:05:14 +0000 (+0800) Subject: storage_conf: Use xmlStrEqual instead of STREQ X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0175f03cde3b0fd96f9e3c77974f1f707cbf6767;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git storage_conf: Use xmlStrEqual instead of STREQ And improve the error message --- diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 215ce8472..60068ccc7 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -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 "), + 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 "), + root->name); goto cleanup; }