Changeset 49570 in vbox
- Timestamp:
- Nov 20, 2013 9:13:04 AM (11 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
-
GuestProcessImpl.cpp (modified) (7 diffs)
-
GuestSessionImpl.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r49504 r49570 519 519 * a process B. Process B in turn then has a different guest PID. 520 520 * 521 * Note: This also can happen when restoring from a saved state which 522 * had a guest process running. 523 * 521 524 * @return IPRT status code. 522 525 * @param uPID PID to check. … … 524 527 inline int GuestProcess::checkPID(uint32_t uPID) 525 528 { 529 int rc = VINF_SUCCESS; 530 526 531 /* Was there a PID assigned yet? */ 527 532 if (mData.mPID) 528 533 { 529 /* 530 531 */ 532 if (mSession->getProtocolVersion() < 2) 533 { 534 /* Simply ignore the stale requests. */ 535 return (mData.mPID == uPID) 536 ? VINF_SUCCESS : VERR_NOT_FOUND; 537 } 538 #ifndef DEBUG_andy 539 /* This should never happen! */ 540 AssertReleaseMsg(mData.mPID == uPID, ("Unterminated guest process (guest PID %RU32) sent data to a newly started process (host PID %RU32)\n", 541 uPID, mData.mPID)); 542 #endif 543 } 544 545 return VINF_SUCCESS; 534 if (RT_UNLIKELY(mData.mPID != uPID)) 535 { 536 LogFlowFunc(("Stale guest process (PID=%RU32) sent data to a newly started process (pProcesS=%p, PID=%RU32, status=%RU32)\n", 537 uPID, this, mData.mPID, mData.mStatus)); 538 rc = VERR_NOT_FOUND; 539 } 540 } 541 542 return rc; 546 543 } 547 544 … … 865 862 866 863 /** 867 * Called by IGuestSession right before this process gets 868 * removed from the public process list. 864 * Called by IGuestSession right before this process gets 865 * removed from the public process list. 869 866 */ 870 867 int GuestProcess::onRemove(void) … … 876 873 int vrc = VINF_SUCCESS; 877 874 878 /* 875 /* 879 876 * Note: The event source stuff holds references to this object, 880 877 * so make sure that this is cleaned up *before* calling uninit(). … … 2060 2057 int vrc = pSession->processCreateExInteral(mStartupInfo, pProcess); 2061 2058 if (RT_SUCCESS(vrc)) 2062 vrc = fAsync 2063 ? pProcess->startProcessAsync() 2059 vrc = fAsync 2060 ? pProcess->startProcessAsync() 2064 2061 : pProcess->startProcess(30 * 1000 /* 30s timeout */, pGuestRc); 2065 2062 … … 2164 2161 /* Make sure the process runs until completion. */ 2165 2162 vrc = procTool.Wait(GUESTPROCESSTOOL_FLAG_NONE, &guestRc); 2166 2167 Assert(RT_SUCCESS(guestRc)); 2168 guestRc = procTool.TerminatedOk(NULL /* Exit code */); 2169 if (RT_FAILURE(guestRc)) 2170 vrc = VERR_GSTCTL_GUEST_ERROR; 2171 if (pGuestRc) 2172 *pGuestRc = guestRc; 2173 } 2174 else if (vrc == VERR_GSTCTL_GUEST_ERROR) 2175 { 2176 if (pGuestRc) 2177 *pGuestRc = guestRc; 2178 } 2163 if (RT_SUCCESS(vrc)) 2164 { 2165 guestRc = procTool.TerminatedOk(NULL /* Exit code */); 2166 if (RT_FAILURE(guestRc)) 2167 vrc = VERR_GSTCTL_GUEST_ERROR; 2168 } 2169 } 2170 2171 if (pGuestRc) 2172 *pGuestRc = guestRc; 2179 2173 2180 2174 LogFlowFunc(("Returned rc=%Rrc, guestRc=%Rrc\n", vrc, guestRc)); … … 2322 2316 2323 2317 default: 2324 Assert ReleaseMsgFailed(("Unhandled process wait result %RU32\n", waitRes));2318 AssertMsgFailed(("Unhandled process wait result %RU32\n", waitRes)); 2325 2319 break; 2326 2320 } -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r49504 r49570 283 283 284 284 #ifdef VBOX_WITH_GUEST_CONTROL 285 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 285 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 286 286 287 287 LogFlowThisFunc(("Closing directories (%zu total)\n", … … 321 321 mData.mProcesses.clear(); 322 322 323 AssertMsg(mData.mNumObjects == 0, 323 AssertMsg(mData.mNumObjects == 0, 324 324 ("mNumObjects=%RU32 when it should be 0\n", mData.mNumObjects)); 325 325 … … 731 731 vrc = VERR_INVALID_PARAMETER; 732 732 } 733 733 734 734 if (uMode) 735 735 { … … 808 808 LogFlowFunc(("Removing directory \"%s\" (Session: %RU32) (now total %zu processes, %ld objects)\n", 809 809 Utf8Str(strName).c_str(), mData.mSession.mID, mData.mDirectories.size() - 1, mData.mNumObjects - 1)); 810 810 811 811 rc = pDirectory->onRemove(); 812 812 mData.mDirectories.erase(itDirs); … … 1194 1194 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1195 1195 1196 int rc = VERR_NOT_FOUND; 1196 int rc = VERR_NOT_FOUND; 1197 1197 1198 1198 SessionFiles::iterator itFiles = mData.mFiles.begin(); … … 1221 1221 fireGuestFileRegisteredEvent(mEventSource, this, pCurFile, 1222 1222 false /* Unregistered */); 1223 pCurFile.setNull(); 1223 pCurFile.setNull(); 1224 1224 break; 1225 1225 } … … 1229 1229 1230 1230 LogFlowFuncLeaveRC(rc); 1231 return rc; 1231 return rc; 1232 1232 } 1233 1233 … … 1426 1426 } 1427 1427 1428 LogFlowFuncLeaveRC(vrc); 1428 LogFlowThisFunc(("Returning rc=%Rrc, guestRc=%Rrc\n", 1429 vrc, guestRc)); 1429 1430 return vrc; 1430 1431 } … … 1515 1516 1516 1517 /** 1517 * Called by IGuest right before this session gets removed from 1518 * the public session list. 1518 * Called by IGuest right before this session gets removed from 1519 * the public session list. 1519 1520 */ 1520 1521 int GuestSession::onRemove(void) … … 1526 1527 int vrc = VINF_SUCCESS; 1527 1528 1528 /* 1529 /* 1529 1530 * Note: The event source stuff holds references to this object, 1530 1531 * so make sure that this is cleaned up *before* calling uninit.
Note:
See TracChangeset
for help on using the changeset viewer.

