VirtualBox

Changeset 32885 in vbox


Ignore:
Timestamp:
Oct 4, 2010 12:56:35 PM (14 years ago)
Author:
vboxsync
Message:

Renaming cpu priority to cpu execution cap

Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r32431 r32885  
    693693    CpuList             llCpus;                 // requires settings version 1.10 (VirtualBox 3.2)
    694694    bool                fHpetEnabled;           // requires settings version 1.10 (VirtualBox 3.2)
    695     uint32_t            ulCpuPriority;          // requires settings version 1.11 (VirtualBox 3.3)
     695    uint32_t            ulCpuExecutionCap;      // requires settings version 1.11 (VirtualBox 3.3)
    696696
    697697    CpuIdLeafsList      llCpuIdLeafs;
  • trunk/include/VBox/vm.h

    r32796 r32885  
    713713    /** Number of virtual CPUs. */
    714714    uint32_t                    cCpus;
    715     /** CPU priority (1-100) */
    716     uint32_t                    uCpuPriority;
     715    /** CPU excution cap (1-100) */
     716    uint32_t                    uCpuExecutionCap;
    717717
    718718    /** Size of the VM structure including the VMCPU array. */
  • trunk/include/VBox/vm.mac

    r32137 r32885  
    5353    .hSelf                  resd 1
    5454    .cCpus                  resd 1
    55     .uCpuPriority           resd 1
     55    .uCpuExecutionCap       resd 1
    5656    .cbSelf                 resd 1
    5757    .offVMCPU               resd 1
  • trunk/include/VBox/vmapi.h

    r32190 r32885  
    409409VMMR3DECL(int)              VMR3HotUnplugCpu(PVM pVM, VMCPUID idCpu);
    410410VMMR3DECL(int)              VMR3HotPlugCpu(PVM pVM, VMCPUID idCpu);
    411 VMMR3DECL(int)              VMR3SetCpuPriority(PVM pVM, unsigned ulCpuPriority);
     411VMMR3DECL(int)              VMR3SetCpuExecutionCap(PVM pVM, unsigned ulExecutionCap);
    412412/** @} */
    413413#endif /* IN_RING3 */
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r32718 r32885  
    142142            CHECK_ERROR_BREAK(sessionMachine, HotPlugCPU(n));
    143143        }
     144        else if (!strcmp(a->argv[1], "cpuexecutioncap"))
     145        {
     146            if (a->argc <= 1 + 1)
     147            {
     148                errorArgument("Missing argument to '%s'. Expected execution cap number.", a->argv[1]);
     149                rc = E_FAIL;
     150                break;
     151            }
     152
     153            unsigned n = parseNum(a->argv[2], 100, "ExecutionCap");
     154
     155            CHECK_ERROR_BREAK(machine, COMSETTER(CPUExecutionCap)(n));
     156        }
    144157        else if (!strcmp(a->argv[1], "poweroff"))
    145158        {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r32712 r32885  
    184184                     "                            [--plugcpu <id>]\n"
    185185                     "                            [--unplugcpu <id>]\n"
     186                     "                            [--cpuexecutioncap <1-100>]\n"
    186187                     "                            [--rtcuseutc on|off]\n"
    187188                     "                            [--monitorcount <number>]\n"
     
    418419                     "                            plugcpu <id>\n"
    419420                     "                            unplugcpu <id>\n"
     421                     "                            cpuexecutioncap <1-100>\n"
    420422                     "\n");
    421423    }
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r32718 r32885  
    158158    MODIFYVM_FAULT_TOLERANCE_PORT,
    159159    MODIFYVM_FAULT_TOLERANCE_PASSWORD,
    160     MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL
     160    MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL,
     161    MODIFYVM_CPU_EXECTUION_CAP
    161162};
    162163
     
    185186    { "--plugcpu",                  MODIFYVM_PLUGCPU,                   RTGETOPT_REQ_UINT32 },
    186187    { "--unplugcpu",                MODIFYVM_UNPLUGCPU,                 RTGETOPT_REQ_UINT32 },
     188    { "--cpuexecutioncap",          MODIFYVM_CPU_EXECTUION_CAP,         RTGETOPT_REQ_UINT32 },
    187189    { "--rtcuseutc",                MODIFYVM_RTCUSEUTC,                 RTGETOPT_REQ_BOOL_ONOFF },
    188190    { "--monitorcount",             MODIFYVM_MONITORCOUNT,              RTGETOPT_REQ_UINT32 },
     
    517519            }
    518520
     521            case MODIFYVM_CPU_EXECTUION_CAP:
     522            {
     523                CHECK_ERROR(machine, COMSETTER(CPUExecutionCap)(ValueUnion.u32));
     524            }
     525
    519526            case MODIFYVM_MONITORCOUNT:
    520527            {
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r32851 r32885  
    275275        kOnMediumChanged,
    276276        kOnCPUChanged,
    277         kOnCPUPriorityChanged,
     277        kOnCPUExecutionCapChanged,
    278278        kOnVRDPServerChanged,
    279279        kOnRemoteDisplayInfoChanged,
     
    33543354
    33553355        case VMSTATE_RUNNING_LS:
     3356        case VMSTATE_RUNNING_FT:
    33563357            return setErrorInternal(VBOX_E_INVALID_VM_STATE,
    33573358                                    COM_IIDOF(IConsole),
    33583359                                    getStaticComponentName(),
    3359                                     Utf8Str(tr("Cannot change drive during live migration")),
     3360                                    (enmVMState == VMSTATE_RUNNING_LS) ? Utf8Str(tr("Cannot change drive during live migration")) : Utf8Str(tr("Cannot change drive during fault tolerant syncing")),
    33603361                                    false /*aWarning*/,
    33613362                                    true /*aLogIt*/);
     
    33673368    /* Determine the base path for the device instance. */
    33683369    PCFGMNODE pCtlInst;
    3369     pCtlInst = CFGMR3GetChildF(CFGMR3GetRoot(pVM), "Devices/%s/%u/", pcszDevice,
    3370  uInstance);
     3370    pCtlInst = CFGMR3GetChildF(CFGMR3GetRoot(pVM), "Devices/%s/%u/", pcszDevice, uInstance);
    33713371    AssertReturn(pCtlInst, VERR_INTERNAL_ERROR);
    33723372
     
    39063906
    39073907/**
    3908  * Called by IInternalSessionControl::OnCPUPriorityChange().
     3908 * Called by IInternalSessionControl::OnCpuExecutionCapChange().
    39093909 *
    39103910 * @note Locks this object for writing.
    39113911 */
    3912 HRESULT Console::onCPUPriorityChange(ULONG aCpuPriority)
     3912HRESULT Console::onCPUExecutionCapChange(ULONG aExecutionCap)
    39133913{
    39143914    LogFlowThisFunc(("\n"));
     
    39343934        {
    39353935            /* No need to call in the EMT thread. */
    3936             rc = VMR3SetCpuPriority(mpVM, aCpuPriority);
     3936            rc = VMR3SetCpuExecutionCap(mpVM, aExecutionCap);
    39373937        }
    39383938        else
     
    39423942    /* notify console callbacks on success */
    39433943    if (SUCCEEDED(rc))
    3944         CONSOLE_DO_CALLBACKS1(OnCPUPriorityChanged, aCpuPriority);
     3944        CONSOLE_DO_CALLBACKS1(OnCPUExecutionCapChanged, aExecutionCap);
    39453945
    39463946    LogFlowThisFunc(("Leaving rc=%#x\n", rc));
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r32851 r32885  
    551551    hrc = pMachine->COMGETTER(CPUCount)(&cCpus);                                        H();
    552552
    553     ULONG ulCpuPriority = 100;
    554     hrc = pMachine->COMGETTER(CPUPriority)(&ulCpuPriority);                             H();
     553    ULONG ulCpuExecutionCap = 100;
     554    hrc = pMachine->COMGETTER(CPUExecutionCap)(&ulCpuExecutionCap);                     H();
    555555
    556556    Bstr osTypeId;
     
    587587        InsertConfigInteger(pRoot, "RamHoleSize",          cbRamHole);
    588588        InsertConfigInteger(pRoot, "NumCPUs",              cCpus);
    589         InsertConfigInteger(pRoot, "CpuPriority",          ulCpuPriority);
     589        InsertConfigInteger(pRoot, "CpuExecutionCap",      ulCpuExecutionCap);
    590590        InsertConfigInteger(pRoot, "TimerMillies",         10);
    591591#ifdef VBOX_WITH_RAW_MODE
  • trunk/src/VBox/Main/MachineImpl.cpp

    r32780 r32885  
    196196    mIoCacheSize    = 5; /* 5MB */
    197197
    198     /* Maximum CPU priority by default. */
    199     mCpuPriority = 100;
     198    /* Maximum CPU execution cap by default. */
     199    mCpuExecutionCap = 100;
    200200}
    201201
     
    13141314}
    13151315
    1316 STDMETHODIMP Machine::COMGETTER(CPUPriority)(ULONG *aPriority)
    1317 {
    1318     if (!aPriority)
     1316STDMETHODIMP Machine::COMGETTER(CPUExecutionCap)(ULONG *aExecutionCap)
     1317{
     1318    if (!aExecutionCap)
    13191319        return E_POINTER;
    13201320
     
    13241324    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    13251325
    1326     *aPriority = mHWData->mCpuPriority;
    1327 
    1328     return S_OK;
    1329 }
    1330 
    1331 STDMETHODIMP Machine::COMSETTER(CPUPriority)(ULONG aPriority)
     1326    *aExecutionCap = mHWData->mCpuExecutionCap;
     1327
     1328    return S_OK;
     1329}
     1330
     1331STDMETHODIMP Machine::COMSETTER(CPUExecutionCap)(ULONG aExecutionCap)
    13321332{
    13331333    HRESULT rc = S_OK;
    13341334
    1335     /* check priority limits */
    1336     if (    aPriority < 1
    1337          || aPriority > 100
     1335    /* check throttle limits */
     1336    if (    aExecutionCap < 1
     1337         || aExecutionCap > 100
    13381338       )
    13391339        return setError(E_INVALIDARG,
    1340                         tr("Invalid CPU priority: %lu (must be in range [%lu, %lu])"),
    1341                         aPriority, 1, 100);
     1340                        tr("Invalid CPU execution cap value: %lu (must be in range [%lu, %lu])"),
     1341                        aExecutionCap, 1, 100);
    13421342
    13431343    AutoCaller autoCaller(this);
     
    13471347
    13481348    alock.release();
    1349     rc = onCPUPriorityChange(aPriority);
     1349    rc = onCpuExecutionCapChange(aExecutionCap);
    13501350    alock.acquire();
    13511351    if (FAILED(rc)) return rc;
     
    13531353    setModified(IsModified_MachineData);
    13541354    mHWData.backup();
    1355     mHWData->mCpuPriority = aPriority;
     1355    mHWData->mCpuExecutionCap = aExecutionCap;
    13561356
    13571357    /* Save settings if online - todo why is this required?? */
     
    70217021        mHWData->mCPUCount                    = data.cCPUs;
    70227022        mHWData->mCPUHotPlugEnabled           = data.fCpuHotPlug;
    7023         mHWData->mCpuPriority                 = data.ulCpuPriority;
     7023        mHWData->mCpuExecutionCap             = data.ulCpuExecutionCap;
    70247024
    70257025        // cpu
     
    80708070        }
    80718071
    8072         data.cCPUs         = mHWData->mCPUCount;
    8073         data.fCpuHotPlug   = !!mHWData->mCPUHotPlugEnabled;
    8074         data.ulCpuPriority = mHWData->mCpuPriority;
     8072        data.cCPUs             = mHWData->mCPUCount;
     8073        data.fCpuHotPlug       = !!mHWData->mCPUHotPlugEnabled;
     8074        data.ulCpuExecutionCap = mHWData->mCpuExecutionCap;
    80758075
    80768076        data.llCpus.clear();
     
    1099110991}
    1099210992
    10993 HRESULT SessionMachine::onCPUPriorityChange(ULONG aCpuPriority)
     10993HRESULT SessionMachine::onCPUExecutionCapChange(ULONG aExecutionCap)
    1099410994{
    1099510995    LogFlowThisFunc(("\n"));
     
    1100811008        return S_OK;
    1100911009
    11010     return directControl->OnCPUPriorityChange(aCpuPriority);
     11010    return directControl->OnCPUExecutionCapChange(aExecutionCap);
    1101111011}
    1101211012
  • trunk/src/VBox/Main/SessionImpl.cpp

    r32727 r32885  
    596596}
    597597
    598 STDMETHODIMP Session::OnCPUPriorityChange(ULONG aCpuPriority)
     598STDMETHODIMP Session::OnCPUExecutionCapChange(ULONG aExecutionCap)
    599599{
    600600    LogFlowThisFunc(("\n"));
     
    607607    AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE);
    608608
    609     return mConsole->onCPUPriorityChange(aCpuPriority);
     609    return mConsole->onCPUExecutionCapChange(aExecutionCap);
    610610}
    611611
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r32870 r32885  
    34333433  <interface
    34343434     name="IMachine" extends="$unknown"
    3435      uuid="917a4c5f-9388-4848-bbeb-5f02bfebf3d6"
     3435     uuid="5c91359b-5bdb-4518-9bd1-5f2c50a3c129"
    34363436     wsmap="managed"
    34373437     >
     
    36213621    </attribute>
    36223622
    3623     <attribute name="CPUPriority" type="unsigned long">
     3623    <attribute name="CPUExecutionCap" type="unsigned long">
    36243624       <desc>
    3625          Priority of the virtual CPUs. Means to limit the number of CPU cycles
    3626          a guest can use. The unit is percentage of host CPU cycles per second.
    3627          The valid range is 1 - 100. 100 (the default) implies no limit.
     3625         Means to limit the number of CPU cycles a guest can use. The unit
     3626         is percentage of host CPU cycles per second. The valid range
     3627         is 1 - 100. 100 (the default) implies no limit.
    36283628       </desc>
    36293629    </attribute>
     
    1252512525  <interface
    1252612526     name="IInternalSessionControl" extends="$unknown"
    12527      uuid="ef059f1d-2273-4f81-9342-c152a0d2cd40"
     12527     uuid="0431ef9e-2c2e-42af-87d7-c8f52455f28a"
    1252812528     internal="yes"
    1252912529     wsmap="suppress"
     
    1270512705    </method>
    1270612706
    12707     <method name="onCPUPriorityChange">
    12708       <desc>
    12709          Notification when the CPU priority changes.
    12710       </desc>
    12711       <param name="priority" type="unsigned long" dir="in">
    12712          <desc>The new CPU priority value. (1-100)</desc>
     12707    <method name="onCPUExecutionCapChange">
     12708      <desc>
     12709         Notification when the CPU execution cap changes.
     12710      </desc>
     12711      <param name="executionCap" type="unsigned long" dir="in">
     12712         <desc>The new CPU execution cap value. (1-100)</desc>
    1271312713      </param>
    1271412714    </method>
     
    1393413934  <enum
    1393513935     name="VBoxEventType"
    13936      uuid="2c76667e-6981-4122-a71a-cdfd6a6eb575">
     13936     uuid="d00980f3-bfcb-4e7d-a20e-08cabf3eb89f">
    1393713937
    1393813938    <desc>
     
    1414614146      </desc>
    1414714147    </const>
    14148     <const name="OnCPUPriorityChanged" value="63">
    14149       <desc>
    14150         See <link to="ICPUPriorityChangedEvent">ICPUPriorityChangedEvent</link>.
     14148    <const name="OnCPUExecutionCapChanged" value="63">
     14149      <desc>
     14150        See <link to="ICPUExecutionCapChangedEvent">ICPUExecutionCapChangedEvent</link>.
    1415114151      </desc>
    1415214152    </const>
     
    1488914889
    1489014890  <interface
    14891     name="ICPUPriorityChangedEvent" extends="IEvent"
    14892     uuid="657fe2fe-a75a-4cb6-8cf9-072aa41e7d75"
    14893     wsmap="managed" autogen="VBoxEvent" id="OnCPUPriorityChanged"
     14891    name="ICPUExecutionCapChangedEvent" extends="IEvent"
     14892    uuid="dfa7e4f5-b4a4-44ce-85a8-127ac5eb59dc"
     14893    wsmap="managed" autogen="VBoxEvent" id="OnCPUExecutionCapChanged"
    1489414894    >
    1489514895   <desc>
    14896       Notification when the CPU priority changes.
     14896      Notification when the CPU execution cap changes.
    1489714897   </desc>
    14898      <attribute name="priority" type="unsigned long" readonly="yes">
     14898     <attribute name="executionCap" type="unsigned long" readonly="yes">
    1489914899       <desc>
    14900          The new CPU priority value. (1-100)
     14900         The new CPU execution cap value. (1-100)
    1490114901       </desc>
    1490214902     </attribute>
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r32851 r32885  
    182182    HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
    183183    HRESULT onCPUChange(ULONG aCPU, BOOL aRemove);
    184     HRESULT onCPUPriorityChange(ULONG aCpuPriority);
     184    HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
    185185    HRESULT onVRDPServerChange(BOOL aRestart);
    186186    HRESULT onUSBControllerChange();
  • trunk/src/VBox/Main/include/MachineImpl.h

    r32398 r32885  
    263263        ULONG                mCPUCount;
    264264        BOOL                 mCPUHotPlugEnabled;
    265         ULONG                mCpuPriority;
     265        ULONG                mCpuExecutionCap;
    266266        BOOL                 mAccelerate3DEnabled;
    267267        BOOL                 mHpetEnabled;
     
    385385    STDMETHOD(COMGETTER(CPUHotPlugEnabled))(BOOL *enabled);
    386386    STDMETHOD(COMSETTER(CPUHotPlugEnabled))(BOOL enabled);
    387     STDMETHOD(COMGETTER(CPUPriority))(ULONG *aPriority);
    388     STDMETHOD(COMSETTER(CPUPriority))(ULONG aPriority);
     387    STDMETHOD(COMGETTER(CPUExecutionCap))(ULONG *aExecutionCap);
     388    STDMETHOD(COMSETTER(CPUExecutionCap))(ULONG aExecutionCap);
    389389    STDMETHOD(COMGETTER(HpetEnabled))(BOOL *enabled);
    390390    STDMETHOD(COMSETTER(HpetEnabled))(BOOL enabled);
     
    623623    virtual HRESULT onStorageControllerChange() { return S_OK; }
    624624    virtual HRESULT onCPUChange(ULONG /* aCPU */, BOOL /* aRemove */) { return S_OK; }
    625     virtual HRESULT onCPUPriorityChange(ULONG /* aCpuPriority */) { return S_OK; }
     625    virtual HRESULT onCPUExecutionCapChange(ULONG /* aExecutionCap */) { return S_OK; }
    626626    virtual HRESULT onMediumChange(IMediumAttachment * /* mediumAttachment */, BOOL /* force */) { return S_OK; }
    627627    virtual HRESULT onSharedFolderChange() { return S_OK; }
     
    958958    HRESULT onParallelPortChange(IParallelPort *parallelPort);
    959959    HRESULT onCPUChange(ULONG aCPU, BOOL aRemove);
    960     HRESULT onCPUPriorityChange(ULONG aCpuPriority);
     960    HRESULT onCPUExecutionCapChange(ULONG aCpuExecutionCap);
    961961    HRESULT onVRDPServerChange(BOOL aRestart);
    962962    HRESULT onUSBControllerChange();
  • trunk/src/VBox/Main/include/SessionImpl.h

    r31698 r32885  
    9090    STDMETHOD(OnMediumChange)(IMediumAttachment *aMediumAttachment, BOOL aForce);
    9191    STDMETHOD(OnCPUChange)(ULONG aCPU, BOOL aRemove);
    92     STDMETHOD(OnCPUPriorityChange)(ULONG aCpuPriority);
     92    STDMETHOD(OnCPUExecutionCapChange)(ULONG aExecutionCap);
    9393    STDMETHOD(OnVRDPServerChange)(BOOL aRestart);
    9494    STDMETHOD(OnUSBControllerChange)();
  • trunk/src/VBox/Main/xml/Settings.cpp

    r32123 r32885  
    15401540          fCpuHotPlug(false),
    15411541          fHpetEnabled(false),
    1542           ulCpuPriority(100),
     1542          ulCpuExecutionCap(100),
    15431543          ulMemorySizeMB((uint32_t)-1),
    15441544          ulVRAMSizeMB(8),
     
    15871587                  && (cCPUs                     == h.cCPUs)
    15881588                  && (fCpuHotPlug               == h.fCpuHotPlug)
    1589                   && (ulCpuPriority             == h.ulCpuPriority)
     1589                  && (ulCpuExecutionCap         == h.ulCpuExecutionCap)
    15901590                  && (fHpetEnabled              == h.fHpetEnabled)
    15911591                  && (llCpus                    == h.llCpus)
     
    22492249
    22502250            pelmHwChild->getAttributeValue("hotplug", hw.fCpuHotPlug);
    2251             pelmHwChild->getAttributeValue("priority", hw.ulCpuPriority);
     2251            pelmHwChild->getAttributeValue("executionCap", hw.ulCpuExecutionCap);
    22522252
    22532253            const xml::ElementNode *pelmCPUChild;
     
    31943194        pelmCPU->createChild("SyntheticCpu")->setAttribute("enabled", hw.fSyntheticCpu);
    31953195    pelmCPU->setAttribute("count", hw.cCPUs);
    3196     if (hw.ulCpuPriority != 100)
    3197         pelmCPU->setAttribute("priority", hw.ulCpuPriority);
     3196    if (hw.ulCpuExecutionCap != 100)
     3197        pelmCPU->setAttribute("executionCap", hw.ulCpuExecutionCap);
    31983198
    31993199    if (hw.fLargePages)
     
    42324232        // VirtualBox 4.0 adds HD audio, CPU priorities, fault tolerance and per-machine media registries
    42334233        if (    hardwareMachine.audioAdapter.controllerType == AudioControllerType_HDA
    4234              || hardwareMachine.ulCpuPriority != 100
     4234             || hardwareMachine.ulCpuExecutionCap != 100
    42354235             || machineUserData.enmFaultToleranceState != FaultToleranceState_Inactive
    42364236             || machineUserData.uFaultTolerancePort
  • trunk/src/VBox/VMM/VM.cpp

    r32356 r32885  
    590590        AssertRelease(pVM->pSession == pUVM->vm.s.pSession);
    591591        AssertRelease(pVM->cCpus == cCpus);
    592         AssertRelease(pVM->uCpuPriority == 100);
     592        AssertRelease(pVM->uCpuExecutionCap == 100);
    593593        AssertRelease(pVM->offVMCPU == RT_UOFFSETOF(VM, aCpus));
    594594
     
    653653            if (RT_SUCCESS(rc))
    654654            {
    655                 rc = CFGMR3QueryU32Def(pRoot, "CpuPriority", &pVM->uCpuPriority, 100);
    656                 AssertLogRelMsgRC(rc, ("Configuration error: Querying \"CpuPriority\" as integer failed, rc=%Rrc\n", rc));
     655                rc = CFGMR3QueryU32Def(pRoot, "CpuExecutionCap", &pVM->uCpuExecutionCap, 100);
     656                AssertLogRelMsgRC(rc, ("Configuration error: Querying \"CpuExecutionCap\" as integer failed, rc=%Rrc\n", rc));
    657657
    658658                /*
     
    42724272
    42734273/**
    4274  * Changes the VCPU priority.
     4274 * Changes the VMM execution cap.
    42754275 *
    42764276 * @returns VBox status code.
    4277  * @param   pVM             The VM to operate on.
    4278  * @param   ulCpuPriority   New CPU priority
    4279  */
    4280 VMMR3DECL(int) VMR3SetCpuPriority(PVM pVM, unsigned ulCpuPriority)
    4281 {
    4282     AssertReturn(ulCpuPriority > 0 && ulCpuPriority <= 100, VERR_INVALID_PARAMETER);
    4283 
    4284     Log(("VMR3SetCpuPriority: new priority = %d\n", ulCpuPriority));
     4277 * @param   pVM                 The VM to operate on.
     4278 * @param   ulCpuExecutionCap   New CPU execution cap
     4279 */
     4280VMMR3DECL(int) VMR3SetCpuExecutionCap(PVM pVM, unsigned ulCpuExecutionCap)
     4281{
     4282    AssertReturn(ulCpuExecutionCap > 0 && ulCpuExecutionCap <= 100, VERR_INVALID_PARAMETER);
     4283
     4284    Log(("VMR3SetCpuExecutionCap: new priority = %d\n", ulCpuExecutionCap));
    42854285    /* Note: not called from EMT. */
    4286     pVM->uCpuPriority = ulCpuPriority;
     4286    pVM->uCpuExecutionCap = ulCpuExecutionCap;
    42874287    return VINF_SUCCESS;
    42884288}
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r32815 r32885  
    800800                            PVM pVM = (PVM)RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj); AssertPtr(pVM);
    801801                            memset(pVM, 0, cPages << PAGE_SHIFT);
    802                             pVM->enmVMState     = VMSTATE_CREATING;
    803                             pVM->pVMR0          = pVM;
    804                             pVM->pSession       = pSession;
    805                             pVM->hSelf          = iHandle;
    806                             pVM->cbSelf         = cbVM;
    807                             pVM->cCpus          = cCpus;
    808                             pVM->uCpuPriority   = 100; /* default is maximum priority. */
    809                             pVM->offVMCPU       = RT_UOFFSETOF(VM, aCpus);
     802                            pVM->enmVMState       = VMSTATE_CREATING;
     803                            pVM->pVMR0            = pVM;
     804                            pVM->pSession         = pSession;
     805                            pVM->hSelf            = iHandle;
     806                            pVM->cbSelf           = cbVM;
     807                            pVM->cCpus            = cCpus;
     808                            pVM->uCpuExecutionCap = 100; /* default is no cap. */
     809                            pVM->offVMCPU         = RT_UOFFSETOF(VM, aCpus);
    810810
    811811                            rc = RTR0MemObjAllocPage(&pGVM->gvmm.s.VMPagesMemObj, cPages * sizeof(SUPPAGE), false /* fExecutable */);
Note: See TracChangeset for help on using the changeset viewer.

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