search for: xmlnodegetcont

Displaying 20 results from an estimated 32 matches for "xmlnodegetcont".

2017 Mar 07
0
[PATCH v4 2/9] lib: extract osinfo DB traversing API
...t;application-id")) { + if (compile_re (g, child, &osinfo->re_application_id) == -1) + return -1; + } + } + + return 0; +} + +static int +compile_re (guestfs_h *g, xmlNodePtr node, pcre **re) +{ + const char *err; + int offset; + CLEANUP_FREE char *content = (char *) xmlNodeGetContent (node); + + if (content) { + *re = pcre_compile (content, 0, &err, &offset, NULL); + if (*re == NULL) + debug (g, "osinfo: could not parse regular expression '%s': %s (ignored)", + content, err); + } + + return 0; +} + +/* Read the attributes o...
2017 Feb 10
0
[PATCH v3 05/10] lib: extract osinfo DB traversing API
...t;application-id")) { + if (compile_re (g, child, &osinfo->re_application_id) == -1) + return -1; + } + } + + return 0; +} + +static int +compile_re (guestfs_h *g, xmlNodePtr node, pcre **re) +{ + const char *err; + int offset; + CLEANUP_FREE char *content = (char *) xmlNodeGetContent (node); + + if (content) { + *re = pcre_compile (content, 0, &err, &offset, NULL); + if (*re == NULL) + debug (g, "osinfo: could not parse regular expression '%s': %s (ignored)", + content, err); + } + + return 0; +} + +/* Read the attributes o...
2017 Jun 19
0
[PATCH v7 2/9] lib: extract osinfo DB traversing API
...t;application-id")) { + if (compile_re (g, child, &osinfo->re_application_id) == -1) + return -1; + } + } + + return 0; +} + +static int +compile_re (guestfs_h *g, xmlNodePtr node, pcre **re) +{ + const char *err; + int offset; + CLEANUP_FREE char *content = (char *) xmlNodeGetContent (node); + + if (content) { + *re = pcre_compile (content, 0, &err, &offset, NULL); + if (*re == NULL) + debug (g, "osinfo: could not parse regular expression '%s': %s (ignored)", + content, err); + } + + return 0; +} + +/* Read the attributes o...
2017 Apr 12
0
[PATCH v6 02/10] lib: extract osinfo DB traversing API
...t;application-id")) { + if (compile_re (g, child, &osinfo->re_application_id) == -1) + return -1; + } + } + + return 0; +} + +static int +compile_re (guestfs_h *g, xmlNodePtr node, pcre **re) +{ + const char *err; + int offset; + CLEANUP_FREE char *content = (char *) xmlNodeGetContent (node); + + if (content) { + *re = pcre_compile (content, 0, &err, &offset, NULL); + if (*re == NULL) + debug (g, "osinfo: could not parse regular expression '%s': %s (ignored)", + content, err); + } + + return 0; +} + +/* Read the attributes o...
2017 Feb 07
0
[PATCH v2 3/7] mllib: expose libosinfo DB reading functions in mllib
...t;application-id")) { + if (compile_re (g, child, &osinfo->re_application_id) == -1) + return -1; + } + } + + return 0; +} + +static int +compile_re (guestfs_h *g, xmlNodePtr node, pcre **re) +{ + const char *err; + int offset; + CLEANUP_FREE char *content = (char *) xmlNodeGetContent (node); + + if (content) { + *re = pcre_compile (content, 0, &err, &offset, NULL); + if (*re == NULL) + debug (g, "osinfo: could not parse regular expression '%s': %s (ignored)", + content, err); + } + + return 0; +} + +/* Read the attributes o...
2016 May 26
1
[PATCH] osinfo: use guestfs_int_version_from_x_y to parse the os version
...read, -1 = error, >= 1 = #records */ static struct osinfo *osinfo_db = NULL; @@ -436,17 +434,16 @@ static int parse_version (guestfs_h *g, xmlNodePtr node, struct osinfo *osinfo) { CLEANUP_FREE char *content = NULL; - CLEANUP_FREE char *major = NULL, *minor = NULL; content = (char *) xmlNodeGetContent (node); if (content) { - if (match2 (g, content, re_major_minor, &major, &minor)) { - osinfo->major_version = guestfs_int_parse_unsigned_int (g, major); - if (osinfo->major_version == -1) - return -1; - osinfo->minor_version = guestfs_int_parse_unsign...
2016 Jul 25
1
[PATCH] osinfo: parse also single-digit version numbers
...t; #include "glthread/lock.h" +#include "c-ctype.h" #include "guestfs.h" #include "guestfs-internal.h" @@ -548,9 +549,12 @@ parse_version (guestfs_h *g, xmlNodePtr node, struct osinfo *osinfo) CLEANUP_FREE char *content = NULL; content = (char *) xmlNodeGetContent (node); - if (content) { + /* We parse either "X.Y" or "X" as version strings, so try to parse + * only if the first character is a digit. + */ + if (content && c_isdigit (content[0])) { struct version version; - int res = guestfs_int_version_from_x_y (...
2015 Aug 25
2
[PATCH 1/2] inspect: recognize the ALT Linux distribution
Check its presence ahead of /etc/redhat-release, as the distro provides it and thus previously it was recognized as "redhat-based". --- generator/actions.ml | 4 ++++ src/guestfs-internal.h | 1 + src/inspect-fs-unix.c | 21 +++++++++++++++++++++ src/inspect-fs.c | 2 ++ src/inspect-icon.c | 1 + src/inspect.c | 1 + 6 files changed, 30 insertions(+) diff
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
2015 Aug 25
0
[PATCH 2/2] osinfo: add altlinux and mageia distributions
--- src/osinfo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osinfo.c b/src/osinfo.c index 0454b45..f7e1548 100644 --- a/src/osinfo.c +++ b/src/osinfo.c @@ -492,7 +492,9 @@ parse_distro (guestfs_h *g, xmlNodePtr node, struct osinfo *osinfo) content = (char *) xmlNodeGetContent (node); if (content) { - if (STREQ (content, "centos")) + if (STREQ (content, "altlinux")) + osinfo->distro = OS_DISTRO_ALTLINUX; + else if (STREQ (content, "centos")) osinfo->distro = OS_DISTRO_CENTOS; else if (STREQ (content, &qu...
2017 Jun 19
11
[PATCH v7 0/9] Introducing virt-builder-repository
Hi all, Here is an update of the series fixing Pino's latest comment. It just doesn't implement the change based on never-accepted run commands patch. Cédric Bosdonnat (9): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo builder: rename docs test script builder: add a template parameter to get_index
2017 Feb 07
11
[PATCH v2 0/7] Introducing virt-builder-repository
Hi all, Here is a new version of the virt-builder-repository series taking care of Pino's comments. It has also been rebased on recent master. Cédric Bosdonnat (7): mllib: factorize code to add Checksum.get_checksum function Move xml and xpath_helpers OCAML code to mllib mllib: expose libosinfo DB reading functions in mllib builder: rename docs test script builder: add
2017 Apr 12
12
[PATCH v6 00/10] Add a virt-builder-repository tool
Hi all, Here is an updated version of that patch series. Diff to v5: * Apply Pino's comments * Fix indentation issues * Add a default value for arch in builder/index_parser.ml if template is set * Improved new images filtering: don't process image that didn't change. This has been uncovered by introduction of --no-compression Cédric Bosdonnat (10): lib/osinfo.c:
2017 Mar 23
13
[PATCH v5 00/10] Introducing virt-builder-repository
Hi all, Here is the v5 of my patches series applying the latest comments from Pino. Cédric Bosdonnat (10): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo builder: rename docs test script builder: add a template parameter to get_index builder: add Index.write_entry function dib: move do_cp to
2017 Feb 10
15
[PATCH v3 00/10] Introducing virt-builder-repository
Hi guys, Here is a v3 of the series, including changes to answer Richard's comments. Cédric Bosdonnat (10): mllib: factorize code to add Checksum.get_checksum function Move xml and xpath_helpers OCAML code to mllib mllib: add Xml.parse_file helper lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo
2017 Mar 07
15
[PATCH v4 0/9] Introducing virt-builder-repository
Hi all, Here is a v4 of my series. It includes the changes according to Pino and Richard's comments. However, the perrorf/debug problem is addressed differently: instead of adding an implementation for the internal function names when building for mllib, I redefine these macros. Obviously this is not perfect, but at least easier to understand. Pino's comment about the Notes regex
2017 Mar 16
0
[PATCH 1/4] p2v: Pass host CPU details to virt-v2v.
...derr, _("%s: %s: %d: unable to evaluate xpath expression\n"), + getprogname (), __FILE__, __LINE__); + return; + } + nodes = xpathObj->nodesetval; + nr_nodes = nodes->nodeNr; + if (nr_nodes > 0) { + node = nodes->nodeTab[0]; + cpu->vendor = (char *) xmlNodeGetContent (node); + } + + /* Get the CPU model. */ + xmlXPathFreeObject (xpathObj); + xpathObj = + xmlXPathEvalExpression (BAD_CAST "/capabilities/host/cpu/model/text()", + xpathCtx); + if (xpathObj == NULL) { + fprintf (stderr, _("%s: %s: %d: unable to...
2017 Mar 23
2
[PATCH] p2v: Use lscpu instead of libvirt to get CPU information.
...: unable to evaluate xpath expression: %s\n"), - getprogname (), xpathexpr); - virConnectClose (conn); - return; - } - nodes = xpathObj->nodesetval; - nr_nodes = nodes->nodeNr; - if (nr_nodes > 0) { - node = nodes->nodeTab[0]; - cpu->vendor = (char *) xmlNodeGetContent (node); - } - - /* Get the CPU model. */ - xmlXPathFreeObject (xpathObj); - xpathexpr = "/capabilities/host/cpu/model/text()"; - xpathObj = xmlXPathEvalExpression (BAD_CAST xpathexpr, xpathCtx); - if (xpathObj == NULL) { - fprintf (stderr, _("%s: unable to evaluate xpath...
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 Jun 16
1
[PATCH] inspection: Deprecate APIs and remove support for inspecting installer CDs.
...t;application-id")) { - if (compile_re (g, child, &osinfo->re_application_id) == -1) - return -1; - } - } - - return 0; -} - -static int -compile_re (guestfs_h *g, xmlNodePtr node, pcre **re) -{ - const char *err; - int offset; - CLEANUP_FREE char *content = (char *) xmlNodeGetContent (node); - - if (content) { - *re = pcre_compile (content, 0, &err, &offset, NULL); - if (*re == NULL) - debug (g, "osinfo: could not parse regular expression '%s': %s (ignored)", - content, err); - } - - return 0; -} - -/* Read the attributes o...