Changeset 98608 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Feb 16, 2023 4:28:22 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155900
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r98526 r98608 1676 1676 fWaitFlags, newStatus, waitResult)); 1677 1677 #endif 1678 if ( ProcessWaitResult_None != waitResult) /* We got a waiting result. */1678 if (waitResult != ProcessWaitResult_None) /* We got a waiting result. */ 1679 1679 break; 1680 1680 } … … 1687 1687 unregisterWaitEvent(pEvent); 1688 1688 1689 LogFlowThisFunc(("Returned waitResult=%RU32, newStatus=%RU32, vrc=%Rrc\n", waitResult, newStatus, vrc)); 1689 LogFlowThisFunc(("returns %Rrc - waitResult=%RU32 newStatus=%RU32 *pvrcGuest=%Rrc\n", 1690 vrc, waitResult, newStatus, pvrcGuest ? *pvrcGuest : -VERR_IPE_UNINITIALIZED_STATUS)); 1690 1691 return vrc; 1691 1692 } … … 1883 1884 Assert(vrc != VERR_GSTCTL_GUEST_ERROR || !pvrcGuest || *pvrcGuest != (int)0xcccccccc); 1884 1885 1885 LogFlowFuncLeaveRC(vrc); 1886 LogFlowFunc(("LEAVE: %Rrc *pvrcGuest=%Rrc *pProcessStatus=%d\n", 1887 vrc, pvrcGuest ? *pvrcGuest : -VERR_IPE_UNINITIALIZED_STATUS, pProcessStatus ? *pProcessStatus : -1)); 1886 1888 return vrc; 1887 1889 } … … 2411 2413 bool GuestProcessToolbox::isTerminatedOk(void) 2412 2414 { 2413 return getTerminationStatus() == VINF_SUCCESS ? true : false;2415 return getTerminationStatus() == VINF_SUCCESS; 2414 2416 } 2415 2417 … … 2428 2430 */ 2429 2431 /* static */ 2430 int GuestProcessToolbox::run( GuestSession *pGuestSession, 2431 const GuestProcessStartupInfo &startupInfo, 2432 int *pvrcGuest /* = NULL */) 2433 { 2434 int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS; 2435 2432 int GuestProcessToolbox::run(GuestSession *pGuestSession, 2433 GuestProcessStartupInfo const &startupInfo, 2434 int *pvrcGuest /* = NULL */) 2435 { 2436 2436 GuestProcessToolErrorInfo errorInfo = { VERR_IPE_UNINITIALIZED_STATUS, INT32_MAX }; 2437 2437 int vrc = runErrorInfo(pGuestSession, startupInfo, errorInfo); 2438 2438 if (RT_SUCCESS(vrc)) 2439 2439 { 2440 /** @todo r=bird: Seems like this is duplicated in the runErrInfo or 2441 * something, because it returns with VERR_GSTCTL_GUEST_ERROR. 2442 * Temporary fix is to always set pvrcGuest before returning. */ 2440 2443 /* Make sure to check the error information we got from the guest tool. */ 2441 2444 if (GuestProcess::i_isGuestError(errorInfo.vrcGuest)) 2442 2445 { 2443 2446 if (errorInfo.vrcGuest == VERR_GSTCTL_PROCESS_EXIT_CODE) /* Translate exit code to a meaningful error code. */ 2444 vrcGuest = GuestProcessToolbox::exitCodeToRc(startupInfo, errorInfo.iExitCode); 2445 else /* At least return something. */ 2446 vrcGuest = errorInfo.vrcGuest; 2447 2448 if (pvrcGuest) 2449 *pvrcGuest = vrcGuest; 2450 2447 errorInfo.vrcGuest = GuestProcessToolbox::exitCodeToRc(startupInfo, errorInfo.iExitCode); 2451 2448 vrc = VERR_GSTCTL_GUEST_ERROR; 2452 2449 } 2453 2450 } 2454 2451 2455 LogFlowFunc(("Returned vrc=%Rrc, vrcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode)); 2452 /* See above. */ 2453 if (pvrcGuest) 2454 *pvrcGuest = errorInfo.vrcGuest; 2455 2456 LogFlowFunc(("returns %Rrc - vrcGuest=%Rrc iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode)); 2456 2457 return vrc; 2457 2458 } … … 2513 2514 } 2514 2515 2515 LogFlowFunc((" Returned vrc=%Rrc, vrcGuest=%Rrc,iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode));2516 LogFlowFunc(("returns %Rrc - vrcGuest=%Rrc iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode)); 2516 2517 return vrc; 2517 2518 } … … 2553 2554 { 2554 2555 GuestToolboxStreamBlock strmBlk; 2555 vrc = procTool.waitEx( paStrmOutObjects 2556 ? GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK 2557 : GUESTPROCESSTOOL_WAIT_FLAG_NONE, &strmBlk, &errorInfo.vrcGuest); 2556 vrc = procTool.waitEx(paStrmOutObjects 2557 ? GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK 2558 : GUESTPROCESSTOOL_WAIT_FLAG_NONE, 2559 &strmBlk, &errorInfo.vrcGuest); 2558 2560 if (paStrmOutObjects) 2559 2561 paStrmOutObjects->push_back(strmBlk); … … 2577 2579 } 2578 2580 2579 LogFlowFunc(("Returned vrc=%Rrc, vrcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode)); 2581 LogFlowFunc(("returns %Rrc - vrcGuest=%Rrc iExitCode=%d (%#x)\n", 2582 vrc, errorInfo.vrcGuest, errorInfo.iExitCode, errorInfo.iExitCode)); 2580 2583 return vrc; 2581 2584 }
Note:
See TracChangeset
for help on using the changeset viewer.