search for: amend_source

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

2015 Aug 27
2
Re: [PATCH v2 02/17] v2v: factor out opening input VM
...PM +0300, Roman Kagan wrote: > Opening the source VM and amending the properties in its internal > representation in accordance with command-line options fit nicely into > two isolated functions. Better to write this as: let rec main () = ... and open_source ... = ... and amend_source ... = ... and inspect_source ... = ... so it's consistent with how all the other sub-functions are done in the same file. 'let rec .. and ..' defines mutually recursive functions that can call each other. Rich. -- Richard Jones, Virtualization Group, Red Hat http://peopl...
2015 Oct 20
1
[PATCH v3 01/13] v2v: factor out opening input VM
...ot;) network_map in - { nic with s_vnet = new_name } - with Not_found -> - (* Not found, so return the original NIC unchanged. *) - nic - ) nics in - { source with s_nics = nics } in + let source = open_source input print_source in + let source = amend_source source output_name network_map in (* Create a qcow2 v3 overlay to protect the source image(s). There * is a specific reason to use the newer qcow2 variant: Because the @@ -454,6 +397,69 @@ let rec main () = message (f_"Finishing off"); delete_target_on_exit := false (* Do...
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
2015 Oct 20
1
[PATCH v3 02/13] v2v: factor out overlay creation
...++++++++--------------------------------- 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 564c5da..155eb83 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -57,40 +57,7 @@ let rec main () = let source = open_source input print_source in let source = amend_source source output_name network_map in - - (* Create a qcow2 v3 overlay to protect the source image(s). There - * is a specific reason to use the newer qcow2 variant: Because the - * L2 table can store zero clusters efficiently, and because - * discarded blocks are stored as zero clusters, this...
2015 Aug 11
0
[PATCH v2 04/17] v2v: factor out populating targets list
...an asking users to tell us. *) - if verbose () then - printf "%s: %s %s (%s)\n%!" - prog Config.package_name Config.package_version Config.host_cpu; - - if debug_gc then - at_exit (fun () -> Gc.compact()); - - let source = open_source input print_source in - let source = amend_source source output_name network_map in - let overlays = create_overlays source.s_disks in - - (* Open the guestfs handle. *) - message (f_"Opening the overlay"); - let g = new G.guestfs () in - if trace () then g#set_trace true; - if verbose () then g#set_verbose true; - g#set_network t...
2015 Aug 11
0
[PATCH v2 02/17] v2v: factor out opening input VM
...;%s\n" (string_of_source source); exit 0 ); - if verbose () then printf "%s%!" (string_of_source source); (match source.s_hypervisor with @@ -87,6 +72,9 @@ let rec main () = assert (disk.s_qemu_uri <> ""); ) source.s_disks; + source + +let amend_source source output_name network_map = (* Map source name. *) let source = match output_name with @@ -97,26 +85,43 @@ let rec main () = | Some name -> { source with s_name = name } in (* Map networks and bridges. *) - let source = - let { s_nics = nics } = source in - let n...
2015 Aug 11
0
[PATCH v2 03/17] v2v: factor out overlay creation
...an Kagan <rkagan@virtuozzo.com> --- v2v/v2v.ml | 91 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index a2cf249..b3dfa07 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -105,6 +105,45 @@ let amend_source source output_name network_map = { source with s_nics = nics } +let create_overlays src_disks = + (* Create a qcow2 v3 overlay to protect the source image(s). There + * is a specific reason to use the newer qcow2 variant: Because the + * L2 table can store zero clusters efficiently, an...
2015 Aug 11
41
[PATCH v2 00/17] v2v: add --in-place mode
This series is a second 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. The first 14 patches are just refactoring and rearrangement of the code, factoring the implementation
2015 Oct 20
1
[PATCH v3 03/13] v2v: factor out populating targets list
...++++++++++++++------------------------------ 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 155eb83..4257b8d 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -58,6 +58,7 @@ let rec main () = let source = open_source input print_source in let source = amend_source source output_name network_map in let overlays = create_overlays source.s_disks in + let targets = init_targets overlays source output output_format in (* Open the guestfs handle. *) message (f_"Opening the overlay"); @@ -75,43 +76,6 @@ let rec main () = g#launch (); -...
2015 Aug 27
0
Re: [PATCH v2 02/17] v2v: factor out opening input VM
...amending the properties in its internal > > representation in accordance with command-line options fit nicely into > > two isolated functions. > > Better to write this as: > > let rec main () = > ... > > and open_source ... = > ... > > and amend_source ... = > ... > > and inspect_source ... = > ... > > so it's consistent with how all the other sub-functions are > done in the same file. I actually went the other way around: I moved all callees ahead of callers, with main() at the end. This is typical of many...
2015 Aug 11
0
[PATCH v2 15/17] v2v: add --in-place mode
...map, no_trim, + debug_gc, debug_overlays, do_copy, in_place, network_map, no_trim, output_alloc, output_format, output_name, print_source, root_choice = Cmdline.parse_cmdline () in @@ -877,24 +888,35 @@ let main () = let source = open_source input print_source in let source = amend_source source output_name network_map in - let overlays = create_overlays source.s_disks in - let targets = init_targets overlays source output output_format in + let overlays = + if not in_place then create_overlays source.s_disks + else [] in + let targets = + if not in_place then init_targ...
2015 Aug 27
1
Re: [PATCH v2 15/17] v2v: add --in-place mode
...easier than asking users to tell us. *) if verbose () then printf "%s: %s %s (%s)\n%!" prog Config.package_name Config.package_version Config.host_cpu; if debug_gc then at_exit (fun () -> Gc.compact()); let source = open_source input print_source in let source = amend_source source output_name network_map in let overlays = if not in_place then create_overlays source.s_disks else [] in let targets = if not in_place then init_targets overlays source output output_format else [] in let guestfs_kind = if not in_place then "overlay" else...
2016 Apr 11
0
[PATCH] v2v: Reject duplicate -b/-n parameters on the command line (RHBZ#1325825).
...+virt-v2v -i disk -b b1 -n n1 |& grep "expecting a disk image" +virt-v2v -i disk -b b1:r1 -b b2 -n n1:r1 -n n2 |& grep "expecting a disk image" diff --git a/v2v/v2v.ml b/v2v/v2v.ml index f0c118e..4d0d525 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -189,12 +189,12 @@ and amend_source cmdline source = (* Look for a --network or --bridge parameter which names this * network/bridge (eg. --network in:out). *) - let new_name = List.assoc (t, vnet) cmdline.network_map in + let new_name = NetworkMap.find (t, Some vnet) cmdline.network_map in...
2016 Aug 24
1
[PATCH] v2v: Allow libvirt >= 2.1.0 to be used for Xen and vCenter conversions.
...+ * hence the try block. + *) + if verbose () then ( + try + let major, minor, release = Domainxml.libvirt_get_version () in + debug "libvirt version: %d.%d.%d" major minor release + with _ -> () + ); + let source = open_source cmdline input in let source = amend_source cmdline source in -- 2.7.4
2015 Oct 20
2
[PATCH v3 11/13] v2v: add --in-place mode
...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 () in @@ -57,12 +61,26 @@ let rec main () = let source = open_source input print_source in let source = amend_source source output_name network_map in - let overlays = create_overlays source.s_disks in - let targets = init_targets overlays source output output_format in - message (f_"Opening the overlay"); + let conversion_mode = + if not in_place then ( + let overlays = create_overlays so...
2015 Aug 27
2
Re: [PATCH v2 15/17] v2v: add --in-place mode
On Tue, Aug 11, 2015 at 08:00:34PM +0300, Roman Kagan wrote: > + let overlays = > + if not in_place then create_overlays source.s_disks > + else [] in > + let targets = > + if not in_place then init_targets overlays source output output_format > + else [] in This doesn't solve the problem I raised before which is that overlays and targets should never be empty
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 ---
2015 Oct 29
7
[PATCH 0/7] v2v: Miscellaneous refactorings.
Just refactoring. Rich.
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
...prog Guestfs_config.package_name Guestfs_config.package_version Guestfs_config.host_cpu; + debug "%s: %s %s (%s)" + prog Guestfs_config.package_name + Guestfs_config.package_version Guestfs_config.host_cpu; let source = open_source cmdline input in let source = amend_source cmdline source in @@ -126,8 +126,7 @@ let rec main () = let target_buses = Target_bus_assignment.target_bus_assignment source targets guestcaps in - if verbose () then - printf "%s%!" (string_of_target_b...
2016 May 22
4
ocaml tools: Use a common debug function.
Add a Common_utils.debug function for printing messages only when in verbose mode. Rich.