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

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



Signed-off-by: Jiri Denemark <jdenemar 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


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