Skip to content

Commit

Permalink
IH-728: Remove unused copy_into function
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Liu <[email protected]>
  • Loading branch information
Vincent-lau committed Oct 25, 2024
1 parent 8435a4e commit c62d742
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 53 deletions.
29 changes: 0 additions & 29 deletions ocaml/xapi-idl/storage/storage_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -976,21 +976,6 @@ module StorageAPI (R : RPC) = struct
~description:["when true, verify remote server certificate"]
Types.bool

(** [copy_into task sr vdi url sr2] copies the data from [vdi] into a remote
system [url]'s [sr2] *)
let copy_into =
let dest_vdi_p = Param.mk ~name:"dest_vdi" Vdi.t in
declare "DATA.copy_into" []
(dbg_p
@-> sr_p
@-> vdi_p
@-> url_p
@-> dest_p
@-> dest_vdi_p
@-> verify_dest_p
@-> returning task_id_p err
)

let copy =
let result_p = Param.mk ~name:"task_id" Task.id in
declare "DATA.copy" []
Expand Down Expand Up @@ -1344,17 +1329,6 @@ module type Server_impl = sig
val get_by_name : context -> dbg:debug_info -> name:string -> sr * vdi_info

module DATA : sig
val copy_into :
context
-> dbg:debug_info
-> sr:sr
-> vdi:vdi
-> url:string
-> dest:sr
-> dest_vdi:vdi
-> verify_dest:bool
-> Task.id

val copy :
context
-> dbg:debug_info
Expand Down Expand Up @@ -1549,9 +1523,6 @@ module Server (Impl : Server_impl) () = struct
Impl.VDI.list_changed_blocks () ~dbg ~sr ~vdi_from ~vdi_to
) ;
S.get_by_name (fun dbg name -> Impl.get_by_name () ~dbg ~name) ;
S.DATA.copy_into (fun dbg sr vdi url dest dest_vdi verify_dest ->
Impl.DATA.copy_into () ~dbg ~sr ~vdi ~url ~dest ~dest_vdi ~verify_dest
) ;
S.DATA.copy (fun dbg sr vdi dp url dest verify_dest ->
Impl.DATA.copy () ~dbg ~sr ~vdi ~dp ~url ~dest ~verify_dest
) ;
Expand Down
1 change: 0 additions & 1 deletion ocaml/xapi-idl/storage/storage_skeleton.ml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ end
let get_by_name ctx ~dbg ~name = u "get_by_name"

module DATA = struct
let copy_into ctx ~dbg ~sr ~vdi ~url ~dest ~dest_vdi = u "DATA.copy_into"

let copy ctx ~dbg ~sr ~vdi ~dp ~url ~dest = u "DATA.copy"

Expand Down
1 change: 0 additions & 1 deletion ocaml/xapi-storage-script/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,6 @@ let bind ~volume_script_dir =
S.VDI.get_url (u "VDI.get_url") ;
S.DATA.MIRROR.start (u "DATA.MIRROR.start") ;
S.Policy.get_backend_vm (u "Policy.get_backend_vm") ;
S.DATA.copy_into (u "DATA.copy_into") ;
S.DATA.MIRROR.receive_cancel (u "DATA.MIRROR.receive_cancel") ;
S.SR.update_snapshot_info_src (u "SR.update_snapshot_info_src") ;
S.DATA.MIRROR.stop (u "DATA.MIRROR.stop") ;
Expand Down
9 changes: 0 additions & 9 deletions ocaml/xapi/storage_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,6 @@ let copy' ~task ~dbg ~sr ~vdi ~url ~dest ~dest_vdi ~verify_dest =
perform_cleanup_actions !on_fail ;
raise e

let copy_into ~task ~dbg ~sr ~vdi ~url ~dest ~dest_vdi ~verify_dest =
copy' ~task ~dbg ~sr ~vdi ~url ~dest ~dest_vdi ~verify_dest

let remove_from_sm_config vdi_info key =
{
vdi_info with
Expand Down Expand Up @@ -1368,12 +1365,6 @@ let copy ~dbg ~sr ~vdi ~dp ~url ~dest ~verify_dest =
copy ~task ~dbg:dbg.Debug_info.log ~sr ~vdi ~dp ~url ~dest ~verify_dest
)

let copy_into ~dbg ~sr ~vdi ~url ~dest ~dest_vdi ~verify_dest =
with_task_and_thread ~dbg (fun task ->
copy_into ~task ~dbg:dbg.Debug_info.log ~sr ~vdi ~url ~dest ~dest_vdi
~verify_dest
)

(* The remote end of this call, SR.update_snapshot_info_dest, is implemented in
* the SMAPIv1 section of storage_migrate.ml. It needs to access the setters
* for snapshot_of, snapshot_time and is_a_snapshot, which we don't want to add
Expand Down
4 changes: 0 additions & 4 deletions ocaml/xapi/storage_mux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,6 @@ module Mux = struct
let copy () ~dbg =
with_dbg ~name:"DATA.copy" ~dbg @@ fun dbg -> Storage_migrate.copy ~dbg

let copy_into () ~dbg =
with_dbg ~name:"DATA.copy_into" ~dbg @@ fun dbg ->
Storage_migrate.copy_into ~dbg

module MIRROR = struct
let start () ~dbg =
with_dbg ~name:"DATA.MIRROR.start" ~dbg @@ fun dbg ->
Expand Down
4 changes: 0 additions & 4 deletions ocaml/xapi/storage_smapiv1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1202,10 +1202,6 @@ module SMAPIv1 : Server_impl = struct
let get_by_name _context ~dbg:_ ~name:_ = assert false

module DATA = struct
let copy_into _context ~dbg:_ ~sr:_ ~vdi:_ ~url:_ ~dest:_ ~dest_vdi:_
~verify_dest:_ =
assert false

let copy _context ~dbg:_ ~sr:_ ~vdi:_ ~dp:_ ~url:_ ~dest:_ ~verify_dest:_ =
assert false

Expand Down
5 changes: 0 additions & 5 deletions ocaml/xapi/storage_smapiv1_wrapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,6 @@ functor
Impl.get_by_name context ~dbg ~name

module DATA = struct
let copy_into context ~dbg ~sr ~vdi ~url ~dest =
info "DATA.copy_into dbg:%s sr:%s vdi:%s url:%s dest:%s" dbg
(s_of_sr sr) (s_of_vdi vdi) url (s_of_sr dest) ;
Impl.DATA.copy_into context ~dbg ~sr ~vdi ~url ~dest

let copy context ~dbg ~sr ~vdi ~dp ~url ~dest =
info "DATA.copy dbg:%s sr:%s vdi:%s url:%s dest:%s" dbg (s_of_sr sr)
(s_of_vdi vdi) url (s_of_sr dest) ;
Expand Down

0 comments on commit c62d742

Please sign in to comment.