Changeset 83798 in vbox for trunk/src/VBox/Frontends/VBoxBalloonCtrl
- Timestamp:
- Apr 18, 2020 2:13:58 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137324
- Location:
- trunk/src/VBox/Frontends/VBoxBalloonCtrl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp
r82968 r83798 626 626 0 /* Not used */, 627 627 /* pszUsage. */ 628 " [--apimon-groups=<string[,stringN]>]\n"629 " [--apimon-isln-response=<cmd>] [--apimon-isln-timeout=<ms>]\n"630 " [--apimon-resp-timeout=<ms>]",628 " [--apimon-groups=<string[,stringN]>]\n" 629 " [--apimon-isln-response=<cmd>] [--apimon-isln-timeout=<ms>]\n" 630 " [--apimon-resp-timeout=<ms>]", 631 631 /* pszOptions. */ 632 "--apimon-groups Sets the VM groups for monitoring (all),\n" 633 " comma-separated list.\n" 634 "--apimon-isln-response Sets the isolation response to one of:\n" 635 " none, pause, poweroff, save, shutdown\n" 636 " (none).\n" 637 "--apimon-isln-timeout Sets the isolation timeout in ms (30s).\n" 638 "--apimon-resp-timeout Sets the response timeout in ms (30s).\n", 632 " --apimon-groups=<string[,...]>\n" 633 " Sets the VM groups for monitoring (all), comma-separated list.\n" 634 " --apimon-isln-response=<cmd>\n" 635 " Sets the isolation response to one of: none, pause, poweroff,\n" 636 " save, or shutdown. Default: none\n" 637 " --apimon-isln-timeout=<ms>\n" 638 " Sets the isolation timeout in ms (30s).\n" 639 " --apimon-resp-timeout=<ms>\n" 640 " Sets the response timeout in ms (30s).\n", 639 641 /* methods. */ 640 642 VBoxModAPIMonitorPreInit, -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp
r82968 r83798 746 746 0 /* Not used */, 747 747 /* pszUsage. */ 748 " [--balloon-dec=<MB>] [--balloon-groups=<string>] [--balloon-inc=<MB>]\n" 749 " [--balloon-interval=<ms>] [--balloon-lower-limit=<MB>]\n" 750 " [--balloon-max=<MB>]\n", 748 " [--balloon-dec=<MB>] [--balloon-groups=<string>]\n" 749 " [--balloon-inc=<MB>] [--balloon-interval=<ms>]\n" 750 " [--balloon-lower-limit=<MB>] [--balloon-max=<MB>]\n" 751 " [--balloon-safety-margin=<MB]\n", 751 752 /* pszOptions. */ 752 "--balloon-dec Sets the ballooning decrement in MB (128 MB).\n" 753 "--balloon-groups Sets the VM groups for ballooning (all).\n" 754 "--balloon-inc Sets the ballooning increment in MB (256 MB).\n" 755 "--balloon-interval Sets the check interval in ms (30 seconds).\n" 756 "--balloon-lower-limit Sets the ballooning lower limit in MB (64 MB).\n" 757 "--balloon-max Sets the balloon maximum limit in MB (0 MB).\n" 758 " Specifying \"0\" means disabled ballooning.\n" 753 " --balloon-dec=<MB>\n" 754 " Sets the ballooning decrement in MB (128 MB).\n" 755 " --balloon-groups=<string>\n" 756 " Sets the VM groups for ballooning (all).\n" 757 " --balloon-inc=<MB>\n" 758 " Sets the ballooning increment in MB (256 MB).\n" 759 " --balloon-interval=<ms>\n" 760 " Sets the check interval in ms (30 seconds).\n" 761 " --balloon-lower-limit=<MB>\n" 762 " Sets the ballooning lower limit in MB (64 MB).\n" 763 " --balloon-max=<MB>\n" 764 " Sets the balloon maximum limit in MB (0 MB).\n" 765 " Specifying \"0\" means disabled ballooning.\n" 759 766 #if 1 760 767 /* (Legacy) note. */ 761 "Set \"VBoxInternal/Guest/BalloonSizeMax\" for a per-VM maximum ballooning size.\n" 768 " Set \"VBoxInternal/Guest/BalloonSizeMax\" for a per-VM\n" 769 " maximum ballooning size.\n" 762 770 #endif 763 "--balloon-safety-margin Free memory when deflating a balloon in MB (1024 MB).\n" 771 " --balloon-safety-margin=<MB>\n" 772 " Free memory when deflating a balloon in MB (1024 MB).\n" 764 773 , 765 774 /* methods. */ -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp
r82968 r83798 53 53 #include <iprt/time.h> 54 54 55 56 #include <algorithm>57 #include <string>58 55 #include <signal.h> 59 56 … … 62 59 using namespace com; 63 60 61 62 /********************************************************************************************************************************* 63 * Structures and Typedefs * 64 *********************************************************************************************************************************/ 65 /** 66 * The details of the services that has been compiled in. 67 */ 68 typedef struct VBOXWATCHDOGMOD 69 { 70 /** Pointer to the service descriptor. */ 71 PCVBOXMODULE pDesc; 72 /** Whether Pre-init was called. */ 73 bool fPreInited; 74 /** Whether the module is enabled or not. */ 75 bool fEnabled; 76 } VBOXWATCHDOGMOD, *PVBOXWATCHDOGMOD; 77 78 enum GETOPTDEF_WATCHDOG 79 { 80 GETOPTDEF_WATCHDOG_DISABLE_MODULE = 1000, 81 GETOPTDEF_WATCHDOG_DRYRUN 82 }; 83 84 85 /********************************************************************************************************************************* 86 * Global Variables * 87 *********************************************************************************************************************************/ 64 88 /** External globals. */ 65 89 bool g_fDryrun = false; … … 69 93 mapVM g_mapVM; 70 94 mapGroup g_mapGroup; 71 # 95 #ifdef VBOX_WATCHDOG_GLOBAL_PERFCOL 72 96 ComPtr<IPerformanceCollector> g_pPerfCollector = NULL; 73 # 97 #endif 74 98 75 99 /** The critical section for the machines map. */ … … 87 111 static bool g_fDaemonize = false; 88 112 89 /**90 * The details of the services that has been compiled in.91 */92 typedef struct VBOXWATCHDOGMOD93 {94 /** Pointer to the service descriptor. */95 PCVBOXMODULE pDesc;96 /** Whether Pre-init was called. */97 bool fPreInited;98 /** Whether the module is enabled or not. */99 bool fEnabled;100 } VBOXWATCHDOGMOD, *PVBOXWATCHDOGMOD;101 102 113 static VBOXWATCHDOGMOD g_aModules[] = 103 114 { … … 106 117 }; 107 118 108 enum GETOPTDEF_WATCHDOG109 {110 GETOPTDEF_WATCHDOG_DISABLE_MODULE = 1000,111 GETOPTDEF_WATCHDOG_DRYRUN112 };113 114 119 /** 115 120 * Command line arguments. 116 121 */ 117 static const RTGETOPTDEF g_aOptions[] = { 122 static const RTGETOPTDEF g_aOptions[] = 123 { 118 124 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined (RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 119 125 { "--background", 'b', RTGETOPT_REQ_NOTHING }, … … 138 144 static NativeEventQueue *g_pEventQ = NULL; 139 145 140 /* Prototypes. */ 146 147 /********************************************************************************************************************************* 148 * Internal Functions * 149 *********************************************************************************************************************************/ 141 150 static int machineAdd(const Bstr &strUuid); 142 151 static int machineRemove(const Bstr &strUuid); … … 826 835 827 836 RTStrmPrintf(g_pStdErr, 828 "Usage: \n"829 " %s [-v|--verbose] [-h|-?|--help] [-P|--pidfile]\n"830 " [-F|--logfile=<file>] [-R|--logrotate=<num>] [-S|--logsize=<bytes>]\n"831 " [-I|--loginterval=<seconds>]\n",pszImage);837 "Usage: %s [-v|--verbose] [-h|-?|--help] [-P|--pidfile]\n" 838 " [-F|--logfile=<file>] [-R|--logrotate=<num>] \n" 839 " [-S|--logsize=<bytes>] [-I|--loginterval=<seconds>]\n", 840 pszImage); 832 841 for (unsigned j = 0; j < RT_ELEMENTS(g_aModules); j++) 833 842 if (g_aModules[j].pDesc->pszUsage) 834 843 RTStrmPrintf(g_pStdErr, "%s", g_aModules[j].pDesc->pszUsage); 835 844 836 RTStrmPrintf(g_pStdErr, "\n" 845 RTStrmPrintf(g_pStdErr, 846 "\n" 837 847 "Options:\n"); 838 848 839 for (unsigned i = 0; 840 i < RT_ELEMENTS(g_aOptions); 841 ++i) 842 { 843 std::string str(g_aOptions[i].pszLong); 844 if (g_aOptions[i].iShort < 1000) /* Don't show short options which are defined by an ID! */ 845 { 846 str += ", -"; 847 str += g_aOptions[i].iShort; 848 } 849 str += ":"; 850 849 for (unsigned i = 0; i < RT_ELEMENTS(g_aOptions); i++) 850 { 851 851 const char *pcszDescr = ""; 852 853 852 switch (g_aOptions[i].iShort) 854 853 { … … 891 890 } 892 891 893 RTStrmPrintf(g_pStdErr, "%-23s%s\n", str.c_str(), pcszDescr); 892 if (g_aOptions[i].iShort < 1000) 893 RTStrmPrintf(g_pStdErr, 894 " %s, -%c\n" 895 " %s\n", g_aOptions[i].pszLong, g_aOptions[i].iShort, pcszDescr); 896 else 897 RTStrmPrintf(g_pStdErr, 898 " %s\n" 899 " %s\n", g_aOptions[i].pszLong, g_aOptions[i].iShort, pcszDescr); 894 900 } 895 901 -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogInternal.h
r82968 r83798 35 35 #endif /* !VBOX_ONLY_DOCS */ 36 36 37 #include <algorithm>38 37 #include <map> 39 #include <sstream>40 #include <string>41 38 #include <vector> 42 39 -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogUtils.cpp
r82968 r83798 22 22 #include <VBox/com/array.h> 23 23 #include "VBoxWatchdogInternal.h" 24 25 #include <iprt/sanitized/sstream> 26 #include <algorithm> 24 27 25 28
Note:
See TracChangeset
for help on using the changeset viewer.