]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add vmx option tip for record control
authorYiwen Zhang <yizhang@vmware.com>
Tue, 9 Sep 2008 07:33:11 +0000 (15:33 +0800)
committerAdar Dembo <adar@vmware.com>
Thu, 18 Sep 2008 01:46:00 +0000 (18:46 -0700)
 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

open-vm-tools/toolbox/toolboxInt.h
open-vm-tools/toolbox/toolboxRecord.c
open-vm-tools/toolbox/toolboxcmd-record.c

index 65a86f12edfd5e2f6325240c57a201809a878f2a..0420f8e2ffadcd28c5c9953fccc19ce9b60c1370 100644 (file)
@@ -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_*/
index e8c0dde1b25ef347af62e8855d38573a0d5ad3c0..f5ef1fd9e07bf54415c82c752610dbd75af282cd 100644 (file)
@@ -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);
+   }
 }
 
index 92527fe5423c913e2e58ba3fe5dbf6e8c43307b7..aa48f8a7d29e4aa405415ed52065dd5596f5e0ff 100644 (file)
 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;
+   }
 }