(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");
);
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