minor fixes from testing: do not require vm to be present for force-create, fix id generation in vmm_tls, use 32mb memory for unikernels by default
This commit is contained in:
parent
9191d2cf9a
commit
2b85c65dd8
|
@ -119,6 +119,10 @@ let cpu =
|
|||
let doc = "CPUid" in
|
||||
Arg.(value & opt int 0 & info [ "cpu" ] ~doc)
|
||||
|
||||
let vm_mem =
|
||||
let doc = "Memory to assign" in
|
||||
Arg.(value & opt int 32 & info [ "mem" ] ~doc)
|
||||
|
||||
let args =
|
||||
let doc = "Boot arguments" in
|
||||
Arg.(value & opt_all string [] & info [ "arg" ] ~doc)
|
||||
|
|
|
@ -197,7 +197,7 @@ let create_cmd =
|
|||
[`S "DESCRIPTION";
|
||||
`P "Creates a virtual machine."]
|
||||
in
|
||||
Term.(ret (const create $ setup_log $ destination $ ca_cert $ ca_key $ server_ca $ force $ vm_name $ image $ cpu $ mem $ args $ block $ net $ compress_level)),
|
||||
Term.(ret (const create $ setup_log $ destination $ ca_cert $ ca_key $ server_ca $ force $ vm_name $ image $ cpu $ vm_mem $ args $ block $ net $ compress_level)),
|
||||
Term.info "create" ~doc ~man
|
||||
|
||||
let console_cmd =
|
||||
|
|
|
@ -156,7 +156,7 @@ let create_cmd =
|
|||
[`S "DESCRIPTION";
|
||||
`P "Creates a virtual machine."]
|
||||
in
|
||||
Term.(ret (const create $ setup_log $ socket $ force $ vm_name $ image $ cpu $ mem $ args $ block $ net $ compress_level)),
|
||||
Term.(ret (const create $ setup_log $ socket $ force $ vm_name $ image $ cpu $ vm_mem $ args $ block $ net $ compress_level)),
|
||||
Term.info "create" ~doc ~man
|
||||
|
||||
let console_cmd =
|
||||
|
|
|
@ -121,7 +121,7 @@ let create_cmd =
|
|||
[`S "DESCRIPTION";
|
||||
`P "Creates a virtual machine."]
|
||||
in
|
||||
Term.(ret (const create $ setup_log $ force $ vm_name $ image $ cpu $ mem $ args $ block $ net $ compress_level)),
|
||||
Term.(ret (const create $ setup_log $ force $ vm_name $ image $ cpu $ vm_mem $ args $ block $ net $ compress_level)),
|
||||
Term.info "create" ~doc ~man
|
||||
|
||||
let console_cmd =
|
||||
|
|
|
@ -13,7 +13,7 @@ let cert_name cert =
|
|||
match Vmm_asn.cert_extension_of_cstruct data with
|
||||
| Error (`Msg _) -> Error (`Msg "couldn't parse albatross extension")
|
||||
| Ok (_, `Policy_cmd (`Policy_add _)) -> Error (`Msg "policy add may not have an empty name")
|
||||
| _ -> Ok (Some name)
|
||||
| _ -> Ok None
|
||||
else Ok (Some name)
|
||||
|
||||
let name chain =
|
||||
|
|
|
@ -158,7 +158,11 @@ let handle_command t (header, payload) =
|
|||
| `Vm_create vm_config ->
|
||||
handle_create t header vm_config
|
||||
| `Vm_force_create vm_config ->
|
||||
Vmm_resources.remove_vm t.resources id >>= fun resources ->
|
||||
let resources =
|
||||
match Vmm_resources.remove_vm t.resources id with
|
||||
| Error _ -> t.resources
|
||||
| Ok r -> r
|
||||
in
|
||||
if Vmm_resources.check_vm_policy resources id vm_config then
|
||||
begin match Vmm_resources.find_vm t.resources id with
|
||||
| None -> handle_create t header vm_config
|
||||
|
|
Loading…
Reference in a new issue