search for: xmlxpathobjectptr

Displaying 20 results from an estimated 49 matches for "xmlxpathobjectptr".

2016 Nov 16
3
[PATCH 1/2] libvirt: un-duplicate XPath code
Move the checks for empty xmlXPathObjectPtr, and for extracting the result string out of it, to a new helper functions. This is just code motion, there should be no behaviour changes. --- src/libvirt-domain.c | 122 +++++++++++++++++++++------------------------------ 1 file changed, 50 insertions(+), 72 deletions(-) diff --git a/src/libvi...
2015 Jun 25
2
[PATCH v2] v2v: Free XML objects in the correct order.
In version 2: - No substantial change, I just tidied up the code a bit. - Removed one case where whitespace changes had crept in. Rich.
2015 Jun 25
0
[PATCH v2] v2v: Free XML objects in the correct order.
If you free an xmlDocPtr before any xmlXPathObjectPtrs that reference the doc, you'll get valgrind errors like this: ==7390== Invalid read of size 4 ==7390== at 0x4EB8BC6: xmlXPathFreeNodeSet (xpath.c:4185) ==7390== by 0x4EB8CC5: xmlXPathFreeObject (xpath.c:5492) ==7390== by 0x400A56: main (in /tmp/test) ==7390== Address 0x60c...
2015 Jun 25
0
[PATCH] v2v: Free XML objects in the correct order.
If you free an xmlDocPtr before any xmlXPathObjectPtr 's that reference the doc, you'll get valgrind errors like this: ==7390== Invalid read of size 4 ==7390== at 0x4EB8BC6: xmlXPathFreeNodeSet (xpath.c:4185) ==7390== by 0x4EB8CC5: xmlXPathFreeObject (xpath.c:5492) ==7390== by 0x400A56: main (in /tmp/test) ==7390== Address...
2016 Nov 16
0
[PATCH 2/2] libvirt: read secrets of disks (RHBZ#1392798)
...nst char *secret, void *data), void *data); static int libvirt_selinux_label (guestfs_h *g, xmlDocPtr doc, char **label_rtn, char **imagelabel_rtn); static char *filename_from_pool (guestfs_h *g, virConnectPtr conn, const char *pool_nane, const char *volume_name); static bool xPathObjectIsEmpty (xmlXPathObjectPtr obj); @@ -95,8 +97,12 @@ guestfs_impl_add_domain (guestfs_h *g, const char *domain_name, return -1; } - /* Connect to libvirt, find the domain. */ - conn = guestfs_int_open_libvirt_connection (g, libvirturi, VIR_CONNECT_RO); + /* Connect to libvirt, find the domain. We cannot open the...
2016 Sep 20
1
[PATCH] libvirt: read disk paths from pools (RHBZ#1366049)
...tic ssize_t for_each_disk (guestfs_h *g, + virConnectPtr conn, xmlDocPtr doc, int (*f) (guestfs_h *g, const char *filename, const char *format, @@ -509,6 +511,8 @@ for_each_disk (guestfs_h *g, CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpprotocol = NULL; CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xphost = NULL; CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpusername = NULL; + CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xppool = NULL; + CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpvolume = NULL;...
2016 Sep 22
1
[PATCH v2] libvirt: read disk paths from pools (RHBZ#1366049)
...tic ssize_t for_each_disk (guestfs_h *g, + virConnectPtr conn, xmlDocPtr doc, int (*f) (guestfs_h *g, const char *filename, const char *format, @@ -509,6 +511,8 @@ for_each_disk (guestfs_h *g, CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpprotocol = NULL; CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xphost = NULL; CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpusername = NULL; + CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xppool = NULL; + CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpvolume = NULL;...
2013 May 07
7
[PATCH 0/5] rbd improvements
This series improves ceph rbd support in libguestfs. It uses the servers list, adds support for a custom username, and starts to add support for custom secret.
2013 Feb 28
7
[PATCH 0/7] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
https://bugzilla.redhat.com/show_bug.cgi?id=912499 (especially comments 7 & 10) This patch set is the final fix so that we can access disks in use by other guests when SELinux and sVirt are enabled. Previously such disks were inaccessible because sVirt labels the disks with a random SELinux label to prevent other instances of qemu from being able to read them. So naturally the libguestfs
2020 Feb 11
2
[PATCH v2] lib: add support for disks with 4096 bytes sector size
...int blocksize, void *data), void *data); static int libvirt_selinux_label (guestfs_h *g, xmlDocPtr doc, char **label_rtn, char **imagelabel_rtn); static char *filename_from_pool (guestfs_h *g, virConnectPtr conn, const char *pool_nane, const char *volume_name); static bool xpath_object_is_empty (xmlXPathObjectPtr obj); static char *xpath_object_get_string (xmlDocPtr doc, xmlXPathObjectPtr obj); +static int xpath_object_get_int (xmlDocPtr doc, xmlXPathObjectPtr obj); static void ignore_errors (void *ignore, virErrorPtr ignore2) @@ -169,7 +170,7 @@ guestfs_impl_add_domain (guestfs_h *g, const char *domai...
2020 Feb 10
1
[PATCH] lib: allow to specify physical/logical block size for disks
...int blocksize, void *data), void *data); static int libvirt_selinux_label (guestfs_h *g, xmlDocPtr doc, char **label_rtn, char **imagelabel_rtn); static char *filename_from_pool (guestfs_h *g, virConnectPtr conn, const char *pool_nane, const char *volume_name); static bool xpath_object_is_empty (xmlXPathObjectPtr obj); static char *xpath_object_get_string (xmlDocPtr doc, xmlXPathObjectPtr obj); +static int xpath_object_get_int (xmlDocPtr doc, xmlXPathObjectPtr obj); static void ignore_errors (void *ignore, virErrorPtr ignore2) @@ -169,7 +170,7 @@ guestfs_impl_add_domain (guestfs_h *g, const char *domai...
2013 Feb 28
5
[PATCH v2 0/5] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
Link to version 1: https://www.redhat.com/archives/libguestfs/2013-February/thread.html#00122 Changes since version 1: - I've pushed two (of the three) code refactoring patches. The third one proved rather hard to move. - selinuxnorelabel option is no more. Instead there is a second internal API (internal_set_libvirt_selinux_norelabel_disks). - fixed bogus commit message -
2017 Feb 07
0
[PATCH v2 2/7] Move xml and xpath_helpers OCAML code to mllib
...ram1 (xpathctxv); xmlXPathContextPtr xpathctx = xpathctxptr_val (xpathctxv); @@ -96,7 +97,7 @@ static struct custom_operations xpathobjptr_custom_operations = { }; value -v2v_xml_free_xpathobjptr (value xpathobjv) +mllib_xml_free_xpathobjptr (value xpathobjv) { CAMLparam1 (xpathobjv); xmlXPathObjectPtr xpathobj = xpathobjptr_val (xpathobjv); @@ -106,7 +107,7 @@ v2v_xml_free_xpathobjptr (value xpathobjv) } value -v2v_xml_parse_memory (value xmlv) +mllib_xml_parse_memory (value xmlv) { CAMLparam1 (xmlv); CAMLlocal1 (docv); @@ -128,7 +129,7 @@ v2v_xml_parse_memory (value xmlv) } value...
2019 May 24
3
[PATCH 0/2] libvirt: fix check of custom QEMU
In case you configure libguestfs with a custom QEMU, e.g.: $ ./configure [...] QEMU=/path/to/qemu then the libvirt backend did not use to override it, launching the appliance with the default QEMU for libvirt. This does not change the manual emulator overriding using set-hv. Pino Toscano (2): launch: libvirt: get default QEMU from domcapabilities launch: libvirt: fix custom hypervisor
2016 Jul 28
3
[PATCH] utils: add new CLEANUP_XMLFREE cleanup, to call xmlFree()
Small cleanup helper to dispose xmlChar* buffers. --- src/cleanup.c | 9 +++++++++ src/guestfs-internal-frontend.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/cleanup.c b/src/cleanup.c index 1aa3051..6c4558c 100644 --- a/src/cleanup.c +++ b/src/cleanup.c @@ -106,6 +106,15 @@ guestfs_int_cleanup_unlink_free (char **ptr) } void +guestfs_int_cleanup_xmlFree
2014 Aug 26
3
Segmentation fault when trying to add binding
...text *) val xpath_eval_expression : xpathctx -> string -> xpathobj (** xmlXPathEvalExpression *) +val xpath_register_ns : string -> string -> xpathctx -> int +(** xmlXPathRegisterNs *) val xpathobj_nr_nodes : xpathobj -> int (** Get the number of nodes in the node set of the xmlXPathObjectPtr. *) ===================================================================================
2016 Jul 25
2
[PATCH] osinfo: revamp db reading (RHBZ#1359652)
...nt -read_osinfo_db_xml (guestfs_h *g, const char *filename) +read_osinfo_db_xml (guestfs_h *g, const char *pathname) { - CLEANUP_FREE char *pathname = NULL; CLEANUP_XMLFREEDOC xmlDocPtr doc = NULL; CLEANUP_XMLXPATHFREECONTEXT xmlXPathContextPtr xpathCtx = NULL; CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpathObj = NULL; @@ -236,8 +350,6 @@ read_osinfo_db_xml (guestfs_h *g, const char *filename) struct osinfo *osinfo; size_t i; - pathname = safe_asprintf (g, "%s/%s", LIBOSINFO_DB_OS_PATH, filename); - doc = xmlReadFile (pathname, NULL, XML_PARSE_NONET); if (doc == NULL) {...
2017 Jun 15
0
[PATCH v6 05/41] utils: Split out cleanups into common/cleanups.
...WriterPtr *) ptr; + + if (xo) + xmlFreeTextWriter (xo); +} + +void +guestfs_int_cleanup_xmlXPathFreeContext (void *ptr) +{ + xmlXPathContextPtr ctx = * (xmlXPathContextPtr *) ptr; + + if (ctx) + xmlXPathFreeContext (ctx); +} + +void +guestfs_int_cleanup_xmlXPathFreeObject (void *ptr) +{ + xmlXPathObjectPtr obj = * (xmlXPathObjectPtr *) ptr; + + if (obj) + xmlXPathFreeObject (obj); +} diff --git a/common/utils/cleanup.c b/common/cleanups/stdlib-cleanups.c similarity index 62% rename from common/utils/cleanup.c rename to common/cleanups/stdlib-cleanups.c index 6c4558c39..0512a86a2 100644 --- a/comm...
2017 Mar 07
0
[PATCH v4 2/9] lib: extract osinfo DB traversing API
...l path). + * Only memory allocation failures are fatal errors here. + */ +static int +read_osinfo_db_xml (guestfs_h *g, const char *pathname, void *opaque) +{ + CLEANUP_XMLFREEDOC xmlDocPtr doc = NULL; + CLEANUP_XMLXPATHFREECONTEXT xmlXPathContextPtr xpathCtx = NULL; + CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpathObj = NULL; + xmlNodeSetPtr nodes; + xmlNodePtr iso_node, media_node, os_node; + struct osinfo *osinfo; + size_t i; + + doc = xmlReadFile (pathname, NULL, XML_PARSE_NONET); + if (doc == NULL) { + debug (g, "osinfo: unable to parse XML file %s", pathname); + return 0; + }...
2017 Feb 10
0
[PATCH v3 05/10] lib: extract osinfo DB traversing API
...l path). + * Only memory allocation failures are fatal errors here. + */ +static int +read_osinfo_db_xml (guestfs_h *g, const char *pathname, void *opaque) +{ + CLEANUP_XMLFREEDOC xmlDocPtr doc = NULL; + CLEANUP_XMLXPATHFREECONTEXT xmlXPathContextPtr xpathCtx = NULL; + CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpathObj = NULL; + xmlNodeSetPtr nodes; + xmlNodePtr iso_node, media_node, os_node; + struct osinfo *osinfo; + size_t i; + + doc = xmlReadFile (pathname, NULL, XML_PARSE_NONET); + if (doc == NULL) { + debug (g, "osinfo: unable to parse XML file %s", pathname); + return 0; + }...