2017-05-26 14:30:34 +00:00
|
|
|
(* (c) 2017 Hannes Mehnert, all rights reserved *)
|
|
|
|
|
|
|
|
open Rresult
|
|
|
|
|
|
|
|
open Vmm_core
|
|
|
|
|
revise force-restart: now with wait for kill and resource cleanup before start
allows to cleanup various hacks, such as checking for pid in vmm_resources
or removing temporarily the allocated resources from the resource map in vmm_engine
semantics is now slightly different, but for sure enhanced.
- each VM has a Lwt.wait () task attached in Vmm_engine.t (tasks : 'c String.Map.t)
- normal create shouldn't be much different, apart from memoizing the sleeper
- after waitpid is done in vmmd, and vmm_engine.shutdown succeeded, Lwt.wakeup is called for the sleeper
- force create now:
- checks static policies
- looks for existing VM (and task), if present: kill and wait for task in vmmd
- continue with presence checking of vm name, dynamic policies, allocate resources (tap, img, fifo)
this means the whole randomness in filenames can be removed, and the
communication between vmm_console and vmm_client is working again (attach/detach
could not work since vmm_console knew only about "albatross.AAA.BBB.RANDOM",
whereas vmm_client insisted on "AAA.BBB"
resource overcommitment (and races in e.g. block device closing + opening) are
gone now, only if the old vm is cleanup up, resources for the new one are
allocated and it is executed
2018-04-04 23:02:45 +00:00
|
|
|
val prepare : vm_config -> (string list, [> R.msg ]) result
|
2017-05-26 14:30:34 +00:00
|
|
|
|
|
|
|
val shutdown : vm -> (unit, [> R.msg ]) result
|
|
|
|
|
2018-04-25 11:15:53 +00:00
|
|
|
val exec : vm_config -> string list -> (vm, [> R.msg ]) result
|
2017-05-26 14:30:34 +00:00
|
|
|
|
|
|
|
val destroy : vm -> unit
|
|
|
|
|
|
|
|
val close_no_err : Unix.file_descr -> unit
|
|
|
|
|
|
|
|
val create_tap : string -> (string, [> R.msg ]) result
|
|
|
|
|
|
|
|
val create_bridge : string -> (unit, [> R.msg ]) result
|