Changeset 4524 in vbox for trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
- Timestamp:
- Sep 5, 2007 8:34:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r4492 r4524 1184 1184 if (requestHeader->size != sizeof(VMMDevGetMemBalloonChangeRequest)) 1185 1185 { 1186 AssertFailed(); 1186 1187 requestHeader->rc = VERR_INVALID_PARAMETER; 1187 1188 } … … 1197 1198 /* Remember which mode the client has queried. */ 1198 1199 pData->u32LastMemoryBalloonSize = pData->u32MemoryBalloonSize; 1200 } 1201 1202 requestHeader->rc = VINF_SUCCESS; 1203 } 1204 break; 1205 } 1206 1207 case VMMDevReq_GetStatisticsChangeRequest: 1208 { 1209 Log(("VMMDevReq_GetStatisticsChangeRequest\n")); 1210 if (requestHeader->size != sizeof(VMMDevGetStatisticsChangeRequest)) 1211 { 1212 AssertFailed(); 1213 requestHeader->rc = VERR_INVALID_PARAMETER; 1214 } 1215 else 1216 { 1217 VMMDevGetStatisticsChangeRequest *statIntervalChangeRequest = (VMMDevGetStatisticsChangeRequest*)requestHeader; 1218 /* just pass on the information */ 1219 Log(("VMMDev: returning statistics interval %d seconds\n", pData->u32StatIntervalSize)); 1220 statIntervalChangeRequest->u32StatInterval = pData->u32StatIntervalSize; 1221 1222 if (statIntervalChangeRequest->eventAck == VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST) 1223 { 1224 /* Remember which mode the client has queried. */ 1225 pData->u32LastStatIntervalSize= pData->u32StatIntervalSize; 1199 1226 } 1200 1227 … … 1696 1723 return VINF_SUCCESS; 1697 1724 } 1725 1726 static DECLCALLBACK(int) vmmdevSetStatisticsInterval(PPDMIVMMDEVPORT pInterface, uint32_t ulStatInterval) 1727 { 1728 VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1729 1730 /* Verify that the new resolution is different and that guest does not yet know about it. */ 1731 bool fSame = (pData->u32LastStatIntervalSize == ulStatInterval); 1732 1733 Log(("vmmdevSetStatisticsInterval: old=%d. new=%d\n", pData->u32LastStatIntervalSize, ulStatInterval)); 1734 1735 if (!fSame) 1736 { 1737 /* we could validate the information here but hey, the guest can do that as well! */ 1738 pData->u32StatIntervalSize = ulStatInterval; 1739 1740 /* IRQ so the guest knows what's going on */ 1741 VMMDevNotifyGuest (pData, VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST); 1742 } 1743 1744 return VINF_SUCCESS; 1745 } 1746 1698 1747 1699 1748 static DECLCALLBACK(int) vmmdevSetCredentials(PPDMIVMMDEVPORT pInterface, const char *pszUsername, … … 1985 2034 pData->Port.pfnRequestSeamlessChange = vmmdevRequestSeamlessChange; 1986 2035 pData->Port.pfnSetMemoryBalloon = vmmdevSetMemoryBalloon; 2036 pData->Port.pfnSetStatisticsInterval = vmmdevSetStatisticsInterval; 1987 2037 1988 2038 /* Shared folder LED */ … … 2116 2166 /* disabled memory ballooning */ 2117 2167 pData->u32LastMemoryBalloonSize = 0; 2168 2169 /* disabled statistics updating */ 2170 pData->u32LastStatIntervalSize = 0; 2118 2171 2119 2172 /* Clear the event variables.
Note:
See TracChangeset
for help on using the changeset viewer.