File tree Expand file tree Collapse file tree 4 files changed +45
-7
lines changed
Expand file tree Collapse file tree 4 files changed +45
-7
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ let vm_guest_agent_xenstore_quota = ref 128
7777
7878let vm_guest_agent_xenstore_quota_warn_interval = ref 3600
7979
80+ let vm_suspend_timeout = ref 1200.
81+
82+ let vm_suspend_ack_timeout = ref 30.
83+
8084let oxenstored_conf = ref " /etc/xen/oxenstored.conf"
8185
8286let for_each_line path f =
@@ -320,6 +324,17 @@ let options =
320324 , (fun () -> string_of_bool ! Xenops_server. xenopsd_vbd_plug_unplug_legacy)
321325 , " False if we want to split the plug atomic into attach/activate"
322326 )
327+ ; ( " vm-suspend-timeout"
328+ , Arg. Set_float vm_suspend_timeout
329+ , (fun () -> string_of_float ! vm_suspend_timeout)
330+ , " Timeout in seconds for a VM to suspend after after acknowledging a \
331+ suspend request"
332+ )
333+ ; ( " vm-suspend-ack-timeout"
334+ , Arg. Set_float vm_suspend_ack_timeout
335+ , (fun () -> string_of_float ! vm_suspend_ack_timeout)
336+ , " Timeout in seconds for a VM to acknowledge a suspend request"
337+ )
323338 ]
324339
325340let path () = Filename. concat ! sockets_path " xenopsd"
Original file line number Diff line number Diff line change @@ -778,8 +778,11 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
778778 Xenctrl. domain_shutdown xc domid (shutdown_to_xc_shutdown req)
779779 ) else (
780780 debug
781- " VM = %s; domid = %d; Waiting for domain to acknowledge shutdown request"
782- uuid domid ;
781+ " VM = %s; domid = %d; Waiting for domain to acknowledge %s request \
782+ (timeout = %.0fs)"
783+ uuid domid
784+ (string_of_shutdown_reason req)
785+ timeout ;
783786 let path = control_shutdown ~xs domid in
784787 let cancel = Domain domid in
785788 if
@@ -788,8 +791,8 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
788791 [Watch. key_to_disappear path]
789792 t ~xs ~timeout ()
790793 then
791- info " VM = %s; domid = %d; Domain acknowledged shutdown request" uuid
792- domid
794+ info " VM = %s; domid = %d; Domain acknowledged %s request" uuid domid
795+ (string_of_shutdown_reason req)
793796 else
794797 debug " VM = %s; domid = %d; Domain disappeared" uuid domid
795798 )
Original file line number Diff line number Diff line change @@ -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 *)
Original file line number Diff line number Diff line change @@ -116,3 +116,10 @@ disable-logging-for=http tracing tracing_export
116116# On Intel a similar effect is already achieved with iPAT in Xen,
117117# but setting this to 0 works on Intel too.
118118# xen-platform-pci-bar-uc=false
119+
120+ # Timeout in seconds for a VM to suspend after after acknowledging a suspend
121+ # request
122+ # vm-suspend-timeout=1200
123+
124+ # Timeout in seconds for a VM to acknowledge a suspend request
125+ # vm-suspend-ack-timeout=30
You can’t perform that action at this time.
0 commit comments