search for: xpathobj

Displaying 20 results from an estimated 48 matches for "xpathobj".

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...
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== A...
2017 Mar 16
0
[PATCH 1/4] p2v: Pass host CPU details to virt-v2v.
...* we care about. + */ +static void +libvirt_capabilities (struct cpu_config *cpu) +{ + virConnectPtr conn; + CLEANUP_FREE char *capabilities_xml = NULL; + CLEANUP_XMLFREEDOC xmlDocPtr doc = NULL; + CLEANUP_XMLXPATHFREECONTEXT xmlXPathContextPtr xpathCtx = NULL; + CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpathObj = NULL; + xmlNodeSetPtr nodes; + size_t nr_nodes, i; + xmlNodePtr node; + + /* Connect to libvirt and get the capabilities XML. */ + conn = virConnectOpenReadOnly (NULL); + if (!conn) { + libvirt_error (_("could not connect to libvirt")); + return; + } + + /*...
2017 Mar 23
2
[PATCH] p2v: Use lscpu instead of libvirt to get CPU information.
...ilities (struct cpu_config *cpu) +get_flags (char **lscpu, struct cpu_config *cpu) { - virConnectPtr conn; - CLEANUP_FREE char *capabilities_xml = NULL; - CLEANUP_XMLFREEDOC xmlDocPtr doc = NULL; - CLEANUP_XMLXPATHFREECONTEXT xmlXPathContextPtr xpathCtx = NULL; - CLEANUP_XMLXPATHFREEOBJECT xmlXPathObjectPtr xpathObj = NULL; - const char *xpathexpr; - xmlNodeSetPtr nodes; - size_t nr_nodes, i; - xmlNodePtr node; - - /* Connect to libvirt and get the capabilities XML. */ - conn = virConnectOpenReadOnly (NULL); - if (!conn) { - libvirt_error (_("could not connect to libvirt"));...
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 -
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
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
2014 Aug 26
3
Segmentation fault when trying to add binding
...2v/xml.ml +++ b/v2v/xml.ml @@ -31,6 +31,7 @@ type node = doc * node_ptr external parse_memory : string -> doc = "v2v_xml_parse_memory" external xpath_new_context : doc -> xpathctx = "v2v_xml_xpath_new_context" external xpath_eval_expression : xpathctx -> string -> xpathobj = "v2v_xml_xpath_eval_expression" +external xpath_register_ns : string -> string -> xpathctx -> int = "v2v_xml_xpath_register_ns" external xpathobj_nr_nodes : xpathobj -> int = "v2v_xml_xpathobj_nr_nodes" external xpathobj_get_node_ptr : xpathobj ->...
2020 Jan 16
7
[PATCH 0/4] Use libvirt firmware autoselection
Starting with 5.2.0, libvirt has a way to select the firmware by specifying its type, provided configuration files for the firmware are shipped. Currently we start the appliance as UEFI if any of the firmware are found, so instead we can try to just set the firmware type iff: - the libvirt autoselection works - the 'efi' firmware is available The only behaviour change is that the default
2017 Mar 16
7
[PATCH 0/4] Pass CPU vendor, model and topology from source to target.
This is tangentially related to: https://bugzilla.redhat.com/show_bug.cgi?id=1372668 The problem in that bug is that we didn't pass the source CPU model (Sandybridge in that case) through to the target RHV hypervisor. So when the Windows guest booted on the target it gives an error about CPU hardware being disconnected (although it otherwise boots and works fine). This patch series
2017 Mar 07
0
[PATCH v4 2/9] lib: extract osinfo DB traversing API
...ath). + * 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
...ath). + * 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 Jun 19
0
[PATCH v7 2/9] lib: extract osinfo DB traversing API
...ath). + * 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 Apr 12
0
[PATCH v6 02/10] lib: extract osinfo DB traversing API
...ath). + * 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 Oct 27
0
[PATCH v11 7/8] mllib: add XPath helper xpath_get_nodes
...th_eval parsefn xpathctx expr = let xpath_string = xpath_eval identity let xpath_int = xpath_eval int_of_string let xpath_int64 = xpath_eval Int64.of_string + +let xpath_get_nodes xpathctx expr = + let obj = Xml.xpath_eval_expression xpathctx expr in + let nodes = ref [] in + for i = 0 to Xml.xpathobj_nr_nodes obj - 1 do + let node = Xml.xpathobj_node obj i in + push_front node nodes + done; + List.rev !nodes diff --git a/common/mltools/xpath_helpers.mli b/common/mltools/xpath_helpers.mli index 3a8190b05..3a2607aeb 100644 --- a/common/mltools/xpath_helpers.mli +++ b/common/mltools/xpath_...
2017 Mar 17
7
[PATCH v2 0/6] v2v: Pass CPU vendor, model and topology from source to target.
v1 -> v2: - Support for passing topology through -o glance. - Support for passing topology through -o rhv. - Use bool for acpi/apic/pae struct fields in virt-p2v. - Write the xpath expression in error messages instead of file/line. - Fix more memory leaks in virt-p2v cpuid.c. - Passes make check & check-valgrind. There may be some other minor changes. I believe that everything
2017 Feb 07
0
[PATCH v2 2/7] Move xml and xpath_helpers OCAML code to mllib
...ct custom_operations xpathctxptr_custom_operations = { }; value -v2v_xml_free_xpathctxptr (value xpathctxv) +mllib_xml_free_xpathctxptr (value xpathctxv) { CAMLparam1 (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_...
2017 Apr 04
1
Re: [PATCH v5 09/10] mllib: add XPath helper xpath_get_nodes()
...tity > let xpath_int_default = xpath_eval_default int_of_string > let xpath_int64_default = xpath_eval_default Int64.of_string > + > +let xpath_get_nodes xpathctx expr = > + let obj = Xml.xpath_eval_expression xpathctx expr in > + let nodes = ref [] in > + for i = 0 to Xml.xpathobj_nr_nodes obj - 1 do > + let node = Xml.xpathobj_node obj i in > + nodes := List.append !nodes [node] You can use the utilities from Common_utils for manipulating list references, so: push_back nodes node; The other option to not use a list reference to collect the nodes would be to...
2017 Feb 07
0
[PATCH v2 3/7] mllib: expose libosinfo DB reading functions in mllib
...ath). + * 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...