Changeset 39988 in vbox
- Timestamp:
- Feb 3, 2012 4:23:24 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 76098
- Location:
- trunk/src/VBox/Frontends/VBoxBalloonCtrl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp
r39986 r39988 60 60 using namespace com; 61 61 62 #define VBOX_MOD_APIMON ITOR_NAME "apimonitor"62 #define VBOX_MOD_APIMON_NAME "apimon" 63 63 64 64 /** 65 65 * The module's RTGetOpt-IDs for the command line. 66 66 */ 67 enum GETOPTDEF_APIMONITOR 68 { 69 GETOPTDEF_APIMONITOR_GROUPS = 1000, 67 enum GETOPTDEF_APIMON 68 { 69 GETOPTDEF_APIMON_ISLN_RESPONSE = 1000, 70 GETOPTDEF_APIMON_ISLN_TIMEOUT, 71 GETOPTDEF_APIMON_GROUPS 70 72 }; 71 73 … … 74 76 */ 75 77 static const RTGETOPTDEF g_aAPIMonitorOpts[] = { 76 { "--apimonitor-groups", GETOPTDEF_APIMONITOR_GROUPS, RTGETOPT_REQ_STRING } 78 { "--apimon-isln-response", GETOPTDEF_APIMON_ISLN_RESPONSE, RTGETOPT_REQ_STRING }, 79 { "--apimon-isln-timeout", GETOPTDEF_APIMON_ISLN_TIMEOUT, RTGETOPT_REQ_UINT32 }, 80 { "--apimon-groups", GETOPTDEF_APIMON_GROUPS, RTGETOPT_REQ_STRING } 77 81 }; 82 83 static unsigned long g_ulAPIMonIslnTimeoutMS = 0; 84 static Bstr g_strAPIMonGroups; 85 static Bstr g_strAPIMonIslnCmdResp; 78 86 79 87 /* Callbacks. */ … … 105 113 switch (c) 106 114 { 107 case GETOPTDEF_APIMONITOR_GROUPS: 115 case GETOPTDEF_APIMON_ISLN_RESPONSE: 116 break; 117 118 case GETOPTDEF_APIMON_ISLN_TIMEOUT: 119 g_ulAPIMonIslnTimeoutMS = ValueUnion.u32; 120 if (g_ulAPIMonIslnTimeoutMS < 1000) 121 g_ulAPIMonIslnTimeoutMS = 1000; 122 break; 123 124 case GETOPTDEF_APIMON_GROUPS: 108 125 break; 109 126 … … 119 136 static DECLCALLBACK(int) VBoxModAPIMonitorInit(void) 120 137 { 121 return VINF_SUCCESS; /* Nothing to do here right now. */ 138 HRESULT rc = S_OK; 139 140 do 141 { 142 Bstr bstrValue; 143 144 /* Host isolation timeout (in ms). */ 145 if (!g_ulAPIMonIslnTimeoutMS) /* Not set by command line? */ 146 { 147 CHECK_ERROR_BREAK(g_pVirtualBox, GetExtraData(Bstr("VBoxInternal2/Watchdog/APIMonitor/IsolationTimeout").raw(), 148 bstrValue.asOutParam())); 149 g_ulAPIMonIslnTimeoutMS = Utf8Str(bstrValue).toUInt32(); 150 } 151 if (!g_ulAPIMonIslnTimeoutMS) 152 { 153 /* Default is 30 seconds timeout. */ 154 g_ulAPIMonIslnTimeoutMS = 30 * 1000; 155 } 156 157 /* VM groups to watch for. */ 158 if (g_strAPIMonGroups.isEmpty()) /* Not set by command line? */ 159 { 160 CHECK_ERROR_BREAK(g_pVirtualBox, GetExtraData(Bstr("VBoxInternal2/Watchdog/APIMonitor/Groups").raw(), 161 g_strAPIMonGroups.asOutParam())); 162 } 163 164 /* Host isolation command response. */ 165 if (g_strAPIMonIslnCmdResp.isEmpty()) /* Not set by command line? */ 166 { 167 CHECK_ERROR_BREAK(g_pVirtualBox, GetExtraData(Bstr("VBoxInternal2/Watchdog/APIMonitor/IsolationResponse").raw(), 168 g_strAPIMonIslnCmdResp.asOutParam())); 169 } 170 } while (0); 171 172 return SUCCEEDED(rc) ? VINF_SUCCESS : VERR_COM_IPRT_ERROR; /* @todo Find a better rc! */ 122 173 } 123 174 … … 163 214 { 164 215 /* pszName. */ 165 VBOX_MOD_APIMON ITOR_NAME,216 VBOX_MOD_APIMON_NAME, 166 217 /* pszDescription. */ 167 218 "API monitor for host isolation detection", … … 171 222 0 /* Not used */, 172 223 /* pszUsage. */ 173 " [--apimon itor-groups <string>]\n"174 ,224 " [--apimon-isln-response=<cmd>] [--apimon-isln-timeout=<ms>]\n" 225 " [--apimon-groups=<string>]\n", 175 226 /* pszOptions. */ 176 "--apimonitor-groups Sets the VM groups for monitoring (none).\n", 227 "--apimon-isln-response Sets the isolation response (shutdown VM).\n" 228 "--apimon-isln-timeout Sets the isolation timeout in ms (none).\n" 229 "--apimon-groups Sets the VM groups for monitoring (none).\n", 177 230 /* methods. */ 178 231 VBoxModAPIMonitorPreInit, -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp
r39986 r39988 542 542 0 /* Not used */, 543 543 /* pszUsage. */ 544 " [--balloon-dec <MB>] [--balloon-groups <string>] [--balloon-inc<MB>]\n"545 " [--balloon-interval <ms>] [--balloon-lower-limit<MB>]\n"546 " [--balloon-max 544 " [--balloon-dec=<MB>] [--balloon-groups=<string>] [--balloon-inc=<MB>]\n" 545 " [--balloon-interval=<ms>] [--balloon-lower-limit=<MB>]\n" 546 " [--balloon-max=<MB>]\n", 547 547 /* pszOptions. */ 548 548 "--balloon-dec Sets the ballooning decrement in MB (128 MB).\n" -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp
r39986 r39988 827 827 for (unsigned j = 0; j < RT_ELEMENTS(g_aModules); j++) 828 828 if (g_aModules[j].pDesc->pszUsage) 829 RTStrmPrintf(g_pStdErr, "%s \n", g_aModules[j].pDesc->pszUsage);829 RTStrmPrintf(g_pStdErr, "%s", g_aModules[j].pDesc->pszUsage); 830 830 831 831 RTStrmPrintf(g_pStdErr, "\n"
Note:
See TracChangeset
for help on using the changeset viewer.