search for: self_init

Displaying 20 results from an estimated 40 matches for "self_init".

2014 Jan 28
1
[PATCH] builder, sysprep: initialise the random generator
virt-builder and virt-sysprep may make use of Common_utils.string_random8 (which uses Random.int) for constructing temporary paths; not initialising the random generator means that every invocation will reuse the same name used previously (!). Thus just call Random.self_init, just like virt-sparsify already does. Expand the test-virt-sysprep-script.sh test to ensure that virt-sysprep is not affected again by this issue. --- .gitignore | 1 + builder/builder.ml | 2 ++ sysprep/main.ml | 2 ++ sysprep/scr...
2015 Aug 28
1
[PATCH] handle --debug-gc universally via at_exit hook
...rmat, ignores, machine_readable, zeroes, mode + indisk, format, ignores, machine_readable, zeroes, mode diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml index 1f631d8..30e3020 100644 --- a/sparsify/sparsify.ml +++ b/sparsify/sparsify.ml @@ -30,7 +30,7 @@ module G = Guestfs let () = Random.self_init () let rec main () = - let indisk, debug_gc, format, ignores, machine_readable, zeroes, mode = + let indisk, format, ignores, machine_readable, zeroes, mode = parse_cmdline () in (match mode with @@ -39,9 +39,6 @@ let rec main () = format ignores machine_readable option tmp ze...
2015 Aug 11
0
[PATCH v2 02/17] v2v: factor out opening input VM
...+++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 9cb4a27..a2cf249 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -43,21 +43,7 @@ let print_mpstat chan { mp_dev = dev; mp_path = path; let () = Random.self_init () -let rec main () = - (* Handle the command line. *) - let input, output, - debug_gc, debug_overlays, do_copy, network_map, no_trim, - output_alloc, output_format, output_name, print_source, root_choice = - Cmdline.parse_cmdline () in - - (* Print the version, easier than asking use...
2015 Nov 11
1
[PATCH] sparsify: Make the interface between cmdline.ml and sparsify.ml explicit.
...Mode_in_place +and check_t = [`Ignore|`Continue|`Warn|`Fail] + +val parse_cmdline : unit -> cmdline diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml index 30e3020..b40dbf4 100644 --- a/sparsify/sparsify.ml +++ b/sparsify/sparsify.ml @@ -30,15 +30,16 @@ module G = Guestfs let () = Random.self_init () let rec main () = - let indisk, format, ignores, machine_readable, zeroes, mode = - parse_cmdline () in + let cmdline = parse_cmdline () in - (match mode with + (match cmdline.mode with | Mode_copying (outdisk, check_tmpdir, compress, convert, option, tmp) -> - Copying.run i...
2015 Nov 10
1
[PATCH] v2v: Add --compressed option to produce compressed qcow2 files (RHBZ#1279273).
...work_map, no_trim, + compressed, debug_overlays, do_copy, in_place, network_map, no_trim, output_alloc, output_format, output_name, print_source, root_choice diff --git a/v2v/v2v.ml b/v2v/v2v.ml index dabec7f..f1ebb45 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -50,7 +50,7 @@ let () = Random.self_init () let rec main () = (* Handle the command line. *) let input, output, - debug_overlays, do_copy, in_place, network_map, no_trim, + compressed, debug_overlays, do_copy, in_place, network_map, no_trim, output_alloc, output_format, output_name, print_source, root_choice = Cmdli...
2015 Aug 12
0
[PATCH 1/2] builder: add non-int revisions
...der/index_parser.ml | 4 ++-- builder/utils.ml | 7 +++++++ 8 files changed, 25 insertions(+), 11 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index adfa412..260af94 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -34,6 +34,13 @@ open Printf let () = Random.self_init () let remove_duplicates index = + let compare_revisions rev1 rev2 = + match rev1, rev2 with + | Rev_int n1, Rev_int n2 -> compare n1 n2 + | Rev_string s1, Rev_int n2 -> compare s1 (string_of_int n2) + | Rev_int n1, Rev_string s2 -> compare (string_of_int n1) s2 + | Rev_...
2015 Oct 20
2
[PATCH v3 11/13] v2v: add --in-place mode
...@ -41,12 +41,16 @@ let print_mpstat chan { mp_dev = dev; mp_path = path; fprintf chan " bsize=%Ld blocks=%Ld bfree=%Ld bavail=%Ld\n" s.G.bsize s.G.blocks s.G.bfree s.G.bavail +type conversion_mode = + | Copying of overlay list * target list + | In_place + let () = Random.self_init () let rec main () = (* Handle the command line. *) let input, output, - debug_overlays, do_copy, network_map, no_trim, + debug_overlays, do_copy, in_place, network_map, no_trim, output_alloc, output_format, output_name, print_source, root_choice = Cmdline.parse_cmdline ()...
2016 Dec 02
1
[PATCH NOT TO BE APPLIED] builder: make-template: Add --encrypted
I was attempting one way to solve: https://bugzilla.redhat.com/show_bug.cgi?id=1400332 "RFE: virt-builder should support templates with encrypted filesystems" However this approach doesn't really work because templates containing encrypted partitions cannot be compressed, and therefore the guest template would be a multi-gigabyte download. I better approach will likely be to use
2018 Aug 23
0
[PATCH v4] v2v: Add --print-estimate option to print copy size estimate.
...et > $f + +echo -n "Estimate: " +cat $f + +# Check the output looks reasonable. +grep -E '^[[:digit:]]+$' $f + +rm -f $f diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 1775200d3..d7b791885 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -48,6 +48,8 @@ type mpstat = { let () = Random.self_init () +let sum = List.fold_left (+^) 0L + let rec main () = (* Handle the command line. *) let cmdline, input, output = parse_cmdline () in @@ -156,6 +158,22 @@ let rec main () = (match conversion_mode with | In_place -> () | Copying overlays -> + (* Print copy size esti...
2018 Aug 17
0
[PATCH v3 4/4] v2v: Add --print-estimate option to print copy size estimate.
...et > $f + +echo -n "Estimate: " +cat $f + +# Check the output looks reasonable. +grep -E '^[[:digit:]]+$' $f + +rm -f $f diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 1775200d3..af04a265a 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -48,6 +48,8 @@ type mpstat = { let () = Random.self_init () +let sum = List.fold_left (+^) 0L + let rec main () = (* Handle the command line. *) let cmdline, input, output = parse_cmdline () in @@ -156,6 +158,17 @@ let rec main () = (match conversion_mode with | In_place -> () | Copying overlays -> + (* Print copy size esti...
2018 Aug 24
0
[PATCH v6] v2v: Add --print-estimate option to print copy size estimate.
...te: " +cat $f + +# Check the total field exists and is numeric. +jq '.total' $f | grep -Esq '^[[:digit:]]+$' + +rm -f $f diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 1775200d3..53a1041c5 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -48,6 +48,8 @@ type mpstat = { let () = Random.self_init () +let sum = List.fold_left (+^) 0L + let rec main () = (* Handle the command line. *) let cmdline, input, output = parse_cmdline () in @@ -156,6 +158,12 @@ let rec main () = (match conversion_mode with | In_place -> () | Copying overlays -> + (* Print copy size esti...
2018 Aug 23
0
[PATCH v5] v2v: Add --print-estimate option to print copy size estimate.
...le:$f + +echo -n "Estimate: " +cat $f + +# Check the output looks reasonable. +grep -E 'total.*[[:digit:]]+' $f + +rm -f $f diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 1775200d3..884dfecaa 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -48,6 +48,8 @@ type mpstat = { let () = Random.self_init () +let sum = List.fold_left (+^) 0L + let rec main () = (* Handle the command line. *) let cmdline, input, output = parse_cmdline () in @@ -156,6 +158,12 @@ let rec main () = (match conversion_mode with | In_place -> () | Copying overlays -> + (* Print copy size esti...
2018 Aug 23
2
[PATCH v4] v2v: Add --print-estimate option to print copy size estimate.
v4: - Same as v3, but depends on and uses new --machine-readable work. Rich.
2018 Aug 24
2
[PATCH v6] v2v: Add --print-estimate option to print copy size estimate.
v6: - Make the text output a bit nicer. - Changes as suggested to Measure_disk module temp file & json parsing. - Use jq to test JSON output. - Retest.
2016 Nov 30
0
Re: [PATCH] builder: Rearrange how template-building scripts work.
...(* version number *) > +type arch = X86_64 | Aarch64 | Armv7 | I686 | PPC64 | PPC64le | S390X > + > +let quote = Filename.quote > +let (//) = Filename.concat > + > +let virtual_size_gb = 6 > + > +let rec main () = > + assert (Sys.word_size = 64); > + Random.self_init (); > + > + (* Get the os, version, arch from the command line. *) > + if Array.length Sys.argv < 3 || Array.length Sys.argv > 4 then ( > + eprintf "%s os version [arch]\n" prog; > + exit 1 > + ); > + > + let os = os_of_string Sys.argv.(1) Sys.argv....
2015 Nov 10
3
[PATCH] v2v: Make the interface between cmdline.ml and v2v.ml
I'm interested to hear opinions on whether this makes the code clearer, or not. This is virt-v2v, but many other virt-* tools work the same way, and analogous changes could be made. Currently when command line argument parsing is done in 'cmdline.ml' the list of parsed parameters is passed to the main program in a very long tuple. Each parameter is strongly typed, but not named (so
2018 Aug 23
2
[PATCH v5] v2v: Add --print-estimate option to print copy size estimate.
v5: - Normal output modified approx as suggested in previous email. - Machine readable output uses JSON.
2015 Oct 20
5
[PATCH v4 0/3] v2v: add --in-place mode
This series is an attempt to add a mode of virt-v2v operation where it leaves the config and disk image conversion, rollback on errors, registering with the destination hypervisor, etc. to a third-party toolset, and performs only tuning of the guest OS to run in the KVM-based hypervisor. Roman Kagan (3): v2v: add --in-place mode v2v: document --in-place v2v: add test for --in-place ---
2016 Aug 19
1
[PATCH] virt-rescue rewrite in OCaml
Hi, I tried to rewrite virt-rescue from C to OCaml. Goals were feature parity with C implementation, smaller codebase and hopefully better maintainability. I still don't know if I've covered everything right. So, please check it out. PS: my git send-email seems to be broken, so I'm sending it from thunderbird Thanks! maros
2017 Jan 03
0
[PATCH 5/5] Add a virt-builder-repository tool
...ong + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +open Common_gettext.Gettext +open Common_utils +open Getopt.OptionName +open Utils +open Yajl +open Xpath_helpers + +open Printf + +let () = Random.self_init () + +type cmdline = { + gpg : string; + gpgkey : string; + interactive : bool; + repo : string; +} + +let parse_cmdline () = + let gpg = ref "gpg" in + let gpgkey = ref "" in + let interactive = ref false in + + let argspec = [ + [ L"gpg" ], Getopt.Se...