Skip to content

Commit

Permalink
IH-728: Remove unused dp from copy function
Browse files Browse the repository at this point in the history
There is no remote invocation of this function, so should be safe.

Signed-off-by: Vincent Liu <[email protected]>
  • Loading branch information
Vincent-lau committed Oct 25, 2024
1 parent c62d742 commit 14b48b0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
6 changes: 2 additions & 4 deletions ocaml/xapi-idl/storage/storage_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,6 @@ module StorageAPI (R : RPC) = struct
(dbg_p
@-> sr_p
@-> vdi_p
@-> dp_p
@-> url_p
@-> dest_p
@-> verify_dest_p
Expand Down Expand Up @@ -1334,7 +1333,6 @@ module type Server_impl = sig
-> dbg:debug_info
-> sr:sr
-> vdi:vdi
-> dp:dp
-> url:string
-> dest:sr
-> verify_dest:bool
Expand Down Expand Up @@ -1523,8 +1521,8 @@ 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 (fun dbg sr vdi dp url dest verify_dest ->
Impl.DATA.copy () ~dbg ~sr ~vdi ~dp ~url ~dest ~verify_dest
S.DATA.copy (fun dbg sr vdi url dest verify_dest ->
Impl.DATA.copy () ~dbg ~sr ~vdi ~url ~dest ~verify_dest
) ;
S.DATA.MIRROR.start (fun dbg sr vdi dp url dest verify_dest ->
Impl.DATA.MIRROR.start () ~dbg ~sr ~vdi ~dp ~url ~dest ~verify_dest
Expand Down
3 changes: 1 addition & 2 deletions ocaml/xapi-idl/storage/storage_skeleton.ml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ end
let get_by_name ctx ~dbg ~name = u "get_by_name"

module DATA = struct

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

module MIRROR = struct
(** [start task sr vdi url sr2] creates a VDI in remote [url]'s [sr2] and
Expand Down
6 changes: 3 additions & 3 deletions ocaml/xapi/storage_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ let nbd_handler req s sr vdi dp =
| None ->
()

let copy ~task ~dbg ~sr ~vdi ~dp:_ ~url ~dest ~verify_dest =
let copy ~task ~dbg ~sr ~vdi ~url ~dest ~verify_dest =
debug "copy sr:%s vdi:%s url:%s dest:%s verify_dest:%B"
(Storage_interface.Sr.string_of sr)
(Storage_interface.Vdi.string_of vdi)
Expand Down Expand Up @@ -1360,9 +1360,9 @@ let start ~dbg ~sr ~vdi ~dp ~url ~dest ~verify_dest =
start' ~task ~dbg:dbg.Debug_info.log ~sr ~vdi ~dp ~url ~dest ~verify_dest
)

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

(* The remote end of this call, SR.update_snapshot_info_dest, is implemented in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/storage_smapiv1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ module SMAPIv1 : Server_impl = struct
let get_by_name _context ~dbg:_ ~name:_ = assert false

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

module MIRROR = struct
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/storage_smapiv1_wrapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,10 @@ functor
Impl.get_by_name context ~dbg ~name

module DATA = struct
let copy context ~dbg ~sr ~vdi ~dp ~url ~dest =
let copy context ~dbg ~sr ~vdi ~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) ;
Impl.DATA.copy context ~dbg ~sr ~vdi ~dp ~url ~dest
Impl.DATA.copy context ~dbg ~sr ~vdi ~url ~dest

module MIRROR = struct
let start context ~dbg ~sr ~vdi ~dp ~url ~dest =
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_vm_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ let vdi_copy_fun __context dbg vdi_map remote is_intra_pool remote_vdis so_far
let mirror_to_remote new_dp =
let task =
if not vconf.do_mirror then
SMAPI.DATA.copy dbg vconf.sr vconf.location new_dp remote.sm_url dest_sr
SMAPI.DATA.copy dbg vconf.sr vconf.location remote.sm_url dest_sr
is_intra_pool
else
(* Though we have no intention of "write", here we use the same mode as the
Expand Down

0 comments on commit 14b48b0

Please sign in to comment.