(****************************************************************************************
*)
+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 =
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 ->
()
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