vmm_vmmd: introduce and use type 'a create
This commit is contained in:
parent
e58ab236b7
commit
4d3bb777e1
|
@ -70,6 +70,9 @@ type service_out = [
|
|||
|
||||
type out = [ service_out | `Data of Vmm_commands.wire ]
|
||||
|
||||
type 'a create =
|
||||
'a t -> ('a t * out list * Name.t * Unikernel.t, [ `Msg of string ]) result
|
||||
|
||||
let log t name event =
|
||||
let data = (Ptime_clock.now (), event) in
|
||||
let header = Vmm_commands.{ version = t.wire_version ; sequence = t.log_counter ; name } in
|
||||
|
|
|
@ -18,17 +18,18 @@ type service_out = [
|
|||
|
||||
type out = [ service_out | `Data of Vmm_commands.wire ]
|
||||
|
||||
type 'a create =
|
||||
'a t -> ('a t * out list * Name.t * Unikernel.t, [ `Msg of string ]) result
|
||||
|
||||
val handle_shutdown : 'a t -> Name.t -> Unikernel.t ->
|
||||
[ `Exit of int | `Signal of int | `Stop of int ] -> 'a t * out list
|
||||
|
||||
val handle_command : 'a t -> Vmm_commands.wire ->
|
||||
'a t * out list *
|
||||
[ `Create of 'a t -> ('a t * out list * Name.t * Unikernel.t, [> `Msg of string ]) result
|
||||
[ `Create of 'a create
|
||||
| `Loop
|
||||
| `End
|
||||
| `Wait of Name.t * out
|
||||
| `Wait_and_create of Name.t * ('a t -> 'a t * out list *
|
||||
[ `Create of 'a t -> ('a t * out list * Name.t * Unikernel.t, [> Rresult.R.msg ]) result
|
||||
| `End ]) ]
|
||||
| `Wait_and_create of Name.t * ('a t -> 'a t * out list * [ `Create of 'a create | `End ]) ]
|
||||
|
||||
val killall : 'a t -> bool
|
||||
|
|
Loading…
Reference in a new issue