Skip to content

Commit

Permalink
lib: xmlParse{File,Memory} -> xmlRead{File,Memory}
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ptoscano committed May 6, 2014
1 parent 4dc4269 commit 845dade
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/launch-libvirt.c
Expand Up @@ -611,7 +611,8 @@ parse_capabilities (guestfs_h *g, const char *capabilities_xml,
size_t seen_qemu, seen_kvm;
int force_tcg;

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;
Expand Down
3 changes: 2 additions & 1 deletion src/libvirt-domain.c
Expand Up @@ -750,7 +750,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;
Expand Down
2 changes: 1 addition & 1 deletion src/osinfo.c
Expand Up @@ -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;
Expand Down

0 comments on commit 845dade

Please sign in to comment.