Skip to content

Commit

Permalink
Revert "CP-45016: Clean up the source VM earlier"
Browse files Browse the repository at this point in the history
This reverts commit 889dfa6. As there
is no need to clean up the source VM earlier at all, VM_save already
does the job of deactivating the source VM datapath.

Signed-off-by: Vincent Liu <[email protected]>
  • Loading branch information
Vincent-lau committed Jan 28, 2025
1 parent 03e82b6 commit bd3024b
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions ocaml/xenopsd/lib/xenops_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2732,23 +2732,6 @@ and perform_exn ?result (op : operation) (t : Xenops_task.task_handle) : unit =
) ;
debug "VM.migrate: Synchronisation point 1"
in
let pause_src_vm () =
debug
"VM.migrate: pause src vm before allowing destination to proceed" ;
(* cleanup tmp src VM *)
let atomics =
[
VM_hook_script_stable
( id
, Xenops_hooks.VM_pre_destroy
, Xenops_hooks.reason__suspend
, new_src_id
)
]
@ atomics_of_operation (VM_shutdown (new_src_id, None))
in
perform_atomics atomics t
in
let final_handshake () =
Handshake.send vm_fd Handshake.Success ;
debug "VM.migrate: Synchronisation point 3" ;
Expand Down Expand Up @@ -2789,10 +2772,7 @@ and perform_exn ?result (op : operation) (t : Xenops_task.task_handle) : unit =
the main VM migration sequence. *)
match VGPU_DB.ids id with
| [] ->
first_handshake () ;
save () ;
pause_src_vm () ;
final_handshake ()
first_handshake () ; save () ; final_handshake ()
| (_vm_id, dev_id) :: _ ->
let url =
make_url "/migrate/vgpu/"
Expand All @@ -2809,12 +2789,20 @@ and perform_exn ?result (op : operation) (t : Xenops_task.task_handle) : unit =
first_handshake () ;
save ~vgpu_fd:(FD vgpu_fd) ()
) ;
pause_src_vm () ;
final_handshake ()
) ;
let cleanup_src_vm () =
let atomics =
[
(* cleanup tmp src VM *)
let atomics =
[
VM_hook_script_stable
( id
, Xenops_hooks.VM_pre_destroy
, Xenops_hooks.reason__suspend
, new_src_id
)
]
@ atomics_of_operation (VM_shutdown (new_src_id, None))
@ [
VM_hook_script_stable
( id
, Xenops_hooks.VM_post_destroy
Expand All @@ -2823,10 +2811,8 @@ and perform_exn ?result (op : operation) (t : Xenops_task.task_handle) : unit =
)
; VM_remove new_src_id
]
in
perform_atomics atomics t
in
cleanup_src_vm ()
perform_atomics atomics t
| VM_receive_memory
{
vmr_id= id
Expand Down

0 comments on commit bd3024b

Please sign in to comment.