From c3c0174b73cff11b5c4ee498fac390b0b565ecca Mon Sep 17 00:00:00 2001 From: Tomasz Wroblewski Date: Thu, 3 Dec 2009 12:18:34 +0000 Subject: [PATCH] Reboots are back to being handled by xenvm. But reread configuration file during reboot. --- xenvm/vmconfig.ml | 2 +- xenvm/xenvm.ml | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/xenvm/vmconfig.ml b/xenvm/vmconfig.ml index 3fd2ccf..af905e8 100644 --- a/xenvm/vmconfig.ml +++ b/xenvm/vmconfig.ml @@ -642,7 +642,7 @@ let empty = notify = NotifyNone; daemonize = false; on_halt = ActionDestroy; - on_restart = ActionPreserve; + on_restart = ActionRestart; on_crash = ActionDestroy; cpus_affinity = []; } diff --git a/xenvm/xenvm.ml b/xenvm/xenvm.ml index 8260ab6..8f48136 100644 --- a/xenvm/xenvm.ml +++ b/xenvm/xenvm.ml @@ -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 -- 2.39.5