search for: normalize_arch

Displaying 20 results from an estimated 21 matches for "normalize_arch".

2015 Aug 11
3
[PATCH 1/2] mllib: add normalize_arch helper
...ons(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index f9e8996..ca6d470 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -730,13 +730,21 @@ let rec mkdir_p path permissions = mkdir_p (Filename.dirname path) permissions; Unix.mkdir path permissions +let normalize_arch = function + | "i386" | "i486" | "i586" | "i686" -> "i386" + | "amd64" | "x86_64" -> "x86_64" + | "powerpc" | "ppc" -> "ppc" + | arch -> arch + (* Are guest arch and host_c...
2015 Aug 11
1
Re: [PATCH 1/2] mllib: add normalize_arch helper
...ex f9e8996..ca6d470 100644 > > --- a/mllib/common_utils.ml > > +++ b/mllib/common_utils.ml > > @@ -730,13 +730,21 @@ let rec mkdir_p path permissions = > > mkdir_p (Filename.dirname path) permissions; > > Unix.mkdir path permissions > > > > +let normalize_arch = function > > + | "i386" | "i486" | "i586" | "i686" -> "i386" > > + | "amd64" | "x86_64" -> "x86_64" > > Commit 8864c47b had "x64" also (added by you in b1cf6246). IIRC x64 was for...
2015 Aug 11
0
Re: [PATCH 1/2] mllib: add normalize_arch helper
...ml b/mllib/common_utils.ml > index f9e8996..ca6d470 100644 > --- a/mllib/common_utils.ml > +++ b/mllib/common_utils.ml > @@ -730,13 +730,21 @@ let rec mkdir_p path permissions = > mkdir_p (Filename.dirname path) permissions; > Unix.mkdir path permissions > > +let normalize_arch = function > + | "i386" | "i486" | "i586" | "i686" -> "i386" > + | "amd64" | "x86_64" -> "x86_64" Commit 8864c47b had "x64" also (added by you in b1cf6246). > + | "powerpc" | &quo...
2016 Jan 14
2
[PATCH 1/2] builder: move os-version search in own function
...aliases with + | None -> false + | Some l -> List.mem cmdline.arg l + ) index in + fst item + with Not_found -> cmdline.arg in + let item = + try List.find ( + fun (name, { Index.arch = a }) -> + name = arg && cmdline.arch = normalize_arch a + ) index + with Not_found -> + error (f_"cannot find os-version '%s' with architecture '%s'.\nUse --list to list available guest types.") + arg cmdline.arch in + item + let main () = (* Command line argument parsing - see cmdline.ml. *) let...
2015 Oct 29
7
[PATCH 0/7] v2v: Miscellaneous refactorings.
Just refactoring. Rich.
2017 Oct 27
0
[PATCH v11 3/8] builder: change arch type to (string, string option) maybe.
...r/builder.ml b/builder/builder.ml index 3f7c79bc9..519cdbc79 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -94,7 +94,10 @@ let selected_cli_item cmdline index = let item = try List.find ( fun (name, { Index.arch = a }) -> - name = arg && cmdline.arch = normalize_arch a + match a with + | Either a + | Or Some a -> name = arg && cmdline.arch = normalize_arch a + | Or None -> false ) index with Not_found -> error (f_"cannot find os-version ‘%s’ with architecture ‘%s’.\nUse --list to list available...
2017 Nov 21
0
[PATCH v13 1/3] builder: change arch type to distinguish guesses
...er/builder.ml b/builder/builder.ml index 3f7c79bc9..41c0a4ccc 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -94,7 +94,7 @@ let selected_cli_item cmdline index = let item = try List.find ( fun (name, { Index.arch = a }) -> - name = arg && cmdline.arch = normalize_arch a + name = arg && cmdline.arch = normalize_arch (Index.string_of_arch a) ) index with Not_found -> error (f_"cannot find os-version ‘%s’ with architecture ‘%s’.\nUse --list to list available guest types.") @@ -252,7 +252,7 @@ let main () = List....
2017 Nov 13
0
[PATCH v12 1/3] builder: change arch type to distinguish guesses
...er/builder.ml b/builder/builder.ml index 3f7c79bc9..8a950cd8f 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -94,7 +94,9 @@ let selected_cli_item cmdline index = let item = try List.find ( fun (name, { Index.arch = a }) -> - name = arg && cmdline.arch = normalize_arch a + match a with + | Index.Arch a + | Index.GuessedArch a -> name = arg && cmdline.arch = normalize_arch a ) index with Not_found -> error (f_"cannot find os-version ‘%s’ with architecture ‘%s’.\nUse --list to list available guest types.&quot...
2015 Nov 11
0
[PATCH] builder: Make the interface between cmdline.ml and builder.ml explicit.
...> List.mem arg l + | Some l -> List.mem cmdline.arg l ) index in fst item - with Not_found -> arg in + with Not_found -> cmdline.arg in let item = try List.find ( fun (name, { Index.arch = a }) -> - name = arg && arch = normalize_arch a + name = arg && cmdline.arch = normalize_arch a ) index with Not_found -> error (f_"cannot find os-version '%s' with architecture '%s'.\nUse --list to list available guest types.") - arg arch in + arg cmdline.arch in le...
2017 Nov 13
6
[PATCH v12 0/3] virt-builder-repository tool
Hi there! Here is the latest version of the series including Richard's comments. I also reworked the repository_main.ml code to avoid setting an empty entry if not found. Cédric Bosdonnat (3): builder: change arch type to distinguish guesses builder: add a template parameter to get_index New tool: virt-builder-repository .gitignore | 4 +
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
..._) -> () + | Unix.Unix_error (Unix.ENOENT, _, _) -> + (* A component in the path does not exist, so first try + * creating the parent directory, and then again the requested + * directory. *) + mkdir_p (Filename.dirname path) permissions; + Unix.mkdir path permissions + +let normalize_arch = function + | "i486" | "i586" | "i686" -> "i386" + | "amd64" -> "x86_64" + | "powerpc" -> "ppc" + | "powerpc64" -> "ppc64" + | "powerpc64le" -> "ppc64le" + |...
2017 Nov 21
5
[PATCH v13 0/3] virt-builder-repository
Hey there, Here is an update of the series. The changes: * Incorporate Richard's comments. Left out the with_openfile one since that leads to a double close. * Change the ask option return type to string (removing the option) since if the use doesn't input anything we're using the default, and the default is now a mandatory parameter. * Make sure there are items in the
2015 May 29
0
[PATCH v3] RFC: New virt-dib tool
...on_gettext.Gettext +open Common_utils + +open Printf + +exception Tool_not_found of string (* tool *) + +let quote = Filename.quote + +let unit_GB howmany = + (Int64.of_int howmany) *^ 1024_L *^ 1024_L *^ 1024_L + +let current_arch () = + (* Turn a CPU into the dpkg architecture naming. *) + let normalize_arch = function + | "amd64" | "x86_64" -> "amd64" + | "i386"| "i486" | "i586" | "i686" -> "i386" + | arch when string_prefix arch "armv" -> "armhf" + | arch -> arch in + normalize_arch Co...
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html I believe this addresses everything raised in comments on that patch series. Rich.
2015 Mar 31
0
[PATCH] WIP: New virt-dib tool
...ls + +open Printf + +let prog = Filename.basename Sys.executable_name +let error ?exit_code fs = error ~prog ?exit_code fs +let warning fs = warning ~prog fs +let info fs = info ~prog fs + +let unit_GB howmany = + (Int64.of_int howmany) *^ 1024_L *^ 1024_L *^ 1024_L + +let current_arch () = + let normalize_arch = function + | "amd64" | "x86_64" | "x64" -> "amd64" + | "i386"| "i486"| "i586"| "i686" -> "i386" + | arch when string_prefix arch "armv" -> "armhf" + | arch -> arch in + +...
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought. We have lots of utility functions, spread all over the repository, with not a lot of structure. This moves many of them under common/ and structures them so there are clear dependencies. This doesn't complete the job by any means. Other items I had on my to-do list for this change were: - Split up mllib/common_utils into: -
2017 Oct 27
15
[PATCH v11 0/8] virt-builder-repository
Hi all, Here is the latest version of the series. Diffs to v10: * Make Index.arch a (string, string option) maybe and use it to guess arch at parse time * Compute the image size at parse time when the template flag is set and the value is missing. * Add virt-repository_main slow test * Other fixes from Richard's comments Cédric Bosdonnat (7): Ignore builder/*.out and *.img
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of: https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html [PATCH 00/12] Refactor utility functions. plus: https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html [PATCH v3 00/19] Allow APIs to be implemented in OCaml. with the second patches rebased on top of the utility refactoring, and some other adjustments and extensions. This passes
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.
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