Skip to content

Commit 1b57d09

Browse files
committed
Change all receive_finalize2 to receive_finalize3
Similar to receive_start2, we need to keep receive_finalize2 as well for backwards compatibility Signed-off-by: Vincent Liu <[email protected]>
1 parent 3b34ea1 commit 1b57d09

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

ocaml/xapi-idl/storage/storage_interface.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ module StorageAPI (R : RPC) = struct
11431143
)
11441144

11451145
(** Called on the receiving end to prepare for receipt of the storage. This
1146-
function should be used in conjunction with [receive_finalize2]*)
1146+
function should be used in conjunction with [receive_finalize3]*)
11471147
let receive_start3 =
11481148
let similar_p = Param.mk ~name:"similar" Mirror.similars in
11491149
let result = Param.mk ~name:"result" Mirror.mirror_receive_result in
@@ -1162,18 +1162,18 @@ module StorageAPI (R : RPC) = struct
11621162
(** Called on the receiving end
11631163
@deprecated This function is deprecated, and is only here to keep backward
11641164
compatibility with old xapis that call Remote.DATA.MIRROR.receive_finalize
1165-
during SXM. Use the receive_finalize2 function instead.
1165+
during SXM. Use the receive_finalize3 function instead.
11661166
*)
11671167
let receive_finalize =
11681168
declare "DATA.MIRROR.receive_finalize" []
11691169
(dbg_p @-> id_p @-> returning unit_p err)
11701170

