search for: ov_overlay_file

Displaying 20 results from an estimated 43 matches for "ov_overlay_file".

2015 Oct 20
1
[PATCH v3 08/13] v2v: factor out preserving overlays for debugging
...debug-overlays option was used. *) - if debug_overlays then ( - let overlay_dir = (new Guestfs.guestfs ())#get_cachedir () in - List.iter ( - fun ov -> - let saved_filename = - sprintf "%s/%s-%s.qcow2" overlay_dir source.s_name ov.ov_sd in - rename ov.ov_overlay_file saved_filename; - printf (f_"Overlay saved as %s [--debug-overlays]\n") saved_filename - ) overlays - ); + if debug_overlays then preserve_overlays overlays source.s_name; message (f_"Finishing off"); delete_target_on_exit := false (* Don't delete target...
2015 Oct 20
1
[PATCH v3 10/13] v2v: factor out opening and populating guestfs handle
...t output_format in - (* Open the guestfs handle. *) message (f_"Opening the overlay"); - let g = new G.guestfs () in - g#set_identifier "v2v"; - if trace () then g#set_trace true; - if verbose () then g#set_verbose true; - g#set_network true; - List.iter ( - fun ({ov_overlay_file = overlay_file}) -> - g#add_drive_opts overlay_file - ~format:"qcow2" ~cachemode:"unsafe" ~discard:"besteffort" - ~copyonread:true - ) overlays; + let g = open_guestfs () in + populate_overlays g overlays; g#launch (); @@ -261,6 +251,24...
2019 Oct 09
3
[PATCH] v2v: Output saved overlays in a machine-readable fashion
...tual_target_size target_file disk_stats = (* Save overlays if --debug-overlays option was used. *) and preserve_overlays overlays src_name = - List.iter ( - fun ov -> - let saved_filename = - sprintf "%s/%s-%s.qcow2" overlay_dir src_name ov.ov_sd in - rename ov.ov_overlay_file saved_filename; - info (f_"Overlay saved as %s [--debug-overlays]") saved_filename - ) overlays + let filenames = List.map ( + fun ov -> + let saved_filename = + sprintf "%s/%s-%s.qcow2" overlay_dir src_name ov.ov_sd in + rename ov.o...
2015 Oct 20
1
[PATCH v3 02/13] v2v: factor out overlay creation
...in + let overlays = create_overlays source.s_disks in (* Open the guestfs handle. *) message (f_"Opening the overlay"); @@ -100,7 +67,7 @@ let rec main () = if verbose () then g#set_verbose true; g#set_network true; List.iter ( - fun (overlay_file, _) -> + fun ({ov_overlay_file = overlay_file}) -> g#add_drive_opts overlay_file ~format:"qcow2" ~cachemode:"unsafe" ~discard:"besteffort" ~copyonread:true @@ -108,20 +75,6 @@ let rec main () = g#launch (); - (* Create the list of overlays structs. Query each dis...
2015 Aug 11
0
[PATCH v2 03/17] v2v: factor out overlay creation
...not ((new G.guestfs ())#disk_has_backing_file overlay_file) then + error (f_"internal error: qemu-img did not create overlay with backing file"); + + let sd = "sd" ^ drive_name i in + + let vsize = (new G.guestfs ())#disk_virtual_size overlay_file in + + { ov_overlay_file = overlay_file; ov_sd = sd; + ov_virtual_size = vsize; ov_source = source } + ) src_disks + let rec main () = (* Handle the command line. *) let input, output, @@ -122,40 +161,7 @@ let rec main () = let source = open_source input print_source in let source = amend_source sour...
2018 Mar 15
0
[PATCH 2/2] v2v: Add --print-target to display overlay and target information.
...tion; print_source : bool; + print_target : bool; root_choice : Types.root_choice; } diff --git a/v2v/types.ml b/v2v/types.ml index b89bd2fe2..c1f36fdb1 100644 --- a/v2v/types.ml +++ b/v2v/types.ml @@ -281,11 +281,10 @@ type overlay = { } let string_of_overlay ov = - sprintf "\ -ov_overlay_file = %s -ov_sd = %s -ov_virtual_size = %Ld -ov_source = %s + sprintf " overlay file: %s + overlay device name: %s +overlay virtual disk size: %Ld + overlay source qemu URI: %s " ov.ov_overlay_file ov.ov_sd @@ -304,12 +303,9 @@ and target_file = | TargetURI of...
2019 Oct 10
0
Re: [PATCH] v2v: Output saved overlays in a machine-readable fashion
...= > > (* Save overlays if --debug-overlays option was used. *) > and preserve_overlays overlays src_name = > - List.iter ( > - fun ov -> > - let saved_filename = > - sprintf "%s/%s-%s.qcow2" overlay_dir src_name ov.ov_sd in > - rename ov.ov_overlay_file saved_filename; > - info (f_"Overlay saved as %s [--debug-overlays]") saved_filename > - ) overlays > + let filenames = List.map ( > + fun ov -> > + let saved_filename = > + sprintf "%s/%s-%s.qcow2" overlay_dir src_name ov.o...
2015 Aug 11
0
[PATCH v2 04/17] v2v: factor out populating targets list
...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 true; - List.iter ( - fun ({ov_overlay_file = overlay_file}) -> - g#add_drive_opts overlay_file - ~format:"qcow2" ~cachemode:"unsafe" ~discard:"besteffort" - ~copyonread:true - ) overlays; - - g#launch (); - +let init_targets overlays source output output_format = (* Work out where we...
2018 Mar 16
7
[PATCH v2 0/5] Add --print-target with machine-readable version.
This adds --print-target. In addition, v2 provides a machine-readable version (in JSON format). All of the record -> JSON boilerplate in this patch could be eliminated if we moved the baseline to OCaml 4.02. Rich.
2018 Mar 15
3
[PATCH 0/2] v2v: Add --print-target to display overlay and target information.
RHV was connecting to the VMware source in order to find out the virtual disk size of the source disk(s), duplicating logic that virt-v2v already provides. This makes that information available using a new ‘virt-v2v --print-target option’. Note in order to get all the information, this has to actually perform the conversion step, so it takes 30 seconds or so before we reach the point where the
2015 Oct 20
1
[PATCH v3 07/13] v2v: factor out copying of output data
...to happen with lazy_refcounts was - * used. The symptom was that the header wasn't written back - * to the disk correctly and the file appeared to have no - * backing file. Just sanity check this here. - *) - let overlay_file = t.target_overlay.ov_overlay_file in - if not ((new G.guestfs ())#disk_has_backing_file overlay_file) then - error (f_"internal error: qemu corrupted the overlay file"); - - (* Give the input module a chance to adjust the parameters - * of the overlay/backing file. This allows us to...
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 Nov 10
1
[PATCH] OCaml tools: use open_guestfs everywhere
...error (f_"internal error: qemu-img did not create overlay with backing file"); let sd = "sd" ^ drive_name i in - let vsize = (new G.guestfs ())#disk_virtual_size overlay_file in + let vsize = (open_guestfs ())#disk_virtual_size overlay_file in { ov_overlay_file = overlay_file; ov_sd = sd; ov_virtual_size = vsize; ov_source = source } @@ -780,7 +780,7 @@ and copy_targets targets input output output_alloc = * backing file. Just sanity check this here. *) let overlay_file = t.target_overlay.ov_overlay_file in - if not ((...
2018 Aug 16
0
[PATCH v2] v2v: Add --print-estimate option to print copy size estimate.
...estfs.blocks s.Guestfs.bfree s.Guestfs.bavail +(* Print the estimated size that will be copied for each disk. *) +and print_copy_size_estimate cmdline overlays = + let json = cmdline.machine_readable in + if json then printf "{ \"disks\": [\n%!"; + List.iteri ( + fun i { ov_overlay_file } -> + if json && i > 0 then printf ",\n%!"; + let cmd = + [ Guestfs_config.qemu_img; "measure"; + (* For use of -O qcow2 here, see this thread: + * https://www.redhat.com/archives/libguestfs/2018-August/thread.html#00142 +...
2019 Apr 30
1
[PATCH] v2v: Allow output modes to rewrite disk copying
...[ "qemu-img"; "convert" ] @ + (if not (quiet ()) then [ "-p" ] else []) @ + [ "-n"; "-f"; "qcow2"; "-O"; target.target_format ] @ + (if compressed then [ "-c" ] else []) @ + [ target.target_overlay.ov_overlay_file; filename ] in + message (f_"Copying disk to %s (%s)") filename target.target_format; + if run_command cmd <> 0 then + error (f_"qemu-img command failed, see earlier errors"); + method virtual create_metadata : source -> target list -> target_buses -&gt...
2018 Aug 23
0
[PATCH v4] v2v: Add --print-estimate option to print copy size estimate.
...ne () in @@ -156,6 +158,22 @@ let rec main () = (match conversion_mode with | In_place -> () | Copying overlays -> + (* Print copy size estimate and stop. *) + if cmdline.print_estimate then ( + let estimated_size = + sum (List.map + (fun { ov_overlay_file } -> + Measure_disk.measure ~format:"qcow2" ov_overlay_file) + overlays) in + (match machine_readable () with + | None -> + printf "%Ld\n" estimated_size + | Some {pr} -> + pr "%Ld\n&quo...
2018 Aug 17
0
[PATCH v3 4/4] v2v: Add --print-estimate option to print copy size estimate.
...ne () in @@ -156,6 +158,17 @@ let rec main () = (match conversion_mode with | In_place -> () | Copying overlays -> + (* Print copy size estimate and stop. *) + if cmdline.print_estimate then ( + let estimated_size = + sum (List.map + (fun { ov_overlay_file } -> + Measure_disk.measure ~format:"qcow2" ov_overlay_file) + overlays) in + printf "%Ld\n" estimated_size; + exit 0 + ); + message (f_"Assigning disks to buses"); let target_buses = Target...
2018 Aug 24
0
[PATCH v6] v2v: Add --print-estimate option to print copy size estimate.
...e_target_size mpstats overlays = - let sum = List.fold_left (+^) 0L in - (* (1) *) let fs_total_size = sum ( @@ -617,6 +623,25 @@ and get_target_formats cmdline output overlays = format ) overlays +and print_estimate overlays = + let estimates = + List.map ( + fun { ov_overlay_file } -> + Measure_disk.measure ~format:"qcow2" ov_overlay_file + ) overlays in + let total = sum estimates in + + match machine_readable () with + | None -> + List.iteri (fun i e -> printf "disk %d: %Ld\n" (i+1) e) estimates; + printf "total: %Ld\...
2018 Aug 23
0
[PATCH v5] v2v: Add --print-estimate option to print copy size estimate.
...e_target_size mpstats overlays = - let sum = List.fold_left (+^) 0L in - (* (1) *) let fs_total_size = sum ( @@ -617,6 +623,25 @@ and get_target_formats cmdline output overlays = format ) overlays +and print_estimate overlays = + let estimates = + List.map ( + fun { ov_overlay_file } -> + Measure_disk.measure ~format:"qcow2" ov_overlay_file + ) overlays in + let total = sum estimates in + + match machine_readable () with + | None -> + List.iteri (fun i e -> printf "%d %Ld\n" (i+1) e) estimates; + printf "total %Ld\n"...
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.