Commit 2f557912 authored by Nikita Krishnia-INTERN's avatar Nikita Krishnia-INTERN Committed by Aaron Plattner

Modified logic to update status/messages on 'Manage License Page' and rename...

Modified logic to update status/messages on 'Manage License Page' and rename "Tesla(unlicensed)" string to "GRID Virtual Apps"

Details:
- From nvidia-gridd, fetching license state from the state machine. Sending this
  license state instead of license status to nvidia-settings.
- According to license state and featureType fetched from nvidia-gridd, setting
  license status on nvidia-settings side.
- Updated all license status messages to latest reviewed strings.
- Renamed "Tesla(unlicensed)" string to "GRID Virtual Apps".
parent 2fb5615f
......@@ -52,7 +52,7 @@ static const char * __manage_grid_licenses_help =
"for GRID vGPU or Quadro Virtual Datacenter Workstation on supported Tesla products.";
static const char * __grid_virtual_workstation_help =
"Select this option to enable Quadro Virtual Datacenter Workstation license.";
static const char * __tesla_unlicensed_help =
static const char * __grid_vapp_help =
"Select this option to disable the Quadro Virtual Datacenter Workstation license.";
static const char * __license_edition_help =
"This section indicates the status of GRID licensing for the system.";
......@@ -413,17 +413,17 @@ static void UpdateGriddConfigFromGui(
nvfree(griddConfig->str[NV_GRIDD_FEATURE_TYPE]);
switch (ctk_manage_grid_license->feature_type) {
case GRID_LICENSED_FEATURE_TYPE_TESLA:
tmp = "0";
break;
case GRID_LICENSED_FEATURE_TYPE_VGPU:
tmp = "1";
break;
case GRID_LICENSED_FEATURE_TYPE_GVW:
tmp = "2";
break;
default:
tmp = "0";
case NV_GRID_LICENSE_FEATURE_TYPE_VAPP:
tmp = "0";
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VGPU:
tmp = "1";
break;
case NV_GRID_LICENSE_FEATURE_TYPE_QDWS:
tmp = "2";
break;
default:
tmp = "0";
}
griddConfig->str[NV_GRIDD_FEATURE_TYPE] = nvstrdup(tmp);
......@@ -730,138 +730,205 @@ done:
static gboolean update_manage_grid_license_state_info(gpointer user_data)
{
CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data);
gchar *licenseState = "";
gchar *licenseStatusMessage = "";
gboolean ret = TRUE;
int licenseStatus = NV_GRID_UNLICENSED;
int licenseFeatureType = GRID_LICENSED_FEATURE_TYPE_TESLA;
int licenseStatus = NV_GRID_UNLICENSED_VGPU;
int licenseState = NV_GRID_UNLICENSED;
int griddFeatureType = ctk_manage_grid_license->feature_type;
/* Send license state request */
if (!(send_message_to_gridd(ctk_manage_grid_license, LICENSE_STATE_REQUEST,
&licenseStatus))) {
&licenseState))) {
ret = FALSE;
}
/* Send license feature type request */
if (!(send_message_to_gridd(ctk_manage_grid_license, LICENSE_FEATURE_TYPE_REQUEST,
&licenseFeatureType))) {
ret = FALSE;
}
/* Set default unlicensed state string if could not communicate with nvidia-gridd */
if (licenseStatus == NV_GRID_UNLICENSED)
{
if (licenseState == NV_GRID_UNLICENSED) {
switch (ctk_manage_grid_license->feature_type) {
case GRID_LICENSED_FEATURE_TYPE_VGPU:
licenseStatus = NV_GRID_UNLICENSED_VGPU;
break;
case GRID_LICENSED_FEATURE_TYPE_TESLA:
case GRID_LICENSED_FEATURE_TYPE_GVW:
licenseStatus = NV_GRID_UNLICENSED_TESLA;
break;
default:
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VAPP:
licenseStatus = NV_GRID_UNLICENSED_VAPP;
break;
case NV_GRID_LICENSE_FEATURE_TYPE_QDWS:
licenseStatus = NV_GRID_UNLICENSED_QDWS_SELECTED;
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VGPU:
licenseStatus = NV_GRID_UNLICENSED_VGPU;
break;
default:
break;
}
}
/* Set correct status message when Quadro Virtual Datacenter Workstation
* checkbox selected */
if ((licenseStatus == NV_GRID_UNLICENSED_TESLA) &&
(ctk_manage_grid_license->feature_type == GRID_LICENSED_FEATURE_TYPE_GVW)) {
licenseStatus = NV_GRID_UNLICENSED_GVW_SELECTED;
}
/* Set correct status message when Tesla (unlicensed)
* checkbox selected */
if ((licenseStatus == NV_GRID_UNLICENSED_GVW_SELECTED) &&
(ctk_manage_grid_license->feature_type == GRID_LICENSED_FEATURE_TYPE_TESLA)) {
licenseStatus = NV_GRID_UNLICENSED_TESLA;
}
/* Set correct status message when Quadro Virtual Datacenter Workstation
* checkbox selected in licensed state.*/
if ((licenseStatus == NV_GRID_LICENSE_RESTART_REQUIRED) &&
(ctk_manage_grid_license->license_feature_type == GRID_LICENSED_FEATURE_TYPE_GVW)) {
licenseStatus = NV_GRID_LICENSE_ACQUIRED_GVW;
else {
/* Send license feature type request */
if (!(send_message_to_gridd(ctk_manage_grid_license, LICENSE_FEATURE_TYPE_REQUEST,
&griddFeatureType))) {
ret = FALSE;
}
/* Set the license feature type fetched from nvidia-gridd.*/
ctk_manage_grid_license->gridd_feature_type = griddFeatureType;
if ((licenseState == NV_GRID_LICENSED) ||
(licenseState == NV_GRID_LICENSE_RENEWING) ||
(licenseState == NV_GRID_LICENSE_RENEW_FAILED)) {
switch (ctk_manage_grid_license->feature_type) {
case NV_GRID_LICENSE_FEATURE_TYPE_VAPP:
licenseStatus = NV_GRID_LICENSE_ACQUIRED_QDWS; // Default status in licensed state on non-vGPU case
if (ctk_manage_grid_license->feature_type == ctk_manage_grid_license->gridd_feature_type) {
licenseStatus = NV_GRID_LICENSE_RESTART_REQUIRED;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_QDWS:
licenseStatus = NV_GRID_LICENSE_ACQUIRED_QDWS;
if (ctk_manage_grid_license->feature_type != ctk_manage_grid_license->gridd_feature_type) {
/* On licensed non-vGPU setup, mismatch in feature type fetched from nvidia-gridd service and
the feature type read from gridd.conf/UI controls indicates user has edited the feature type
directly in the gridd.conf file and hence those changes will not be reflected until the system
is rebooted. Set appropriate license status to indicate the same. */
licenseStatus = NV_GRID_LICENSE_RESTART_REQUIRED;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VGPU:
licenseStatus = NV_GRID_LICENSE_ACQUIRED_VGPU;
break;
default:
break;
}
}
else if (licenseState == NV_GRID_LICENSE_REQUESTING) {
switch (ctk_manage_grid_license->feature_type) {
case NV_GRID_LICENSE_FEATURE_TYPE_VAPP:
licenseStatus = NV_GRID_LICENSE_REQUESTING_QDWS; // Default status in license requesting state on non-vGPU case
if (ctk_manage_grid_license->feature_type == ctk_manage_grid_license->gridd_feature_type) {
licenseStatus = NV_GRID_UNLICENSED_VAPP;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_QDWS:
licenseStatus = NV_GRID_LICENSE_REQUESTING_QDWS;
if (ctk_manage_grid_license->feature_type != ctk_manage_grid_license->gridd_feature_type) {
/* On non-vGPU setup with license requesting state, mismatch in feature type fetched from nvidia-gridd service and
the feature type read from gridd.conf/UI controls indicates user has edited the feature type
directly in the gridd.conf file. So set appropriate license status message. */
licenseStatus = NV_GRID_UNLICENSED_QDWS_SELECTED;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VGPU:
licenseStatus = NV_GRID_LICENSE_REQUESTING_VGPU;
break;
default:
break;
}
}
else if (licenseState == NV_GRID_LICENSE_FAILED) {
switch (ctk_manage_grid_license->feature_type) {
case NV_GRID_LICENSE_FEATURE_TYPE_VAPP:
licenseStatus = NV_GRID_LICENSE_FAILED_QDWS; // Default status in license failed state on non-vGPU case
if (ctk_manage_grid_license->feature_type == ctk_manage_grid_license->gridd_feature_type) {
licenseStatus = NV_GRID_UNLICENSED_VAPP;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_QDWS:
licenseStatus = NV_GRID_LICENSE_FAILED_QDWS;
if (ctk_manage_grid_license->feature_type != ctk_manage_grid_license->gridd_feature_type) {
/* On non-vGPU setup with license failed state, mismatch in feature type fetched from nvidia-gridd service and
the feature type read from gridd.conf/UI controls indicates user has edited the feature type
directly in the gridd.conf file. So set appropriate license status message. */
licenseStatus = NV_GRID_UNLICENSED_QDWS_SELECTED;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VGPU:
licenseStatus = NV_GRID_LICENSE_FAILED_VGPU;
break;
default:
break;
}
}
else if (licenseState == NV_GRID_LICENSE_EXPIRED) {
switch (ctk_manage_grid_license->feature_type) {
case NV_GRID_LICENSE_FEATURE_TYPE_VAPP:
licenseStatus = NV_GRID_LICENSE_EXPIRED_QDWS; // Default status in license expired state on non-vGPU case
if (ctk_manage_grid_license->feature_type == ctk_manage_grid_license->gridd_feature_type) {
licenseStatus = NV_GRID_LICENSE_RESTART_REQUIRED;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_QDWS:
licenseStatus = NV_GRID_LICENSE_EXPIRED_QDWS;
if (ctk_manage_grid_license->feature_type != ctk_manage_grid_license->gridd_feature_type) {
/* On non-vGPU setup with expired license, mismatch in feature type fetched from nvidia-gridd service and
the feature type read from gridd.conf/UI controls indicates user has edited the feature type
directly in the gridd.conf file and hence those changes will not be reflected until the system
is rebooted. Set appropriate license status to indicate the same. */
licenseStatus = NV_GRID_LICENSE_RESTART_REQUIRED;
}
break;
case NV_GRID_LICENSE_FEATURE_TYPE_VGPU:
licenseStatus = NV_GRID_LICENSE_EXPIRED_VGPU;
break;
default:
break;
}
}
}
/* Show the message received */
switch (licenseStatus) {
case NV_GRID_UNLICENSED_VGPU:
licenseState = "Your system does not have a valid GRID vGPU license.\n"
licenseStatusMessage = "Your system does not have a valid GRID vGPU license.\n"
"Enter license server details and apply.";
break;
case NV_GRID_UNLICENSED_TESLA:
licenseState = "Your system is currently running on "
"Tesla (unlicensed).";
case NV_GRID_UNLICENSED_VAPP:
licenseStatusMessage = "Your system is currently configured for "
"GRID Virtual Apps.";
break;
case NV_GRID_UNLICENSED_GVW_SELECTED:
licenseState = "Your system is currently running on Tesla (unlicensed).\n"
case NV_GRID_UNLICENSED_QDWS_SELECTED:
licenseStatusMessage = "Your system is currently configured for GRID Virtual Apps.\n"
"Enter license server details and apply.";
break;
case NV_GRID_LICENSE_ACQUIRED_VGPU:
licenseState = "Your system is licensed for GRID vGPU.";
licenseStatusMessage = "Your system is licensed for GRID vGPU.";
break;
case NV_GRID_LICENSE_ACQUIRED_GVW:
licenseState = "Your system is licensed for Quadro Virtual Datacenter "
"Workstation Edition.";
case NV_GRID_LICENSE_ACQUIRED_QDWS:
licenseStatusMessage = "Your system is licensed for Quadro Virtual Datacenter "
"Workstation.";
break;
case NV_GRID_LICENSE_REQUESTING_VGPU:
licenseState = "Acquiring license for GRID vGPU Edition.\n"
licenseStatusMessage = "Acquiring license for GRID vGPU.\n"
"Your system does not have a valid GRID vGPU license.";
break;
case NV_GRID_LICENSE_REQUESTING_GVW:
licenseState = "Acquiring license for Quadro Virtual Datacenter "
"Workstation Edition.\n"
"Your system does not have a valid Quadro Virtual Datacenter "
"Workstation license.";
case NV_GRID_LICENSE_REQUESTING_QDWS:
licenseStatusMessage = "Acquiring license for Quadro Virtual Datacenter "
"Workstation.\n"
" Your system is currently configured for GRID Virtual Apps.";
break;
case NV_GRID_LICENSE_FAILED_VGPU:
licenseState = "Failed to acquire NVIDIA vGPU license.";
licenseStatusMessage = "Failed to acquire GRID vGPU license.";
break;
case NV_GRID_LICENSE_FAILED_GVW:
licenseState = "Failed to acquire NVIDIA Quadro Virtual Datacenter "
"Workstation license.";
case NV_GRID_LICENSE_FAILED_QDWS:
licenseStatusMessage = "Failed to acquire Quadro Virtual Datacenter "
"Worstation license.\n"
" Your system is currently configured for GRID Virtual Apps.";
break;
case NV_GRID_LICENSE_EXPIRED_VGPU:
licenseState = "Failed to renew license for GRID vGPU Edition.\n"
licenseStatusMessage = "GRID vGPU license has expired.\n"
"Your system does not have a valid GRID vGPU license.";
break;
case NV_GRID_LICENSE_EXPIRED_GVW:
licenseState = "License for Quadro Virtual Datacenter Workstation "
case NV_GRID_LICENSE_EXPIRED_QDWS:
licenseStatusMessage = "License for Quadro Virtual Datacenter Workstation "
"has expired.\n"
"Your system does not have a valid Quadro Virtual Datacenter "
"Workstation license.";
break;
case NV_GRID_LICENSE_RESTART_REQUIRED:
licenseState = "Restart your system for Tesla Edition.\n"
"Your system is currently running Quadro Virtual Datacenter "
"Workstation Edition.";
licenseStatusMessage = "Restart your system for GRID Virtual Apps.\n"
"Your system is currently licensed for Quadro Virtual Datacenter "
"Workstation.";
break;
default:
licenseState = "Your system does not have a valid GPU license.\n"
licenseStatusMessage = "Your system does not have a valid GPU license.\n"
"Enter license server details and apply.";
break;
}
ctk_manage_grid_license->license_status = licenseStatus;
switch (licenseFeatureType) {
case NV_GRID_LICENSED_FEATURE_TYPE_TESLA:
licenseFeatureType = GRID_LICENSED_FEATURE_TYPE_TESLA;
break;
case NV_GRID_LICENSED_FEATURE_TYPE_VGPU:
licenseFeatureType = GRID_LICENSED_FEATURE_TYPE_VGPU;
break;
case NV_GRID_LICENSED_FEATURE_TYPE_GVW:
licenseFeatureType = GRID_LICENSED_FEATURE_TYPE_GVW;
break;
default:
break;
}
ctk_manage_grid_license->license_feature_type = licenseFeatureType;
gtk_label_set_text(GTK_LABEL(ctk_manage_grid_license->label_license_state),
licenseState);
licenseStatusMessage);
return ret;
}
......@@ -975,7 +1042,7 @@ static void license_edition_toggled(GtkWidget *widget, gpointer user_data)
{
CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data);
gboolean enabled;
gchar *licenseState = "";
gchar *statusBarMsg = "";
NvGriddConfigParams *griddConfig;
const char *textBoxServerStr, *textBoxServerPortStr, *textBoxSecondaryServerStr, *textBoxSecondaryServerPortStr;
......@@ -996,11 +1063,11 @@ static void license_edition_toggled(GtkWidget *widget, gpointer user_data)
}
user_data = g_object_get_data(G_OBJECT(widget), "button_id");
if (GPOINTER_TO_INT(user_data) == GRID_LICENSED_FEATURE_TYPE_GVW) {
if (GPOINTER_TO_INT(user_data) == NV_GRID_LICENSE_FEATURE_TYPE_QDWS) {
gtk_widget_set_sensitive(ctk_manage_grid_license->box_server_info, TRUE);
licenseState = "You selected Quadro Virtual Datacenter Workstation Edition.";
statusBarMsg = "You selected Quadro Virtual Datacenter Workstation Edition.";
ctk_manage_grid_license->feature_type =
GRID_LICENSED_FEATURE_TYPE_GVW;
NV_GRID_LICENSE_FEATURE_TYPE_QDWS;
/* Enable Apply/Cancel button if the feature type selection has changed*/
if (strcmp(griddConfig->str[NV_GRIDD_FEATURE_TYPE], "2") != 0) {
/* Disable Apply/Cancel button if Primary server address textbox string is empty. */
......@@ -1026,12 +1093,11 @@ static void license_edition_toggled(GtkWidget *widget, gpointer user_data)
}
}
} else if (GPOINTER_TO_INT(user_data) == GRID_LICENSED_FEATURE_TYPE_TESLA) {
} else if (GPOINTER_TO_INT(user_data) == NV_GRID_LICENSE_FEATURE_TYPE_VAPP) {
gtk_widget_set_sensitive(ctk_manage_grid_license->box_server_info, FALSE);
/* force unlicensed mode */
ctk_manage_grid_license->feature_type =
GRID_LICENSED_FEATURE_TYPE_TESLA;
licenseState = "You selected Tesla (Unlicensed) mode.";
NV_GRID_LICENSE_FEATURE_TYPE_VAPP;
statusBarMsg = "You selected GRID Virtual Apps Edition.";
/* Enable Apply/Cancel button if the feature type selection has changed*/
if (strcmp(griddConfig->str[NV_GRIDD_FEATURE_TYPE], "0") != 0) {
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_apply, TRUE);
......@@ -1053,7 +1119,8 @@ static void license_edition_toggled(GtkWidget *widget, gpointer user_data)
}
/* update status bar message */
ctk_config_statusbar_message(ctk_manage_grid_license->ctk_config,
"%s", licenseState);
"%s", statusBarMsg);
update_manage_grid_license_state_info(ctk_manage_grid_license);
FreeNvGriddConfigParams(griddConfig);
}
......@@ -1273,7 +1340,7 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
}
/* GRID M6 is licensable gpu so we want to allow users to choose
* Quadro Virtual Datacenter Workstation and Unlicensed Tesla mode on baremetal setup.
* Quadro Virtual Datacenter Workstation and GRID Virtual Apps on baremetal setup.
* When virtualization mode is NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_NONE
* treat it same way like NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH.
* So that it will show the Quadro Virtual Datacenter Workstation interface in case of
......@@ -1332,25 +1399,26 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
ctk_manage_grid_license->license_edition_state = mode;
ctk_manage_grid_license->dbusData = dbusData;
ctk_manage_grid_license->feature_type = 0;
ctk_manage_grid_license->license_status = 0;
/* set default value for feature type based on the user configured parameter or virtualization mode */
if (griddConfig) {
/* Check Feature type "2" for Quadro Virtual Datacenter Workstation. */
if (strcmp(griddConfig->str[NV_GRIDD_FEATURE_TYPE], "2") == 0) {
ctk_manage_grid_license->feature_type = GRID_LICENSED_FEATURE_TYPE_GVW;
ctk_manage_grid_license->feature_type = NV_GRID_LICENSE_FEATURE_TYPE_QDWS;
}
else {
ctk_manage_grid_license->feature_type = GRID_LICENSED_FEATURE_TYPE_TESLA;
ctk_manage_grid_license->feature_type = NV_GRID_LICENSE_FEATURE_TYPE_VAPP;
}
}
/* Overwrite feature type in vGPU case */
if (ctk_manage_grid_license->license_edition_state == NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_VGPU)
{
ctk_manage_grid_license->feature_type = GRID_LICENSED_FEATURE_TYPE_VGPU;
ctk_manage_grid_license->feature_type = NV_GRID_LICENSE_FEATURE_TYPE_VGPU;
}
ctk_manage_grid_license->gridd_feature_type = ctk_manage_grid_license->feature_type;
/* set container properties for the CtkManageGridLicense widget */
gtk_box_set_spacing(GTK_BOX(ctk_manage_grid_license), 5);
......@@ -1402,15 +1470,15 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
slist = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button1));
gtk_box_pack_start(GTK_BOX(vbox3), button1, FALSE, FALSE, 0);
g_object_set_data(G_OBJECT(button1), "button_id",
GINT_TO_POINTER(GRID_LICENSED_FEATURE_TYPE_GVW));
GINT_TO_POINTER(NV_GRID_LICENSE_FEATURE_TYPE_QDWS));
g_signal_connect(G_OBJECT(button1), "toggled",
G_CALLBACK(license_edition_toggled),
(gpointer) ctk_manage_grid_license);
button2 = gtk_radio_button_new_with_label(slist, "Tesla (Unlicensed)");
button2 = gtk_radio_button_new_with_label(slist, "GRID Virtual Apps");
gtk_box_pack_start(GTK_BOX(vbox3), button2, FALSE, FALSE, 0);
g_object_set_data(G_OBJECT(button2), "button_id",
GINT_TO_POINTER(GRID_LICENSED_FEATURE_TYPE_TESLA));
GINT_TO_POINTER(NV_GRID_LICENSE_FEATURE_TYPE_VAPP));
g_signal_connect(G_OBJECT(button2), "toggled",
G_CALLBACK(license_edition_toggled),
......@@ -1612,12 +1680,12 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
/* Set license edition toggle button active */
if (button2 && button1) {
if (ctk_manage_grid_license->feature_type == GRID_LICENSED_FEATURE_TYPE_GVW) {
if (ctk_manage_grid_license->feature_type == NV_GRID_LICENSE_FEATURE_TYPE_QDWS) {
/* Set 'Quadro Virtual Datacenter Workstation' toggle button active */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button1), TRUE);
}
else {
/* Set 'Tesla (unlicensed)' toggle button active */
/* Set 'GRID Virtual Apps' toggle button active */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button2), TRUE);
}
}
......@@ -1634,21 +1702,13 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
update_manage_grid_license_state_info(ctk_manage_grid_license);
/* Enable Apply/Cancel button if user edits feature type from nvidia-gridd in all license states except unlicensed state. */
if ((ctk_manage_grid_license->license_status != NV_GRID_UNLICENSED_TESLA) || (ctk_manage_grid_license->license_status != NV_GRID_UNLICENSED_GVW_SELECTED ))
{
int featureType = atoi(griddConfig->str[NV_GRIDD_FEATURE_TYPE]);
if (featureType != ctk_manage_grid_license->license_feature_type) {
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_apply, TRUE);
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_cancel, TRUE);
}
else {
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_apply, FALSE);
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_cancel, FALSE);
}
/* Enable Apply/Cancel button if there is mismatch between feature type fetched from nvidia-gridd
and feature type updated from UI/gridd.conf. */
if (ctk_manage_grid_license->feature_type != ctk_manage_grid_license->gridd_feature_type) {
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_apply, TRUE);
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_cancel, TRUE);
}
else {
/* Disable Apply/Cancel button. */
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_apply, FALSE);
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_cancel, FALSE);
}
......@@ -1681,8 +1741,8 @@ GtkTextBuffer *ctk_manage_grid_license_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "Quadro Virtual Datacenter Workstation");
ctk_help_para(b, &i, "%s", __grid_virtual_workstation_help);
ctk_help_heading(b, &i, "Tesla (Unlicensed)");
ctk_help_para(b, &i, "%s", __tesla_unlicensed_help);
ctk_help_heading(b, &i, "GRID Virtual Apps");
ctk_help_para(b, &i, "%s", __grid_vapp_help);
}
ctk_help_heading(b, &i, "License Server");
......
......@@ -20,11 +20,6 @@
#ifndef __CTK_MANAGE_GRID_LICENSE_H__
#define __CTK_MANAGE_GRID_LICENSE_H__
// Licensed feature types
#define GRID_LICENSED_FEATURE_TYPE_TESLA 0
#define GRID_LICENSED_FEATURE_TYPE_VGPU 1
#define GRID_LICENSED_FEATURE_TYPE_GVW 2
G_BEGIN_DECLS
#define CTK_TYPE_MANAGE_GRID_LICENSE (ctk_manage_grid_license_get_type())
......@@ -66,11 +61,29 @@ struct _CtkManageGridLicense
DbusData *dbusData;
gint license_edition_state;
gint feature_type;
int license_status;
int license_feature_type;
gint feature_type; // Feature type from UI/gridd.conf.
int gridd_feature_type; // Feature type fetched from nvidia-gridd.
};
/*
* Status related to GRID licensing
*/
typedef enum
{
NV_GRID_UNLICENSED_VGPU = 0,
NV_GRID_UNLICENSED_VAPP,
NV_GRID_UNLICENSED_QDWS_SELECTED,
NV_GRID_LICENSE_ACQUIRED_VGPU,
NV_GRID_LICENSE_ACQUIRED_QDWS,
NV_GRID_LICENSE_REQUESTING_VGPU,
NV_GRID_LICENSE_REQUESTING_QDWS,
NV_GRID_LICENSE_FAILED_VGPU,
NV_GRID_LICENSE_FAILED_QDWS,
NV_GRID_LICENSE_EXPIRED_VGPU,
NV_GRID_LICENSE_EXPIRED_QDWS,
NV_GRID_LICENSE_RESTART_REQUIRED,
} licenseStatus;
struct _CtkManageGridLicenseClass
{
GtkVBoxClass parent_class;
......
......@@ -33,33 +33,27 @@
#define LICENSE_FEATURE_TYPE_REQUEST 3
/*
* List of grid license states
* GRID license states
*/
typedef enum
{
NV_GRID_UNLICENSED = 0, // Your system does not have a valid GPU license. Enter license server details and apply.
NV_GRID_UNLICENSED_VGPU, // Your system does not have a valid vGPU license. Enter license server details and apply.
NV_GRID_UNLICENSED_TESLA, // Your system is currently running on Tesla (unlicensed).
NV_GRID_UNLICENSED_GVW_SELECTED, // Your system is currently running on Tesla (unlicensed). Enter license server details and apply.
NV_GRID_LICENSE_ACQUIRED_VGPU, // Your system is licensed for GRID vGPU.
NV_GRID_LICENSE_ACQUIRED_GVW, // Your system is licensed for Quadro Virtual Datacenter Workstation Edition.
NV_GRID_LICENSE_REQUESTING_VGPU, // Acquiring license for GRID vGPU Edition. Your system does not have a valid GRID vGPU license.
NV_GRID_LICENSE_REQUESTING_GVW, // Acquiring license for Quadro Virtual Datacenter Workstation Edition. Your system does not have a valid Quadro Virtual Datacenter Workstation license.
NV_GRID_LICENSE_FAILED_VGPU, // Failed to acquire NVIDIA vGPU license.
NV_GRID_LICENSE_FAILED_GVW, // Failed to acquire NVIDIA Quadro Virtual Datacenter Workstation license.
NV_GRID_LICENSE_EXPIRED_VGPU, // Failed to renew license for GRID vGPU Edition. Your system does not have a valid GRID vGPU license.
NV_GRID_LICENSE_EXPIRED_GVW, // License for Quadro Virtual Datacenter Workstation has expired. Your system does not have a valid Quadro Virtual Datacenter Workstation license.
NV_GRID_LICENSE_RESTART_REQUIRED, // Restart your system for Tesla Edition. Your system is currently running Quadro Virtual Datacenter Workstation Edition.
} gridLicenseStatus;
NV_GRID_UNLICENSED = 0,
NV_GRID_LICENSE_REQUESTING,
NV_GRID_LICENSE_FAILED,
NV_GRID_LICENSED,
NV_GRID_LICENSE_RENEWING,
NV_GRID_LICENSE_RENEW_FAILED,
NV_GRID_LICENSE_EXPIRED,
} gridLicenseState;
/*
* List of grid license feature types
* GRID license feature types
*/
typedef enum
{
NV_GRID_LICENSED_FEATURE_TYPE_TESLA = 0,
NV_GRID_LICENSED_FEATURE_TYPE_VGPU,
NV_GRID_LICENSED_FEATURE_TYPE_GVW,
NV_GRID_LICENSE_FEATURE_TYPE_VAPP = 0,
NV_GRID_LICENSE_FEATURE_TYPE_VGPU,
NV_GRID_LICENSE_FEATURE_TYPE_QDWS,
} gridLicenseFeatureType;
#endif // _NVIDIA_NV_GRID_DBUS_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment