]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
Added auto-start parameter to reboot command.
authorTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Fri, 27 Nov 2009 15:18:17 +0000 (15:18 +0000)
committerTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Fri, 27 Nov 2009 15:18:17 +0000 (15:18 +0000)
If false, does not restart VM automatically but puts it into Rebooted state

xenvm/tasks.ml
xenvm/xenvm.ml

index c7049186161ce1aac238998ee5259e1eb60aa084..f5926a5d93b12aebfe058ae6fadfcae1a294d711 100644 (file)
@@ -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");
index 52d8d5fe330e7e81a8c6a4bc2fc3e6a6b5771a6f..8260ab6af3fdb36056602c9ba9375001279e5d0d 100644 (file)
@@ -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