mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
lib: xmlParse{File,Memory} -> xmlRead{File,Memory}
Switch from xmlParse* to xmlRead* so we can explicitly specify parsing
flags, including no network usage and no entity resolution.
The two behaviours mentioned above were not done before either, so this
should not introduce behaviour changes in libguestfs.
(cherry picked from commit 845daded5f)
This commit is contained in:
committed by
Richard W.M. Jones
parent
205d72417a
commit
83b054537a
@@ -88,7 +88,8 @@ guestfs___for_each_disk (guestfs_h *g,
|
||||
/* Now the horrible task of parsing out the fields we need from the XML.
|
||||
* http://www.xmlsoft.org/examples/xpath1.c
|
||||
*/
|
||||
doc = xmlParseMemory (xml, strlen (xml));
|
||||
doc = xmlReadMemory (xml, strlen (xml),
|
||||
NULL, NULL, XML_PARSE_NONET);
|
||||
if (doc == NULL) {
|
||||
error_function (g, 0,
|
||||
_("unable to parse XML information returned by libvirt"));
|
||||
|
||||
@@ -515,7 +515,8 @@ parse_capabilities (guestfs_h *g, const char *capabilities_xml,
|
||||
xmlAttrPtr attr;
|
||||
size_t seen_qemu, seen_kvm;
|
||||
|
||||
doc = xmlParseMemory (capabilities_xml, strlen (capabilities_xml));
|
||||
doc = xmlReadMemory (capabilities_xml, strlen (capabilities_xml),
|
||||
NULL, NULL, XML_PARSE_NONET);
|
||||
if (doc == NULL) {
|
||||
error (g, _("unable to parse capabilities XML returned by libvirt"));
|
||||
return -1;
|
||||
|
||||
@@ -334,7 +334,8 @@ connect_live (guestfs_h *g, virDomainPtr dom)
|
||||
}
|
||||
|
||||
/* Parse XML to document. */
|
||||
doc = xmlParseMemory (xml, strlen (xml));
|
||||
doc = xmlReadMemory (xml, strlen (xml),
|
||||
NULL, NULL, XML_PARSE_NONET);
|
||||
if (doc == NULL) {
|
||||
error (g, _("unable to parse XML information returned by libvirt"));
|
||||
return -1;
|
||||
|
||||
@@ -273,7 +273,7 @@ read_osinfo_db_xml (guestfs_h *g, const char *filename)
|
||||
|
||||
snprintf (pathname, pathname_len, "%s/%s", LIBOSINFO_DB_OS_PATH, filename);
|
||||
|
||||
doc = xmlParseFile (pathname);
|
||||
doc = xmlReadFile (pathname, NULL, XML_PARSE_NONET);
|
||||
if (doc == NULL) {
|
||||
debug (g, "osinfo: unable to parse XML file %s", pathname);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user