Skip to content

Commit 5ed535d

Browse files
committed
Change post_detach_hook to post_deactivate_hook
Previously the `post_detach_hook` was run after the VDI is detached on the source VM, which is at the very end of the SXM, where the source VM is shutdown. However, the job of `post_detach_hook` is to call `Remote.receive_finalize` which will destroy the mirroring datapath. This should have been called as soon as we deactivate the datapath on the source VM, at which point the source VM will stop writing using that datapath. This commit changes `post_detach_hook` to `post_deactivate_hook` and moves its calling locations accordingly. Signed-off-by: Vincent Liu <[email protected]>
1 parent fc56ca0 commit 5ed535d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ocaml/xapi/storage_migrate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ let pre_deactivate_hook ~dbg:_ ~dp:_ ~sr ~vdi =
13201320
s.failed <- true
13211321
)
13221322

1323-
let post_detach_hook ~sr ~vdi ~dp:_ =
1323+
let post_deactivate_hook ~sr ~vdi ~dp:_ =
13241324
let open State.Send_state in
13251325
let id = State.mirror_id_of (sr, vdi) in
13261326
State.find_active_local_mirror id

ocaml/xapi/storage_smapiv1_wrapper.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ functor
422422
| Vdi_automaton.Deactivate ->
423423
Storage_migrate.pre_deactivate_hook ~dbg ~dp ~sr ~vdi ;
424424
Impl.VDI.deactivate context ~dbg ~dp ~sr ~vdi ~vm ;
425+
Storage_migrate.post_deactivate_hook ~sr ~vdi ~dp ;
425426
vdi_t
426427
| Vdi_automaton.Detach ->
427428
Impl.VDI.detach context ~dbg ~dp ~sr ~vdi ~vm ;
428-
Storage_migrate.post_detach_hook ~sr ~vdi ~dp ;
429429
vdi_t
430430
in
431431
Sr.add_or_replace vdi new_vdi_t sr_t ;

0 commit comments

Comments
 (0)