Changeset 26295 in vbox for trunk/src/VBox/Main
- Timestamp:
- Feb 5, 2010 2:36:51 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r26290 r26295 82 82 mMemoryBalloonSize = 0; /* Default is no ballooning */ 83 83 84 ULONG aStatUpdateInterval; 85 ret = mParent->machine()->COMGETTER(StatisticsUpdateInterval)(&aStatUpdateInterval); 86 if (ret == S_OK) 87 mStatUpdateInterval = aStatUpdateInterval; 88 else 89 mStatUpdateInterval = 0; /* Default is not to report guest statistics at all */ 90 84 91 /* invalidate all stats */ 85 92 for (int i=0;i<GuestStatisticType_MaxVal;i++) … … 218 225 } 219 226 227 STDMETHODIMP Guest::COMGETTER(StatisticsUpdateInterval) (ULONG *aUpdateInterval) 228 { 229 CheckComArgOutPointerValid(aUpdateInterval); 230 231 AutoCaller autoCaller(this); 232 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 233 234 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 235 236 *aUpdateInterval = mStatUpdateInterval; 237 238 return S_OK; 239 } 240 241 STDMETHODIMP Guest::COMSETTER(StatisticsUpdateInterval) (ULONG aUpdateInterval) 242 { 243 AutoCaller autoCaller(this); 244 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 245 246 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 247 248 HRESULT ret = mParent->machine()->COMSETTER(StatisticsUpdateInterval)(aUpdateInterval); 249 if (ret == S_OK) 250 { 251 mStatUpdateInterval = aUpdateInterval; 252 /* forward the information to the VMM device */ 253 VMMDev *vmmDev = mParent->getVMMDev(); 254 if (vmmDev) 255 vmmDev->getVMMDevPort()->pfnSetStatisticsInterval(vmmDev->getVMMDevPort(), aUpdateInterval); 256 } 257 258 return ret; 259 } 220 260 221 261 STDMETHODIMP Guest::SetCredentials(IN_BSTR aUserName, IN_BSTR aPassword, -
trunk/src/VBox/Main/MachineImpl.cpp
r26290 r26295 157 157 mCPUHotPlugEnabled = false; 158 158 mMemoryBalloonSize = 0; 159 mStatisticsUpdateInterval = 0; 159 160 mVRAMSize = 8; 160 161 mAccelerate3DEnabled = false; … … 1158 1159 return S_OK; 1159 1160 } 1161 1162 /** @todo this method should not be public */ 1163 STDMETHODIMP Machine::COMGETTER(StatisticsUpdateInterval) (ULONG *statisticsUpdateInterval) 1164 { 1165 if (!statisticsUpdateInterval) 1166 return E_POINTER; 1167 1168 AutoCaller autoCaller(this); 1169 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1170 1171 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1172 1173 *statisticsUpdateInterval = mHWData->mStatisticsUpdateInterval; 1174 1175 return S_OK; 1176 } 1177 1178 /** @todo this method should not be public */ 1179 STDMETHODIMP Machine::COMSETTER(StatisticsUpdateInterval) (ULONG statisticsUpdateInterval) 1180 { 1181 AutoCaller autoCaller(this); 1182 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1183 1184 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1185 1186 HRESULT rc = checkStateDependency(MutableStateDep); 1187 if (FAILED(rc)) return rc; 1188 1189 setModified(IsModified_MachineData); 1190 mHWData.backup(); 1191 mHWData->mStatisticsUpdateInterval = statisticsUpdateInterval; 1192 1193 return S_OK; 1194 } 1195 1160 1196 1161 1197 STDMETHODIMP Machine::COMGETTER(Accelerate3DEnabled)(BOOL *enabled) … … 6236 6272 // guest settings 6237 6273 mHWData->mMemoryBalloonSize = data.ulMemoryBalloonSize; 6274 mHWData->mStatisticsUpdateInterval = data.ulStatisticsUpdateInterval; 6238 6275 6239 6276 #ifdef VBOX_WITH_GUEST_PROPS … … 7269 7306 /* Guest */ 7270 7307 data.ulMemoryBalloonSize = mHWData->mMemoryBalloonSize; 7308 data.ulStatisticsUpdateInterval = mHWData->mStatisticsUpdateInterval; 7271 7309 7272 7310 // guest properties -
trunk/src/VBox/Main/VMMDevInterface.cpp
r26290 r26295 403 403 } 404 404 405 /** 406 * Request the statistics interval 407 * 408 * @returns VBox status code. 409 * @param pInterface Pointer to this interface. 410 * @param pulInterval Pointer to interval in seconds 411 * @thread The emulation thread. 412 */ 413 DECLCALLBACK(int) vmmdevQueryStatisticsInterval(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pulInterval) 414 { 415 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 416 ULONG val = 0; 417 418 if (!pulInterval) 419 return VERR_INVALID_POINTER; 420 421 /* store that information in IGuest */ 422 Guest* guest = pDrv->pVMMDev->getParent()->getGuest(); 423 Assert(guest); 424 if (!guest) 425 return VERR_INVALID_PARAMETER; /** @todo wrong error */ 426 427 guest->COMGETTER(StatisticsUpdateInterval)(&val); 428 *pulInterval = val; 429 return VINF_SUCCESS; 430 } 405 431 406 432 /** … … 710 736 pData->Connector.pfnQueryVisibleRegion = vmmdevQueryVisibleRegion; 711 737 pData->Connector.pfnReportStatistics = vmmdevReportStatistics; 738 pData->Connector.pfnQueryStatisticsInterval = vmmdevQueryStatisticsInterval; 712 739 pData->Connector.pfnChangeMemoryBalloon = vmmdevChangeMemoryBalloon; 713 740 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r26290 r26295 4371 4371 </attribute> 4372 4372 4373 <attribute name="statisticsUpdateInterval" type="unsigned long"> 4374 <desc>Initial interval to update guest statistics in seconds.</desc> 4375 </attribute> 4376 4373 4377 <attribute name="VRAMSize" type="unsigned long"> 4374 4378 <desc>Video memory size in megabytes.</desc> … … 8307 8311 <attribute name="memoryBalloonSize" type="unsigned long"> 8308 8312 <desc>Guest system memory balloon size in megabytes.</desc> 8313 </attribute> 8314 8315 <attribute name="statisticsUpdateInterval" type="unsigned long"> 8316 <desc>Interval to update guest statistics in seconds.</desc> 8309 8317 </attribute> 8310 8318 -
trunk/src/VBox/Main/include/GuestImpl.h
r26290 r26295 65 65 STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize); 66 66 STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize); 67 STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval); 68 STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval); 67 69 68 70 // IGuest methods … … 99 101 100 102 ULONG mMemoryBalloonSize; 103 ULONG mStatUpdateInterval; 101 104 102 105 ULONG mCurrentGuestStat[GuestStatisticType_MaxVal]; -
trunk/src/VBox/Main/include/MachineImpl.h
r26290 r26295 269 269 ULONG mMemorySize; 270 270 ULONG mMemoryBalloonSize; 271 ULONG mStatisticsUpdateInterval; 271 272 ULONG mVRAMSize; 272 273 ULONG mMonitorCount; … … 375 376 STDMETHOD(COMGETTER(MemoryBalloonSize))(ULONG *memoryBalloonSize); 376 377 STDMETHOD(COMSETTER(MemoryBalloonSize))(ULONG memoryBalloonSize); 378 STDMETHOD(COMGETTER(StatisticsUpdateInterval))(ULONG *statisticsUpdateInterval); 379 STDMETHOD(COMSETTER(StatisticsUpdateInterval))(ULONG statisticsUpdateInterval); 377 380 STDMETHOD(COMGETTER(VRAMSize))(ULONG *memorySize); 378 381 STDMETHOD(COMSETTER(VRAMSize))(ULONG memorySize);
Note:
See TracChangeset
for help on using the changeset viewer.