summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Krishnia-INTERN <nkrishnia@nvidia.com>2018-02-20 01:01:11 -0800
committerAaron Plattner <aplattner@nvidia.com>2018-03-14 16:50:54 -0700
commitdff02b94a33bc8b470f4efaefe08e7683e94ff00 (patch)
tree94046ae5a3d7beb5ae646c74c69e43d3cb5807cf
parent82ffaf9aad8bf05602a1a9e618eb563bf1f3bb66 (diff)
Set default License Status message to request license server details when QDWS is selected and license features are enabled.
Details: *On licensed setup, if license server details are modified through UI/gridd.conf and service is restarted, set default license status message to request license server details. *On failed attempt, handled the termination of license acquisition loop when vAPP is selected and license features are enabled on that system. Testing done: Verified on NMOS, correct license status message is displayed. Also, on failed attempt license acquisition loop stops when vAPP is selected.
-rw-r--r--src/gtk+-2.x/ctkgridlicense.c25
-rw-r--r--src/gtk+-2.x/ctkgridlicense.h1
2 files changed, 13 insertions, 13 deletions
diff --git a/src/gtk+-2.x/ctkgridlicense.c b/src/gtk+-2.x/ctkgridlicense.c
index e594f47..ced1406 100644
--- a/src/gtk+-2.x/ctkgridlicense.c
+++ b/src/gtk+-2.x/ctkgridlicense.c
@@ -121,7 +121,7 @@ static void update_gui_from_griddconfig(gpointer user_data);
static gboolean licenseStateQueryFailed = FALSE;
static void get_licensed_feature_code(gpointer user_data);
static gboolean is_restart_required(gpointer user_data);
-static gboolean isStateLicensed = FALSE;
+static gboolean queryLicensedFeatureCode = TRUE;
int64_t licensedFeatureCode = NV_GRID_LICENSE_FEATURE_TYPE_VAPP;
GType ctk_manage_grid_license_get_type(void)
@@ -795,6 +795,7 @@ static gboolean update_manage_grid_license_state_info(gpointer user_data)
ctk_manage_grid_license->gridd_feature_type = griddFeatureType;
if (licenseState == NV_GRID_UNLICENSED) {
+ queryLicensedFeatureCode = TRUE;
switch (ctk_manage_grid_license->feature_type) {
case NV_GRID_LICENSE_FEATURE_TYPE_VAPP:
licenseStatus = NV_GRID_UNLICENSED_VAPP;
@@ -804,6 +805,9 @@ static gboolean update_manage_grid_license_state_info(gpointer user_data)
break;
case NV_GRID_LICENSE_FEATURE_TYPE_QDWS:
licenseStatus = NV_GRID_UNLICENSED_QDWS_SELECTED;
+ if (licensedFeatureCode == NV_GRID_LICENSE_FEATURE_TYPE_QDWS) {
+ licenseStatus = NV_GRID_UNLICENSED_REQUEST_DETAILS;
+ }
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VGPU:
licenseStatus = NV_GRID_UNLICENSED_VGPU;
@@ -811,9 +815,6 @@ static gboolean update_manage_grid_license_state_info(gpointer user_data)
default:
break;
}
- if (ctk_manage_grid_license->feature_type != NV_GRID_LICENSE_FEATURE_TYPE_VGPU) {
- isStateLicensed = FALSE;
- }
}
else {
if ((licenseState == NV_GRID_LICENSED) ||
@@ -842,10 +843,9 @@ static gboolean update_manage_grid_license_state_info(gpointer user_data)
default:
break;
}
- if ((ctk_manage_grid_license->feature_type != NV_GRID_LICENSE_FEATURE_TYPE_VGPU) &&
- (isStateLicensed == FALSE)) {
+ if (queryLicensedFeatureCode == TRUE) {
get_licensed_feature_code(ctk_manage_grid_license);
- isStateLicensed = TRUE;
+ queryLicensedFeatureCode = FALSE;
}
}
else if (licenseState == NV_GRID_LICENSE_REQUESTING) {
@@ -978,8 +978,9 @@ static gboolean update_manage_grid_license_state_info(gpointer user_data)
case NV_GRID_LICENSE_RESTART_REQUIRED_VAPP:
licenseStatusMessage = "Restart your system for GRID Virtual Apps.";
break;
+ case NV_GRID_UNLICENSED_REQUEST_DETAILS:
default:
- licenseStatusMessage = "Your system does not have a valid GPU license.\n"
+ licenseStatusMessage = "Your system does not have a valid GRID license.\n"
"Enter license server details and apply.";
break;
}
@@ -998,9 +999,9 @@ static gboolean is_restart_required(gpointer user_data)
gboolean ret = FALSE;
/* Once licensed, system reboot required if there is mismatch between feature type
- fetched from nvidia-gridd and feature code of the feature that is licensed on this system. */
+ updated from UI/gridd.conf and feature code of the feature that is licensed on this system. */
if ((licensedFeatureCode) &&
- (licensedFeatureCode != ctk_manage_grid_license->gridd_feature_type)) {
+ (licensedFeatureCode != ctk_manage_grid_license->feature_type)) {
ret = TRUE;
}
return ret;
@@ -1784,9 +1785,7 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
/* Update GUI with information from the nvidia-gridd config file */
update_gui_from_griddconfig(ctk_manage_grid_license);
- if (ctk_manage_grid_license->feature_type != NV_GRID_LICENSE_FEATURE_TYPE_VGPU) {
- get_licensed_feature_code(ctk_manage_grid_license);
- }
+ get_licensed_feature_code(ctk_manage_grid_license);
/* Set the license feature type fetched from nvidia-gridd */
ctk_manage_grid_license->gridd_feature_type = ctk_manage_grid_license->feature_type;
diff --git a/src/gtk+-2.x/ctkgridlicense.h b/src/gtk+-2.x/ctkgridlicense.h
index a79ee35..42178dc 100644
--- a/src/gtk+-2.x/ctkgridlicense.h
+++ b/src/gtk+-2.x/ctkgridlicense.h
@@ -86,6 +86,7 @@ typedef enum
NV_GRID_LICENSE_EXPIRED_QDWS,
NV_GRID_LICENSE_RESTART_REQUIRED,
NV_GRID_LICENSE_RESTART_REQUIRED_VAPP,
+ NV_GRID_UNLICENSED_REQUEST_DETAILS, // Default case
} licenseStatus;
struct _CtkManageGridLicenseClass