Changeset 26061 in vbox
- Timestamp:
- Jan 27, 2010 10:18:30 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56980
- Location:
- trunk
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r25975 r26061 502 502 /** @name CPU hotplug monitor 503 503 * @{ */ 504 VBGLR3DECL(int) VbglR3CpuHot plugInit(void);505 VBGLR3DECL(int) VbglR3CpuHot plugTerm(void);506 VBGLR3DECL(int) VbglR3CpuHot plugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);504 VBGLR3DECL(int) VbglR3CpuHotPlugInit(void); 505 VBGLR3DECL(int) VbglR3CpuHotPlugTerm(void); 506 VBGLR3DECL(int) VbglR3CpuHotPlugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage); 507 507 /** @} */ 508 508 -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp
r26058 r26061 34 34 * @returns VBox status code. 35 35 */ 36 VBGLR3DECL(int) VbglR3CpuHot plugInit(void)36 VBGLR3DECL(int) VbglR3CpuHotPlugInit(void) 37 37 { 38 38 int rc = VbglR3CtlFilterMask(VMMDEV_EVENT_CPU_HOTPLUG, 0); … … 58 58 * @returns VBox status. 59 59 */ 60 VBGLR3DECL(int) VbglR3CpuHot plugTerm(void)60 VBGLR3DECL(int) VbglR3CpuHotPlugTerm(void) 61 61 { 62 62 /* Clear the events. */ … … 78 78 * @param pidCpuPackage Where to store the CPU package ID on success. 79 79 */ 80 VBGLR3DECL(int) VbglR3CpuHot plugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage)80 VBGLR3DECL(int) VbglR3CpuHotPlugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage) 81 81 { 82 82 AssertPtrReturn(penmEventType, VERR_INVALID_POINTER); -
trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk
r25975 r26061 5 5 6 6 # 7 # Copyright (C) 2007 Sun Microsystems, Inc.7 # Copyright (C) 2007-2010 Sun Microsystems, Inc. 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 42 42 endif 43 43 endif 44 if1of ($(KBUILD_TARGET), linux) 45 VBoxService_DEFS += VBOXSERVICE_CPUHOTPLUG 46 endif 47 44 48 VBoxService_SOURCES = \ 45 49 VBoxService.cpp \ … … 56 60 endif 57 61 endif 62 if1of ($(KBUILD_TARGET), linux) 63 VBoxService_SOURCES += \ 64 VBoxServiceCpuHotPlug.cpp 65 endif 58 66 VBoxService_SOURCES.win += \ 59 67 VBoxService-win.rc \ … … 63 71 VBoxServiceClipboard-os2.cpp 64 72 65 # CPU hotplug support only for Linux guests at the moment66 VBoxService_DEFS.linux += VBOXSERVICE_CPUHOTPLUG67 VBoxService_SOURCES.linux += \68 VBoxServiceCpuHotplug.cpp69 70 73 VBoxService_LIBS = \ 71 74 $(VBOX_LIB_IPRT_GUEST_R3) \ … … 74 77 ifdef VBOX_WITH_GUEST_PROPS 75 78 VBoxService_LIBS.win += \ 76 Secur32.lib \77 WtsApi32.lib \78 Psapi.lib79 Secur32.lib \ 80 WtsApi32.lib \ 81 Psapi.lib 79 82 VBoxService_LIBS.solaris += \ 80 nsl83 nsl 81 84 endif 82 85 … … 84 87 # VBoxServiceNT - NT4 version of VBoxService. 85 88 # 86 VBoxServiceNT_TEMPLATE 87 VBoxServiceNT_EXTENDS 88 VBoxServiceNT_DEFS.win 89 VBoxServiceNT_TEMPLATE = VBOXGUESTR3EXE 90 VBoxServiceNT_EXTENDS = VBoxService 91 VBoxServiceNT_DEFS.win = _WIN32_WINNT=0x0400 TARGET_NT4 89 92 90 #VBoxServiceVMInfo.cpp uses VBOX_SVN_REV.91 93 VBoxServiceVMInfo.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) 92 94 VBoxServiceVMInfo.cpp_DEPS = $(VBOX_SVN_REV_KMK) -
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r25975 r26061 5 5 6 6 /* 7 * Copyright (C) 2007-20 09Sun Microsystems, Inc.7 * Copyright (C) 2007-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 92 92 #endif 93 93 #ifdef VBOXSERVICE_CPUHOTPLUG /* Disabled by default. Use --enable-cpuhotplug to enable */ 94 { &g_CpuHot plug, NIL_RTTHREAD, false, false, false, false },94 { &g_CpuHotPlug, NIL_RTTHREAD, false, false, false, false }, 95 95 #endif 96 96 }; -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp
r26014 r26061 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxService - Guest Additions C pu Hotplug Service.3 * VBoxService - Guest Additions CPU Hot Plugging Service. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 20 07Sun Microsystems, Inc.7 * Copyright (C) 2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 23 23 * Header Files * 24 24 *******************************************************************************/ 25 #include <iprt/assert.h> 26 #include <iprt/dir.h> 27 #include <iprt/file.h> 28 #include <iprt/mem.h> 29 #include <iprt/string.h> 25 30 #include <iprt/thread.h> 26 #include <iprt/string.h>27 #include <iprt/file.h>28 #include <iprt/assert.h>29 #include <iprt/mem.h>30 #include <iprt/dir.h>31 31 #include <VBox/VBoxGuestLib.h> 32 32 #include "VBoxServiceInternal.h" … … 37 37 #endif 38 38 39 /** 40 * Paths to access the CPU device 41 */ 42 #ifdef RT_OS_LINUX 43 # define SYSFS_ACPI_CPU_PATH "/sys/devices/LNXSYSTM:00/device:00" 44 # define SYSFS_CPU_PATH "/sys/devices/system/cpu" 39 40 /******************************************************************************* 41 * Defined Constants And Macros * 42 *******************************************************************************/ 43 #ifdef RT_OS_LINUX 44 /** @name Paths to access the CPU device 45 * @{ 46 */ 47 # define SYSFS_ACPI_CPU_PATH "/sys/devices/LNXSYSTM:00/device:00" 48 # define SYSFS_CPU_PATH "/sys/devices/system/cpu" 49 /** @} */ 45 50 #endif 46 51 47 /*******************************************************************************48 * Global Variables *49 *******************************************************************************/50 52 51 53 #ifdef RT_OS_LINUX … … 58 60 * @param idCpuPackage The package ID of the CPU. 59 61 */ 60 static int cpuHotplugGetACPIDevicePath(char **ppszPath, uint32_t idCpuCore, uint32_t idCpuPackage) 61 { 62 int rc = VINF_SUCCESS; 62 static int VBoxServiceCpuHotPlugGetACPIDevicePath(char **ppszPath, uint32_t idCpuCore, uint32_t idCpuPackage) 63 { 64 AssertPtr(ppszPath); 65 63 66 PRTDIR pDirDevices = NULL; 64 65 AssertPtrReturn(ppszPath, VERR_INVALID_PARAMETER); 66 67 rc = RTDirOpen(&pDirDevices, SYSFS_ACPI_CPU_PATH); /*could use RTDirOpenFiltered*/ 68 67 int rc = RTDirOpen(&pDirDevices, SYSFS_ACPI_CPU_PATH); /*could use RTDirOpenFiltered*/ 69 68 if (RT_SUCCESS(rc)) 70 69 { 71 70 RTDIRENTRY DirFolderContent; 72 73 71 while (RT_SUCCESS(RTDirRead(pDirDevices, &DirFolderContent, NULL))) /* Assumption that szName has always enough space */ 74 72 { 75 if (! RTStrNCmp(DirFolderContent.szName, "LNXCPU", 6))73 if (!strncmp(DirFolderContent.szName, "LNXCPU", 6)) 76 74 { 77 char *pszSysDevPath = NULL;78 79 75 /* Get the sysdev */ 80 rc = RTStrAPrintf(&pszSysDevPath, "%s/%s", SYSFS_ACPI_CPU_PATH, DirFolderContent.szName); 76 uint32_t idCore = RTLinuxSysFsReadIntFile(10, "%s/%s/sysdev/topology/core_id", 77 SYSFS_ACPI_CPU_PATH, DirFolderContent.szName); 78 uint32_t idPackage = RTLinuxSysFsReadIntFile(10, "%s/%s/sysdev/topology/physical_package_id", 79 SYSFS_ACPI_CPU_PATH, DirFolderContent.szName); 80 if ( idCore == idCpuCore 81 && idPackage == idCpuPackage) 82 { 83 /* Return the path */ 84 rc = RTStrAPrintf(ppszPath, "%s/%s", SYSFS_ACPI_CPU_PATH, DirFolderContent.szName); 85 break; 86 } 87 } 88 } 89 90 RTDirClose(pDirDevices); 91 } 92 93 return rc; 94 } 95 #endif /* RT_OS_LINUX */ 96 97 98 /** @copydoc VBOXSERVICE::pfnPreInit */ 99 static DECLCALLBACK(int) VBoxServiceCpuHotPlugPreInit(void) 100 { 101 return VINF_SUCCESS; 102 } 103 104 105 /** @copydoc VBOXSERVICE::pfnOption */ 106 static DECLCALLBACK(int) VBoxServiceCpuHotPlugOption(const char **ppszShort, int argc, char **argv, int *pi) 107 { 108 return VINF_SUCCESS; 109 } 110 111 112 /** @copydoc VBOXSERVICE::pfnInit */ 113 static DECLCALLBACK(int) VBoxServiceCpuHotPlugInit(void) 114 { 115 return VINF_SUCCESS; 116 } 117 118 119 /** 120 * Handles VMMDevCpuEventType_Plug. 121 * 122 * @param idCpuCore The CPU core ID. 123 * @param idCpuPackage The CPU package ID. 124 */ 125 static void VBoxServiceCpuHotPlugHandlePlugEvent(uint32_t idCpuCore, uint32_t idCpuPackage) 126 { 127 #ifdef RT_OS_LINUX 128 /* 129 * The topology directory is not available until the CPU is online. So we just iterate over all directories 130 * and enable every CPU which is not online already. 131 */ 132 /** @todo Maybe use udev to monitor events from the kernel */ 133 PRTDIR pDirDevices = NULL; 134 int rc = RTDirOpen(&pDirDevices, SYSFS_CPU_PATH); /*could use RTDirOpenFiltered*/ 135 if (RT_SUCCESS(rc)) 136 { 137 RTDIRENTRY DirFolderContent; 138 while (RT_SUCCESS(RTDirRead(pDirDevices, &DirFolderContent, NULL))) /* Assumption that szName has always enough space */ 139 { 140 /** @todo r-bird: This code is bringing all CPUs online; the idCpuCore and 141 * idCpuPackage parameters are unused! */ 142 /* 143 * Check if this is a CPU object. 144 * cpu0 is excluded because it is not possible to change the state 145 * of the first CPU on Linux (it doesn't even have an online file) 146 * and cpuidle is no CPU device. Prevents error messages later. 147 */ 148 if( !strncmp(DirFolderContent.szName, "cpu", 3) 149 && strncmp(DirFolderContent.szName, "cpu0", 4) 150 && strncmp(DirFolderContent.szName, "cpuidle", 7)) 151 { 152 /* Get the sysdev */ 153 RTFILE hFileCpuOnline = NIL_RTFILE; 154 rc = RTFileOpenF(&hFileCpuOnline, RTFILE_O_WRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE, 155 "%s/%s/online", SYSFS_CPU_PATH, DirFolderContent.szName); 81 156 if (RT_SUCCESS(rc)) 82 157 { 83 uint32_t idCore = RTLinuxSysFsReadIntFile(10, "%s/sysdev/topology/core_id", pszSysDevPath); 84 uint32_t idPackage = RTLinuxSysFsReadIntFile(10, "%s/sysdev/topology/physical_package_id", pszSysDevPath); 85 86 if ( (idCore == idCpuCore) 87 && (idPackage == idCpuPackage)) 158 /* Write a 1 to online the CPU */ 159 rc = RTFileWrite(hFileCpuOnline, "1", 1, NULL); 160 RTFileClose(hFileCpuOnline); 161 if (RT_SUCCESS(rc)) 88 162 { 89 /* Return the path */ 90 *ppszPath = pszSysDevPath; 163 VBoxServiceVerbose(1, "CpuHotPlug: CPU %u/%u was brought online\n", idCpuPackage, idCpuCore); 91 164 break; 92 165 } 93 RTStrFree(pszSysDevPath);166 /* Error means CPU not present or online already */ 94 167 } 95 168 else 96 break; 169 VBoxServiceError("CpuHotPlug: Failed to open \"%s/%s/online\" rc=%Rrc\n", 170 SYSFS_CPU_PATH, DirFolderContent.szName, rc); 97 171 } 98 172 } 99 100 RTDirClose(pDirDevices);101 173 } 102 103 return rc; 104 } 174 else 175 VBoxServiceError("CpuHotPlug: Failed to open path %s rc=%Rrc\n", SYSFS_CPU_PATH, rc); 176 #else 177 # error "Port me" 105 178 #endif 106 107 /** @copydoc VBOXSERVICE::pfnPreInit */ 108 static DECLCALLBACK(int) VBoxServiceCpuHotplugPreInit(void) 109 { 110 return VINF_SUCCESS; 111 } 112 113 114 /** @copydoc VBOXSERVICE::pfnOption */ 115 static DECLCALLBACK(int) VBoxServiceCpuHotplugOption(const char **ppszShort, int argc, char **argv, int *pi) 116 { 117 return VINF_SUCCESS; 118 } 119 120 121 /** @copydoc VBOXSERVICE::pfnInit */ 122 static DECLCALLBACK(int) VBoxServiceCpuHotplugInit(void) 123 { 124 return VINF_SUCCESS; 179 } 180 181 182 /** 183 * Handles VMMDevCpuEventType_Unplug. 184 * 185 * @param idCpuCore The CPU core ID. 186 * @param idCpuPackage The CPU package ID. 187 */ 188 static void VBoxServiceCpuHotPlugHandleUnplugEvent(uint32_t idCpuCore, uint32_t idCpuPackage) 189 { 190 #ifdef RT_OS_LINUX 191 char *pszCpuDevicePath = NULL; 192 int rc = VBoxServiceCpuHotPlugGetACPIDevicePath(&pszCpuDevicePath, idCpuCore, idCpuPackage); 193 if (RT_SUCCESS(rc)) 194 { 195 RTFILE hFileCpuEject; 196 rc = RTFileOpenF(&hFileCpuEject, RTFILE_O_WRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE, 197 "%s/eject", pszCpuDevicePath); 198 if (RT_SUCCESS(rc)) 199 { 200 /* Write a 1 to eject the CPU */ 201 rc = RTFileWrite(hFileCpuEject, "1", 1, NULL); 202 if (RT_SUCCESS(rc)) 203 VBoxServiceVerbose(1, "CpuHotPlug: CPU %u/%u was ejected\n", idCpuPackage, idCpuCore); 204 else 205 VBoxServiceError("CpuHotPlug: Failed to eject CPU %u/%u rc=%Rrc\n", idCpuPackage, idCpuCore, rc); 206 207 RTFileClose(hFileCpuEject); 208 } 209 else 210 VBoxServiceError("CpuHotPlug: Failed to open \"%s/eject\" rc=%Rrc\n", pszCpuDevicePath, rc); 211 RTStrFree(pszCpuDevicePath); 212 } 213 else 214 VBoxServiceError("CpuHotPlug: Failed to get CPU device path rc=%Rrc\n", rc); 215 #else 216 # error "Port me" 217 #endif 125 218 } 126 219 127 220 128 221 /** @copydoc VBOXSERVICE::pfnWorker */ 129 DECLCALLBACK(int) VBoxServiceCpuHotplugWorker(bool volatile *pfShutdown) 130 { 131 int rc = VINF_SUCCESS; 132 222 DECLCALLBACK(int) VBoxServiceCpuHotPlugWorker(bool volatile *pfShutdown) 223 { 133 224 /* 134 225 * Tell the control thread that it can continue spawning services. … … 139 230 * Enable the CPU hotplug notifier. 140 231 */ 141 rc = VbglR3CpuHotplugInit();232 int rc = VbglR3CpuHotPlugInit(); 142 233 if (RT_FAILURE(rc)) 143 234 return rc; … … 148 239 for (;;) 149 240 { 150 uint32_t idCpuCore = UINT32_MAX; 151 uint32_t idCpuPackage = UINT32_MAX; 152 VMMDevCpuEventType enmEventType = VMMDevCpuEventType_None; 153 154 /* Wait for CPU hotplug event. */ 155 rc = VbglR3CpuHotplugWaitForEvent(&enmEventType, &idCpuCore, &idCpuPackage); 156 if (RT_FAILURE(rc) && (rc != VERR_INTERRUPTED)) 157 break; 158 159 VBoxServiceVerbose(3, "CPUHotplug: Event happened idCpuCore=%u idCpuPackage=%u enmEventType=%d\n", idCpuCore, idCpuPackage, enmEventType); 160 161 if (enmEventType == VMMDevCpuEventType_Plug) 162 { 163 #ifdef RT_OS_LINUX 164 /* 165 * The topology directory is not available until the CPU is online. So we just iterate over all directories 166 * and enable every CPU which is not online already. 167 */ 168 /** @todo Maybe use udev to monitor events from the kernel */ 169 PRTDIR pDirDevices = NULL; 170 171 rc = RTDirOpen(&pDirDevices, SYSFS_CPU_PATH); /*could use RTDirOpenFiltered*/ 172 173 if(RT_SUCCESS(rc)) 241 /* Wait for CPU hot plugging event. */ 242 uint32_t idCpuCore; 243 uint32_t idCpuPackage; 244 VMMDevCpuEventType enmEventType; 245 rc = VbglR3CpuHotPlugWaitForEvent(&enmEventType, &idCpuCore, &idCpuPackage); 246 if (RT_SUCCESS(rc)) 247 { 248 VBoxServiceVerbose(3, "CpuHotPlug: Event happened idCpuCore=%u idCpuPackage=%u enmEventType=%d\n", 249 idCpuCore, idCpuPackage, enmEventType); 250 switch (enmEventType) 174 251 { 175 RTDIRENTRY DirFolderContent; 176 177 while(RT_SUCCESS(RTDirRead(pDirDevices, &DirFolderContent, NULL))) /* Assumption that szName has always enough space */ 252 case VMMDevCpuEventType_Plug: 253 VBoxServiceCpuHotPlugHandlePlugEvent(idCpuCore, idCpuPackage); 254 break; 255 256 case VMMDevCpuEventType_Unplug: 257 VBoxServiceCpuHotPlugHandleUnplugEvent(idCpuCore, idCpuPackage); 258 break; 259 260 default: 178 261 { 179 /** Check if this is a CPU object. 180 * cpu0 is excluded because it is not possbile 181 * to change the state of the first CPU 182 * (it doesn't even have an online file) 183 * and cpuidle is no CPU device. 184 * Prevents error messages later. 185 */ 186 if( !RTStrNCmp(DirFolderContent.szName, "cpu", 3) 187 && RTStrNCmp(DirFolderContent.szName, "cpu0", 4) 188 && RTStrNCmp(DirFolderContent.szName, "cpuidle", 7)) 189 { 190 char *pszSysDevPath = NULL; 191 192 /* Get the sysdev */ 193 rc = RTStrAPrintf(&pszSysDevPath, "%s/%s/online", SYSFS_CPU_PATH, DirFolderContent.szName); 194 if (RT_SUCCESS(rc)) 195 { 196 RTFILE FileCpuOnline = NIL_RTFILE; 197 198 rc = RTFileOpen(&FileCpuOnline, pszSysDevPath, RTFILE_O_WRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 199 if (RT_SUCCESS(rc)) 200 { 201 /* Write a 1 to online the CPU */ 202 rc = RTFileWrite(FileCpuOnline, "1", 1, NULL); 203 if (RT_SUCCESS(rc)) 204 { 205 VBoxServiceVerbose(1, "CPUHotplug: CPU %u/%u was brought online\n", idCpuPackage, idCpuCore); 206 RTFileClose(FileCpuOnline); 207 break; 208 } 209 /* Error means CPU not present or online already */ 210 211 RTFileClose(FileCpuOnline); 212 } 213 else 214 VBoxServiceError("CPUHotplug: Failed to open online path %s rc=%Rrc\n", pszSysDevPath, rc); 215 216 RTStrFree(pszSysDevPath); 217 } 218 } 262 static uint32_t s_iErrors = 0; 263 if (s_iErrors++ < 10) 264 VBoxServiceError("CpuHotPlug: Unknown event: idCpuCore=%u idCpuPackage=%u enmEventType=%d\n", 265 idCpuCore, idCpuPackage, enmEventType); 266 break; 219 267 } 220 268 } 221 else 222 VBoxServiceError("CPUHotplug: Failed to open path %s rc=%Rrc\n", SYSFS_CPU_PATH, rc); 223 #else 224 # error "Port me" 225 #endif 226 } 227 else if (enmEventType == VMMDevCpuEventType_Unplug) 228 { 229 #ifdef RT_OS_LINUX 230 char *pszCpuDevicePath = NULL; 231 232 rc = cpuHotplugGetACPIDevicePath(&pszCpuDevicePath, idCpuCore, idCpuPackage); 233 if (RT_SUCCESS(rc)) 234 { 235 char *pszPathEject = NULL; 236 237 rc = RTStrAPrintf(&pszPathEject, "%s/eject", pszCpuDevicePath); 238 if (RT_SUCCESS(rc)) 239 { 240 RTFILE FileCpuEject = NIL_RTFILE; 241 242 rc = RTFileOpen(&FileCpuEject, pszPathEject, RTFILE_O_WRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 243 if (RT_SUCCESS(rc)) 244 { 245 /* Write a 1 to eject the CPU */ 246 rc = RTFileWrite(FileCpuEject, "1", 1, NULL); 247 if (RT_SUCCESS(rc)) 248 VBoxServiceVerbose(1, "CPUHotplug: CPU %u/%u was ejected\n", idCpuPackage, idCpuCore); 249 else 250 VBoxServiceError("CPUHotplug: Failed to eject CPU %u/%u rc=%Rrc\n", idCpuPackage, idCpuCore, rc); 251 252 RTFileClose(FileCpuEject); 253 } 254 else 255 VBoxServiceError("CPUHotplug: Failed to open eject path %s rc=%Rrc\n", pszPathEject, rc); 256 } 257 else 258 VBoxServiceError("CPUHotplug: Failed to allocate eject path rc=%Rrc\n", rc); 259 260 RTStrFree(pszCpuDevicePath); 261 } 262 else 263 VBoxServiceError("CPUHotplug: Failed to get CPU device path rc=%Rrc\n", rc); 264 #else 265 # error "Port me" 266 #endif 267 } 268 /* Ignore invalid values. */ 269 } 270 else if (rc != VERR_INTERRUPTED && rc != VERR_TRY_AGAIN) 271 { 272 VBoxServiceError("CpuHotPlug: VbglR3CpuHotPlugWaitForEvent returned %Rrc\n", rc); 273 break; 274 } 269 275 270 276 if (*pfShutdown) … … 272 278 } 273 279 274 VbglR3CpuHot plugTerm();280 VbglR3CpuHotPlugTerm(); 275 281 return rc; 276 282 } … … 278 284 279 285 /** @copydoc VBOXSERVICE::pfnStop */ 280 static DECLCALLBACK(void) VBoxServiceCpuHot plugStop(void)286 static DECLCALLBACK(void) VBoxServiceCpuHotPlugStop(void) 281 287 { 282 288 VbglR3InterruptEventWaits(); … … 286 292 287 293 /** @copydoc VBOXSERVICE::pfnTerm */ 288 static DECLCALLBACK(void) VBoxServiceCpuHot plugTerm(void)294 static DECLCALLBACK(void) VBoxServiceCpuHotPlugTerm(void) 289 295 { 290 296 return; … … 295 301 * The 'timesync' service description. 296 302 */ 297 VBOXSERVICE g_CpuHot plug =303 VBOXSERVICE g_CpuHotPlug = 298 304 { 299 305 /* pszName. */ 300 306 "cpuhotplug", 301 307 /* pszDescription. */ 302 "CPU hot plug monitor",308 "CPU hot plugging monitor", 303 309 /* pszUsage. */ 304 310 NULL, … … 306 312 NULL, 307 313 /* methods */ 308 VBoxServiceCpuHot plugPreInit,309 VBoxServiceCpuHot plugOption,310 VBoxServiceCpuHot plugInit,311 VBoxServiceCpuHot plugWorker,312 VBoxServiceCpuHot plugStop,313 VBoxServiceCpuHot plugTerm314 VBoxServiceCpuHotPlugPreInit, 315 VBoxServiceCpuHotPlugOption, 316 VBoxServiceCpuHotPlugInit, 317 VBoxServiceCpuHotPlugWorker, 318 VBoxServiceCpuHotPlugStop, 319 VBoxServiceCpuHotPlugTerm 314 320 }; 315 321 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r25975 r26061 5 5 6 6 /* 7 * Copyright (C) 2007-20 09Sun Microsystems, Inc.7 * Copyright (C) 2007-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 95 95 #ifdef RT_OS_WINDOWS 96 96 /** The service name (needed for mutex creation on Windows). */ 97 # define VBOXSERVICE_NAME"VBoxService"97 # define VBOXSERVICE_NAME "VBoxService" 98 98 /** The friendly service name. */ 99 # define VBOXSERVICE_FRIENDLY_NAME"VirtualBox Guest Additions Service"99 # define VBOXSERVICE_FRIENDLY_NAME "VirtualBox Guest Additions Service" 100 100 /** The service description (only W2K+ atm) */ 101 # define VBOXSERVICE_DESCRIPTION"Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."101 # define VBOXSERVICE_DESCRIPTION "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems." 102 102 /** The following constant may be defined by including NtStatus.h. */ 103 # define STATUS_SUCCESS((NTSTATUS)0x00000000L)103 # define STATUS_SUCCESS ((NTSTATUS)0x00000000L) 104 104 /** Structure for storing the looked up user information. */ 105 105 typedef struct 106 106 { 107 WCHAR szUser 108 WCHAR szAuthenticationPackage 109 WCHAR szLogonDomain 107 WCHAR szUser[_MAX_PATH]; 108 WCHAR szAuthenticationPackage[_MAX_PATH]; 109 WCHAR szLogonDomain[_MAX_PATH]; 110 110 } VBOXSERVICEVMINFOUSER, *PVBOXSERVICEVMINFOUSER; 111 111 /** Structure for the file information lookup. */ 112 112 typedef struct 113 113 { 114 char *pszFilePath;115 char *pszFileName;114 char *pszFilePath; 115 char *pszFileName; 116 116 } VBOXSERVICEVMINFOFILE, *PVBOXSERVICEVMINFOFILE; 117 117 /** Function prototypes for dynamic loading. */ 118 118 typedef DWORD (WINAPI* fnWTSGetActiveConsoleSessionId)(); 119 #endif 119 #endif /* RT_OS_WINDOWS */ 120 120 121 121 RT_C_DECLS_BEGIN … … 138 138 extern VBOXSERVICE g_VMInfo; 139 139 extern VBOXSERVICE g_Exec; 140 extern VBOXSERVICE g_CpuHot plug;140 extern VBOXSERVICE g_CpuHotPlug; 141 141 142 142 #ifdef RT_OS_WINDOWS … … 151 151 /** Reports our current status to the SCM. */ 152 152 extern BOOL VBoxServiceWinSetStatus(DWORD dwStatus, DWORD dwCheckPoint); 153 # ifdef VBOX_WITH_GUEST_PROPS153 # ifdef VBOX_WITH_GUEST_PROPS 154 154 /** Detects wheter a user is logged on based on the enumerated processes. */ 155 extern BOOL VBoxServiceVMInfoWinIsLoggedIn(VBOXSERVICEVMINFOUSER *a_pUserInfo,155 extern BOOL VBoxServiceVMInfoWinIsLoggedIn(VBOXSERVICEVMINFOUSER *a_pUserInfo, 156 156 PLUID a_pSession, 157 157 PLUID a_pLuid, … … 159 159 /** Gets logon user IDs from enumerated processes. */ 160 160 extern DWORD VBoxServiceVMInfoWinGetLUIDsFromProcesses(PLUID *ppLuid); 161 # endif /* VBOX_WITH_GUEST_PROPS */161 # endif /* VBOX_WITH_GUEST_PROPS */ 162 162 #endif /* RT_OS_WINDOWS */ 163 163
Note:
See TracChangeset
for help on using the changeset viewer.