search for: re_major_minor

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

2016 May 26
1
[PATCH] osinfo: use guestfs_int_version_from_x_y to parse the os version
...info.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/osinfo.c b/src/osinfo.c index 4a4cbfc..f4e2c71 100644 --- a/src/osinfo.c +++ b/src/osinfo.c @@ -65,8 +65,6 @@ #include "guestfs.h" #include "guestfs-internal.h" -COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) - gl_lock_define_initialized (static, osinfo_db_lock); static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */ static struct osinfo *osinfo_db = NULL; @@ -436,17 +434,16 @@ static int parse_version (guestfs_h *g, xmlNodePtr node, stru...
2017 Sep 19
1
Re: [PATCH v12 08/11] daemon: Implement inspection types and utility functions.
On Wednesday, 9 August 2017 19:23:43 CEST Richard W.M. Jones wrote: > +let parse_version_from_major_minor str data = > + if verbose () then > + eprintf "parse_version_from_major_minor: parsing '%s'\n%!" str; > + > + if PCRE.matches re_major_minor str || > + PCRE.matches re_major_no_minor str then ( > + let major = > + try Some (int_of_string (PCRE.sub 1)) > + with Not_found | Invalid_argument _ | Failure _ -> None in > + let minor = > + try Some (int_of_string (PCRE.sub 2)) > + with Not_...
2016 May 26
1
[PATCH] lib: qemu: use guestfs_int_version_from_x_y for qemu version parsing
...c3f0 100644 --- a/src/qemu.c +++ b/src/qemu.c @@ -37,16 +37,12 @@ #include <libxml/uri.h> -#include <pcre.h> - #include "ignore-value.h" #include "guestfs.h" #include "guestfs-internal.h" #include "guestfs_protocol.h" -COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) - struct qemu_data { char *qemu_help; /* Output of qemu -help. */ char *qemu_devices; /* Output of qemu -device ? */ @@ -265,29 +261,15 @@ static void parse_qemu_version (guestfs_h *g, const char *qemu_help, struct...
2014 Nov 28
2
[PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.
...d; -static pcre *re_centos; -static pcre *re_centos_no_minor; -static pcre *re_scientific_linux_old; -static pcre *re_scientific_linux; -static pcre *re_scientific_linux_no_minor; -static pcre *re_oracle_linux_old; -static pcre *re_oracle_linux; -static pcre *re_oracle_linux_no_minor; -static pcre *re_major_minor; -static pcre *re_xdev; -static pcre *re_cciss; -static pcre *re_mdN; -static pcre *re_freebsd_mbr; -static pcre *re_freebsd_gpt; -static pcre *re_diskbyid; -static pcre *re_netbsd; -static pcre *re_opensuse; -static pcre *re_sles; -static pcre *re_nld; -static pcre *re_opensuse_version; -static pc...
2011 Nov 24
2
[PATCH] NFC: Cleanup iteration over fstab entries in inspect_fs_unix.c
...--git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c index 0fa3e83..34d218f 100644 --- a/src/inspect_fs_unix.c +++ b/src/inspect_fs_unix.c @@ -110,7 +110,6 @@ compile_regexps (void) COMPILE (re_scientific_linux_no_minor, "Scientific Linux.*release (\\d+)", 0); COMPILE (re_major_minor, "(\\d+)\\.(\\d+)", 0); - COMPILE (re_aug_seq, "/\\d+$", 0); COMPILE (re_xdev, "^/dev/(h|s|v|xv)d([a-z]+)(\\d*)$", 0); COMPILE (re_cciss, "^/dev/(cciss/c\\d+d\\d+)(?:p(\\d+))?$", 0); COMPILE (re_mdN, "^(/dev/md\\d+)$", 0); @@ -132,7 +131,6...
2016 May 18
0
[PATCH 2/2] inspect: switch to version struct for os major/minor version
...unix.c +++ b/src/inspect-fs-unix.c @@ -54,7 +54,6 @@ COMPILE_REGEXP (re_oracle_linux_old, COMPILE_REGEXP (re_oracle_linux, "Oracle Linux.*release (\\d+)\\.(\\d+)", 0) COMPILE_REGEXP (re_oracle_linux_no_minor, "Oracle Linux.*release (\\d+)", 0) -COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) COMPILE_REGEXP (re_xdev, "^/dev/(h|s|v|xv)d([a-z]+)(\\d*)$", 0) COMPILE_REGEXP (re_cciss, "^/dev/(cciss/c\\d+d\\d+)(?:p(\\d+))?$", 0) COMPILE_REGEXP (re_mdN, "^(/dev/md\\d+)$", 0) @@ -148,7 +147,8 @@ parse_os_release (guestfs_h *g, s...
2014 Nov 27
2
[PATCH 1/1] inspect: Fix a bug in the *BSD root detection
...nspect-fs.c b/src/inspect-fs.c index 539d814..99a8658 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -47,7 +47,7 @@ * multiple threads call into the libguestfs API functions below * simultaneously. */ -static pcre *re_first_partition; +static pcre *re_primary_partition; static pcre *re_major_minor; static void compile_regexps (void) __attribute__((constructor)); @@ -68,14 +68,14 @@ compile_regexps (void) } \ } while (0) - COMPILE (re_first_partition, "^/dev/(?:h|s|v)d.1$", 0); + COMPILE (re_primary_par...
2016 Mar 22
0
[PATCH v3 07/11] launch: direct: Don't run qemu -version.
...direct_data *data) @@ -1013,13 +999,13 @@ parse_qemu_version (guestfs_h *g, struct backend_direct_data *data) data->qemu_version_major = 0; data->qemu_version_minor = 0; - if (!data->qemu_version) + if (!data->qemu_help) return; - if (!match2 (g, data->qemu_version, re_major_minor, &major_s, &minor_s)) { + if (!match2 (g, data->qemu_help, re_major_minor, &major_s, &minor_s)) { parse_failed: - debug (g, "%s: failed to parse qemu version string '%s'", - __func__, data->qemu_version); + debug (g, "%s: failed to pa...
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
2011 Dec 01
2
[PATCH 0/2] handle MD devices in fstab
Only change from previous post is explicitly checking md_map for NULL before hash_free and lookup.
2011 Dec 02
3
[PATCH 1/3] build: Add more suppressions for valgrind tests
--- extratests/suppressions | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/extratests/suppressions b/extratests/suppressions index 97d4b78..78ca4ab 100644 --- a/extratests/suppressions +++ b/extratests/suppressions @@ -3,19 +3,19 @@ Memcheck:Cond fun:* fun:numa_node_size64 - fun:numa_init + obj:/usr/lib64/libnuma.so.1 } {
2014 Nov 28
0
Re: [PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.
...oid) \ { \ if (_internal_##name) \ pcre_free (_internal_##name); \ } using it e.g.: match (re_major_minor (), ...) The only issue I could see is that the above is not thread-safe. -- Pino Toscano
2020 Feb 20
1
[PATCH] lib: Move guestfs_device_index impl from daemon to library.
Although the commit message ties this to https://bugzilla.redhat.com/1804207, in fact I believe this commit could be applied independently. It's a simple optimization. Rich.
2015 Sep 09
2
[PATCH] inspect: try to use /etc/os-release on Linux guests
...distro = OS_DISTRO_UBUNTU; + } else if (STRPREFIX (line, "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 (min...
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.
2015 Jun 04
3
[PATCH] Use safe_realloc() in favor of realloc overall.
...=%s mountpoint=%s", mountable, mountpoint); - - return 0; } /* Compute a uuid hash as a simple xor of of its 4 32bit components */ diff --git a/src/inspect-fs.c b/src/inspect-fs.c index 09a7005..073ae57 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -47,7 +47,7 @@ COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) static int check_filesystem (guestfs_h *g, const char *mountable, const struct guestfs_internal_mountable *m, int whole_device); -static int extend_fses (guestfs_h *g); +static void extend_fses (guestfs_h...
2016 May 17
2
[PATCH 0/2] Use -bios bios-fast.bin where supported.
NOTE: Not for upstream, yet. This depends on 3 non-upstream patches. - The qemu rework in libguestfs, which in turn depends on what Pino is up to. - Support for '-L ?' in qemu: https://lists.gnu.org/archive/html/qemu-devel/2016-05/threads.html#02596 - Support for bios-fast.bin in qemu: https://lists.gnu.org/archive/html/qemu-devel/2016-05/threads.html#02408 This commit
2015 Sep 29
0
[PATCH 4/4] lib: Remove unused header files.
...<sys/stat.h> -#include <errno.h> #include <libintl.h> #ifdef HAVE_ENDIAN_H @@ -40,8 +35,6 @@ #include "guestfs.h" #include "guestfs-internal.h" -#include "guestfs-internal-actions.h" -#include "guestfs_protocol.h" COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) diff --git a/src/inspect-icon.c b/src/inspect-icon.c index 15c721b..fe38266 100644 --- a/src/inspect-icon.c +++ b/src/inspect-icon.c @@ -20,18 +20,13 @@ #include <stdio.h> #include <stdlib.h> -#include <stdint.h> -#include <inttypes.h>...
2017 Aug 09
0
[PATCH v12 08/11] daemon: Implement inspection types and utility functions.
...ry test for "is a partition", taken directly from + * the old C inspection code. XXX fix function and callers + *) +let is_partition partition = + try + let device = Devsparts.part_to_dev partition in + ignore (Devsparts.device_index device); + true + with _ -> false + +let re_major_minor = PCRE.compile "(\\d+)\\.(\\d+)" +let re_major_no_minor = PCRE.compile "(\\d+)" + +let parse_version_from_major_minor str data = + if verbose () then + eprintf "parse_version_from_major_minor: parsing '%s'\n%!" str; + + if PCRE.matches re_major_minor str |...