[Libguestfs] [PATCH virt-v2v 2/2] v2v: Remove output#disk_copied

Richard W.M. Jones
Tue, 03 Aug 2021 09:26:31 -0000

As a consequence of the previous commit, there is no need to have the
output#disk_copied method any longer.
---
 v2v/types.ml  | 1 -
 v2v/types.mli | 4 ----
 v2v/v2v.ml    | 9 +--------
 3 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/v2v/types.ml b/v2v/types.ml
index 5af0e892c..c10b03439 100644
--- a/v2v/types.ml
+++ b/v2v/types.ml
@@ -556,7 +556,6 @@ class virtual output = object
   method transfer_format t = t.target_format
   method virtual prepare_targets : string -> (string * overlay) list ->
guestcaps -> target_file list
   method disk_create = (open_guestfs ())#disk_create
-  method disk_copied (_ : target) (_ : int) (_ : int) = ()
   method virtual create_metadata : source -> inspect -> target_meta ->
target list -> unit
   method keep_serial_console = true
   method write_out_of_order = false
diff --git a/v2v/types.mli b/v2v/types.mli
index 9fa8f7d88..3cd89cf6b 100644
--- a/v2v/types.mli
+++ b/v2v/types.mli
@@ -502,10 +502,6 @@ class virtual output : object
   (** Called in order to create disks on the target.  The method has the
       same signature as Guestfs#disk_create.  Normally you should {b not}
       define this since the default method calls Guestfs#disk_create. *)
-  method disk_copied : target -> int -> int -> unit
-  (** Called after a disk was successfully copied on the target.
-      The second parameter is the index of the copied disk (starting
-      from 0), and the third is the number of disks in total. *)
   method virtual create_metadata : source -> inspect -> target_meta ->
target list -> unit
   (** Called after conversion and copying to create metadata and
       do any finalization. *)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 3206cb6a3..efdc593b0 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -612,14 +612,7 @@ and copy_targets cmdline targets input output          |
Some actual ->
            eprintf "real copying rate: %.1f M bits/sec\n%!"
                    (mbps actual elapsed_time)
-      );
-
-      (* Let the output mode know that the disk was copied successfully,
-       * so it can perform any operations without waiting for all the
-       * other disks to be copied (i.e. before the metadata is actually
-       * created).
-       *)
-      output#disk_copied t i nr_disks
+      )
   ) targets

 (* Update the target_actual_size field in the target structure. *)
--
2.32.0