@@ -2712,7 +2712,7 @@ module VM = struct
27122712 with Watch. Timeout _ -> false
27132713 )
27142714
2715- let wait_shutdown task vm _reason timeout =
2715+ let wait_shutdown task vm reason timeout =
27162716 let is_vm_event = function
27172717 | Dynamic. Vm id when id = vm.Vm. id ->
27182718 debug " EVENT on our VM: %s" id ;
@@ -2859,7 +2859,9 @@ module VM = struct
28592859 not
28602860 ( with_tracing ~task
28612861 ~name: " VM_save_domain_suspend_callback_request_shutdown"
2862- @@ fun () -> request_shutdown task vm Suspend 30.
2862+ @@ fun () ->
2863+ request_shutdown task vm Suspend
2864+ ! Xenopsd. vm_suspend_ack_timeout
28632865 )
28642866 then
28652867 raise (Xenopsd_error Failed_to_acknowledge_suspend_request ) ;
@@ -2870,14 +2872,25 @@ module VM = struct
28702872 | _ ->
28712873 ()
28722874 ) ;
2875+ let suspend_timeout = ! Xenopsd. vm_suspend_timeout in
28732876 if
28742877 not
28752878 ( with_tracing ~task
28762879 ~name: " VM_save_domain_suspend_callback_wait_shutdown"
2877- @@ fun () -> wait_shutdown task vm Suspend 1200.
2880+ @@ fun () ->
2881+ debug
2882+ " VM = %s; domid = %d; Waiting for domain to suspend \
2883+ (timeout = %.0fs)"
2884+ vm.Vm. id domid suspend_timeout ;
2885+ wait_shutdown task vm Suspend suspend_timeout
28782886 )
28792887 then
2880- raise (Xenopsd_error (Failed_to_suspend (vm.Vm. id, 1200. )))
2888+ raise
2889+ (Xenopsd_error
2890+ (Failed_to_suspend (vm.Vm. id, suspend_timeout))
2891+ )
2892+ else
2893+ debug " VM = %s; domid = %d; Domain suspended" vm.Vm. id domid
28812894 ) ;
28822895 (* Record the final memory usage of the domain so we know how much
28832896 to allocate for the resume *)
0 commit comments