Changeset 32885 in vbox for trunk/src/VBox/Main/MachineImpl.cpp
- Timestamp:
- Oct 4, 2010 12:56:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r32780 r32885 196 196 mIoCacheSize = 5; /* 5MB */ 197 197 198 /* Maximum CPU priorityby default. */199 mCpu Priority= 100;198 /* Maximum CPU execution cap by default. */ 199 mCpuExecutionCap = 100; 200 200 } 201 201 … … 1314 1314 } 1315 1315 1316 STDMETHODIMP Machine::COMGETTER(CPU Priority)(ULONG *aPriority)1317 { 1318 if (!a Priority)1316 STDMETHODIMP Machine::COMGETTER(CPUExecutionCap)(ULONG *aExecutionCap) 1317 { 1318 if (!aExecutionCap) 1319 1319 return E_POINTER; 1320 1320 … … 1324 1324 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1325 1325 1326 *a Priority = mHWData->mCpuPriority;1327 1328 return S_OK; 1329 } 1330 1331 STDMETHODIMP Machine::COMSETTER(CPU Priority)(ULONG aPriority)1326 *aExecutionCap = mHWData->mCpuExecutionCap; 1327 1328 return S_OK; 1329 } 1330 1331 STDMETHODIMP Machine::COMSETTER(CPUExecutionCap)(ULONG aExecutionCap) 1332 1332 { 1333 1333 HRESULT rc = S_OK; 1334 1334 1335 /* check prioritylimits */1336 if ( a Priority< 11337 || a Priority> 1001335 /* check throttle limits */ 1336 if ( aExecutionCap < 1 1337 || aExecutionCap > 100 1338 1338 ) 1339 1339 return setError(E_INVALIDARG, 1340 tr("Invalid CPU priority: %lu (must be in range [%lu, %lu])"),1341 a Priority, 1, 100);1340 tr("Invalid CPU execution cap value: %lu (must be in range [%lu, %lu])"), 1341 aExecutionCap, 1, 100); 1342 1342 1343 1343 AutoCaller autoCaller(this); … … 1347 1347 1348 1348 alock.release(); 1349 rc = onC PUPriorityChange(aPriority);1349 rc = onCpuExecutionCapChange(aExecutionCap); 1350 1350 alock.acquire(); 1351 1351 if (FAILED(rc)) return rc; … … 1353 1353 setModified(IsModified_MachineData); 1354 1354 mHWData.backup(); 1355 mHWData->mCpu Priority = aPriority;1355 mHWData->mCpuExecutionCap = aExecutionCap; 1356 1356 1357 1357 /* Save settings if online - todo why is this required?? */ … … 7021 7021 mHWData->mCPUCount = data.cCPUs; 7022 7022 mHWData->mCPUHotPlugEnabled = data.fCpuHotPlug; 7023 mHWData->mCpu Priority = data.ulCpuPriority;7023 mHWData->mCpuExecutionCap = data.ulCpuExecutionCap; 7024 7024 7025 7025 // cpu … … 8070 8070 } 8071 8071 8072 data.cCPUs = mHWData->mCPUCount;8073 data.fCpuHotPlug = !!mHWData->mCPUHotPlugEnabled;8074 data.ulCpu Priority = mHWData->mCpuPriority;8072 data.cCPUs = mHWData->mCPUCount; 8073 data.fCpuHotPlug = !!mHWData->mCPUHotPlugEnabled; 8074 data.ulCpuExecutionCap = mHWData->mCpuExecutionCap; 8075 8075 8076 8076 data.llCpus.clear(); … … 10991 10991 } 10992 10992 10993 HRESULT SessionMachine::onCPU PriorityChange(ULONG aCpuPriority)10993 HRESULT SessionMachine::onCPUExecutionCapChange(ULONG aExecutionCap) 10994 10994 { 10995 10995 LogFlowThisFunc(("\n")); … … 11008 11008 return S_OK; 11009 11009 11010 return directControl->OnCPU PriorityChange(aCpuPriority);11010 return directControl->OnCPUExecutionCapChange(aExecutionCap); 11011 11011 } 11012 11012
Note:
See TracChangeset
for help on using the changeset viewer.