From: Tomasz Wroblewski Date: Fri, 27 Nov 2009 15:18:17 +0000 (+0000) Subject: Added auto-start parameter to reboot command. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=747f2c4e70b7f6d16a64c1dfa8d02310f94173bf;p=xenclient%2Ftoolstack.git Added auto-start parameter to reboot command. If false, does not restart VM automatically but puts it into Rebooted state --- diff --git a/xenvm/tasks.ml b/xenvm/tasks.ml index c704918..f5926a5 100644 --- a/xenvm/tasks.ml +++ b/xenvm/tasks.ml @@ -85,7 +85,7 @@ let actions_table = [ (Quit, mk_desc "quit"); (Destroy, mk_desc "destroy"); (Halt, mk_desc_args "halt" [ ("forced", D (ValBool false), ArgBool) ] ); - (Reboot, mk_desc_args "reboot" [ ("forced", D (ValBool false), ArgBool) ] ); + (Reboot, mk_desc_args "reboot" [ ("forced", D (ValBool false), ArgBool); ("auto-start", D (ValBool true), ArgBool) ] ); (Start, mk_desc "start"); (Pause, mk_desc "pause"); (Unpause, mk_desc "unpause"); diff --git a/xenvm/xenvm.ml b/xenvm/xenvm.ml index 52d8d5f..8260ab6 100644 --- a/xenvm/xenvm.ml +++ b/xenvm/xenvm.ml @@ -417,11 +417,14 @@ let do_task state (task, args) = ); Xenvmlib.Ok | Tasks.Reboot -> - let force = optional_arg false Tasks.args_get_bool args "forced" in + let force = optional_arg false Tasks.args_get_bool args "forced" + and auto_start = optional_arg true Tasks.args_get_bool args "auto-start" in with_xcs (fun xc xs -> Misc.with_xal (fun xal -> Vmact.shutdown_vm xc xs xal state force Domain.Reboot); Vmact.stop_vm xc xs state; - Vmact.start_vm xc xs state; + if auto_start + then Vmact.start_vm xc xs state + else Vmact.change_vmstate state VmRebooted ); Xenvmlib.Ok | Tasks.Start -> with_xcs (fun xc xs -> Vmact.start_vm xc xs state); Xenvmlib.Ok