Changeset 27217 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Mar 9, 2010 2:53:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp
r27119 r27217 62 62 return VINF_SUCCESS; 63 63 64 VBoxServiceVerbose(3, "VBoxServiceBalloonSetUser: cNewChunks=%u g_cMemBalloonChunks=%u\n", cNewChunks, g_cMemBalloonChunks); 64 65 int rc = VINF_SUCCESS; 65 66 if (cNewChunks > g_cMemBalloonChunks) 66 67 { 67 68 /* inflate */ 69 g_pavBalloon = (void**)RTMemRealloc(g_pavBalloon, cNewChunks * sizeof(void*)); 68 70 uint32_t i; 69 g_pavBalloon = (void**)RTMemRealloc(g_pavBalloon, cNewChunks * sizeof(void*));70 71 for (i = g_cMemBalloonChunks; i < cNewChunks; i++) 71 72 { … … 79 80 { 80 81 g_pavBalloon[i] = pv; 81 /* protect against access by dangling pointers (may fail) */ 82 #ifndef RT_OS_SOLARIS 83 /* 84 * Protect against access by dangling pointers (ignore errors as it may fail). 85 * On Solaris it corrupts the address space leaving the process unkillable. This could 86 * perhaps be related to what the underlying segment driver does; currently just disable it. 87 */ 82 88 RTMemProtect(pv, VMMDEV_MEMORY_BALLOON_CHUNK_SIZE, RTMEM_PROT_NONE); 89 #endif 83 90 g_cMemBalloonChunks++; 84 91 } … … 89 96 } 90 97 } 98 VBoxServiceVerbose(3, "VBoxServiceBalloonSetUser: inflation complete. chunks=%u rc=%d\n", i, rc); 91 99 } 92 100 else … … 100 108 if (RT_SUCCESS(rc)) 101 109 { 110 #ifndef RT_OS_SOLARIS 102 111 /* unprotect */ 103 112 RTMemProtect(pv, VMMDEV_MEMORY_BALLOON_CHUNK_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE); 113 #endif 104 114 RTMemPageFree(g_pavBalloon[i]); 105 115 g_pavBalloon[i] = NULL; … … 108 118 else 109 119 break; 120 VBoxServiceVerbose(3, "VBoxServiceBalloonSetUser: deflation complete. chunks=%u rc=%d\n", i, rc); 110 121 } 111 122 } … … 213 224 cNewChunks, fHandleInR3 ? "R3" : "R0"); 214 225 if (fHandleInR3) 226 { 215 227 rc = VBoxServiceBalloonSetUser(cNewChunks); 228 if (RT_FAILURE(rc)) 229 { 230 VBoxServiceVerbose(3, "VBoxServiceBalloonWorker: failed to set balloon size %d MB (%s memory)\n", 231 cNewChunks, fHandleInR3 ? "R3" : "R0"); 232 } 233 else 234 VBoxServiceVerbose(3, "VBoxServiceBalloonWorker: successfully set requested balloon size %d.\n", cNewChunks); 235 } 216 236 else 217 237 g_cMemBalloonChunks = cNewChunks;
Note:
See TracChangeset
for help on using the changeset viewer.