Skip to content

Commit

Permalink
Remove redundant check for VM.appliance on VM.recover.
Browse files Browse the repository at this point in the history
A user should not be allowed to call VM.recover if the VM is part of an
appliance. This is checked in message_forwarding.ml, so this check in
xapi_vm.ml is redundant and can be removed.

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information
johnelse committed Mar 23, 2011
1 parent 08c6428 commit baa6877
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ocaml/xapi/xapi_vm.ml
Expand Up @@ -1257,12 +1257,6 @@ let assert_can_be_recovered ~__context ~self ~session_to =
Xapi_vm_helpers.assert_can_be_recovered ~__context ~self ~session_to

let recover ~__context ~self ~session_to ~force =
(* If a VM is part of an appliance, the appliance *)
(* should be recovered using VM_appliance.recover *)
let appliance = Db.VM.get_appliance ~__context ~self in
if appliance <> Ref.null then
raise (Api_errors.Server_error(Api_errors.vm_is_part_of_an_appliance,
[Ref.string_of self; Ref.string_of appliance]));
(* Check the VM SRs are available. *)
assert_can_be_recovered ~__context ~self ~session_to;
(* Attempt to recover the VM. *)
Expand Down

0 comments on commit baa6877

Please sign in to comment.