CP-15408: Add license restriction for VM migration

Cherry picked from cream-indigo:
CP-14848: XenCenter: Implement license restriction for migration
Signed-off-by: Cheng Zhang <cheng.zhang@citrix.com>
This commit is contained in:
Cheng Zhang 2015-11-24 16:29:45 +08:00 committed by Mihaela Stoica
parent 2b03930baa
commit ea690581d0
2 changed files with 14 additions and 0 deletions

View File

@ -89,6 +89,10 @@ namespace XenAdmin.Commands
private static bool CanExecute(VM vm)
{
if (vm.Connection != null && vm.Connection.IsConnected)
if (Helpers.FeatureForbidden(vm.Connection, Host.RestrictInterPoolMigrate))
return false;
if (vm != null && !vm.is_a_template && !vm.Locked)
{
if(Helpers.TampaOrGreater(vm.Connection))

View File

@ -426,6 +426,16 @@ namespace XenAPI
return h._RestrictExportResourceData;
}
private bool _RestrictInterPoolMigrate
{
get { return BoolKeyPreferTrue(license_params, "restrict_xen_motion"); }
}
public static bool RestrictInterPoolMigrate(Host h)
{
return h._RestrictInterPoolMigrate;
}
private bool _RestrictReadCaching
{
get { return BoolKeyPreferTrue(license_params, "restrict_read_caching"); }