From 0175f03cde3b0fd96f9e3c77974f1f707cbf6767 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Wed, 22 May 2013 20:05:14 +0800 Subject: [PATCH] storage_conf: Use xmlStrEqual instead of STREQ 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 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; } -- 2.39.5