From: Yiwen Zhang Date: Tue, 9 Sep 2008 07:33:11 +0000 (+0800) Subject: Add vmx option tip for record control X-Git-Tag: 2008.10.10-123053~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16d18d8323da1f80485abdb7425a012bce679c29;p=thirdparty%2Fopen-vm-tools.git Add vmx option tip for record control Once the recording control option from vm is not set, the toolbox command line and gtk application will give message to user that they should add the option. testing done:sandbox --- diff --git a/open-vm-tools/toolbox/toolboxInt.h b/open-vm-tools/toolbox/toolboxInt.h index 65a86f12e..0420f8e2f 100644 --- a/open-vm-tools/toolbox/toolboxInt.h +++ b/open-vm-tools/toolbox/toolboxInt.h @@ -55,5 +55,8 @@ "enabled while the host believes it is disabled. " \ "Please close and reopen the Toolbox to synchronize " \ "it with the host.\n" +#define RECORD_VMX_DISABLED "Error, this operation is prevented by current vmx setting.\n" \ + "To enable it, add the following option to your vmx file:\n\n" \ + " isolation.tools.stateLoggerControl.disable = \"FALSE\"\n" \ #endif /*_TOOLBOX_INT_H_*/ diff --git a/open-vm-tools/toolbox/toolboxRecord.c b/open-vm-tools/toolbox/toolboxRecord.c index e8c0dde1b..f5ef1fd9e 100644 --- a/open-vm-tools/toolbox/toolboxRecord.c +++ b/open-vm-tools/toolbox/toolboxRecord.c @@ -117,7 +117,9 @@ static void RecordOnStart(gpointer btn, // IN: unused gpointer data) // IN: unused { - GuestApp_ControlRecord(1); + if (GuestApp_ControlRecord(1) == FALSE) { + ToolsMain_MsgBox(NULL, RECORD_VMX_DISABLED); + } } @@ -142,6 +144,8 @@ static void RecordOnStop(gpointer btn, // IN: unused gpointer data) // IN: unused { - GuestApp_ControlRecord(2); + if (GuestApp_ControlRecord(2)) { + ToolsMain_MsgBox(NULL, RECORD_VMX_DISABLED); + } } diff --git a/open-vm-tools/toolbox/toolboxcmd-record.c b/open-vm-tools/toolbox/toolboxcmd-record.c index 92527fe54..aa48f8a7d 100644 --- a/open-vm-tools/toolbox/toolboxcmd-record.c +++ b/open-vm-tools/toolbox/toolboxcmd-record.c @@ -44,7 +44,12 @@ Bool Record_StartRecording(void) { - return GuestApp_ControlRecord(1); + if (GuestApp_ControlRecord(1) == TRUE) { + return TRUE; + } else { + fprintf(stderr, RECORD_VMX_DISABLED); + return FALSE; + } } @@ -67,6 +72,11 @@ Record_StartRecording(void) Bool Record_StopRecording(void) { - return GuestApp_ControlRecord(2); + if (GuestApp_ControlRecord(2) == FALSE) { + return TRUE; + } else { + fprintf(stderr, RECORD_VMX_DISABLED); + return FALSE; + } }