VirtualBox

儲存庫 vbox 的更動 44336


忽略:
時間撮記:
2013-1-23 下午01:51:33 (12 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
83289
訊息:

Frontends/VBoxBalloonCtrl: add logic to prevent deflating the balloon if there is not sufficient host memory free, add docs

位置:
trunk
檔案:
修改 5 筆資料

圖例:

未更動
新增
刪除
  • trunk/doc/manual/en_US/user_AdvancedTopics.xml

    r44008 r44336  
    21082108      There is one mandatory parameter, <computeroutput>VBOXWEB_USER</computeroutput>,
    21092109      which must be set to the user which will later start the VMs. The
    2110       paramters in the table below all start with <computeroutput>VBOXWEB_</computeroutput>
     2110      parameters in the table below all start with <computeroutput>VBOXWEB_</computeroutput>
    21112111      (<computeroutput>VBOXWEB_HOST</computeroutput>,
    21122112      <computeroutput>VBOXWEB_PORT</computeroutput> etc.):
     
    23972397    </sect2>
    23982398
     2399    <sect2 id="vboxwatchdog-linux">
     2400      <title>Linux: starting the watchdog service via <computeroutput>init</computeroutput></title>
     2401
     2402      <para>On Linux, the watchdog service can be automatically started during
     2403      host boot by adding appropriate parameters to the file
     2404      <computeroutput>/etc/default/virtualbox</computeroutput>.
     2405      There is one mandatory parameter, <computeroutput>VBOXWATCHDOG_USER</computeroutput>,
     2406      which must be set to the user which will later start the VMs. For backward
     2407      compatibility you can also specify <computeroutput>VBOXBALLOONCTRL_USER</computeroutput>The
     2408      parameters in the table below all start with <computeroutput>VBOXWATCHDOG_</computeroutput>
     2409      (<computeroutput>VBOXWATCHDOG_BALLOON_INTERVAL</computeroutput>,
     2410      <computeroutput>VBOXWATCHDOG_LOGSIZE</computeroutput> etc., and for
     2411      previously existing parameters the
     2412      <computeroutput>VBOXBALLOONCTRL_INTERVAL</computeroutput> etc. parameters
     2413      can still be used):
     2414      <table>
     2415        <title>ignored</title>
     2416        <tgroup cols="3">
     2417          <tbody>
     2418            <row>
     2419              <entry><emphasis role="bold">Parameter</emphasis></entry>
     2420              <entry><emphasis role="bold">Description</emphasis></entry>
     2421              <entry><emphasis role="bold">Default</emphasis></entry>
     2422            </row>
     2423            <row>
     2424              <entry>USER</entry>
     2425              <entry>The user as which the watchdog service runs</entry>
     2426              <entry></entry>
     2427            </row>
     2428            <row>
     2429              <entry>ROTATE</entry>
     2430              <entry>Number of log files; 0 disables log rotation</entry>
     2431              <entry>10</entry>
     2432            </row>
     2433            <row>
     2434              <entry>LOGSIZE</entry>
     2435              <entry>Maximum size of a log file in bytes to trigger rotation</entry>
     2436              <entry>1MB</entry>
     2437            </row>
     2438            <row>
     2439              <entry>LOGINTERVAL</entry>
     2440              <entry>Maximum time interval in seconds to trigger log rotation</entry>
     2441              <entry>1 day</entry>
     2442            </row>
     2443            <row>
     2444              <entry>BALLOON_INTERVAL</entry>
     2445              <entry>Interval for checking the balloon size (msec)</entry>
     2446              <entry>30000</entry>
     2447            </row>
     2448            <row>
     2449              <entry>BALLOON_INCREMENT</entry>
     2450              <entry>Balloon size increment (MByte)</entry>
     2451              <entry>256</entry>
     2452            </row>
     2453            <row>
     2454              <entry>BALLOON_DECREMENT</entry>
     2455              <entry>Balloon size decrement (MByte)</entry>
     2456              <entry>128</entry>
     2457            </row>
     2458            <row>
     2459              <entry>BALLOON_LOWERLIMIT</entry>
     2460              <entry>Balloon size lower limit (MByte)</entry>
     2461              <entry>64</entry>
     2462            </row>
     2463            <row>
     2464              <entry>BALLOON_SAFETYMARGIN</entry>
     2465              <entry>Free memory required for decreasing the balloon size (MByte)</entry>
     2466              <entry>1024</entry>
     2467            </row>
     2468          </tbody>
     2469        </tgroup>
     2470      </table>
     2471      </para>
     2472    </sect2>
     2473
     2474    <sect2 id="vboxwatchdog-solaris">
     2475      <title>Solaris: starting the watchdog service via SMF</title>
     2476
     2477      <para>On Solaris hosts, the VirtualBox watchdog service daemon is
     2478      integrated into the SMF framework. You can change the parameters, but
     2479      don't have to if the defaults already match your needs:<screen>svccfg -s svc:/application/virtualbox/balloonctrl:default setprop config/balloon_interval=10000
     2480svccfg -s svc:/application/virtualbox/balloonctrl:default setprop config/balloon_safetymargin=134217728</screen></para>
     2481
     2482      <para>The table in the previous section showing the parameter names and
     2483      defaults also applies to Solaris. The parameter names must be changed
     2484      to lowercase and a prefix of <computeroutput>config/</computeroutput>
     2485      has to be added, e.g. <computeroutput>config/user</computeroutput> or
     2486      <computeroutput>config/balloon_safetymargin</computeroutput>. If you made any
     2487      change, don't forget to run the following command to put the changes into
     2488      effect immediately:<screen>svcadm refresh svc:/application/virtualbox/balloonctrl:default</screen></para>
     2489
     2490      <para>If you forget the above command then the previous settings will
     2491      be used when enabling the service. Check the current property settings
     2492      with:<screen>svcprop -p config svc:/application/virtualbox/balloonctrl:default</screen></para>
     2493
     2494      <para>When everything is configured correctly you can start the
     2495      VirtualBox watchdog service with the following command:<screen>svcadm enable svc:/application/virtualbox/balloonctrl:default</screen></para>
     2496
     2497      <para>For more information about SMF, please refer to the Solaris
     2498      documentation.</para>
     2499    </sect2>
     2500
    23992501  </sect1>
    24002502
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp

    r43738 r44336  
    55
    66/*
    7  * Copyright (C) 2011-2012 Oracle Corporation
     7 * Copyright (C) 2011-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2525
    2626#include "VBoxWatchdogInternal.h"
     27#include <iprt/system.h>
    2728
    2829using namespace com;
     
    3536enum GETOPTDEF_BALLOONCTRL
    3637{
    37     GETOPTDEF_BALLOONCTRL_BALLOOINC = 2000,
     38    GETOPTDEF_BALLOONCTRL_BALLOONINC = 2000,
    3839    GETOPTDEF_BALLOONCTRL_BALLOONDEC,
    3940    GETOPTDEF_BALLOONCTRL_BALLOONLOWERLIMIT,
    4041    GETOPTDEF_BALLOONCTRL_BALLOONMAX,
     42    GETOPTDEF_BALLOONCTRL_BALLOONSAFETY,
    4143    GETOPTDEF_BALLOONCTRL_TIMEOUTMS,
    4244    GETOPTDEF_BALLOONCTRL_GROUPS
     
    4951    { "--balloon-dec",            GETOPTDEF_BALLOONCTRL_BALLOONDEC,        RTGETOPT_REQ_UINT32 },
    5052    { "--balloon-groups",         GETOPTDEF_BALLOONCTRL_GROUPS,            RTGETOPT_REQ_STRING },
    51     { "--balloon-inc",            GETOPTDEF_BALLOONCTRL_BALLOOINC,         RTGETOPT_REQ_UINT32 },
     53    { "--balloon-inc",            GETOPTDEF_BALLOONCTRL_BALLOONINC,        RTGETOPT_REQ_UINT32 },
    5254    { "--balloon-interval",       GETOPTDEF_BALLOONCTRL_TIMEOUTMS,         RTGETOPT_REQ_UINT32 },
    5355    { "--balloon-lower-limit",    GETOPTDEF_BALLOONCTRL_BALLOONLOWERLIMIT, RTGETOPT_REQ_UINT32 },
    54     { "--balloon-max",            GETOPTDEF_BALLOONCTRL_BALLOONMAX,        RTGETOPT_REQ_UINT32 }
     56    { "--balloon-max",            GETOPTDEF_BALLOONCTRL_BALLOONMAX,        RTGETOPT_REQ_UINT32 },
     57    { "--balloon-safety-margin",  GETOPTDEF_BALLOONCTRL_BALLOONSAFETY,     RTGETOPT_REQ_UINT32 }
    5558};
    5659
     
    6265static unsigned long g_ulMemoryBalloonMaxMB = 0;
    6366static unsigned long g_ulMemoryBalloonLowerLimitMB = 0;
     67static unsigned long g_ulMemoryBalloonSafetyMB = _1K;
    6468
    6569/** The ballooning module's payload. */
     
    112116    if (ulCurrentDesktopBalloonSize + lBalloonDelta > ulMaxBalloonSize)
    113117        lBalloonDelta = (ulMaxBalloonSize - ulCurrentDesktopBalloonSize);
     118
     119    /* Limit the ballooning to the available memory, leaving some free.
     120     * If anything fails clamp the delta to 0. */
     121    if (lBalloonDelta < 0)
     122    {
     123        uint64_t cbSafety = (uint64_t)g_ulMemoryBalloonSafetyMB * _1M;
     124        uint64_t cbHostRamAvail = 0;
     125        int vrc = RTSystemQueryAvailableRam(&cbHostRamAvail);
     126        if (RT_SUCCESS(vrc))
     127        {
     128            if (cbHostRamAvail < cbSafety)
     129                lBalloonDelta = 0;
     130            else if ((uint64_t)(-lBalloonDelta) > (cbHostRamAvail - cbSafety) / _1M)
     131                lBalloonDelta = -(long)((cbHostRamAvail - cbSafety) / _1M);
     132        }
     133        else
     134            lBalloonDelta = 0;
     135    }
     136
    114137    return lBalloonDelta;
    115138}
     
    373396                break;
    374397
    375             case GETOPTDEF_BALLOONCTRL_BALLOOINC:
     398            case GETOPTDEF_BALLOONCTRL_BALLOONINC:
    376399                g_ulMemoryBalloonIncrementMB = ValueUnion.u32;
    377400                break;
     
    387410            case GETOPTDEF_BALLOONCTRL_BALLOONMAX:
    388411                g_ulMemoryBalloonMaxMB = ValueUnion.u32;
     412                break;
     413
     414            case GETOPTDEF_BALLOONCTRL_BALLOONSAFETY:
     415                g_ulMemoryBalloonSafetyMB = ValueUnion.u32;
    389416                break;
    390417
  • trunk/src/VBox/Installer/linux/vboxballoonctrl-service.sh

    r43579 r44336  
    11#!/bin/sh
    22#
    3 # VirtualBox balloon control daemon init script.
    4 #
    5 # Copyright (C) 2006-2012 Oracle Corporation
     3# VirtualBox watchdog daemon init script.
     4#
     5# Copyright (C) 2006-2013 Oracle Corporation
    66#
    77# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1515
    1616# chkconfig: 35 35 65
    17 # description: VirtualBox balloon control daemon
     17# description: VirtualBox watchdog daemon
    1818#
    1919### BEGIN INIT INFO
     
    2323# Default-Start:  2 3 4 5
    2424# Default-Stop:   0 1 6
    25 # Description:    VirtualBox balloon control daemon
     25# Description:    VirtualBox watchdog daemon
    2626### END INIT INFO
    2727
     
    278278check_single_user() {
    279279    if [ -n "$2" ]; then
    280         fail_msg "VBOXBALLOONCTRL_USER must not contain multiple users!"
     280        fail_msg "VBOXWATCHDOG_USER must not contain multiple users!"
    281281        exit 1
    282282    fi
     
    285285start() {
    286286    if ! test -f $PIDFILE; then
    287         [ -z "$VBOXBALLOONCTRL_USER" ] && exit 0
    288         begin_msg "Starting VirtualBox balloon control service";
    289         check_single_user $VBOXBALLOONCTRL_USER
     287        [ -z "$VBOXWATCHDOG_USER" -a -z "$VBOXBALLOONCTRL_USER" ] && exit 0
     288        [ -z "$VBOXWATCHDOG_USER" ] && VBOXWATCHDOG_USER="$VBOXBALLOONCTRL_USER"
     289        begin_msg "Starting VirtualBox watchdog service";
     290        check_single_user $VBOXWATCHDOG_USER
    290291        vboxdrvrunning || {
    291292            fail_msg "VirtualBox kernel module not loaded!"
    292293            exit 0
    293294        }
     295        # Handle legacy parameters, do not add any further ones unless absolutely necessary.
     296        [ -z "$VBOXWATCHDOG_BALLOON_INTERVAL" -a -n "$VBOXBALLOONCTRL_INTERVAL" ]           && VBOXWATCHDOG_BALLOON_INTERVAL="$VBOXBALLOONCTRL_INTERVAL"
     297        [ -z "$VBOXWATCHDOG_BALLOON_INCREMENT" -a -n "$VBOXBALLOONCTRL_INCREMENT" ]         && VBOXWATCHDOG_BALLOON_INCREMENT="$VBOXBALLOONCTRL_INCREMENT"
     298        [ -z "$VBOXWATCHDOG_BALLOON_DECREMENT" -a -n "$VBOXBALLOONCTRL_DECREMENT" ]         && VBOXWATCHDOG_BALLOON_DECREMENT="$VBOXBALLOONCTRL_DECREMENT"
     299        [ -z "$VBOXWATCHDOG_BALLOON_LOWERLIMIT" -a -n "$VBOXBALLOONCTRL_LOWERLIMIT" ]       && VBOXWATCHDOG_BALLOON_LOWERLIMIT="$VBOXBALLOONCTRL_LOWERLIMIT"
     300        [ -z "$VBOXWATCHDOG_BALLOON_SAFETYMARGIN" -a -n "$VBOXBALLOONCTRL_SAFETYMARGIN" ]   && VBOXWATCHDOG_BALLOON_SAFETYMARGIN="$VBOXBALLOONCTRL_SAFETYMARGIN"
     301        [ -z "$VBOXWATCHDOG_ROTATE" -a -n "$VBOXBALLOONCTRL_ROTATE" ]           && VBOXWATCHDOG_ROTATE="$VBOXBALLOONCTRL_ROTATE"
     302        [ -z "$VBOXWATCHDOG_LOGSIZE" -a -n "$VBOXBALLOONCTRL_LOGSIZE" ]         && VBOXWATCHDOG_LOGSIZE="$VBOXBALLOONCTRL_LOGSIZE"
     303        [ -z "$VBOXWATCHDOG_LOGINTERVAL" -a -n "$VBOXBALLOONCTRL_LOGINTERVAL" ] && VBOXWATCHDOG_LOGINTERVAL="$VBOXBALLOONCTRL_LOGINTERVAL"
     304
    294305        PARAMS="--background"
    295         [ -n "$VBOXBALLOONCTRL_INTERVAL" ]      && PARAMS="$PARAMS --balloon-interval $VBOXBALLOONCTRL_INTERVAL"
    296         [ -n "$VBOXBALLOONCTRL_INCREMENT" ]     && PARAMS="$PARAMS --balloon-inc $VBOXBALLOONCTRL_INCREMENT"
    297         [ -n "$VBOXBALLOONCTRL_DECREMENT" ]     && PARAMS="$PARAMS --balloon-dec $VBOXBALLOONCTRL_DECREMENT"
    298         [ -n "$VBOXBALLOONCTRL_LOWERLIMIT" ]    && PARAMS="$PARAMS --balloon-lower-limit $VBOXBALLOONCTRL_LOWERLIMIT"
    299         [ -n "$VBOXBALLOONCTRL_ROTATE" ]        && PARAMS="$PARAMS -R $VBOXBALLOONCTRL_ROTATE"
    300         [ -n "$VBOXBALLOONCTRL_LOGSIZE" ]       && PARAMS="$PARAMS -S $VBOXBALLOONCTRL_LOGSIZE"
    301         [ -n "$VBOXBALLOONCTRL_LOGINTERVAL" ]   && PARAMS="$PARAMS -I $VBOXBALLOONCTRL_LOGINTERVAL"
     306        [ -n "$VBOXWATCHDOG_BALLOON_INTERVAL" ]     && PARAMS="$PARAMS --balloon-interval \"$VBOXWATCHDOG_BALLOON_INTERVAL\""
     307        [ -n "$VBOXWATCHDOG_BALLOON_INCREMENT" ]    && PARAMS="$PARAMS --balloon-inc \"$VBOXWATCHDOG_BALLOON_INCREMENT\""
     308        [ -n "$VBOXWATCHDOG_BALLOON_DECREMENT" ]    && PARAMS="$PARAMS --balloon-dec \"$VBOXWATCHDOG_BALLOON_DECREMENT\""
     309        [ -n "$VBOXWATCHDOG_BALLOON_LOWERLIMIT" ]   && PARAMS="$PARAMS --balloon-lower-limit \"$VBOXWATCHDOG_BALLOON_LOWERLIMIT\""
     310        [ -n "$VBOXWATCHDOG_BALLOON_SAFETYMARGIN" ] && PARAMS="$PARAMS --balloon-safety-margin \"$VBOXWATCHDOG_BALLOON_SAFETYMARGIN\""
     311        [ -n "$VBOXWATCHDOG_ROTATE" ]       && PARAMS="$PARAMS -R \"$VBOXWATCHDOG_ROTATE\""
     312        [ -n "$VBOXWATCHDOG_LOGSIZE" ]      && PARAMS="$PARAMS -S \"$VBOXWATCHDOG_LOGSIZE\""
     313        [ -n "$VBOXWATCHDOG_LOGINTERVAL" ]  && PARAMS="$PARAMS -I \"$VBOXWATCHDOG_LOGINTERVAL\""
    302314        # prevent inheriting this setting to VBoxSVC
    303315        unset VBOX_RELEASE_LOG_DEST
    304         start_daemon $VBOXBALLOONCTRL_USER $binary $PARAMS > /dev/null 2>&1
     316        start_daemon $VBOXWATCHDOG_USER $binary $PARAMS > /dev/null 2>&1
    305317        # ugly: wait until the final process has forked
    306318        sleep .1
     
    320332stop() {
    321333    if test -f $PIDFILE; then
    322         begin_msg "Stopping VirtualBox balloon control service";
     334        begin_msg "Stopping VirtualBox watchdog service";
    323335        killproc $binary
    324336        RETVAL=$?
     
    338350
    339351status() {
    340     echo -n "Checking for VBox balloon control service"
     352    echo -n "Checking for VBox watchdog service"
    341353    if [ -f $PIDFILE ]; then
    342354        echo " ...running"
  • trunk/src/VBox/Installer/solaris/smf-vboxballoonctrl.sh

    r43579 r44336  
    22# $Id$
    33
    4 # Copyright (C) 2008-2012 Oracle Corporation
     4# Copyright (C) 2008-2013 Oracle Corporation
    55#
    66# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3636
    3737        # Get svc configuration
    38         VW_USER=`/usr/bin/svcprop -p config/user $SMF_FMRI 2>/dev/null`
    39         [ $? != 0 ] && VW_USER=
    40         VW_INTERVAL=`/usr/bin/svcprop -p config/interval $SMF_FMRI 2>/dev/null`
    41         [ $? != 0 ] && VW_INTERVAL=
    42         VW_INCREMENT=`/usr/bin/svcprop -p config/increment $SMF_FMRI 2>/dev/null`
    43         [ $? != 0 ] && VW_INCREMENT=
    44         VW_DECREMENT=`/usr/bin/svcprop -p config/decrement $SMF_FMRI 2>/dev/null`
    45         [ $? != 0 ] && VW_DECREMENT=
    46         VW_LOWERLIMIT=`/usr/bin/svcprop -p config/lowerlimit $SMF_FMRI 2>/dev/null`
    47         [ $? != 0 ] && VW_LOWERLIMIT=
    48         VW_ROTATE=`/usr/bin/svcprop -p config/logrotate $SMF_FMRI 2>/dev/null`
    49         [ $? != 0 ] && VW_ROTATE=
    50         VW_LOGSIZE=`/usr/bin/svcprop -p config/logsize $SMF_FMRI 2>/dev/null`
    51         [ $? != 0 ] && VW_LOGSIZE=
    52         VW_LOGINTERVAL=`/usr/bin/svcprop -p config/loginterval $SMF_FMRI 2>/dev/null`
    53         [ $? != 0 ] && VW_LOGINTERVAL=
     38        VBOXWATCHDOG_USER=`/usr/bin/svcprop -p config/user $SMF_FMRI 2>/dev/null`
     39        [ $? != 0 ] && VBOXWATCHDOG_USER=
     40        VBOXWATCHDOG_BALLOON_INTERVAL=`/usr/bin/svcprop -p config/balloon_interval $SMF_FMRI 2>/dev/null`
     41        [ $? != 0 ] && VBOXWATCHDOG_BALLOON_INTERVAL=
     42        VBOXWATCHDOG_BALLOON_INCREMENT=`/usr/bin/svcprop -p config/balloon_increment $SMF_FMRI 2>/dev/null`
     43        [ $? != 0 ] && VBOXWATCHDOG_BALLOON_INCREMENT=
     44        VBOXWATCHDOG_BALLOON_DECREMENT=`/usr/bin/svcprop -p config/balloon_decrement $SMF_FMRI 2>/dev/null`
     45        [ $? != 0 ] && VBOXWATCHDOG_BALLOON_DECREMENT=
     46        VBOXWATCHDOG_BALLOON_LOWERLIMIT=`/usr/bin/svcprop -p config/balloon_lowerlimit $SMF_FMRI 2>/dev/null`
     47        [ $? != 0 ] && VBOXWATCHDOG_BALLOON_LOWERLIMIT=
     48        VBOXWATCHDOG_BALLOON_SAFETYMARGIN=`/usr/bin/svcprop -p config/balloon_safetymargin $SMF_FMRI 2>/dev/null`
     49        [ $? != 0 ] && VBOXWATCHDOG_BALLOON_SAFETYMARGIN=
     50        VBOXWATCHDOG_ROTATE=`/usr/bin/svcprop -p config/logrotate $SMF_FMRI 2>/dev/null`
     51        [ $? != 0 ] && VBOXWATCHDOG_ROTATE=
     52        VBOXWATCHDOG_LOGSIZE=`/usr/bin/svcprop -p config/logsize $SMF_FMRI 2>/dev/null`
     53        [ $? != 0 ] && VBOXWATCHDOG_LOGSIZE=
     54        VBOXWATCHDOG_LOGINTERVAL=`/usr/bin/svcprop -p config/loginterval $SMF_FMRI 2>/dev/null`
     55        [ $? != 0 ] && VBOXWATCHDOG_LOGINTERVAL=
     56
     57        # Handle legacy parameters, do not add any further ones unless absolutely necessary.
     58        if [ -z "$VBOXWATCHDOG_BALLOON_INTERVAL" ]; then
     59            VBOXWATCHDOG_BALLOON_INTERVAL=`/usr/bin/svcprop -p config/interval $SMF_FMRI 2>/dev/null`
     60            [ $? != 0 ] && VBOXWATCHDOG_BALLOON_INTERVAL=
     61        fi
     62        if [ -z "$VBOXWATCHDOG_BALLOON_INCREMENT" ]; then
     63            VBOXWATCHDOG_BALLOON_INCREMENT=`/usr/bin/svcprop -p config/increment $SMF_FMRI 2>/dev/null`
     64            [ $? != 0 ] && VBOXWATCHDOG_BALLOON_INCREMENT=
     65        fi
     66        if [ -z "$VBOXWATCHDOG_BALLOON_DECREMENT" ]; then
     67            VBOXWATCHDOG_BALLOON_DECREMENT=`/usr/bin/svcprop -p config/decrement $SMF_FMRI 2>/dev/null`
     68            [ $? != 0 ] && VBOXWATCHDOG_BALLOON_DECREMENT=
     69        fi
     70        if [ -z "$VBOXWATCHDOG_BALLOON_LOWERLIMIT" ]; then
     71            VBOXWATCHDOG_BALLOON_LOWERLIMIT=`/usr/bin/svcprop -p config/lowerlimit $SMF_FMRI 2>/dev/null`
     72            [ $? != 0 ] && VBOXWATCHDOG_BALLOON_LOWERLIMIT=
     73        fi
     74        if [ -z "$VBOXWATCHDOG_BALLOON_SAFETYMARGIN" ]; then
     75            VBOXWATCHDOG_BALLOON_SAFETYMARGIN=`/usr/bin/svcprop -p config/safetymargin $SMF_FMRI 2>/dev/null`
     76            [ $? != 0 ] && VBOXWATCHDOG_BALLOON_SAFETYMARGIN=
     77        fi
    5478
    5579        # Provide sensible defaults
    56         [ -z "$VW_USER" ] && VW_USER=root
    57         [ -z "$VW_INTERVAL" ] && VW_INTERVAL=10000
    58         [ -z "$VW_INCREMENT" ] && VW_INCREMENT=256
    59         [ -z "$VW_DECREMENT" ] && VW_DECREMENT=128
    60         [ -z "$VW_LOWERLIMIT" ] && VW_LOWERLIMIT=64
    61         [ -z "$VW_ROTATE" ] && VW_ROTATE=10
    62         [ -z "$VW_LOGSIZE" ] && VW_LOGSIZE=104857600
    63         [ -z "$VW_LOGINTERVAL" ] && VW_LOGINTERVAL=86400
    64         exec su - "$VW_USER" -c "/opt/VirtualBox/VBoxBalloonCtrl --background --balloon-interval \"$VW_INTERVAL\" --balloon-inc \"$VW_INCREMENT\" --balloon-dec \"$VW_DECREMENT\" --balloon-lower-limit \"$VW_LOWERLIMIT\" --logrotate \"$VW_ROTATE\" --logsize \"$VW_LOGSIZE\" --loginterval \"$VW_LOGINTERVAL\""
     80        [ -z "$VBOXWATCHDOG_USER" ] && VBOXWATCHDOG_USER=root
     81
     82        # Assemble the parameter list
     83        PARAMS="--background"
     84        [ -n "$VBOXWATCHDOG_BALLOON_INTERVAL" ]     && PARAMS="$PARAMS --balloon-interval \"$VBOXWATCHDOG_BALLOON_INTERVAL\""
     85        [ -n "$VBOXWATCHDOG_BALLOON_INCREMENT" ]    && PARAMS="$PARAMS --balloon-inc \"$VBOXWATCHDOG_BALLOON_INCREMENT\""
     86        [ -n "$VBOXWATCHDOG_BALLOON_DECREMENT" ]    && PARAMS="$PARAMS --balloon-dec \"$VBOXWATCHDOG_BALLOON_DECREMENT\""
     87        [ -n "$VBOXWATCHDOG_BALLOON_LOWERLIMIT" ]   && PARAMS="$PARAMS --balloon-lower-limit \"$VBOXWATCHDOG_BALLOON_LOWERLIMIT\""
     88        [ -n "$VBOXWATCHDOG_BALLOON_SAFETYMARGIN" ] && PARAMS="$PARAMS --balloon-safety-margin \"$VBOXWATCHDOG_BALLOON_SAFETYMARGIN\""
     89        [ -n "$VBOXWATCHDOG_ROTATE" ]       && PARAMS="$PARAMS -R \"$VBOXWATCHDOG_ROTATE\""
     90        [ -n "$VBOXWATCHDOG_LOGSIZE" ]      && PARAMS="$PARAMS -S \"$VBOXWATCHDOG_LOGSIZE\""
     91        [ -n "$VBOXWATCHDOG_LOGINTERVAL" ]  && PARAMS="$PARAMS -I \"$VBOXWATCHDOG_LOGINTERVAL\""
     92
     93        exec su - "$VBOXWATCHDOG_USER" -c "/opt/VirtualBox/VBoxBalloonCtrl $PARAMS"
    6594
    6695        VW_EXIT=$?
  • trunk/src/VBox/Installer/solaris/virtualbox-balloonctrl.xml

    • 屬性 svn:eol-style 設為 native
    • 屬性 svn:keywords 設為 Author Date Id Revision
    r43951 r44336  
    55# $Id$
    66
    7     Copyright (C) 2008-2012 Oracle Corporation
     7    Copyright (C) 2008-2013 Oracle Corporation
    88
    99    This file is part of VirtualBox Open Source Edition (OSE), as
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette