Skip to content

Commit

Permalink
Remove an unused function.
Browse files Browse the repository at this point in the history
This function wasn't being used as far back as George, so I think it's
safe to get rid of it.

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information
johnelse committed Nov 8, 2012
1 parent df292dc commit 2c0fbe1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
14 changes: 0 additions & 14 deletions ocaml/xapi/xapi_vm.ml
Expand Up @@ -717,20 +717,6 @@ let get_possible_hosts ~__context ~vm =
let get_allowed_VBD_devices ~__context ~vm = List.map (fun d -> string_of_int (Device_number.to_disk_number d)) (allowed_VBD_devices ~__context ~vm)
let get_allowed_VIF_devices = allowed_VIF_devices

(** Mark all currently-attached VBDs and VIFs as reserved, call some function and then
unmark them again. This allows us to (eg) safeguard them across reboot operations. *)
let reserve_vbds_and_vifs ~__context ~vm f =
let vbds = Db.VM.get_VBDs ~__context ~self:vm in
let vbds = List.filter (fun self -> try Db.VBD.get_currently_attached ~__context ~self with _ -> false) vbds in
let vifs = Db.VM.get_VIFs ~__context ~self:vm in
let vifs = List.filter (fun self -> try Db.VIF.get_currently_attached ~__context ~self with _ -> false) vifs in

let set_all value =
List.iter (fun self -> try Db.VBD.set_reserved ~__context ~self ~value with _ -> ()) vbds;
List.iter (fun self -> try Db.VIF.set_reserved ~__context ~self ~value with _ -> ()) vifs in
set_all true;
finally f (fun () -> set_all false)

(* Undocumented Rio message, deprecated in favour of standard VM.clone *)
let csvm ~__context ~vm =
Xapi_vm_clone.clone ~__context Xapi_vm_clone.Disk_op_clone ~vm
Expand Down
2 changes: 0 additions & 2 deletions ocaml/xapi/xapi_vm.mli
Expand Up @@ -200,8 +200,6 @@ val get_allowed_VBD_devices :
__context:Context.t -> vm:[ `VM ] Ref.t -> string list
val get_allowed_VIF_devices :
__context:Context.t -> vm:[ `VM ] Ref.t -> string list
val reserve_vbds_and_vifs :
__context:Context.t -> vm:[ `VM ] Ref.t -> (unit -> 'a) -> 'a
val csvm : __context:Context.t -> vm:API.ref_VM -> [ `VM ] Ref.t
val maximise_memory :
__context:Context.t ->
Expand Down

0 comments on commit 2c0fbe1

Please sign in to comment.