Changeset 40529 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Mar 19, 2012 11:11:18 AM (13 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r40060 r40529 5 5 6 6 /* 7 * Copyright (C) 201 1Oracle Corporation7 * Copyright (C) 2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 118 118 if (rc == VERR_HGCM_SERVICE_NOT_FOUND) /* Host service is not available. */ 119 119 { 120 VBoxServiceVerbose(0, " Control:Guest property service is not available, skipping\n");120 VBoxServiceVerbose(0, "Guest property service is not available, skipping\n"); 121 121 rc = VINF_SUCCESS; 122 122 } 123 123 else 124 VBoxServiceError(" Control:Failed to connect to the guest property service! Error: %Rrc\n", rc);124 VBoxServiceError("Failed to connect to the guest property service! Error: %Rrc\n", rc); 125 125 } 126 126 else … … 186 186 if (RT_SUCCESS(rc)) 187 187 { 188 VBoxServiceVerbose(3, " Control:Service client ID: %#x\n", g_uControlSvcClientID);188 VBoxServiceVerbose(3, "Service client ID: %#x\n", g_uControlSvcClientID); 189 189 190 190 /* Init thread lists. */ … … 202 202 if (rc == VERR_HGCM_SERVICE_NOT_FOUND) /* Host service is not available. */ 203 203 { 204 VBoxServiceVerbose(0, " Control:Guest control service is not available\n");204 VBoxServiceVerbose(0, "Guest control service is not available\n"); 205 205 rc = VERR_SERVICE_DISABLED; 206 206 } 207 207 else 208 VBoxServiceError(" Control:Failed to connect to the guest control service! Error: %Rrc\n", rc);208 VBoxServiceError("Failed to connect to the guest control service! Error: %Rrc\n", rc); 209 209 RTSemEventMultiDestroy(g_hControlEvent); 210 210 g_hControlEvent = NIL_RTSEMEVENTMULTI; … … 233 233 for (;;) 234 234 { 235 VBoxServiceVerbose(3, " Control:Waiting for host msg ...\n");235 VBoxServiceVerbose(3, "Waiting for host msg ...\n"); 236 236 uint32_t uMsg; 237 237 uint32_t cParms; … … 239 239 if (rc == VERR_TOO_MUCH_DATA) 240 240 { 241 VBoxServiceVerbose(4, " Control:Message requires %ld parameters, but only 2 supplied -- retrying request (no error!)...\n", cParms);241 VBoxServiceVerbose(4, "Message requires %ld parameters, but only 2 supplied -- retrying request (no error!)...\n", cParms); 242 242 rc = VINF_SUCCESS; /* Try to get "real" message in next block below. */ 243 243 } 244 244 else if (RT_FAILURE(rc)) 245 VBoxServiceVerbose(3, " Control:Getting host message failed with %Rrc\n", rc); /* VERR_GEN_IO_FAILURE seems to be normal if ran into timeout. */246 if (RT_SUCCESS(rc)) 247 { 248 VBoxServiceVerbose(3, " Control:Msg=%u (%u parms) retrieved\n", uMsg, cParms);245 VBoxServiceVerbose(3, "Getting host message failed with %Rrc\n", rc); /* VERR_GEN_IO_FAILURE seems to be normal if ran into timeout. */ 246 if (RT_SUCCESS(rc)) 247 { 248 VBoxServiceVerbose(3, "Msg=%u (%u parms) retrieved\n", uMsg, cParms); 249 249 switch (uMsg) 250 250 { 251 251 case HOST_CANCEL_PENDING_WAITS: 252 VBoxServiceVerbose(3, " Control:Host asked us to quit ...\n");252 VBoxServiceVerbose(3, "Host asked us to quit ...\n"); 253 253 break; 254 254 … … 267 267 268 268 default: 269 VBoxServiceVerbose(3, " Control:Unsupported message from host! Msg=%u\n", uMsg);269 VBoxServiceVerbose(3, "Unsupported message from host! Msg=%u\n", uMsg); 270 270 /* Don't terminate here; just wait for the next message. */ 271 271 break; … … 325 325 if (RT_SUCCESS(rc)) 326 326 { 327 VBoxServiceVerbose(3, " Control:Request to start process szCmd=%s, uFlags=0x%x, szArgs=%s, szEnv=%s, szUser=%s, uTimeout=%u\n",327 VBoxServiceVerbose(3, "Request to start process szCmd=%s, uFlags=0x%x, szArgs=%s, szEnv=%s, szUser=%s, uTimeout=%u\n", 328 328 proc.szCmd, proc.uFlags, 329 329 proc.uNumArgs ? proc.szArgs : "<None>", … … 333 333 rc = VBoxServiceControlReapThreads(); 334 334 if (RT_FAILURE(rc)) 335 VBoxServiceError(" Control:Reaping stopped processes failed with rc=%Rrc\n", rc);335 VBoxServiceError("Reaping stopped processes failed with rc=%Rrc\n", rc); 336 336 /* Keep going. */ 337 337 … … 354 354 if (RT_FAILURE(rc)) 355 355 { 356 VBoxServiceError(" Control:Starting process failed with rc=%Rrc\n", rc);356 VBoxServiceError("Starting process failed with rc=%Rrc\n", rc); 357 357 358 358 int rc2 = VbglR3GuestCtrlExecReportStatus(uClientID, uContextID, 0 /* PID, invalid. */, … … 361 361 if (RT_FAILURE(rc2)) 362 362 { 363 VBoxServiceError(" Control:Error sending start process status to host, rc=%Rrc\n", rc2);363 VBoxServiceError("Error sending start process status to host, rc=%Rrc\n", rc2); 364 364 if (RT_SUCCESS(rc)) 365 365 rc = rc2; … … 445 445 if (RT_SUCCESS(rc)) 446 446 { 447 VBoxServiceVerbose(3, " Control: Setting thread (PID %u) inactive\n",448 pThread->uPID );447 VBoxServiceVerbose(3, "Setting thread (PID %u) to list %d\n", 448 pThread->uPID, enmList); 449 449 450 450 PRTLISTANCHOR pAnchor = NULL; … … 563 563 if (RT_FAILURE(rc)) 564 564 { 565 VBoxServiceError(" Control:[PID %u]: Failed to retrieve exec input command! Error: %Rrc\n",565 VBoxServiceError("[PID %u]: Failed to retrieve exec input command! Error: %Rrc\n", 566 566 uPID, rc); 567 567 } 568 568 else if (cbSize > cbMaxBufSize) 569 569 { 570 VBoxServiceError(" Control:[PID %u]: Too much input received! cbSize=%u, cbMaxBufSize=%u\n",570 VBoxServiceError("[PID %u]: Too much input received! cbSize=%u, cbMaxBufSize=%u\n", 571 571 uPID, cbSize, cbMaxBufSize); 572 572 rc = VERR_INVALID_PARAMETER; … … 581 581 { 582 582 fPendingClose = true; 583 VBoxServiceVerbose(4, " Control:[PID %u]: Got last input block of size %u ...\n",583 VBoxServiceVerbose(4, "[PID %u]: Got last input block of size %u ...\n", 584 584 uPID, cbSize); 585 585 } … … 587 587 rc = VBoxServiceControlSetInput(uPID, uContextID, fPendingClose, pabBuffer, 588 588 cbSize, &cbWritten); 589 VBoxServiceVerbose(4, " Control:[PID %u]: Written input, CID=%u, rc=%Rrc, uFlags=0x%x, fPendingClose=%d, cbSize=%u, cbWritten=%u\n",589 VBoxServiceVerbose(4, "[PID %u]: Written input, CID=%u, rc=%Rrc, uFlags=0x%x, fPendingClose=%d, cbSize=%u, cbWritten=%u\n", 590 590 uPID, uContextID, rc, uFlags, fPendingClose, cbSize, cbWritten); 591 591 if (RT_SUCCESS(rc)) … … 619 619 Assert(uStatus > INPUT_STS_UNDEFINED); 620 620 621 VBoxServiceVerbose(3, " Control:[PID %u]: Input processed, CID=%u, uStatus=%u, uFlags=0x%x, cbWritten=%u\n",621 VBoxServiceVerbose(3, "[PID %u]: Input processed, CID=%u, uStatus=%u, uFlags=0x%x, cbWritten=%u\n", 622 622 uPID, uContextID, uStatus, uFlags, cbWritten); 623 623 … … 629 629 630 630 if (RT_FAILURE(rc)) 631 VBoxServiceError(" Control:[PID %u]: Failed to report input status! Error: %Rrc\n",631 VBoxServiceError("[PID %u]: Failed to report input status! Error: %Rrc\n", 632 632 uPID, rc); 633 633 return rc; … … 659 659 rc = VBoxServiceControlExecGetOutput(uPID, uContextID, uHandleID, RT_INDEFINITE_WAIT /* Timeout */, 660 660 pBuf, _64K /* cbSize */, &cbRead); 661 VBoxServiceVerbose(3, " Control:[PID %u]: Got output, rc=%Rrc, CID=%u, cbRead=%u, uHandle=%u, uFlags=%u\n",661 VBoxServiceVerbose(3, "[PID %u]: Got output, rc=%Rrc, CID=%u, cbRead=%u, uHandle=%u, uFlags=%u\n", 662 662 uPID, rc, uContextID, cbRead, uHandleID, uFlags); 663 663 … … 704 704 705 705 if (RT_FAILURE(rc)) 706 VBoxServiceError(" Control:[PID %u]: Error handling output command! Error: %Rrc\n",706 VBoxServiceError("[PID %u]: Error handling output command! Error: %Rrc\n", 707 707 uPID, rc); 708 708 return rc; … … 713 713 static DECLCALLBACK(void) VBoxServiceControlStop(void) 714 714 { 715 VBoxServiceVerbose(3, " Control:Stopping ...\n");715 VBoxServiceVerbose(3, "Stopping ...\n"); 716 716 717 717 /** @todo Later, figure what to do if we're in RTProcWait(). It's a very … … 726 726 if (g_uControlSvcClientID) 727 727 { 728 VBoxServiceVerbose(3, "C ontrol: Cancelling pending waits (client ID=%u) ...\n",728 VBoxServiceVerbose(3, "Cancelling pending waits (client ID=%u) ...\n", 729 729 g_uControlSvcClientID); 730 730 731 731 int rc = VbglR3GuestCtrlCancelPendingWaits(g_uControlSvcClientID); 732 732 if (RT_FAILURE(rc)) 733 VBoxServiceError("C ontrol: Cancelling pending waits failed; rc=%Rrc\n", rc);733 VBoxServiceError("Cancelling pending waits failed; rc=%Rrc\n", rc); 734 734 } 735 735 } … … 761 761 if (RT_FAILURE(rc2)) 762 762 { 763 VBoxServiceError(" Control:Stopping guest process thread failed with rc=%Rrc\n", rc2);763 VBoxServiceError("Stopping guest process thread failed with rc=%Rrc\n", rc2); 764 764 if (RT_SUCCESS(rc)) /* Keep original failure. */ 765 765 rc = rc2; … … 767 767 } 768 768 else 769 VBoxServiceError(" Control:Waiting on guest process thread failed with rc=%Rrc\n", rc2);769 VBoxServiceError("Waiting on guest process thread failed with rc=%Rrc\n", rc2); 770 770 /* Keep going. */ 771 771 … … 781 781 } 782 782 783 VBoxServiceVerbose(4, " Control:Reaping threads returned with rc=%Rrc\n", rc);783 VBoxServiceVerbose(4, "Reaping threads returned with rc=%Rrc\n", rc); 784 784 return rc; 785 785 } … … 791 791 static void VBoxServiceControlShutdown(void) 792 792 { 793 VBoxServiceVerbose(2, " Control:Shutting down ...\n");793 VBoxServiceVerbose(2, "Shutting down ...\n"); 794 794 795 795 /* Signal all threads in the active list that we want to shutdown. */ … … 808 808 30 * 1000 /* Wait 30 seconds max. */); 809 809 if (RT_FAILURE(rc2)) 810 VBoxServiceError(" Control:Guest process thread failed to stop; rc=%Rrc\n", rc2);810 VBoxServiceError("Guest process thread failed to stop; rc=%Rrc\n", rc2); 811 811 812 812 if (fLast) … … 818 818 int rc2 = VBoxServiceControlReapThreads(); 819 819 if (RT_FAILURE(rc2)) 820 VBoxServiceError(" Control:Reaping inactive threads failed with rc=%Rrc\n", rc2);820 VBoxServiceError("Reaping inactive threads failed with rc=%Rrc\n", rc2); 821 821 822 822 AssertMsg(RTListIsEmpty(&g_lstControlThreadsActive), … … 828 828 RTCritSectDelete(&g_csControlThreads); 829 829 830 VBoxServiceVerbose(2, " Control:Shutting down complete\n");830 VBoxServiceVerbose(2, "Shutting down complete\n"); 831 831 } 832 832 … … 835 835 static DECLCALLBACK(void) VBoxServiceControlTerm(void) 836 836 { 837 VBoxServiceVerbose(3, " Control:Terminating ...\n");837 VBoxServiceVerbose(3, "Terminating ...\n"); 838 838 839 839 VBoxServiceControlShutdown(); 840 840 841 VBoxServiceVerbose(3, " Control:Disconnecting client ID=%u ...\n",841 VBoxServiceVerbose(3, "Disconnecting client ID=%u ...\n", 842 842 g_uControlSvcClientID); 843 843 VbglR3GuestCtrlDisconnect(g_uControlSvcClientID); … … 879 879 uProcsRunning++; 880 880 881 VBoxServiceVerbose(3, " Control:Maximum served guest processes set to %u, running=%u\n",881 VBoxServiceVerbose(3, "Maximum served guest processes set to %u, running=%u\n", 882 882 g_uControlProcsMaxKept, uProcsRunning); 883 883 … … 885 885 if (iProcsLeft < 0) 886 886 { 887 VBoxServiceVerbose(3, " Control:Maximum running guest processes reached (%u)\n",887 VBoxServiceVerbose(3, "Maximum running guest processes reached (%u)\n", 888 888 g_uControlProcsMaxKept); 889 889 fLimitReached = true; … … 979 979 uint32_t uTriedPID = uPID; 980 980 uPID += 391939; 981 VBoxServiceVerbose(2, " ControlThread:PID %u was used before, trying again with %u ...\n",981 VBoxServiceVerbose(2, "PID %u was used before, trying again with %u ...\n", 982 982 uTriedPID, uPID); 983 983 fTryAgain = true; -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlThread.cpp
r39906 r40529 5 5 6 6 /* 7 * Copyright (C) 201 1Oracle Corporation7 * Copyright (C) 2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 152 152 AssertPtrReturn(pThread, VERR_INVALID_POINTER); 153 153 154 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Freeing ...\n",154 VBoxServiceVerbose(3, "[PID %u]: Freeing ...\n", 155 155 pThread->uPID); 156 156 … … 170 170 RTStrFree(pThread->pszPassword); 171 171 172 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Setting stopped state\n",172 VBoxServiceVerbose(3, "[PID %u]: Setting stopped state\n", 173 173 pThread->uPID); 174 174 … … 204 204 AssertPtrReturn(pThread, VERR_INVALID_POINTER); 205 205 206 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Stopping ...\n",206 VBoxServiceVerbose(3, "[PID %u]: Stopping ...\n", 207 207 pThread->uPID); 208 208 209 209 int rc = vboxServiceControlThreadRequestCancel(pThread->pRequest); 210 210 if (RT_FAILURE(rc)) 211 VBoxServiceError(" ControlThread:[PID %u]: Signalling request event failed, rc=%Rrc\n",211 VBoxServiceError("[PID %u]: Signalling request event failed, rc=%Rrc\n", 212 212 pThread->uPID, rc); 213 213 … … 221 221 rc = VBoxServiceControlThreadPerform(pThread->uPID, pRequest); 222 222 if (RT_FAILURE(rc)) 223 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Sending quit request failed with rc=%Rrc\n",223 VBoxServiceVerbose(3, "[PID %u]: Sending quit request failed with rc=%Rrc\n", 224 224 pThread->uPID, rc); 225 225 … … 245 245 && ASMAtomicReadBool(&pThread->fStarted)) 246 246 { 247 VBoxServiceVerbose(2, " ControlThread:[PID %u]: Waiting for shutdown ...\n",247 VBoxServiceVerbose(2, "[PID %u]: Waiting for shutdown ...\n", 248 248 pThread->uPID); 249 249 … … 253 253 if (RT_FAILURE(rc)) 254 254 { 255 VBoxServiceError(" ControlThread:[PID %u]: Waiting for shutting down thread returned error rc=%Rrc\n",255 VBoxServiceError("[PID %u]: Waiting for shutting down thread returned error rc=%Rrc\n", 256 256 pThread->uPID, rc); 257 257 } … … 260 260 if (RT_FAILURE(rcThread)) 261 261 { 262 VBoxServiceError(" ControlThread:[PID %u]: Shutdown returned error rc=%Rrc\n",262 VBoxServiceError("[PID %u]: Shutdown returned error rc=%Rrc\n", 263 263 pThread->uPID, rcThread); 264 264 rc = rcThread; … … 328 328 329 329 #ifdef DEBUG 330 VBoxServiceVerbose(4, " ControlThread:VBoxServiceControlThreadHandleOutputError: fPollEvt=0x%x, idPollHnd=%u\n",330 VBoxServiceVerbose(4, "VBoxServiceControlThreadHandleOutputError: fPollEvt=0x%x, idPollHnd=%u\n", 331 331 fPollEvt, idPollHnd); 332 332 #endif … … 344 344 && cbReadable) 345 345 { 346 VBoxServiceVerbose(3, " ControlThread:VBoxServiceControlThreadHandleOutputError: idPollHnd=%u has %ld bytes left, vetoing close\n",346 VBoxServiceVerbose(3, "VBoxServiceControlThreadHandleOutputError: idPollHnd=%u has %ld bytes left, vetoing close\n", 347 347 idPollHnd, cbReadable); 348 348 … … 353 353 } 354 354 else 355 VBoxServiceVerbose(3, " ControlThread:VBoxServiceControlThreadHandleOutputError: idPollHnd=%u will be closed\n",355 VBoxServiceVerbose(3, "VBoxServiceControlThreadHandleOutputError: idPollHnd=%u will be closed\n", 356 356 idPollHnd); 357 357 … … 382 382 { 383 383 #if 0 384 VBoxServiceVerbose(4, " ControlThread:VBoxServiceControlThreadHandleOutputEvent: fPollEvt=0x%x, idPollHnd=%u\n",384 VBoxServiceVerbose(4, "VBoxServiceControlThreadHandleOutputEvent: fPollEvt=0x%x, idPollHnd=%u\n", 385 385 fPollEvt, idPollHnd); 386 386 #endif … … 394 394 && cbReadable) 395 395 { 396 VBoxServiceVerbose(4, " ControlThread:VBoxServiceControlThreadHandleOutputEvent: cbReadable=%ld\n",396 VBoxServiceVerbose(4, "VBoxServiceControlThreadHandleOutputEvent: cbReadable=%ld\n", 397 397 cbReadable); 398 398 } … … 406 406 rc = RTPipeRead(*phPipeR, 407 407 byData, sizeof(byData), &cbRead); 408 VBoxServiceVerbose(4, " ControlThread:VBoxServiceControlThreadHandleOutputEvent cbRead=%u, rc=%Rrc\n",408 VBoxServiceVerbose(4, "VBoxServiceControlThreadHandleOutputEvent cbRead=%u, rc=%Rrc\n", 409 409 cbRead, rc); 410 410 … … 436 436 int rc = RTPipeRead(pThread->hNotificationPipeR, abBuf, sizeof(abBuf), &cbIgnore); 437 437 if (RT_FAILURE(rc)) 438 VBoxServiceError(" ControlThread:Draining IPC notification pipe failed with rc=%Rrc\n", rc);438 VBoxServiceError("Draining IPC notification pipe failed with rc=%Rrc\n", rc); 439 439 440 440 int rcReq = VINF_SUCCESS; /* Actual request result. */ … … 443 443 if (!pRequest) 444 444 { 445 VBoxServiceError(" ControlThread:IPC request is invalid\n");445 VBoxServiceError("IPC request is invalid\n"); 446 446 return VERR_INVALID_POINTER; 447 447 } … … 532 532 ? rcReq : rc; 533 533 534 VBoxServiceVerbose(2, " ControlThread:[PID %u]: Handled req=%u, CID=%u, rc=%Rrc, cbData=%u\n",534 VBoxServiceVerbose(2, "[PID %u]: Handled req=%u, CID=%u, rc=%Rrc, cbData=%u\n", 535 535 pThread->uPID, pRequest->enmType, pRequest->uCID, pRequest->rc, pRequest->cbData); 536 536 … … 589 589 if (RT_FAILURE(rc)) 590 590 { 591 VBoxServiceError(" ControlThread:Unable to assign PID=%u, to new thread, rc=%Rrc\n",591 VBoxServiceError("Unable to assign PID=%u, to new thread, rc=%Rrc\n", 592 592 hProcess, rc); 593 593 return rc; … … 598 598 * and that it's now OK to send input to the process. 599 599 */ 600 VBoxServiceVerbose(2, " ControlThread:[PID %u]: Process \"%s\" started, CID=%u, User=%s\n",600 VBoxServiceVerbose(2, "[PID %u]: Process \"%s\" started, CID=%u, User=%s\n", 601 601 pThread->uPID, pThread->pszCmd, pThread->uContextID, pThread->pszUser); 602 602 rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, … … 623 623 if (RT_SUCCESS(rc2)) 624 624 { 625 /*VBoxServiceVerbose(4, " ControlThread:[PID %u}: RTPollNoResume idPollHnd=%u\n",625 /*VBoxServiceVerbose(4, "[PID %u}: RTPollNoResume idPollHnd=%u\n", 626 626 pThread->uPID, idPollHnd);*/ 627 627 switch (idPollHnd) … … 657 657 658 658 #if 0 659 VBoxServiceVerbose(4, " ControlThread:[PID %u]: Polling done, pollRC=%Rrc, pollCnt=%u, rc=%Rrc, fShutdown=%RTbool\n",659 VBoxServiceVerbose(4, "[PID %u]: Polling done, pollRC=%Rrc, pollCnt=%u, rc=%Rrc, fShutdown=%RTbool\n", 660 660 pThread->uPID, rc2, RTPollSetGetCount(hPollSet), rc, pThread->fShutdown); 661 661 #endif … … 703 703 if (cMsElapsed >= cMsTimeout) 704 704 { 705 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Timed out (%ums elapsed > %ums timeout), killing ...",705 VBoxServiceVerbose(3, "[PID %u]: Timed out (%ums elapsed > %ums timeout), killing ...", 706 706 pThread->uPID, cMsElapsed, cMsTimeout); 707 707 … … 752 752 if (MsProcessKilled == UINT64_MAX) 753 753 { 754 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Is still alive and not killed yet\n",754 VBoxServiceVerbose(3, "[PID %u]: Is still alive and not killed yet\n", 755 755 pThread->uPID); 756 756 … … 762 762 for (size_t i = 0; i < 10; i++) 763 763 { 764 VBoxServiceVerbose(4, " ControlThread:[PID %u]: Kill attempt %d/10: Waiting to exit ...\n",764 VBoxServiceVerbose(4, "[PID %u]: Kill attempt %d/10: Waiting to exit ...\n", 765 765 pThread->uPID, i + 1); 766 766 rc2 = RTProcWait(hProcess, RTPROCWAIT_FLAGS_NOBLOCK, &ProcessStatus); 767 767 if (RT_SUCCESS(rc2)) 768 768 { 769 VBoxServiceVerbose(4, " ControlThread:[PID %u]: Kill attempt %d/10: Exited\n",769 VBoxServiceVerbose(4, "[PID %u]: Kill attempt %d/10: Exited\n", 770 770 pThread->uPID, i + 1); 771 771 fProcessAlive = false; … … 774 774 if (i >= 5) 775 775 { 776 VBoxServiceVerbose(4, " ControlThread:[PID %u]: Kill attempt %d/10: Trying to terminate ...\n",776 VBoxServiceVerbose(4, "[PID %u]: Kill attempt %d/10: Trying to terminate ...\n", 777 777 pThread->uPID, i + 1); 778 778 RTProcTerminate(hProcess); … … 782 782 783 783 if (fProcessAlive) 784 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Could not be killed\n", pThread->uPID);784 VBoxServiceVerbose(3, "[PID %u]: Could not be killed\n", pThread->uPID); 785 785 } 786 786 … … 796 796 if ( fProcessTimedOut && !fProcessAlive && MsProcessKilled != UINT64_MAX) 797 797 { 798 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Timed out and got killed\n",798 VBoxServiceVerbose(3, "[PID %u]: Timed out and got killed\n", 799 799 pThread->uPID); 800 800 uStatus = PROC_STS_TOK; … … 802 802 else if (fProcessTimedOut && fProcessAlive && MsProcessKilled != UINT64_MAX) 803 803 { 804 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Timed out and did *not* get killed\n",804 VBoxServiceVerbose(3, "[PID %u]: Timed out and did *not* get killed\n", 805 805 pThread->uPID); 806 806 uStatus = PROC_STS_TOA; … … 808 808 else if (pThread->fShutdown && (fProcessAlive || MsProcessKilled != UINT64_MAX)) 809 809 { 810 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Got terminated because system/service is about to shutdown\n",810 VBoxServiceVerbose(3, "[PID %u]: Got terminated because system/service is about to shutdown\n", 811 811 pThread->uPID); 812 812 uStatus = PROC_STS_DWN; /* Service is stopping, process was killed. */ … … 815 815 else if (fProcessAlive) 816 816 { 817 VBoxServiceError(" ControlThread:[PID %u]: Is alive when it should not!\n",817 VBoxServiceError("[PID %u]: Is alive when it should not!\n", 818 818 pThread->uPID); 819 819 } 820 820 else if (MsProcessKilled != UINT64_MAX) 821 821 { 822 VBoxServiceError(" ControlThread:[PID %u]: Has been killed when it should not!\n",822 VBoxServiceError("[PID %u]: Has been killed when it should not!\n", 823 823 pThread->uPID); 824 824 } 825 825 else if (ProcessStatus.enmReason == RTPROCEXITREASON_NORMAL) 826 826 { 827 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Ended with RTPROCEXITREASON_NORMAL (Exit code: %u)\n",827 VBoxServiceVerbose(3, "[PID %u]: Ended with RTPROCEXITREASON_NORMAL (Exit code: %u)\n", 828 828 pThread->uPID, ProcessStatus.iStatus); 829 829 … … 833 833 else if (ProcessStatus.enmReason == RTPROCEXITREASON_SIGNAL) 834 834 { 835 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Ended with RTPROCEXITREASON_SIGNAL (Signal: %u)\n",835 VBoxServiceVerbose(3, "[PID %u]: Ended with RTPROCEXITREASON_SIGNAL (Signal: %u)\n", 836 836 pThread->uPID, ProcessStatus.iStatus); 837 837 … … 842 842 { 843 843 /* ProcessStatus.iStatus will be undefined. */ 844 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Ended with RTPROCEXITREASON_ABEND\n",844 VBoxServiceVerbose(3, "[PID %u]: Ended with RTPROCEXITREASON_ABEND\n", 845 845 pThread->uPID); 846 846 … … 849 849 } 850 850 else 851 VBoxServiceVerbose(1, " ControlThread:[PID %u]: Handling process status %u not implemented\n",851 VBoxServiceVerbose(1, "[PID %u]: Handling process status %u not implemented\n", 852 852 pThread->uPID, ProcessStatus.enmReason); 853 853 854 VBoxServiceVerbose(2, " ControlThread:[PID %u]: Ended, ClientID=%u, CID=%u, Status=%u, Flags=0x%x\n",854 VBoxServiceVerbose(2, "[PID %u]: Ended, ClientID=%u, CID=%u, Status=%u, Flags=0x%x\n", 855 855 pThread->uPID, pThread->uClientID, pThread->uContextID, uStatus, uFlags); 856 856 rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, … … 858 858 NULL /* pvData */, 0 /* cbData */); 859 859 if (RT_FAILURE(rc)) 860 VBoxServiceError(" ControlThread:[PID %u]: Error reporting final status to host; rc=%Rrc\n",860 VBoxServiceError("[PID %u]: Error reporting final status to host; rc=%Rrc\n", 861 861 pThread->uPID, rc); 862 862 863 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Process loop ended with rc=%Rrc\n",863 VBoxServiceVerbose(3, "[PID %u]: Process loop ended with rc=%Rrc\n", 864 864 pThread->uPID, rc); 865 865 } 866 866 else 867 VBoxServiceError(" ControlThread:[PID %u]: Loop failed with rc=%Rrc\n",867 VBoxServiceError("[PID %u]: Loop failed with rc=%Rrc\n", 868 868 pThread->uPID, rc); 869 869 return rc; … … 970 970 return VINF_SUCCESS; 971 971 972 VBoxServiceVerbose(4, "C ontrolThread: Cancelling request=0x%p\n", pReq);972 VBoxServiceVerbose(4, "Cancelling request=0x%p\n", pReq); 973 973 974 974 return RTSemEventMultiSignal(pReq->Event); … … 986 986 AssertPtrReturnVoid(pReq); 987 987 988 VBoxServiceVerbose(4, " ControlThread:Freeing request=0x%p (event=%RTsem)\n",988 VBoxServiceVerbose(4, "Freeing request=0x%p (event=%RTsem)\n", 989 989 pReq, &pReq->Event); 990 990 … … 1011 1011 if (RT_SUCCESS(rc)) 1012 1012 { 1013 VBoxServiceVerbose(4, " ControlThread:Performed request with rc=%Rrc, cbData=%u\n",1013 VBoxServiceVerbose(4, "Performed request with rc=%Rrc, cbData=%u\n", 1014 1014 pReq->rc, pReq->cbData); 1015 1015 … … 1018 1018 } 1019 1019 else 1020 VBoxServiceError(" ControlThread:Waiting for request failed, rc=%Rrc\n", rc);1020 VBoxServiceError("Waiting for request failed, rc=%Rrc\n", rc); 1021 1021 1022 1022 return rc; … … 1118 1118 #endif 1119 1119 #ifdef DEBUG 1120 VBoxServiceVerbose(3, " ControlThread:VBoxServiceControlExecMakeFullPath: %s -> %s\n",1120 VBoxServiceVerbose(3, "VBoxServiceControlExecMakeFullPath: %s -> %s\n", 1121 1121 pszPath, pszExpanded); 1122 1122 #endif … … 1127 1127 /** 1128 1128 * Resolves the full path of a specified executable name. This function also 1129 * resolves internal VBoxService tools to its appropriate executable path + name. 1129 * resolves internal VBoxService tools to its appropriate executable path + name if 1130 * VBOXSERVICE_NAME is specified as pszFileName. 1130 1131 * 1131 1132 * @return IPRT status code. … … 1170 1171 * 1171 1172 * @return IPRT status code. 1172 * @param pszArgv0 First argument (argv0), either original or modified version. 1173 * @param pszArgv0 First argument (argv0), either original or modified version. Optional. 1173 1174 * @param papszArgs Original argv command line from the host, starting at argv[1]. 1174 1175 * @param ppapszArgv Pointer to a pointer with the new argv command line. … … 1208 1209 pszNewArgs ? pszNewArgs : "", NULL /* Use standard separators. */); 1209 1210 } 1211 1212 #ifdef DEBUG 1213 VBoxServiceVerbose(3, "Arguments argv0=%s, new arguments=%s\n", 1214 pszArgv0 ? pszArgv0 : "<NULL>", pszNewArgs); 1215 #endif 1210 1216 1211 1217 if (pszNewArgs) … … 1326 1332 uProcFlags |= RTPROC_FLAGS_SERVICE; 1327 1333 #ifdef DEBUG 1328 VBoxServiceVerbose(3, "Co ntrolThread: Command: %s\n", szExecExp);1334 VBoxServiceVerbose(3, "Command: %s\n", szExecExp); 1329 1335 for (size_t i = 0; papszArgsExp[i]; i++) 1330 VBoxServiceVerbose(3, " ControlThread:\targv[%ld]: %s\n", i, papszArgsExp[i]);1336 VBoxServiceVerbose(3, "\targv[%ld]: %s\n", i, papszArgsExp[i]); 1331 1337 #endif 1332 1338 /* Do normal execution. */ … … 1351 1357 { 1352 1358 AssertPtrReturn(pThread, VERR_INVALID_POINTER); 1353 VBoxServiceVerbose(3, " ControlThread:Thread of process \"%s\" started\n", pThread->pszCmd);1359 VBoxServiceVerbose(3, "Thread of process \"%s\" started\n", pThread->pszCmd); 1354 1360 1355 1361 int rc = VBoxServiceControlListSet(VBOXSERVICECTRLTHREADLIST_RUNNING, pThread); … … 1359 1365 if (RT_FAILURE(rc)) 1360 1366 { 1361 VBoxServiceError(" ControlThread:Thread failed to connect to the guest control service, aborted! Error: %Rrc\n", rc);1367 VBoxServiceError("Thread failed to connect to the guest control service, aborted! Error: %Rrc\n", rc); 1362 1368 RTThreadUserSignal(RTThreadSelf()); 1363 1369 return rc; 1364 1370 } 1365 VBoxServiceVerbose(3, " ControlThread:Guest process \"%s\" got client ID=%u, flags=0x%x\n",1371 VBoxServiceVerbose(3, "Guest process \"%s\" got client ID=%u, flags=0x%x\n", 1366 1372 pThread->pszCmd, pThread->uClientID, pThread->uFlags); 1367 1373 … … 1448 1454 &hProcess); 1449 1455 if (RT_FAILURE(rc)) 1450 VBoxServiceError(" ControlThread:Error starting process, rc=%Rrc\n", rc);1456 VBoxServiceError("Error starting process, rc=%Rrc\n", rc); 1451 1457 /* 1452 1458 * Tell the control thread that it can continue … … 1535 1541 NULL /* pvData */, 0 /* cbData */); 1536 1542 if (RT_FAILURE(rc2)) 1537 VBoxServiceError("Co ntrolThread: Could not report process failure error; rc=%Rrc (process error %Rrc)\n",1543 VBoxServiceError("Could not report process failure error; rc=%Rrc (process error %Rrc)\n", 1538 1544 rc2, rc); 1539 1545 } 1540 1546 1541 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Cancelling pending host requests (client ID=%u)\n",1547 VBoxServiceVerbose(3, "[PID %u]: Cancelling pending host requests (client ID=%u)\n", 1542 1548 pThread->uPID, pThread->uClientID); 1543 1549 rc2 = VbglR3GuestCtrlCancelPendingWaits(pThread->uClientID); 1544 1550 if (RT_FAILURE(rc2)) 1545 1551 { 1546 VBoxServiceError(" ControlThread:[PID %u]: Cancelling pending host requests failed; rc=%Rrc\n",1552 VBoxServiceError("[PID %u]: Cancelling pending host requests failed; rc=%Rrc\n", 1547 1553 pThread->uPID, rc2); 1548 1554 if (RT_SUCCESS(rc)) … … 1551 1557 1552 1558 /* Disconnect from guest control service. */ 1553 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Disconnecting (client ID=%u) ...\n",1559 VBoxServiceVerbose(3, "[PID %u]: Disconnecting (client ID=%u) ...\n", 1554 1560 pThread->uPID, pThread->uClientID); 1555 1561 VbglR3GuestCtrlDisconnect(pThread->uClientID); … … 1557 1563 } 1558 1564 1559 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Thread of process \"%s\" ended with rc=%Rrc\n",1565 VBoxServiceVerbose(3, "[PID %u]: Thread of process \"%s\" ended with rc=%Rrc\n", 1560 1566 pThread->uPID, pThread->pszCmd, rc); 1561 1567 … … 1622 1628 if (RT_FAILURE(rc)) 1623 1629 { 1624 VBoxServiceError(" ControlThread:RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n",1630 VBoxServiceError("RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n", 1625 1631 rc, pThread); 1626 1632 } 1627 1633 else 1628 1634 { 1629 VBoxServiceVerbose(4, " ControlThread:Waiting for thread to initialize ...\n");1635 VBoxServiceVerbose(4, "Waiting for thread to initialize ...\n"); 1630 1636 1631 1637 /* Wait for the thread to initialize. */ … … 1635 1641 || RT_FAILURE(rc)) 1636 1642 { 1637 VBoxServiceError(" ControlThread:Thread for process \"%s\" failed to start, rc=%Rrc\n",1643 VBoxServiceError("Thread for process \"%s\" failed to start, rc=%Rrc\n", 1638 1644 pProcess->szCmd, rc); 1639 1645 } … … 1691 1697 && cbWritten) 1692 1698 { 1693 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Waiting for response on enmType=%u, pvData=0x%p, cbData=%u\n",1699 VBoxServiceVerbose(3, "[PID %u]: Waiting for response on enmType=%u, pvData=0x%p, cbData=%u\n", 1694 1700 uPID, pRequest->enmType, pRequest->pvData, pRequest->cbData); 1695 1701 … … 1703 1709 rc = VERR_NOT_FOUND; 1704 1710 1705 VBoxServiceVerbose(3, " ControlThread:[PID %u]: Performed enmType=%u, uCID=%u, pvData=0x%p, cbData=%u, rc=%Rrc\n",1711 VBoxServiceVerbose(3, "[PID %u]: Performed enmType=%u, uCID=%u, pvData=0x%p, cbData=%u, rc=%Rrc\n", 1706 1712 uPID, pRequest->enmType, pRequest->uCID, pRequest->pvData, pRequest->cbData, rc); 1707 1713 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.