search for: parse_version_from_major_minor

Displaying 20 results from an estimated 20 matches for "parse_version_from_major_minor".

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...
2017 Oct 12
1
[PATCH] daemon: inspection: Add support for NeoKylin (RHBZ#1476081).
...quot;/bin/echo"; "/bin/rm"; "/bin/sh" ] @@ -94,7 +95,7 @@ let rec parse_os_release release_file data = else if key = "PRETTY_NAME" then data.product_name <- Some value else if key = "VERSION_ID" then - parse_version_from_major_minor value data + parse_os_release_version_id value data ) ) lines; @@ -124,6 +125,18 @@ let rec parse_os_release release_file data = | _ -> true ) +and parse_os_release_version_id value data = + (* NeoKylin uses a non-standard format in the VERSION_ID...
2017 Aug 09
0
[PATCH v12 08/11] daemon: Implement inspection types and utility functions.
...*) +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 || + PCRE.matches re_major_no_minor str then ( + let major = + try Some (int_of_string (PCRE.sub 1)) + with Not_found | In...
2017 Oct 16
3
[PATCH v3 0/2] daemon: add and use parse_key_value_strings helper
Changes from v2 to v3: - split_key_value_strings renamed to parse_key_value_strings Changes from v1 to v2: - split the "simple unquoting" as helper - pass the unquoting function to split_key_value_strings - use right unquoting function when applying split_key_value_strings Pino Toscano (2): daemon: add split_key_value_strings helper daemon: use parse_key_value_strings
2017 Oct 16
4
[PATCH 1/3] daemon: add split_key_value_strings helper
Add a simple helper to turn a list of strings into key/value pairs, splitting by '='. --- daemon/utils.ml | 15 +++++++++++++++ daemon/utils.mli | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/daemon/utils.ml b/daemon/utils.ml index d87ad75db..fd1681a86 100644 --- a/daemon/utils.ml +++ b/daemon/utils.ml @@ -229,3 +229,18 @@ let unix_canonical_path path = let path =
2017 Oct 16
3
[PATCH v2 0/2] daemon: add and use split_key_value_strings helper
Changes from v1 to v2: - split the "simple unquoting" as helper - pass the unquoting function to split_key_value_strings - use right unquoting function when applying split_key_value_strings Pino Toscano (2): daemon: add split_key_value_strings helper daemon: use split_key_value_strings daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++---------------------------- daemon/md.ml
2017 Aug 08
1
Re: [PATCH v11 08/10] daemon: Implement inspection of Linux and other Unix-like operating systems.
...| Some _ as distro -> data.distro <- distro > + | None -> () > + ) > + else if key = "PRETTY_NAME" then > + data.product_name <- Some value > + else if key = "VERSION_ID" then > + parse_version_from_major_minor value data > + ) > + ) lines; > + > + (* If we haven't got all the fields, exit right away. *) > + if data.distro = None || data.product_name = None then > + false > + else ( > + (* os-release in Debian and CentOS does not provide th...
2018 Feb 06
1
[PATCH v2] daemon: build also without Hivex.OPEN_UNSAFE (RHBZ#1493048)
...* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +val hivex_flag_unsafe : Hivex.open_flag option diff --git a/daemon/inspect_utils.ml b/daemon/inspect_utils.ml index 5127bf30f..b94c98cd1 100644 --- a/daemon/inspect_utils.ml +++ b/daemon/inspect_utils.ml @@ -176,7 +176,11 @@ let parse_version_from_major_minor str data = ) let with_hive hive_filename f = - let flags = [ Hivex.OPEN_UNSAFE ] in + let flags = [] in + let flags = + match Daemon_config.hivex_flag_unsafe with + | None -> flags + | Some f -> f :: flags in let flags = if verbose () then Hivex.OPEN_VERBOSE :: flags else...
2018 Jan 30
3
[PATCH] daemon: build also without Hivex.OPEN_UNSAFE (RHBZ#1493048)
..., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +val hivex_flag_unsafe : Hivex.open_flag list diff --git a/daemon/inspect_utils.ml b/daemon/inspect_utils.ml index 5127bf30f..b2ce072d6 100644 --- a/daemon/inspect_utils.ml +++ b/daemon/inspect_utils.ml @@ -176,7 +176,7 @@ let parse_version_from_major_minor str data = ) let with_hive hive_filename f = - let flags = [ Hivex.OPEN_UNSAFE ] in + let flags = Config_daemon.hivex_flag_unsafe in let flags = if verbose () then Hivex.OPEN_VERBOSE :: flags else flags in let h = Hivex.open_file hive_filename flags in protect ~f:(fun () -> f h...
2017 Aug 09
0
[PATCH v12 09/11] daemon: Implement inspection of Linux and other Unix-like operating systems.
...match distro with + | Some _ as distro -> data.distro <- distro + | None -> () + ) + else if key = "PRETTY_NAME" then + data.product_name <- Some value + else if key = "VERSION_ID" then + parse_version_from_major_minor value data + ) + ) lines; + + (* If we haven't got all the fields, exit right away. *) + if data.distro = None || data.product_name = None then + false + else ( + match data with + (* os-release in Debian and CentOS does not provide the full +...
2017 Jul 31
0
[PATCH v11 08/10] daemon: Implement inspection of Linux and other Unix-like operating systems.
...match distro with + | Some _ as distro -> data.distro <- distro + | None -> () + ) + else if key = "PRETTY_NAME" then + data.product_name <- Some value + else if key = "VERSION_ID" then + parse_version_from_major_minor value data + ) + ) lines; + + (* If we haven't got all the fields, exit right away. *) + if data.distro = None || data.product_name = None then + false + else ( + (* os-release in Debian and CentOS does not provide the full + * version number (VERSIO...
2017 Jun 12
1
[PATCH] UNFINISHED daemon: Reimplement most inspection APIs in the daemon.
This is the (incomplete) patch which reimplements inspection APIs in the daemon. All ‘XXX’s in this patch indicate areas which are not yet implemented or need further work. Rich.
2017 Jul 31
0
[PATCH v11 09/10] daemon: Implement inspection of Windows.
...major_v) + and minor = Int32.to_int (Hivex.value_dword h minor_v) in + data.version <- Some (major, minor) + with + Not_found -> + let v = List.assoc "CurrentVersion" values in + let v = hivex_value_as_utf8 h v in + parse_version_from_major_minor v data + ); + + (* InstallationType (product_variant). *) + (try + let v = List.assoc "InstallationType" values in + data.product_variant <- Some (hivex_value_as_utf8 h v) + with + Not_found -> () + ); + with +...
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.
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
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
2017 Jun 19
29
[PATCH v7 00/29] Reimplement inspection in the daemon.
v6 was posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html and this requires the utilities refactoring posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html Inspection is now complete[*], although not very well tested. I'm intending to compare the output of many guests using old & new virt-inspector to see if I can find any
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html I believe this addresses all comments received so far. Also it now passes a test where I compared about 100 disk images processed with old and new virt-inspector binaries. The output is identical in all cases except one which is caused by a bug in blkid
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5: https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html Since v5, this now implements inspection almost completely for Linux and Windows guests. Rich.