Browse files

import: Add storage motion license check (disabled for now).

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information...
1 parent 94bfb8c commit 628817ac641dc0f0b2abaf63a4613b8da7e27199 @johnelse committed May 9, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 ocaml/xapi/import.ml
View
8 ocaml/xapi/import.ml
@@ -154,6 +154,11 @@ let assert_can_restore_backup rpc session_id (x: header) =
(List.map get_mac_seed all_vms)
let assert_can_live_import __context rpc session_id vm_record =
+ let assert_licensed () =
+ if (not (Pool_features.is_enabled ~__context Features.Storage_motion)) then
+ raise (Api_errors.Server_error(Api_errors.license_restriction, []))
+ in
+
let assert_memory_available () =
let host = Helpers.get_localhost ~__context in
let host_mem_available =
@@ -170,6 +175,9 @@ let assert_can_live_import __context rpc session_id vm_record =
Int64.to_string host_mem_available;
]))
in
+
+ (* TODO: enable this! *)
+ if false then assert_licensed ();
assert_memory_available ()
(* The signature for a set of functions which we must provide to be able to import an object type. *)

0 comments on commit 628817a

Please sign in to comment.