Changeset 107681 in vbox
- Timestamp:
- Jan 10, 2025 4:14:43 PM (8 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r107674 r107681 2848 2848 * Newly created guest session needs to be closed by caller. 2849 2849 * 2850 * @returns 0 on success or VERR_TIMEOUT if guest services were not2851 * started on time.2850 * @returns VBox status code. 2851 * @retval VERR_TIMEOUT if VBoxService on the guest was not started within time. 2852 2852 * @param pGuest Guest interface to use. 2853 2853 * @param osType Guest type. … … 2857 2857 ComObjPtr<GuestSession> &pNewSession) 2858 2858 { 2859 int vrc = VERR_GSTCTL_GUEST_ERROR;2860 int vrcRet = VERR_TIMEOUT;2861 2862 uint64_t tsStart = RTTimeSystemMilliTS();2863 const uint64_t cMsTimeout = 10 * RT_MS_1MIN;2864 2865 2859 AssertReturn(!pGuest.isNull(), VERR_TIMEOUT); 2866 2860 2867 do 2861 uint64_t const tsStart = RTTimeSystemMilliTS(); 2862 uint64_t const cMsTimeout = 10 * RT_MS_1MIN; /** @todo r=andy Make this dynamic. */ 2863 2864 int vrc; 2865 2866 for (;;) 2868 2867 { 2869 2868 GuestCredentials guestCreds; 2869 2870 2870 GuestSessionStartupInfo startupInfo; 2871 2872 2871 startupInfo.mName = "Guest Additions connection check"; 2873 2872 startupInfo.mOpenTimeoutMS = 100; … … 2876 2875 if (RT_SUCCESS(vrc)) 2877 2876 { 2878 Assert(!pNewSession.isNull()); 2879 2880 int vrcGuest = VERR_GSTCTL_GUEST_ERROR; /* unused. */ 2881 vrc = pNewSession->i_startSession(&vrcGuest); 2877 vrc = pNewSession->i_startSession(NULL /* pvrcGuest */); 2882 2878 if (RT_SUCCESS(vrc)) 2883 2879 { 2884 2880 /* Wait for VBoxService to start. */ 2885 2881 GuestSessionWaitResult_T enmWaitResult = GuestSessionWaitResult_None; 2886 int vrcGuest2 = VINF_SUCCESS; /* unused. */2887 vrc = pNewSession->i_waitFor(GuestSessionWaitForFlag_Start, 100 /* timeout, ms */, enmWaitResult, &vrcGuest2);2882 vrc = pNewSession->i_waitFor(GuestSessionWaitForFlag_Start, 100 /* timeout, ms */, enmWaitResult, 2883 NULL /*pvrcGuest */); 2888 2884 if (RT_SUCCESS(vrc)) 2889 2885 { … … 2891 2887 vrc = checkGuestAdditionsStatus(pNewSession, osType); 2892 2888 if (RT_SUCCESS(vrc)) 2893 LogRel(("Guest Additions Update: Guest Additions were successfully reloaded after installation \n"));2889 LogRel(("Guest Additions Update: Guest Additions were successfully reloaded after installation.\n")); 2894 2890 else 2895 LogRel(("Guest Additions Update: Guest Additions were failed to reload after installation, please consider rebooting the guest\n")); 2896 2897 vrcRet = VINF_SUCCESS; 2891 LogRel(("Guest Additions Update: Guest Additions failed to reload after installation, please consider rebooting the guest.\n")); 2898 2892 break; 2899 2893 } 2900 2894 } 2901 2895 2902 vrc = pNewSession->Close(); 2903 } 2896 int vrc2 = pNewSession->Close(); 2897 if (RT_SUCCESS(vrc)) 2898 vrc = vrc2; 2899 } 2900 2901 if ((RTTimeSystemMilliTS() - tsStart) >= cMsTimeout) /* Timeout? */ 2902 { 2903 if (RT_SUCCESS(vrc)) /* Keep already set error. */ 2904 vrc = VERR_TIMEOUT; 2905 break; 2906 } 2907 /* else retry */ 2904 2908 2905 2909 RTThreadSleep(100); 2906 2907 } while ((RTTimeSystemMilliTS() - tsStart) < cMsTimeout); 2908 2909 return vrcRet; 2910 } /* for */ 2911 2912 if (RT_FAILURE(vrc)) 2913 LogRel(("Guest Additions Update: Waiting for guest session failed with %Rrc\n", vrc)); 2914 2915 return vrc; 2910 2916 } 2911 2917
Note:
See TracChangeset
for help on using the changeset viewer.