Skip to content

Commit baa6877

Browse files
committed
Remove redundant check for VM.appliance on VM.recover.
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 <[email protected]>
1 parent 08c6428 commit baa6877

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

ocaml/xapi/xapi_vm.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,12 +1257,6 @@ let assert_can_be_recovered ~__context ~self ~session_to =
12571257
Xapi_vm_helpers.assert_can_be_recovered ~__context ~self ~session_to
12581258

12591259
let recover ~__context ~self ~session_to ~force =
1260-
(* If a VM is part of an appliance, the appliance *)
1261-
(* should be recovered using VM_appliance.recover *)
1262-
let appliance = Db.VM.get_appliance ~__context ~self in
1263-
if appliance <> Ref.null then
1264-
raise (Api_errors.Server_error(Api_errors.vm_is_part_of_an_appliance,
1265-
[Ref.string_of self; Ref.string_of appliance]));
12661260
(* Check the VM SRs are available. *)
12671261
assert_can_be_recovered ~__context ~self ~session_to;
12681262
(* Attempt to recover the VM. *)

0 commit comments

Comments
 (0)