]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
Reboots are back to being handled by xenvm. But reread configuration file
authorTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Thu, 3 Dec 2009 12:18:34 +0000 (12:18 +0000)
committerTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Thu, 3 Dec 2009 12:33:01 +0000 (12:33 +0000)
during reboot.

xenvm/vmconfig.ml
xenvm/xenvm.ml

index 3fd2ccf03ff4726a95509f73e1741e1fccdf6c76..af905e845eb402853b37fa59693c1aed70bb6f24 100644 (file)
@@ -642,7 +642,7 @@ let empty =
                notify = NotifyNone;
                daemonize = false;
                on_halt = ActionDestroy;
-               on_restart = ActionPreserve;
+               on_restart = ActionRestart;
                on_crash = ActionDestroy;
                cpus_affinity = [];
        }
index 8260ab6af3fdb36056602c9ba9375001279e5d0d..8f48136c798fe6a271f059abc7ae787c10a240be 100644 (file)
@@ -242,6 +242,15 @@ let con_pop_reply con r = Queue.pop con.con_replies
 
 (****************************************************************************************
  *)
+let reread_config state path =
+       let path =
+               match path with
+               | None -> state.vm_config_path
+               | Some path -> path
+               in
+       let cfg = Config.of_file state.vm_uuid (fun errors -> ()) path in
+       state.vm_next_cfg <- Some cfg
+
 let monitor_vm state =
        let xs = Xs.daemon_open () in
        let callback_introduce ctx id =
@@ -280,7 +289,9 @@ let monitor_vm state =
                                Vmact.change_vmstate state VmShutdown;
                        | ActionRestart  ->
                                Vmact.stop_vm xc xs state;
-                               Vmact.change_vmstate state VmShutdown;
+                               (* reread the configuration file before start to support graphics passthru
+                                 * setting changes between reboots *)
+                               reread_config state None; 
                                Vmact.start_vm xc xs state;
                        | ActionPreserve ->
                                ()
@@ -384,15 +395,6 @@ let monitor_vm state =
                        Thread.delay 1.
        done
 
-let reread_config state path =
-       let path =
-               match path with
-               | None -> state.vm_config_path
-               | Some path -> path
-               in
-       let cfg = Config.of_file state.vm_uuid (fun errors -> ()) path in
-       state.vm_next_cfg <- Some cfg
-
 let do_task state (task, args) =
        let optional_arg default f args s =
                try f args s with Tasks.Argument_not_found _ -> default