Changeset 29345 in vbox for trunk/src/VBox/Additions
- Timestamp:
- May 11, 2010 12:22:48 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61450
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r29343 r29345 310 310 if (RT_FAILURE(rc)) 311 311 { 312 /* 313 * HACK ALERT! If a service uses some sort of functionality (like a 314 * certain HGCM host service which is not available on the host or 315 * some special OS feature which is not available on the current guest), 316 * just disable that service here in case the service told us so. 317 * 318 * This prevents terminating the whole VBoxService if a (or some) sub service(s) is/are 319 * not available. 320 */ 321 322 /** @todo r=bird: This a generic thing that isn't necessarily restricted to 323 * HGCM. Also, the service knows best whether a host service is required 324 * or optional. So, there service should either have a way of signalling 325 * non-fatal init failure, or simply quietly pretend to work. (Low 326 * prio.) */ 327 if ( rc == VERR_NOT_SUPPORTED 328 || rc == VERR_NOT_IMPLEMENTED) 329 { 330 VBoxServiceVerbose(0, "Service '%s' disabled because a certain functionality is not implemented or supported, rc=%Rrc\n", 331 g_aServices[j].pDesc->pszName, rc); 332 g_aServices[j].fEnabled = false; 333 } 334 else 312 if (rc != VERR_SERVICE_DISABLED) 335 313 { 336 314 VBoxServiceError("Service '%s' failed to initialize: %Rrc\n", … … 338 316 return rc; 339 317 } 318 g_aServices[j].fEnabled = false; 319 VBoxServiceVerbose(0, "Service '%s' was disabled because of missing functionality\n", 320 g_aServices[j].pDesc->pszName); 321 340 322 } 341 323 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp
r29320 r29345 267 267 g_cMemBalloonChunks = cNewChunks; 268 268 } 269 else 270 { 271 if (rc == VERR_INVALID_PARAMETER) /* Host service is not available. */ 269 if (RT_FAILURE(rc)) 270 { 271 /* If the service was not found, we disable this service without 272 causing VBoxService to fail. */ 273 if ( rc == VERR_NOT_IMPLEMENTED 274 #ifdef RT_OS_WINDOWS /** @todo r=bird: Windows kernel driver should return VERR_NOT_IMPLEMENTED, 275 * VERR_INVALID_PARAMETER has too many other uses. */ 276 || rc == VERR_INVALID_PARAMETER 277 #endif 278 ) 279 { 272 280 VBoxServiceVerbose(0, "MemBalloon: Memory ballooning support is not available\n"); 281 rc = VERR_SERVICE_DISABLED; 282 } 273 283 else 284 { 274 285 VBoxServiceVerbose(3, "MemBalloon: VbglR3MemBalloonRefresh failed with %Rrc\n", rc); 286 rc = VERR_SERVICE_DISABLED; /** @todo Playing safe for now, figure out the exact status codes here. */ 287 } 275 288 RTSemEventMultiDestroy(g_MemBalloonEvent); 276 289 g_MemBalloonEvent = NIL_RTSEMEVENTMULTI; 277 278 /*279 * Not having the guest control service on the host renders this whole service280 * unusable, so report that we are not able to continue.281 */282 rc = VERR_NOT_SUPPORTED;283 290 } 284 291 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r29316 r29345 89 89 else 90 90 { 91 /* If the service was not found, we disable this service without 92 causing VBoxService to fail. */ 91 93 if (rc == VERR_HGCM_SERVICE_NOT_FOUND) /* Host service is not available. */ 94 { 92 95 VBoxServiceVerbose(0, "Control: Guest control service is not available\n"); 96 rc = VERR_SERVICE_DISABLED; 97 } 93 98 else 94 99 VBoxServiceError("Control: Failed to connect to the guest control service! Error: %Rrc\n", rc); 95 100 RTSemEventMultiDestroy(g_hControlEvent); 96 101 g_hControlEvent = NIL_RTSEMEVENTMULTI; 97 98 /*99 * Not having the guest control service on the host renders this whole service100 * unusable, so report that we are not able to continue.101 */102 rc = VERR_NOT_SUPPORTED;103 102 } 104 103 return rc; -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp
r29316 r29345 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 135 135 { 136 136 VBoxServiceVerbose(3, "VBoxStatsInit: NTDLL.NtQuerySystemInformation not found!\n"); 137 return VERR_ NOT_IMPLEMENTED;137 return VERR_SERVICE_DISABLED; 138 138 } 139 139 } … … 150 150 /** @todo Now fails in NT4; do we care? */ 151 151 VBoxServiceVerbose(3, "VBoxStatsInit: KERNEL32.GlobalMemoryStatusEx not found!\n"); 152 return VERR_ NOT_IMPLEMENTED;152 return VERR_SERVICE_DISABLED; 153 153 } 154 154 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
r29316 r29345 108 108 109 109 #ifdef RT_OS_WINDOWS 110 /** @todo Use RTLdr instead of LoadLibrary/GetProcAddress here! */111 110 /** @todo r=bird: call a windows specific init function and move 111 * g_pfnWTSGetActiveConsoleSessionId out of the global scope. */ 112 112 /* Get function pointers. */ 113 113 HMODULE hKernel32 = LoadLibrary("kernel32"); … … 124 124 else 125 125 { 126 /* If the service was not found, we disable this service without 127 causing VBoxService to fail. */ 126 128 if (rc == VERR_HGCM_SERVICE_NOT_FOUND) /* Host service is not available. */ 127 VBoxServiceVerbose(0, "VMInfo: Guest property service is not available\n"); 129 { 130 VBoxServiceVerbose(0, "VMInfo: Guest property service is not available, disabling the service\n"); 131 rc = VERR_SERVICE_DISABLED; 132 } 128 133 else 129 134 VBoxServiceError("VMInfo: Failed to connect to the guest property service! Error: %Rrc\n", rc); 130 135 RTSemEventMultiDestroy(g_hVMInfoEvent); 131 136 g_hVMInfoEvent = NIL_RTSEMEVENTMULTI; 132 133 /*134 * Not having the guest property service on the host renders this whole service135 * unusable, so report that we are not able to continue.136 */137 rc = VERR_NOT_SUPPORTED;138 137 } 139 138 … … 142 141 VBoxServicePropCacheCreate(&g_VMInfoPropCache, g_uVMInfoGuestPropSvcClientID); 143 142 144 /** @todo r=bird: Setting Net/Count to 0 here is wrong and will confuse users.145 * Besides, because it is the beacon updating it implies that all the146 * other values are up to date too, but they aren't147 * (VBoxServiceVMInfoWriteFixedProperties hasn't been called yet for148 * instance). I would suggest changing these statements to149 * "declarations" or moving them. */150 151 143 /* 152 * Initialize some guest properties to haveflags and reset values.144 * Declare some guest properties with flags and reset values. 153 145 */ 154 146 VBoxServicePropCacheUpdateEntry(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsersList", … … 496 488 497 489 /** @todo r=bird: if cInterfaces decreased compared to the previous run, zap 498 * the stale data. */490 * the stale data. This can probably be encorporated into the cache. */ 499 491 500 492 … … 549 541 * terminates). [don't remove till implemented] 550 542 */ 551 /** @todo r=bird: Drop the VbglR3GuestPropDelSet call here and make the cache552 * rememberwhat we've written. */543 /** @todo r=bird: Drop the VbglR3GuestPropDelSet call here and use the cache 544 * since it remembers what we've written. */ 553 545 /* Delete the "../Net" branch. */ 554 546 const char *apszPat[1] = { "/VirtualBox/GuestInfo/Net/*" };
Note:
See TracChangeset
for help on using the changeset viewer.