Skip to content

Commit

Permalink
CA-401242: avoid long-running, idle connections on VDI.pool_migrate, …
Browse files Browse the repository at this point in the history
…backport (#6103)
  • Loading branch information
psafont authored Nov 5, 2024
2 parents 2f6028d + ef7e7d4 commit e23d3b6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions ocaml/xapi/message_forwarding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5060,17 +5060,23 @@ functor
in
(snapshot, host)
in
let op session_id rpc =
let sync_op () =
Client.VDI.pool_migrate ~rpc ~session_id ~vdi ~sr ~options
in
let async_op () =
Client.InternalAsync.VDI.pool_migrate ~rpc ~session_id ~vdi ~sr
~options
in
Helpers.try_internal_async ~__context API.ref_VDI_of_rpc async_op
sync_op
in
VM.reserve_memory_for_vm ~__context ~vm ~host ~snapshot
~host_op:`vm_migrate (fun () ->
with_sr_andor_vdi ~__context
~vdi:(vdi, `mirror)
~doc:"VDI.mirror"
(fun () ->
do_op_on ~local_fn ~__context ~host (fun session_id rpc ->
Client.VDI.pool_migrate ~rpc ~session_id ~vdi ~sr
~options
)
)
(fun () -> do_op_on ~local_fn ~__context ~host op)
)
)

Expand Down

0 comments on commit e23d3b6

Please sign in to comment.