vbox的更動 4492 路徑 trunk/src/VBox/Devices/VMMDev
- 時間撮記:
- 2007-9-3 下午12:10:30 (17 年 以前)
- 位置:
- trunk/src/VBox/Devices/VMMDev
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r4194 r4492 1179 1179 1180 1180 1181 case VMMDevReq_GetMemBalloonChangeRequest: 1182 { 1183 Log(("VMMDevReq_GetMemBalloonChangeRequest\n")); 1184 if (requestHeader->size != sizeof(VMMDevGetMemBalloonChangeRequest)) 1185 { 1186 requestHeader->rc = VERR_INVALID_PARAMETER; 1187 } 1188 else 1189 { 1190 VMMDevGetMemBalloonChangeRequest *memBalloonChangeRequest = (VMMDevGetMemBalloonChangeRequest*)requestHeader; 1191 /* just pass on the information */ 1192 Log(("VMMDev: returning memory balloon size =%d\n", pData->u32MemoryBalloonSize)); 1193 memBalloonChangeRequest->u32BalloonSize = pData->u32MemoryBalloonSize; 1194 1195 if (memBalloonChangeRequest->eventAck == VMMDEV_EVENT_BALLOON_CHANGE_REQUEST) 1196 { 1197 /* Remember which mode the client has queried. */ 1198 pData->u32LastMemoryBalloonSize = pData->u32MemoryBalloonSize; 1199 } 1200 1201 requestHeader->rc = VINF_SUCCESS; 1202 } 1203 break; 1204 } 1205 1206 case VMMDevReq_ReportGuestStats: 1207 { 1208 Log(("VMMDevReq_ReportGuestStats\n")); 1209 if (requestHeader->size != sizeof(VMMDevReportGuestStats)) 1210 { 1211 requestHeader->rc = VERR_INVALID_PARAMETER; 1212 } 1213 else 1214 { 1215 VMMDevReportGuestStats *stats = (VMMDevReportGuestStats*)requestHeader; 1216 1217 /* Update the last known memory balloon size */ 1218 if (stats->guestStats.u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_BALLOON) 1219 pData->u32LastMemoryBalloonSize = stats->guestStats.u32PhysMemBalloon; 1220 1221 /* forward the call */ 1222 requestHeader->rc = pData->pDrv->pfnReportStatistics(pData->pDrv, &stats->guestStats); 1223 } 1224 break; 1225 } 1226 1181 1227 case VMMDevReq_QueryCredentials: 1182 1228 { … … 1625 1671 /* IRQ so the guest knows what's going on */ 1626 1672 VMMDevNotifyGuest (pData, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST); 1673 } 1674 1675 return VINF_SUCCESS; 1676 } 1677 1678 static DECLCALLBACK(int) vmmdevSetMemoryBalloon(PPDMIVMMDEVPORT pInterface, uint32_t ulBalloonSize) 1679 { 1680 VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1681 1682 /* Verify that the new resolution is different and that guest does not yet know about it. */ 1683 bool fSame = (pData->u32LastMemoryBalloonSize == ulBalloonSize); 1684 1685 Log(("vmmdevSetMemoryBalloon: old=%d. new=%d\n", pData->u32LastMemoryBalloonSize, ulBalloonSize)); 1686 1687 if (!fSame) 1688 { 1689 /* we could validate the information here but hey, the guest can do that as well! */ 1690 pData->u32MemoryBalloonSize = ulBalloonSize; 1691 1692 /* IRQ so the guest knows what's going on */ 1693 VMMDevNotifyGuest (pData, VMMDEV_EVENT_BALLOON_CHANGE_REQUEST); 1627 1694 } 1628 1695 … … 1917 1984 pData->Port.pfnVBVAChange = vmmdevVBVAChange; 1918 1985 pData->Port.pfnRequestSeamlessChange = vmmdevRequestSeamlessChange; 1986 pData->Port.pfnSetMemoryBalloon = vmmdevSetMemoryBalloon; 1919 1987 1920 1988 /* Shared folder LED */ … … 2045 2113 /* disable seamless mode */ 2046 2114 pData->fLastSeamlessEnabled = false; 2115 2116 /* disabled memory ballooning */ 2117 pData->u32LastMemoryBalloonSize = 0; 2047 2118 2048 2119 /* Clear the event variables. -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r4071 r4492 132 132 } credentialsJudge; 133 133 134 /* memory balloon change request */ 135 uint32_t u32MemoryBalloonSize, u32LastMemoryBalloonSize; 136 134 137 /* seamless mode change request */ 135 138 bool fLastSeamlessEnabled, fSeamlessEnabled;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器