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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]