Skip to content

Commit

Permalink
Merge cd34eee into 01a87ac
Browse files Browse the repository at this point in the history
  • Loading branch information
sharady committed Aug 9, 2017
2 parents 01a87ac + cd34eee commit 83eef86
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ocaml/idl/datamodel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,15 @@ let vm_create_new_blob = call
~allowed_roles:_R_VM_POWER_ADMIN
()

let vm_set_bios_strings = call
~name: "set_bios_strings"
~in_product_since:rel_inverness
~doc:"Set custom BIOS strings to this VM"
~params:[Ref _vm, "self", "The VM to modify";
Map (String, String), "value", "The custom BIOS strings as a list of key-value pairs"]
~allowed_roles:_R_VM_ADMIN
()

let vm_copy_bios_strings = call
~name: "copy_bios_strings"
~in_product_since:rel_midnight_ride
Expand Down Expand Up @@ -7901,6 +7910,7 @@ let vm =
vm_assert_agile;
vm_update_snapshot_metadata;
vm_retrieve_wlb_recommendations;
vm_set_bios_strings;
vm_copy_bios_strings;
vm_set_protection_policy;
vm_set_snapshot_schedule;
Expand Down
4 changes: 4 additions & 0 deletions ocaml/xapi/message_forwarding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,10 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
let local_fn = Local.VM.s3_resume ~vm in
forward_vm_op ~local_fn ~__context ~vm (fun session_id rpc -> Client.VM.s3_resume rpc session_id vm)

let set_bios_strings ~__context ~self ~value =
info "VM.set_bios_strings: self = '%s'; value = '%s'" (vm_uuid ~__context self)
(String.concat "; " (List.map (fun (k,v) -> k ^ "=" ^ v) value));
Local.VM.set_bios_strings ~__context ~self ~value

let copy_bios_strings ~__context ~vm ~host =
info "VM.copy_bios_strings: VM = '%s'; host = '%s'" (vm_uuid ~__context vm) (host_uuid ~__context host);
Expand Down
3 changes: 3 additions & 0 deletions ocaml/xapi/xapi_vm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@ let s3_suspend ~__context ~vm = Xapi_xenops.s3suspend ~__context ~self:vm

let s3_resume ~__context ~vm = Xapi_xenops.s3resume ~__context ~self:vm

let set_bios_strings ~__context ~self ~value =
()

let copy_bios_strings = Xapi_vm_helpers.copy_bios_strings

let set_protection_policy ~__context ~self ~value =
Expand Down
3 changes: 2 additions & 1 deletion ocaml/xapi/xapi_vm.mli
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ val s3_suspend : __context:Context.t -> vm:API.ref_VM -> unit
val s3_resume : __context:Context.t -> vm:API.ref_VM -> unit

(** {2 BIOS strings} *)

val set_bios_strings :
__context:Context.t -> self:[ `VM ] Ref.t -> value:(string * string) list -> unit
val copy_bios_strings :
__context:Context.t -> vm:[ `VM ] Ref.t -> host:[ `host ] Ref.t -> unit
(** Copy the BIOS strings from a host to the VM, unless the VM's BIOS strings
Expand Down

0 comments on commit 83eef86

Please sign in to comment.