mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +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
8fb76be11e
commit
2c41bb8da9
@@ -505,7 +505,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;
|
||||
|
||||
@@ -708,7 +708,8 @@ get_domain_xml (guestfs_h *g, virDomainPtr dom)
|
||||
}
|
||||
|
||||
/* Parse the domain XML into an XML 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 NULL;
|
||||
|
||||
@@ -269,7 +269,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