static DWORD _VMCAStopRestHandle( PVMREST_HANDLE pHandle ) { DWORD dwError = 0; if (pHandle) { /* * REST library have detached threads, maximum time out specified is the max time * allowed for the threads to finish their execution. * If finished early, it will return success. * If not able to finish in specified time, failure will be returned */ dwError = VmRESTStop(pHandle, VMCA_REST_STOP_TIMEOUT_SEC); if (dwError != 0) { VMCA_LOG_WARNING( "%s: Rest stop error: %d", __FUNCTION__, dwError); } } return dwError; }
static VOID _VMCARestFreeHandle( PVMREST_HANDLE pHandle ) { DWORD iter = 0; DWORD dwError = 0; DWORD endPointCnt = 0; if (pHandle) { /* * REST library have detached threads, maximum time out specified is the max time * allowed for the threads to finish their execution. * If finished early, it will return success. * If not able to finish in specified time, failure will be returned */ dwError = VmRESTStop(pHandle, VMCA_REST_STOP_TIMEOUT_SEC); if (dwError != 0) { VMCA_LOG_WARNING("%s: rest server stop error:%d", __FUNCTION__, dwError); } endPointCnt = ARRAY_SIZE(restEndPoints); for (iter = 0; iter < endPointCnt; iter++) { (VOID)VmRESTUnRegisterHandler( pHandle, restEndPoints[iter]); } VmRESTShutdown(pHandle); } }