[libvirt] [PATCH 17/17] cpu: Properly report errors when parsing CPU map XML

Jiri Denemark jdenemar at redhat.com
Sat May 14 08:30:36 UTC 2016


Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---
 src/cpu/cpu_map.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c
index 6130f8a..066be97 100644
--- a/src/cpu/cpu_map.c
+++ b/src/cpu/cpu_map.c
@@ -105,17 +105,8 @@ int cpuMapLoad(const char *arch,
         goto cleanup;
     }
 
-    if ((xml = xmlParseFile(mapfile)) == NULL) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("cannot parse CPU map file: %s"),
-                       mapfile);
+    if (!(xml = virXMLParseFileCtxt(mapfile, &ctxt)))
         goto cleanup;
-    }
-
-    if ((ctxt = xmlXPathNewContext(xml)) == NULL) {
-        virReportOOMError();
-        goto cleanup;
-    }
 
     virBufferAsprintf(&buf, "./arch[@name='%s']", arch);
     if (virBufferCheckError(&buf) < 0)
-- 
2.8.2




More information about the libvir-list mailing list