1171-
(** [receive_finalize2 dbg id] will stop the mirroring process and compose
1171+
(** [receive_finalize3 dbg id] will stop the mirroring process and compose
11721172
the snapshot VDI with the mirror VDI. It also cleans up the storage resources
11731173
used by mirroring. It is called after the the source VM is paused. This fucntion
11741174
should be used in conjunction with [receive_start3] *)
1175-
let receive_finalize2 =
1176-
declare "DATA.MIRROR.receive_finalize2" []
1175+
let receive_finalize3 =
1176+
declare "DATA.MIRROR.receive_finalize3" []
11771177
(dbg_p
11781178
@-> id_p
11791179
@-> sr_p
@@ -1316,7 +1316,7 @@ module type MIRROR = sig
13161316

13171317
val receive_finalize : context -> dbg:debug_info -> id:Mirror.id -> unit
13181318

1319-
val receive_finalize2 :
1319+
val receive_finalize3 :
13201320
context
13211321
-> dbg:debug_info
13221322
-> mirror_id:Mirror.id
@@ -1817,8 +1817,8 @@ module Server (Impl : Server_impl) () = struct
18171817
S.DATA.MIRROR.receive_finalize (fun dbg id ->
18181818
Impl.DATA.MIRROR.receive_finalize () ~dbg ~id
18191819
) ;
1820-
S.DATA.MIRROR.receive_finalize2 (fun dbg mirror_id sr url verify_dest ->
1821-
Impl.DATA.MIRROR.receive_finalize2 () ~dbg ~mirror_id ~sr ~url
1820+
S.DATA.MIRROR.receive_finalize3 (fun dbg mirror_id sr url verify_dest ->
1821+
Impl.DATA.MIRROR.receive_finalize3 () ~dbg ~mirror_id ~sr ~url
18221822
~verify_dest
18231823
) ;
18241824
S.DATA.MIRROR.pre_deactivate_hook (fun dbg dp sr vdi ->

ocaml/xapi-idl/storage/storage_skeleton.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ module DATA = struct
178178

179179
let receive_finalize ctx ~dbg ~id = u "DATA.MIRROR.receive_finalize"
180180

181-
let receive_finalize2 ctx ~dbg ~mirror_id ~sr ~url ~verify_dest =
182-
u "DATA.MIRROR.receive_finalize2"
181+
let receive_finalize3 ctx ~dbg ~mirror_id ~sr ~url ~verify_dest =
182+
u "DATA.MIRROR.receive_finalize3"
183183

184184
let receive_cancel ctx ~dbg ~id = u "DATA.MIRROR.receive_cancel"
185185

ocaml/xapi-storage-script/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ let bind ~volume_script_dir =
19251925
S.DATA.MIRROR.receive_start2 (u "DATA.MIRROR.receive_start2") ;
19261926
S.DATA.MIRROR.receive_start3 (u "DATA.MIRROR.receive_start3") ;
19271927
S.DATA.MIRROR.receive_finalize (u "DATA.MIRROR.receive_finalize") ;
1928-
S.DATA.MIRROR.receive_finalize2 (u "DATA.MIRROR.receive_finalize2") ;
1928+
S.DATA.MIRROR.receive_finalize3 (u "DATA.MIRROR.receive_finalize3") ;
19291929
S.DATA.MIRROR.receive_cancel (u "DATA.MIRROR.receive_cancel") ;
19301930
S.DATA.MIRROR.receive_cancel2 (u "DATA.MIRROR.receive_cancel2") ;
19311931
S.DATA.MIRROR.pre_deactivate_hook (u "DATA.MIRROR.pre_deactivate_hook") ;

ocaml/xapi/storage_migrate.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ let choose_backend dbg sr =
4040
(** module [MigrateRemote] is similar to [MigrateLocal], but most of these functions
4141
tend to be executed on the receiver side. *)
4242
module MigrateRemote = struct
43-
(** [receive_finalize2 dbg mirror_id sr url verify_dest] takes an [sr] parameter
43+
(** [receive_finalize3 dbg mirror_id sr url verify_dest] takes an [sr] parameter
4444
which is the source sr and multiplexes based on the type of that *)
45-
let receive_finalize2 ~dbg ~mirror_id ~sr ~url ~verify_dest =
45+
let receive_finalize3 ~dbg ~mirror_id ~sr ~url ~verify_dest =
4646
let (module Migrate_Backend) = choose_backend dbg sr in
47-
Migrate_Backend.receive_finalize2 () ~dbg ~mirror_id ~sr ~url ~verify_dest
47+
Migrate_Backend.receive_finalize3 () ~dbg ~mirror_id ~sr ~url ~verify_dest
4848

4949
let receive_cancel2 ~dbg ~mirror_id ~url ~verify_dest =
5050
let (module Remote) =
@@ -332,12 +332,12 @@ let post_deactivate_hook ~sr ~vdi ~dp:_ =
332332
r.remote_info
333333
in
334334
let (module Remote) = get_remote_backend r.url verify_dest in
335-
debug "Calling receive_finalize2" ;
335+
debug "Calling receive_finalize3" ;
336336
log_and_ignore_exn (fun () ->
337-
MigrateRemote.receive_finalize2 ~dbg:"Mirror-cleanup" ~mirror_id:id
337+
MigrateRemote.receive_finalize3 ~dbg:"Mirror-cleanup" ~mirror_id:id
338338
~sr ~url:r.url ~verify_dest
339339
) ;
340-
debug "Finished calling receive_finalize2" ;
340+
debug "Finished calling receive_finalize3" ;
341341
State.remove_local_mirror id ;
342342
debug "Removed active local mirror: %s" id ;
343343
Option.iter (fun id -> Scheduler.cancel scheduler id) r.watchdog

ocaml/xapi/storage_mux.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ module Mux = struct
861861
info "%s dbg: %s mirror_id: %s" __FUNCTION__ dbg id ;
862862
Storage_smapiv1_migrate.MIRROR.receive_finalize () ~dbg:di.log ~id
863863

864-
let receive_finalize2 () ~dbg:_ ~mirror_id:_ ~sr:_ ~url:_ ~verify_dest:_ =
864+
let receive_finalize3 () ~dbg:_ ~mirror_id:_ ~sr:_ ~url:_ ~verify_dest:_ =
865865
u __FUNCTION__
866866

867867
let receive_cancel () ~dbg ~id =

ocaml/xapi/storage_smapiv1.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ module SMAPIv1 : Server_impl = struct
11531153

11541154
let receive_finalize _context ~dbg:_ ~id:_ = assert false
11551155

1156-
let receive_finalize2 _context ~dbg:_ ~mirror_id:_ ~sr:_ ~url:_
1156+
let receive_finalize3 _context ~dbg:_ ~mirror_id:_ ~sr:_ ~url:_
11571157
~verify_dest:_ =
11581158
assert false
11591159

ocaml/xapi/storage_smapiv1_migrate.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ module MIRROR : SMAPIv2_MIRROR = struct
681681
stored in memory on different hosts. If receive_start is called, by an older
682682
host, this State.add is run on the destination host. On the other hand, if
683683
receive_start3 is called, this will be stored in memory on the source host.
684-
receive_finalize2 and receive_cancel2 handles this similarly. *)
684+
receive_finalize3 and receive_cancel2 handles this similarly. *)
685685
State.add id
686686
State.(
687687
Recv_op
@@ -749,7 +749,7 @@ module MIRROR : SMAPIv2_MIRROR = struct
749749
Option.iter (fun r -> Local.DP.destroy dbg r.leaf_dp false) recv_state ;
750750
State.remove_receive_mirror id
751751

752-
let receive_finalize2 _ctx ~dbg ~mirror_id ~sr ~url ~verify_dest =
752+
let receive_finalize3 _ctx ~dbg ~mirror_id ~sr ~url ~verify_dest =
753753
D.debug "%s dbg:%s id: %s sr: %s url: %s verify_dest: %B" __FUNCTION__ dbg
754754
mirror_id (s_of_sr sr) url verify_dest ;
755755
let (module Remote) =

ocaml/xapi/storage_smapiv1_wrapper.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ functor
12181218
info "DATA.MIRROR.receive_finalize dbg:%s id:%s" dbg id ;
12191219
Impl.DATA.MIRROR.receive_finalize context ~dbg ~id
12201220

1221-
let receive_finalize2 _context ~dbg:_ ~mirror_id:_ ~sr:_ ~url:_
1221+
let receive_finalize3 _context ~dbg:_ ~mirror_id:_ ~sr:_ ~url:_
12221222
~verify_dest:_ =
12231223
(* see storage_smapiv{1,3}_migrate *)
12241224
u __FUNCTION__

ocaml/xapi/storage_smapiv3_migrate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module MIRROR : SMAPIv2_MIRROR = struct
3535

3636
let receive_finalize _ctx = u __FUNCTION__
3737

38-
let receive_finalize2 _ctx = u __FUNCTION__
38+
let receive_finalize3 _ctx = u __FUNCTION__
3939

4040
let receive_cancel _ctx = u __FUNCTION__
4141

0 commit comments

Comments
 (0)