VirtualBox

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

Renaming cpu priority to cpu execution cap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
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