- Timestamp:
- Dec 21, 2023 4:20:51 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r102654 r102680 3960 3960 LogFlowThisFuncEnter(); 3961 3961 3962 HRESULT hrc = i_isStartedExternal();3963 if (FAILED(hrc))3964 return hrc;3965 3966 3962 int vrc = VINF_SUCCESS; /* Shut up MSVC. */ 3967 3963 3968 /* If the guest session is not in an unsable state (anymore), do the cleanup stuff ourselves. */ 3964 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 3965 3966 /* If the guest session is not in an usable state (anymore), do the cleanup stuff ourselves. */ 3969 3967 if (!i_isReady()) 3970 3968 { … … 3973 3971 } 3974 3972 3975 /* Note: Don't check if the session is ready via i_isStartedExternal() here; 3976 * the session (already) could be in a stopped / aborted state. */ 3973 alock.release(); /* Leave lock before calling i_closeSession() below. */ 3977 3974 3978 3975 int vrcGuest = VINF_SUCCESS; 3979 3976 3980 uint32_t msTimeout = RT_MS_10SEC; /* 10s timeout by default */ 3981 for (int i = 0; i < 3; i++) 3982 { 3983 if (i) 3984 { 3985 LogRel(("Guest Control: Closing session '%s' timed out (%RU32s timeout, attempt %d/10), retrying ...\n", 3986 mData.mSession.mName.c_str(), msTimeout / RT_MS_1SEC, i + 1)); 3987 msTimeout += RT_MS_5SEC; /* Slightly increase the timeout. */ 3988 } 3989 3990 /* Close session on guest. */ 3991 vrc = i_closeSession(0 /* Flags */, msTimeout, &vrcGuest); 3992 if ( RT_SUCCESS(vrc) 3993 || vrc != VERR_TIMEOUT) /* If something else happened there is no point in retrying further. */ 3994 break; 3977 /* If the session is in a started state, tell the guest to close it. 3978 * 3979 * Note: Don't check if the session is ready via i_isStartedExternal() here; 3980 * the session (already) could be in a stopped / aborted state. 3981 */ 3982 AutoCaller autoCallerParent(mParent); 3983 if ( SUCCEEDED(autoCallerParent.hrc()) 3984 && i_isStarted()) 3985 { 3986 uint32_t msTimeout = RT_MS_10SEC; /* 10s timeout by default */ 3987 for (int i = 0; i < 3; i++) 3988 { 3989 if (i) 3990 { 3991 LogRel(("Guest Control: Closing session '%s' timed out (%RU32s timeout, attempt %d/10), retrying ...\n", 3992 mData.mSession.mName.c_str(), msTimeout / RT_MS_1SEC, i + 1)); 3993 msTimeout += RT_MS_5SEC; /* Slightly increase the timeout. */ 3994 } 3995 3996 /* Close session on guest. */ 3997 vrc = i_closeSession(0 /* Flags */, msTimeout, &vrcGuest); 3998 if ( RT_SUCCESS(vrc) 3999 || vrc != VERR_TIMEOUT) /* If something else happened there is no point in retrying further. */ 4000 break; 4001 } 3995 4002 } 3996 4003
Note:
See TracChangeset
for help on using the changeset viewer.

