Changeset 13722 in vbox for trunk/src/VBox/Main/MachineImpl.cpp
- Timestamp:
- Oct 31, 2008 3:53:18 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38690
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r13713 r13722 188 188 /* default values for a newly created machine */ 189 189 mMemorySize = 128; 190 mCPUCount = 1; 190 191 mMemoryBalloonSize = 0; 191 192 mStatisticsUpdateInterval = 0; … … 226 227 mHWVirtExVPIDEnabled != that.mHWVirtExVPIDEnabled || 227 228 mPAEEnabled != that.mPAEEnabled || 229 mCPUCount != that.mCPUCount || 228 230 mClipboardMode != that.mClipboardMode) 229 231 return false; … … 932 934 mHWData.backup(); 933 935 mHWData->mMemorySize = memorySize; 936 937 return S_OK; 938 } 939 940 STDMETHODIMP Machine::COMGETTER(CPUCount) (ULONG *CPUCount) 941 { 942 if (!CPUCount) 943 return E_POINTER; 944 945 AutoCaller autoCaller (this); 946 CheckComRCReturnRC (autoCaller.rc()); 947 948 AutoReadLock alock (this); 949 950 *CPUCount = mHWData->mCPUCount; 951 952 return S_OK; 953 } 954 955 STDMETHODIMP Machine::COMSETTER(CPUCount) (ULONG CPUCount) 956 { 957 /* check RAM limits */ 958 if (CPUCount < SchemaDefs::MinCPUCount || 959 CPUCount > SchemaDefs::MaxCPUCount) 960 return setError (E_INVALIDARG, 961 tr ("Invalid virtual CPU count: %lu (must be in range [%lu, %lu])"), 962 CPUCount, SchemaDefs::MinCPUCount, SchemaDefs::MaxCPUCount); 963 964 AutoCaller autoCaller (this); 965 CheckComRCReturnRC (autoCaller.rc()); 966 967 AutoWriteLock alock (this); 968 969 HRESULT rc = checkStateDependency (MutableStateDep); 970 CheckComRCReturnRC (rc); 971 972 mHWData.backup(); 973 mHWData->mCPUCount = CPUCount; 934 974 935 975 return S_OK; … … 4940 4980 mHWData->mPAEEnabled = PAENode.value <bool> ("enabled"); 4941 4981 } 4982 4983 /* CPUCount(optional, default is 1) */ 4984 Key CPUCountNode = cpuNode.findKey ("CPUCount"); 4985 if (!CPUCountNode.isNull()) 4986 { 4987 mHWData->mCPUCount = CPUCountNode.value <ULONG> ("CPUCount"); 4988 } 4942 4989 } 4943 4990 } … … 6310 6357 PAENode.setValue <bool> ("enabled", true); 6311 6358 } 6359 6360 /* CPU count */ 6361 Key CPUCountNode = cpuNode.createKey ("CPUCount"); 6362 CPUCountNode.setValue <ULONG> ("CPUCount", mHWData->mCPUCount); 6312 6363 } 6313 6364
Note:
See TracChangeset
for help on using the changeset viewer.