search for: guestfs_int_parse_unsigned_int

Displaying 20 results from an estimated 28 matches for "guestfs_int_parse_unsigned_int".

2016 May 18
0
[PATCH 2/2] inspect: switch to version struct for os major/minor version
...src/inspect-fs-cd.c b/src/inspect-fs-cd.c index b008f58..d8373f6 100644 --- a/src/inspect-fs-cd.c +++ b/src/inspect-fs-cd.c @@ -217,9 +217,9 @@ check_fedora_installer_root (guestfs_h *g, struct inspect_fs *fs) return -1; if (r > 0) { v = find_value (str); - fs->major_version = guestfs_int_parse_unsigned_int_ignore_trailing (g, v); + fs->version.v_major = guestfs_int_parse_unsigned_int_ignore_trailing (g, v); free (str); - if (fs->major_version == -1) + if (fs->version.v_major == -1) return -1; } @@ -286,10 +286,10 @@ check_isolinux_installer_root (guestfs_h *g, struc...
2016 May 17
3
[PATCH 0/2] src: introduce an helper version struct
Hi, this adds an helper version struct, and uses it in the backends (for the libvirt and qemu versions) and inspection code. This also moves common code to that, so it is not repeated in many places. This should help with the small refactoring proposed with https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html Thanks, Pino Toscano (2): src: start unifying version handling
2016 May 18
3
[PATCH v2 0/2] src: introduce an helper version struct
Hi, this adds an helper version struct, and uses it in the backends (for the libvirt and qemu versions) and inspection code. This also moves common code to that, so it is not repeated in many places. This should help with the small refactoring proposed with https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html Thanks, Pino Toscano (2): src: start unifying version handling
2015 May 29
1
[PATCH] inspection: fix CentOS 7 detection
...TOS; + + if (parse_release_file (g, fs, "/etc/centos-release") == -1) + return -1; + + if (match2 (g, fs->product_name, re_centos_old, &major, &minor) || + match2 (g, fs->product_name, re_centos, &major, &minor)) { + fs->major_version = guestfs_int_parse_unsigned_int (g, major); + free (major); + if (fs->major_version == -1) { + free (minor); + return -1; + } + fs->minor_version = guestfs_int_parse_unsigned_int (g, minor); + free (minor); + if (fs->minor_version == -1) + return -1; + } + else if...
2016 May 26
1
[PATCH] osinfo: use guestfs_int_version_from_x_y to parse the os version
...ePtr 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_unsigned_int (g, minor); - if (osinfo->minor_version == -1) - return -1; + struct version version; + int res = guestfs_int_version_from_x_y (g, &ve...
2016 May 26
1
[PATCH] lib: qemu: use guestfs_int_version_from_x_y for qemu version parsing
...on_from_x_y (g, qemu_version, qemu_help) < 1) { debug (g, "%s: failed to parse qemu version string from the first line of the output of '%s -help'. When reporting this bug please include the -help output.", __func__, g->hv); return; } - major_i = guestfs_int_parse_unsigned_int (g, major_s); - if (major_i == -1) - goto parse_failed; - - minor_i = guestfs_int_parse_unsigned_int (g, minor_s); - if (minor_i == -1) - goto parse_failed; - - guestfs_int_version_from_values (qemu_version, major_i, minor_i, 0); - - debug (g, "qemu version %d.%d", major_i, min...
2015 Sep 08
1
[PATCH] inspect: recognize the Frugalware distribution
...ILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) { + fs->distro = OS_DISTRO_FRUGALWARE; + + if (parse_release_file (g, fs, "/etc/frugalware-release") == -1) + return -1; + + if (match2 (g, fs->product_name, re_frugalware, &major, &minor)) { + fs->major_version = guestfs_int_parse_unsigned_int (g, major); + free (major); + if (fs->major_version == -1) { + free (minor); + return -1; + } + fs->minor_version = guestfs_int_parse_unsigned_int (g, minor); + free (minor); + if (fs->minor_version == -1) + return -1; + } + } skip...
2015 Sep 09
2
[PATCH] inspect: try to use /etc/os-release on Linux guests
...quot;PRETTY_NAME=")) { + free (product_name); + product_name = safe_strndup (g, value, value_len); + } else if (STRPREFIX (line, "VERSION_ID=")) { + char *major, *minor; + if (match2 (g, value, re_major_minor, &major, &minor)) { + major_version = guestfs_int_parse_unsigned_int (g, major); + free (major); + if (major_version == -1) { + free (minor); + return -1; + } + minor_version = guestfs_int_parse_unsigned_int (g, minor); + free (minor); + if (minor_version == -1) + return -1; + } else { +...
2015 Oct 09
1
[PATCH] inspect: Don't free uninitialized string.
...76 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -232,7 +232,6 @@ parse_os_release (guestfs_h *g, struct inspect_fs *fs, const char *filename) char buf[value_len + 1]; snprintf (buf, sizeof buf, "%*s", (int) value_len, value); major_version = guestfs_int_parse_unsigned_int (g, buf); - free (major); /* Handle cases where VERSION_ID is not a number. */ if (major_version != -1) minor_version = 0; -- 2.5.0
2017 Sep 20
7
[PATCH v2] 0/6] Various clean ups in lib/
v1 -> v2: - Remove the unnecessary calls to guestfs_int_lazy_make_tmpdir in the final patch. Rich.
2017 Sep 19
7
[PATCH 0/6] Various clean ups in lib/
Miscellaneous small cleanups in lib/ directory. Rich.
2015 Aug 25
2
[PATCH 1/2] inspect: recognize the ALT Linux distribution
...S_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) { + fs->distro = OS_DISTRO_ALTLINUX; + + if (parse_release_file (g, fs, "/etc/altlinux-release") == -1) + return -1; + + if (match2 (g, fs->product_name, re_altlinux, &major, &minor)) { + fs->major_version = guestfs_int_parse_unsigned_int (g, major); + free (major); + if (fs->major_version == -1) { + free (minor); + return -1; + } + fs->minor_version = guestfs_int_parse_unsigned_int (g, minor); + free (minor); + if (fs->minor_version == -1) + return -1; + } + } else...
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. (http://stackoverflow.com/a/228797) These large but completely mechanical patches change the illegal identifiers to legal ones. Rich.
2017 Jul 17
12
[PATCH v9 00/11] Reimplement inspection in the daemon.
This depends on the patch series "[PATCH 00/27] Reimplement many daemon APIs in OCaml." (https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html) v8 was posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00274.html v9: - I split up the mega-patch into a more reviewable series of smaller, incremental patches. There are some other changes vs v8, but
2016 Mar 07
1
[PATCH] inspect: list applications with APK
...case 'U': + free (url); + url = safe_strdup (g, &line[2]); + break; + case 'V': + free (version); + free (release); + char *p1, *p2; + p1 = strchr (&line[2], ':'); + if (p1) { + *p1++ = '\0'; + epoch = guestfs_int_parse_unsigned_int (g, &line[2]); /* -1 on error */ + } else { + p1 = &line[2]; + epoch = 0; + } + p2 = strchr (p1, '-'); + if (p2) { + *p2++ = '\0'; + /* Skip the leading 'r' in revisions. */ + if (p2[0] == 'r') +...
2017 Jul 21
10
[PATCH v10 00/10] Reimplement inspection in the daemon.
v9 was here: https://www.redhat.com/archives/libguestfs/2017-July/msg00139.html This depends on these three series (the first two being single minor patches): https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html https://www.redhat.com/archives/libguestfs/2017-July/msg00215.html There is no substantive change. I
2016 May 18
2
[PATCH v2 0/2] lib: qemu: Memoize qemu feature detection.
v1 -> v2: - Rebase on top of Pino's version work. Two patches went upstream, these are the two remaining patches. Note the generation number is still inside the qemu.stat file. We could put it in the filename, I have no particular preference. Rich.
2017 Aug 09
16
[PATCH v12 00/11] Reimplement inspection in the daemon.
This fixes almost everything. Note that it adds an extra commit which fixes the whole utf8/iconv business. It's probably better to list what isn't fixed: (1) I didn't leave the osinfo code around because I'm still haven't looked too closely at virt-builder-repository. Can't we just fetch this code from the git history when we need it? (2) I didn't change the way
2017 Jul 31
16
[PATCH v11 00/10] Reimplement inspection in the daemon.
v10: https://www.redhat.com/archives/libguestfs/2017-July/msg00245.html No actual change here, but I rebased and retested. Also this series now does not depend on any other patch series since everything else needed is upstream. Rich.
2016 May 12
7
[PATCH 0/4] lib: qemu: Memoize qemu feature detection.
Doing qemu feature detection in the direct backend takes ~100ms because we need to run `qemu -help' and `qemu -devices ?', and each of those interacts with glibc's very slow link loader. Fixing the link loader is really hard. Instead memoize the output of those two commands. This patch series first separates all the code dealing with qemu into a separate module (src/qemu.c) and