VirtualBox

Changeset 83740 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 17, 2020 8:51:45 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137258
Message:

Guest Control/Main: Implemented using multiple attempts to close a guest session in IGuestSession::close() and let the user know what's going on. Some bigger guest control process setups may require longer timeouts for getting a guest session closed. bugref:9320

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r83556 r83740  
    29752975     *       the session (already) could be in a stopped / aborted state. */
    29762976
    2977     /* Close session on guest. */
     2977    int vrc;
    29782978    int rcGuest = VINF_SUCCESS;
    2979     int vrc = i_closeSession(0 /* Flags */, 30 * 1000 /* Timeout */, &rcGuest);
     2979
     2980    uint32_t msTimeout = 30 * 1000; /* 30s timeout by default */
     2981    for (int i = 0; i < 10; i++)
     2982    {
     2983        if (i)
     2984        {
     2985            LogRel(("Guest Control: Closing session #%RU32 timed out (%RU32s timeout, attempt %d/10), retrying ...\n",
     2986                    mData.mSession.mID, msTimeout / RT_MS_1SEC, i + 1));
     2987            msTimeout += RT_MS_10SEC; /* Slightly increase the timeout. */
     2988        }
     2989
     2990        /* Close session on guest. */
     2991        vrc = i_closeSession(0 /* Flags */, msTimeout, &rcGuest);
     2992        if (   RT_SUCCESS(vrc)
     2993            || vrc != VERR_TIMEOUT) /* If something else happened there is no point in retrying further. */
     2994            break;
     2995    }
     2996
    29802997    /* On failure don't return here, instead do all the cleanup
    29812998     * work first and then return an error. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette