From 9d9e7b2f24f0a854686211c58219255cd132fe29 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Fri, 14 Nov 2014 17:29:01 +0000 Subject: [PATCH] CP-10334: XenCenter work for the new changes in licensing Signed-off-by: Mihaela Stoica --- .../Dialogs/AssignLicenseDialog.Designer.cs | 37 +- XenAdmin/Dialogs/AssignLicenseDialog.cs | 25 +- XenAdmin/Dialogs/AssignLicenseDialog.resx | 327 +++++++----------- .../Dialogs/LicenseManager/LicenseStatus.cs | 2 + .../LicenseManagerSummaryDecorators.cs | 4 +- XenAdmin/TabPages/GeneralTabPage.cs | 6 +- XenModel/FriendlyNames.Designer.cs | 18 +- XenModel/FriendlyNames.resx | 10 +- XenModel/Messages.Designer.cs | 12 +- XenModel/Messages.resx | 6 +- XenModel/Utils/Helpers.cs | 4 +- XenModel/XenAPI-Extensions/Host.cs | 38 +- 12 files changed, 196 insertions(+), 293 deletions(-) diff --git a/XenAdmin/Dialogs/AssignLicenseDialog.Designer.cs b/XenAdmin/Dialogs/AssignLicenseDialog.Designer.cs index df5c2bc0a..948d8bc9e 100644 --- a/XenAdmin/Dialogs/AssignLicenseDialog.Designer.cs +++ b/XenAdmin/Dialogs/AssignLicenseDialog.Designer.cs @@ -47,11 +47,10 @@ namespace XenAdmin.Dialogs this.enterpriseRadioButton = new System.Windows.Forms.RadioButton(); this.platinumRadioButton = new System.Windows.Forms.RadioButton(); this.xenDesktopEnterpriseRadioButton = new System.Windows.Forms.RadioButton(); - this.enterprisePerSocketRadioButton = new System.Windows.Forms.RadioButton(); + this.desktopRadioButton = new System.Windows.Forms.RadioButton(); this.enterprisePerUserRadioButton = new System.Windows.Forms.RadioButton(); + this.enterprisePerSocketRadioButton = new System.Windows.Forms.RadioButton(); this.standardPerSocketRadioButton = new System.Windows.Forms.RadioButton(); - this.standardPerUserRadioButton = new System.Windows.Forms.RadioButton(); - this.xenDesktopPlatinumRadioButton = new System.Windows.Forms.RadioButton(); this.buttonsLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); this.mainLayoutPanel.SuspendLayout(); this.licenseServerLayoutPanel.SuspendLayout(); @@ -134,9 +133,8 @@ namespace XenAdmin.Dialogs this.editionLayoutPanel.Controls.Add(this.xenDesktopEnterpriseRadioButton); this.editionLayoutPanel.Controls.Add(this.enterprisePerSocketRadioButton); this.editionLayoutPanel.Controls.Add(this.enterprisePerUserRadioButton); + this.editionLayoutPanel.Controls.Add(this.desktopRadioButton); this.editionLayoutPanel.Controls.Add(this.standardPerSocketRadioButton); - this.editionLayoutPanel.Controls.Add(this.standardPerUserRadioButton); - this.editionLayoutPanel.Controls.Add(this.xenDesktopPlatinumRadioButton); this.editionLayoutPanel.Name = "editionLayoutPanel"; // // perSocketRadioButton @@ -171,11 +169,11 @@ namespace XenAdmin.Dialogs this.xenDesktopEnterpriseRadioButton.Name = "xenDesktopEnterpriseRadioButton"; this.xenDesktopEnterpriseRadioButton.UseVisualStyleBackColor = true; // - // enterprisePerSocketRadioButton + // desktopRadioButton // - resources.ApplyResources(this.enterprisePerSocketRadioButton, "enterprisePerSocketRadioButton"); - this.enterprisePerSocketRadioButton.Name = "enterprisePerSocketRadioButton"; - this.enterprisePerSocketRadioButton.UseVisualStyleBackColor = true; + resources.ApplyResources(this.desktopRadioButton, "desktopRadioButton"); + this.desktopRadioButton.Name = "desktopRadioButton"; + this.desktopRadioButton.UseVisualStyleBackColor = true; // // enterprisePerUserRadioButton // @@ -183,24 +181,18 @@ namespace XenAdmin.Dialogs this.enterprisePerUserRadioButton.Name = "enterprisePerUserRadioButton"; this.enterprisePerUserRadioButton.UseVisualStyleBackColor = true; // + // enterprisePerSocketRadioButton + // + resources.ApplyResources(this.enterprisePerSocketRadioButton, "enterprisePerSocketRadioButton"); + this.enterprisePerSocketRadioButton.Name = "enterprisePerSocketRadioButton"; + this.enterprisePerSocketRadioButton.UseVisualStyleBackColor = true; + // // standardPerSocketRadioButton // resources.ApplyResources(this.standardPerSocketRadioButton, "standardPerSocketRadioButton"); this.standardPerSocketRadioButton.Name = "standardPerSocketRadioButton"; this.standardPerSocketRadioButton.UseVisualStyleBackColor = true; // - // standardPerUserRadioButton - // - resources.ApplyResources(this.standardPerUserRadioButton, "standardPerUserRadioButton"); - this.standardPerUserRadioButton.Name = "standardPerUserRadioButton"; - this.standardPerUserRadioButton.UseVisualStyleBackColor = true; - // - // xenDesktopPlatinumRadioButton - // - resources.ApplyResources(this.xenDesktopPlatinumRadioButton, "xenDesktopPlatinumRadioButton"); - this.xenDesktopPlatinumRadioButton.Name = "xenDesktopPlatinumRadioButton"; - this.xenDesktopPlatinumRadioButton.UseVisualStyleBackColor = true; - // // buttonsLayoutPanel // resources.ApplyResources(this.buttonsLayoutPanel, "buttonsLayoutPanel"); @@ -252,8 +244,7 @@ namespace XenAdmin.Dialogs private System.Windows.Forms.RadioButton xenDesktopEnterpriseRadioButton; private System.Windows.Forms.RadioButton enterprisePerSocketRadioButton; private System.Windows.Forms.RadioButton enterprisePerUserRadioButton; - private System.Windows.Forms.RadioButton xenDesktopPlatinumRadioButton; - private System.Windows.Forms.RadioButton standardPerUserRadioButton; + private System.Windows.Forms.RadioButton desktopRadioButton; private System.Windows.Forms.RadioButton standardPerSocketRadioButton; } } \ No newline at end of file diff --git a/XenAdmin/Dialogs/AssignLicenseDialog.cs b/XenAdmin/Dialogs/AssignLicenseDialog.cs index e3a3cf1f3..9141f72a8 100644 --- a/XenAdmin/Dialogs/AssignLicenseDialog.cs +++ b/XenAdmin/Dialogs/AssignLicenseDialog.cs @@ -126,8 +126,7 @@ namespace XenAdmin.Dialogs enterprisePerSocketRadioButton.Visible = false; enterprisePerUserRadioButton.Visible = false; standardPerSocketRadioButton.Visible = false; - standardPerUserRadioButton.Visible = false; - xenDesktopPlatinumRadioButton.Visible = false; + desktopRadioButton.Visible = false; perSocketRadioButton.Checked = true; perSocketRadioButton.Text = String.Format(Messages.PERSOCKET_LICENSES_X_REQUIRED, xos.Sum(x => x.Connection.Cache.Hosts.Sum(h=>h.CpuSockets))); @@ -138,8 +137,7 @@ namespace XenAdmin.Dialogs enterprisePerSocketRadioButton.Visible = false; enterprisePerUserRadioButton.Visible = false; standardPerSocketRadioButton.Visible = false; - standardPerUserRadioButton.Visible = false; - xenDesktopPlatinumRadioButton.Visible = false; + desktopRadioButton.Visible = false; advancedRadioButton.Checked = true; } } @@ -156,7 +154,9 @@ namespace XenAdmin.Dialogs { case Host.Edition.XenDesktop: case Host.Edition.EnterpriseXD: - CheckRadioButtonIfVisible(xenDesktopEnterpriseRadioButton); + CheckRadioButtonIfVisible(xos.TrueForAll(x => Helpers.CreedenceOrGreater(x.Connection)) + ? desktopRadioButton + : xenDesktopEnterpriseRadioButton); break; case Host.Edition.Platinum: CheckRadioButtonIfVisible(platinumRadioButton); @@ -176,15 +176,9 @@ namespace XenAdmin.Dialogs case Host.Edition.EnterprisePerUser: CheckRadioButtonIfVisible(enterprisePerUserRadioButton); break; - case Host.Edition.XenDesktopPlatinum: - CheckRadioButtonIfVisible(xenDesktopPlatinumRadioButton); - break; case Host.Edition.StandardPerSocket: CheckRadioButtonIfVisible(standardPerSocketRadioButton); break; - case Host.Edition.StandardPerUser: - CheckRadioButtonIfVisible(standardPerUserRadioButton); - break; } } @@ -211,13 +205,10 @@ namespace XenAdmin.Dialogs if (enterprisePerUserRadioButton.Checked) return Host.Edition.EnterprisePerUser; - if (xenDesktopPlatinumRadioButton.Checked) - return Host.Edition.XenDesktopPlatinum; + if (desktopRadioButton.Checked) + return Host.Edition.XenDesktop; - if (standardPerSocketRadioButton.Checked) - return Host.Edition.StandardPerSocket; - - return Host.Edition.StandardPerUser; + return Host.Edition.StandardPerSocket; } private void okButton_Click(object sender, EventArgs e) diff --git a/XenAdmin/Dialogs/AssignLicenseDialog.resx b/XenAdmin/Dialogs/AssignLicenseDialog.resx index 00c8f4266..57f155ff7 100644 --- a/XenAdmin/Dialogs/AssignLicenseDialog.resx +++ b/XenAdmin/Dialogs/AssignLicenseDialog.resx @@ -198,6 +198,33 @@ 4 + + True + + + Fill + + + Segoe UI, 9pt + + + NoControl + + + 11, 8 + + + 84, 29 + + + 1 + + + &License Server: + + + MiddleLeft + licenseServerNameLabel @@ -210,6 +237,18 @@ 0 + + Segoe UI, 9pt + + + 101, 11 + + + 304, 23 + + + 2 + licenseServerNameTextBox @@ -222,6 +261,21 @@ 1 + + Segoe UI, 9pt + + + 427, 11 + + + 63, 23 + + + 4 + + + 27000 + licenseServerPortTextBox @@ -234,6 +288,30 @@ 2 + + None + + + True + + + Segoe UI, 9pt + + + NoControl + + + 411, 15 + + + 10, 15 + + + 3 + + + : + colonLabel @@ -511,7 +589,7 @@ 5 - XenServer &Enterprise Per-Socket + XenServer E&nterprise Per-Socket enterprisePerSocketRadioButton @@ -537,17 +615,14 @@ 7, 153 - - 0, 0, 0, 10 - - 180, 29 + 180, 19 6 - XenServer E&nterprise Per-User + XenServer &Enterprise Per-User enterprisePerUserRadioButton @@ -561,6 +636,39 @@ 6 + + True + + + Segoe UI, 9pt + + + NoControl + + + 7, 178 + + + 123, 19 + + + 9 + + + XenServer &Desktop + + + desktopRadioButton + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + editionLayoutPanel + + + 7 + True @@ -571,7 +679,7 @@ NoControl - 7, 188 + 7, 203 187, 19 @@ -592,77 +700,8 @@ editionLayoutPanel - 7 - - - True - - - Segoe UI, 9pt - - - NoControl - - - 7, 213 - - - 0, 0, 0, 10 - - - 175, 29 - - 8 - - XenServer S&tandard Per-User - - - standardPerUserRadioButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - editionLayoutPanel - - - 8 - - - True - - - Segoe UI, 9pt - - - NoControl - - - 7, 248 - - - 139, 19 - - - 9 - - - &XenDesktop Platinum - - - xenDesktopPlatinumRadioButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - editionLayoutPanel - - - 9 - Fill @@ -679,7 +718,7 @@ 4, 0, 4, 4 - 519, 274 + 519, 229 0 @@ -706,7 +745,7 @@ 11, 92 - 525, 296 + 525, 251 2 @@ -739,7 +778,7 @@ Segoe UI, 9pt - 350, 399 + 350, 354 3, 8, 3, 3 @@ -778,7 +817,7 @@ 6 - 547, 442 + 547, 397 0 @@ -798,132 +837,6 @@ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="licenseServerLayoutPanel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="mainLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="editionsGroupBox" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonsLayoutPanel" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,Absolute,20" /></TableLayoutSettings> - - True - - - Fill - - - Segoe UI, 9pt - - - NoControl - - - 11, 8 - - - 84, 29 - - - 1 - - - &License Server: - - - MiddleLeft - - - licenseServerNameLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - licenseServerLayoutPanel - - - 0 - - - Segoe UI, 9pt - - - 101, 11 - - - 304, 23 - - - 2 - - - licenseServerNameTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - licenseServerLayoutPanel - - - 1 - - - Segoe UI, 9pt - - - 427, 11 - - - 63, 23 - - - 4 - - - 27000 - - - licenseServerPortTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - licenseServerLayoutPanel - - - 2 - - - None - - - True - - - Segoe UI, 9pt - - - NoControl - - - 411, 15 - - - 10, 15 - - - 3 - - - : - - - colonLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - licenseServerLayoutPanel - - - 3 - True @@ -937,7 +850,7 @@ GrowAndShrink - 547, 442 + 547, 397 Segoe UI, 9pt diff --git a/XenAdmin/Dialogs/LicenseManager/LicenseStatus.cs b/XenAdmin/Dialogs/LicenseManager/LicenseStatus.cs index b4ad5fa31..705dbe732 100644 --- a/XenAdmin/Dialogs/LicenseManager/LicenseStatus.cs +++ b/XenAdmin/Dialogs/LicenseManager/LicenseStatus.cs @@ -329,6 +329,8 @@ namespace XenAdmin.Dialogs { if (XenObject.Connection.Cache.Hosts.All(h => h.EnterpriseFeaturesEnabled)) return Messages.LICENSE_SUPPORT_AND_ENTERPRISE_FEATURES_ENABLED; + if (XenObject.Connection.Cache.Hosts.All(h => h.DesktopFeaturesEnabled)) + return Messages.LICENSE_SUPPORT_AND_DESKTOP_FEATURES_ENABLED; if (XenObject.Connection.Cache.Hosts.All(h => h.EligibleForSupport)) return Messages.LICENSE_SUPPORT_AND_STANDARD_FEATURES_ENABLED; return Messages.LICENSE_NOT_ELIGIBLE_FOR_SUPPORT; diff --git a/XenAdmin/Dialogs/LicenseManager/SummaryPanelDecorators/LicenseManagerSummaryDecorators.cs b/XenAdmin/Dialogs/LicenseManager/SummaryPanelDecorators/LicenseManagerSummaryDecorators.cs index ab183fe39..7c257007c 100644 --- a/XenAdmin/Dialogs/LicenseManager/SummaryPanelDecorators/LicenseManagerSummaryDecorators.cs +++ b/XenAdmin/Dialogs/LicenseManager/SummaryPanelDecorators/LicenseManagerSummaryDecorators.cs @@ -66,7 +66,7 @@ namespace XenAdmin.Dialogs sb.AppendLine(Messages.LICENSE_MANAGER_SUMMARY_LICENSE_SERVER); linkArea.Start = sb.Length; sb.AppendLine(Row.LicenseServer); - linkArea.Length = Row.LicenseServerAddress.Length; + linkArea.Length = Row.LicenseServerAddress.ToLower() == "localhost" ? 0 : Row.LicenseServerAddress.Length; return sb.AppendLine(); } @@ -77,7 +77,7 @@ namespace XenAdmin.Dialogs public override string GetLink() { - if (String.IsNullOrEmpty(Row.LicenseServer)) + if (string.IsNullOrEmpty(Row.LicenseServer) || Row.LicenseServerAddress.ToLower() == "localhost") return string.Empty; return string.Format(Messages.LICENSE_SERVER_WEB_CONSOLE_FORMAT, Row.LicenseServerAddress, XenAPI.Host.LicenseServerWebConsolePort); diff --git a/XenAdmin/TabPages/GeneralTabPage.cs b/XenAdmin/TabPages/GeneralTabPage.cs index 33efd74b0..8a8b0a3c2 100644 --- a/XenAdmin/TabPages/GeneralTabPage.cs +++ b/XenAdmin/TabPages/GeneralTabPage.cs @@ -950,7 +950,7 @@ namespace XenAdmin.TabPages if (!string.IsNullOrEmpty(host.edition)) { - s.AddEntry(FriendlyName("host.edition"), FriendlyName(String.Format("host.edition-{0}", host.edition)) ?? String.Empty); + s.AddEntry(FriendlyName("host.edition"), Helpers.GetFriendlyLicenseName(host)); if (info.ContainsKey("sku_type")) { info.Remove("sku_type"); @@ -967,8 +967,8 @@ namespace XenAdmin.TabPages if (host.license_server.ContainsKey("address")) { - var licenseServerAddress = host.license_server["address"].Trim().ToLower(); - if (licenseServerAddress == "" || licenseServerAddress == "localhost") + var licenseServerAddress = host.license_server["address"].Trim(); + if (licenseServerAddress == "" || licenseServerAddress.ToLower() == "localhost") s.AddEntry(FriendlyName(String.Format("host.license_server-address")), host.license_server["address"]); else { diff --git a/XenModel/FriendlyNames.Designer.cs b/XenModel/FriendlyNames.Designer.cs index 2fba69849..f4e0b8694 100644 --- a/XenModel/FriendlyNames.Designer.cs +++ b/XenModel/FriendlyNames.Designer.cs @@ -726,6 +726,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Citrix XenServer Desktop Edition. + /// + public static string Label_host_edition_desktop { + get { + return ResourceManager.GetString("Label-host.edition-desktop", resourceCulture); + } + } + /// /// Looks up a localized string similar to Citrix XenServer Enterprise Edition. /// @@ -807,15 +816,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Citrix XenServer Standard Per User Edition. - /// - public static string Label_host_edition_standard_per_user { - get { - return ResourceManager.GetString("Label-host.edition-standard-per-user", resourceCulture); - } - } - /// /// Looks up a localized string similar to Citrix XenServer for XenDesktop. /// diff --git a/XenModel/FriendlyNames.resx b/XenModel/FriendlyNames.resx index afdcb443b..691bbfc7b 100644 --- a/XenModel/FriendlyNames.resx +++ b/XenModel/FriendlyNames.resx @@ -1705,7 +1705,7 @@ The license server is an out-of-date version. - + Citrix XenServer Enterprise Per Socket Edition @@ -1715,12 +1715,9 @@ Citrix XenServer Standard Per Socket Edition - - Citrix XenServer Standard Per User Edition - Citrix XenDesktop Platinum - + Help on Licensing @@ -1739,4 +1736,7 @@ Help on Licensing + + Citrix XenServer Desktop Edition + \ No newline at end of file diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index ea6599eca..ec005b181 100644 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -18024,6 +18024,16 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Eligible for support + ///Desktop features enabled. + /// + public static string LICENSE_SUPPORT_AND_DESKTOP_FEATURES_ENABLED { + get { + return ResourceManager.GetString("LICENSE_SUPPORT_AND_DESKTOP_FEATURES_ENABLED", resourceCulture); + } + } + /// /// Looks up a localized string similar to Eligible for support ///Enterprise features enabled. @@ -26884,7 +26894,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to '{0}': XenServer 6.2 requires new licenses to be added to your license server.. + /// Looks up a localized string similar to '{0}': New versions of XenServer require new licenses to be added to your license server.. /// public static string RPU_WARNING_DESCRIPTION_CLEARWATER_OR_GREATER { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 4720e2c7d..6a835d56b 100644 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -9336,7 +9336,7 @@ The master must be upgraded first, so if you skip the master, the rolling pool u Upgrading VMs using StorageLink Gateway to XenServer 6.0 is only supported if the VMs are shut down and using NetApp, Dell EqualLogic or SMI-S adapters. - '{0}': XenServer 6.2 requires new licenses to be added to your license server. + '{0}': New versions of XenServer require new licenses to be added to your license server. Checking licensing status @@ -12275,4 +12275,8 @@ Standard features only Go to... + + Eligible for support +Desktop features enabled + \ No newline at end of file diff --git a/XenModel/Utils/Helpers.cs b/XenModel/Utils/Helpers.cs index 6b4e1c490..bb6036309 100644 --- a/XenModel/Utils/Helpers.cs +++ b/XenModel/Utils/Helpers.cs @@ -854,7 +854,9 @@ namespace XenAdmin.Core if (string.IsNullOrEmpty(host.edition)) return Messages.UNKNOWN; - string name = PropertyManager.GetFriendlyName("Label-host.edition-" + host.edition); + string name = CreedenceOrGreater(host) && host.edition == "xendesktop" + ? PropertyManager.GetFriendlyName("Label-host.edition-desktop") + : PropertyManager.GetFriendlyName("Label-host.edition-" + host.edition); return name ?? Messages.UNKNOWN; } diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index 42dbbdbe0..5dc2bd523 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -53,12 +53,10 @@ namespace XenAPI Platinum, EnterpriseXD, PerSocket, //Added in Clearwater (PR-1589) - XenDesktop, //Added in Clearwater (PR-1589) and is new form of "EnterpriseXD" + XenDesktop, //Added in Clearwater (PR-1589) and is new form of "EnterpriseXD"; "Desktop Edition" in Creedence EnterprisePerSocket, // Added in Creedence (enterprise-per-socket) EnterprisePerUser, // Added in Creedence (enterprise-per-user) - XenDesktopPlatinum, // Added in Creedence (xendesktop-platinum) StandardPerSocket, // Added in Creedence (standard-per-socket) - StandardPerUser // Added in Creedence (standard-per-user) } public static string LicenseServerWebConsolePort = "8082"; @@ -92,12 +90,8 @@ namespace XenAPI return Edition.EnterprisePerSocket; case "enterprise-per-user": return Edition.EnterprisePerUser; - case "xendesktop-platinum": - return Edition.XenDesktopPlatinum; case "standard-per-socket": return Edition.StandardPerSocket; - case "standard-per-user": - return Edition.StandardPerUser; default: return Edition.Free; } @@ -141,12 +135,8 @@ namespace XenAPI return "enterprise-per-socket"; case Edition.EnterprisePerUser: return "enterprise-per-user"; - case Edition.XenDesktopPlatinum: - return "xendesktop-platinum"; case Edition.StandardPerSocket: return "standard-per-socket"; - case Edition.StandardPerUser: - return "standard-per-user"; default: return "free"; } @@ -427,14 +417,8 @@ namespace XenAPI return BoolKeyPreferTrue(license_params, "restrict_export_resource_data"); } // Pre-Creedence hosts: - // allowed on Per-Socket edition for Clearwater hosts and Advanced, Enterprise and Platinum editions for older hosts - var hostEdition = GetEdition(edition); - if (hostEdition == Edition.PerSocket || hostEdition == Edition.Advanced || - hostEdition == Edition.Enterprise || hostEdition == Edition.Platinum) - { - return LicenseExpiryUTC < DateTime.UtcNow - Connection.ServerTimeOffset; // restrict if the license has expired - } - return true; + // allowed on all non-expired editions except Free + return GetEdition(edition) == Edition.Free || LicenseExpiryUTC < DateTime.UtcNow - Connection.ServerTimeOffset; } } @@ -1381,7 +1365,16 @@ namespace XenAPI get { var hostEdition = GetEdition(edition); - return hostEdition == Edition.EnterprisePerSocket || hostEdition == Edition.EnterprisePerUser; + return EligibleForSupport && hostEdition == Edition.EnterprisePerSocket || hostEdition == Edition.EnterprisePerUser + || hostEdition == Edition.PerSocket; + } + } + + public bool DesktopFeaturesEnabled + { + get + { + return EligibleForSupport && GetEdition(edition) == Edition.XenDesktop; } } @@ -1389,10 +1382,7 @@ namespace XenAPI { get { - var hostEdition = GetEdition(edition); - return hostEdition == Edition.EnterprisePerSocket || hostEdition == Edition.EnterprisePerUser || - hostEdition == Edition.XenDesktopPlatinum || - hostEdition == Edition.StandardPerSocket || hostEdition == Edition.StandardPerUser; + return (Helpers.CreedenceOrGreater(this) && GetEdition(edition) != Edition.Free); } }