- Timestamp:
- Apr 6, 2010 12:24:02 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/GMM.cpp
r27102 r27999 290 290 } 291 291 292 /** 293 * @see GMMR0QueryTotalBalloonSizeReq 294 */ 295 GMMR3DECL(int) GMMR3QueryTotalBalloonSize(PVM pVM, uint64_t *pcTotalBalloonedPages) 296 { 297 GMMBALLOONEDPAGESREQ Req; 298 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 299 Req.Hdr.cbReq = sizeof(Req); 300 Req.cBalloonedPages = 0; 301 302 *pcTotalBalloonedPages = 0; 303 int rc = VMMR3CallR0(pVM, VMMR0_DO_GMM_QUERY_TOTAL_BALLOON_SIZE, 0, &Req.Hdr); 304 if (rc == VINF_SUCCESS) 305 *pcTotalBalloonedPages = Req.cBalloonedPages; 306 307 return rc; 308 } 292 309 293 310 /** -
trunk/src/VBox/VMM/PGMPhys.cpp
r27750 r27999 953 953 } 954 954 955 /** 956 * Query the VM and host balloon sizes 957 * 958 * @returns VBox status code. 959 * @param pVM The VM handle. 960 * @param puBalloonVM Pointer to VM balloon size 961 * @param puBalloonAllVMs Pointer to total balloon size of all VMs 962 */ 963 VMMR3DECL(int) PGMR3QueryBalloonSize(PVM pVM, uint64_t *puBalloonVM, uint64_t *puBalloonAllVMs) 964 { 965 int rc = VINF_SUCCESS; 966 967 if (puBalloonVM) 968 *puBalloonVM = pVM->pgm.s.cBalloonedPages; 969 970 if (puBalloonAllVMs) 971 { 972 *puBalloonAllVMs = 0; 973 rc = GMMR3QueryTotalBalloonSize(pVM, puBalloonAllVMs); 974 AssertRC(rc); 975 } 976 977 return rc; 978 } 955 979 956 980 /** -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r27976 r27999 2862 2862 pVM, enmAction, cBalloonedPages)); 2863 2863 2864 AssertMsgReturn(cBalloonedPages < RT_BIT(32 - PAGE_SHIFT), ("%#x\n", cBalloonedPages), VERR_INVALID_PARAMETER); 2865 2864 2866 /* 2865 2867 * Validate input and get the basics. … … 2871 2873 if (RT_FAILURE(rc)) 2872 2874 return rc; 2873 2874 AssertMsgReturn(cBalloonedPages < RT_BIT(32 - PAGE_SHIFT), ("%#x\n", cBalloonedPages), VERR_INVALID_PARAMETER);2875 2875 2876 2876 /* … … 2991 2991 } 2992 2992 2993 /** 2994 * Return the total amount of ballooned pages for all VMs 2995 * 2996 * @returns VBox status code: 2997 * @param pVM Pointer to the shared VM structure. 2998 * @param pReq The request packet. 2999 */ 3000 GMMR0DECL(int) GMMR0QueryTotalBalloonSizeReq(PVM pVM, PGMMBALLOONQUERYREQ pReq) 3001 { 3002 /* 3003 * Validate input and pass it on. 3004 */ 3005 AssertPtrReturn(pVM, VERR_INVALID_POINTER); 3006 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 3007 AssertMsgReturn(pReq->Hdr.cbReq == sizeof(GMMBALLOONQUERYREQ), 3008 ("%#x < %#x\n", pReq->Hdr.cbReq, sizeof(GMMBALLOONQUERYREQ)), 3009 VERR_INVALID_PARAMETER); 3010 3011 /* 3012 * Validate input and get the basics. 3013 */ 3014 PGMM pGMM; 3015 GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR); 3016 pReq->cBalloonedPages = pGMM->cBalloonedPages; 3017 GMM_CHECK_SANITY_UPON_LEAVING(pGMM); 3018 3019 return VINF_SUCCESS; 3020 } 2993 3021 2994 3022 /** -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r27084 r27999 915 915 return GMMR0BalloonedPagesReq(pVM, idCpu, (PGMMBALLOONEDPAGESREQ)pReqHdr); 916 916 917 case VMMR0_DO_GMM_QUERY_TOTAL_BALLOON_SIZE: 918 if (u64Arg) 919 return VERR_INVALID_PARAMETER; 920 return GMMR0QueryTotalBalloonSizeReq(pVM, (PGMMBALLOONQUERYREQ)pReqHdr); 921 917 922 case VMMR0_DO_GMM_MAP_UNMAP_CHUNK: 918 923 if (u64Arg)
Note:
See TracChangeset
for help on using the changeset viewer.