VirtualBox

Changeset 104003 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Mar 22, 2024 4:13:12 PM (13 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162390
Message:

Guest Control/Main: Added a new define GSTCTL_DEFAULT_TIMEOUT_MS and replaced most of the hardcoded timeout values with it.

Location:
trunk/src/VBox/Main/src-client
Files:
5 edited

Legend:

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

    r99295 r104003  
    367367        vrc = sendMessage(HOST_MSG_DIR_OPEN, i, paParms);
    368368        if (RT_SUCCESS(vrc))
    369             vrc = i_waitForStatusChange(pEvent, 30 * 1000, NULL /* FileStatus */, pvrcGuest);
     369            vrc = i_waitForStatusChange(pEvent, GSTCTL_DEFAULT_TIMEOUT_MS, NULL /* FileStatus */, pvrcGuest);
    370370    }
    371371    else
     
    835835        if (RT_SUCCESS(vrc))
    836836        {
    837             vrc = pEvent->Wait(30 * 1000);
     837            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    838838            if (RT_SUCCESS(vrc))
    839839            {
     
    870870int GuestDirectory::i_closeViaToolbox(int *pvrcGuest)
    871871{
    872     return mData.mProcessTool.terminate(30 * 1000 /* 30s timeout */, pvrcGuest);
     872    return mData.mProcessTool.terminate(GSTCTL_DEFAULT_TIMEOUT_MS, pvrcGuest);
    873873}
    874874#endif /* VBOX_WITH_GSTCTL_TOOLBOX_SUPPORT */
     
    914914        if (RT_SUCCESS(vrc))
    915915        {
    916             vrc = pEvent->Wait(30 * 1000);
     916            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    917917            if (RT_SUCCESS(vrc))
    918918            {
     
    10461046        if (RT_SUCCESS(vrc))
    10471047        {
    1048             vrc = pEvent->Wait(30 * 1000);
     1048            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    10491049            if (RT_SUCCESS(vrc))
    10501050            {
     
    15671567
    15681568    int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS;
    1569     int vrc = i_rewind(30 * 1000 /* Timeout in ms */, &vrcGuest);
     1569    int vrc = i_rewind(GSTCTL_DEFAULT_TIMEOUT_MS, &vrcGuest);
    15701570    if (RT_SUCCESS(vrc))
    15711571        return S_OK;
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r104001 r104003  
    421421    vrc = sendMessage(HOST_MSG_FILE_CLOSE, i, paParms);
    422422    if (RT_SUCCESS(vrc))
    423         vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
    424                                     NULL /* FileStatus */, prcGuest);
     423        vrc = i_waitForStatusChange(pEvent, GSTCTL_DEFAULT_TIMEOUT_MS, NULL /* FileStatus */, prcGuest);
    425424    unregisterWaitEvent(pEvent);
    426425
     
    17581757
    17591758    uint64_t uNewOffset;
    1760     int vrc = i_seekAt(aOffset, eSeekType,
    1761                        30 * 1000 /* 30s timeout */, &uNewOffset);
     1759    int vrc = i_seekAt(aOffset, eSeekType, GSTCTL_DEFAULT_TIMEOUT_MS, &uNewOffset);
    17621760    if (RT_SUCCESS(vrc))
    17631761        *aNewOffset = RT_MIN(uNewOffset, (uint64_t)INT64_MAX);
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r99782 r104003  
    13841384        return VERR_COM_UNEXPECTED;
    13851385
    1386     int vrc = pProcess->i_startProcess(30 * 1000 /* 30s timeout */, NULL /* pvrcGuest, ignored */);
     1386    int vrc = pProcess->i_startProcess(GSTCTL_DEFAULT_TIMEOUT_MS, NULL /* pvrcGuest, ignored */);
    13871387    /* Nothing to do here anymore. */
    13881388
     
    20902090
    20912091    int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS;
    2092     int vrc = i_terminateProcess(30 * 1000 /* Timeout in ms */, &vrcGuest);
     2092    int vrc = i_terminateProcess(GSTCTL_DEFAULT_TIMEOUT_MS, &vrcGuest);
    20932093
    20942094    switch (vrc)
     
    23122312        vrc = fAsync
    23132313            ? pProcess->i_startProcessAsync()
    2314             : pProcess->i_startProcess(30 * 1000 /* 30s timeout */, &vrcGuest);
     2314            : pProcess->i_startProcess(GSTCTL_DEFAULT_TIMEOUT_MS, &vrcGuest);
    23152315
    23162316        if (   RT_SUCCESS(vrc)
     
    23372337    /* Make sure the process is terminated and unregistered from the guest session. */
    23382338    int vrcGuestIgnored;
    2339     terminate(30 * 1000 /* 30s timeout */, &vrcGuestIgnored);
     2339    terminate(GSTCTL_DEFAULT_TIMEOUT_MS, &vrcGuestIgnored);
    23402340
    23412341    /* Unregister the process from the process (and the session's object) list. */
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r104001 r104003  
    10791079        if (RT_SUCCESS(vrc))
    10801080        {
    1081             vrc = pEvent->Wait(30 * 1000);
     1081            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    10821082            if (RT_SUCCESS(vrc))
    10831083            {
     
    12441244    if (RT_SUCCESS(vrc))
    12451245    {
    1246         vrc = pEvent->Wait(30 * 1000);
     1246        vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    12471247        if (pEvent->HasGuestError() && pvrcGuest)
    12481248            *pvrcGuest = pEvent->GuestResult();
     
    14001400        if (RT_SUCCESS(vrc))
    14011401        {
    1402             vrc = pEvent->Wait(30 * 1000);
     1402            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    14031403            if (RT_SUCCESS(vrc))
    14041404            {
     
    18591859        if (RT_SUCCESS(vrc))
    18601860        {
    1861             vrc = pEvent->Wait(30 * 1000);
     1861            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    18621862            if (RT_SUCCESS(vrc))
    18631863            {
     
    19901990    {
    19911991        int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS;
    1992         vrc = pFile->i_open(30 * 1000 /* 30s timeout */, &vrcGuest);
     1992        vrc = pFile->i_open(GSTCTL_DEFAULT_TIMEOUT_MS, &vrcGuest);
    19931993        if (   vrc == VERR_GSTCTL_GUEST_ERROR
    19941994            && pvrcGuest)
     
    21412141        if (RT_SUCCESS(vrc))
    21422142        {
    2143             vrc = pEvent->Wait(30 * 1000);
     2143            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    21442144            if (RT_SUCCESS(vrc))
    21452145            {
     
    22182218        if (RT_SUCCESS(vrc))
    22192219        {
    2220             vrc = pEvent->Wait(30 * 1000);
     2220            vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    22212221            if (RT_SUCCESS(vrc))
    22222222            {
     
    27962796    {
    27972797        vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Start,
    2798                                     30 * 1000 /* 30s timeout */,
    2799                                     NULL /* Session status */, pvrcGuest);
     2798                                    GSTCTL_DEFAULT_TIMEOUT_MS, NULL /* Session status */, pvrcGuest);
    28002799    }
    28012800    else
     
    30913090    if (RT_SUCCESS(vrc))
    30923091    {
    3093         vrc = pEvent->Wait(30 * 1000);
     3092        vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    30943093        if (pEvent->HasGuestError() && pvrcGuest)
    30953094            *pvrcGuest = pEvent->GuestResult();
     
    31343133    if (RT_SUCCESS(vrc))
    31353134    {
    3136         vrc = pEvent->Wait(30 * 1000);
     3135        vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    31373136        if (RT_SUCCESS(vrc))
    31383137        {
     
    31873186    if (RT_SUCCESS(vrc))
    31883187    {
    3189         vrc = pEvent->Wait(30 * 1000);
     3188        vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    31903189        if (RT_SUCCESS(vrc))
    31913190        {
     
    32373236    if (RT_SUCCESS(vrc))
    32383237    {
    3239         vrc = pEvent->Wait(30 * 1000);
     3238        vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    32403239        if (RT_SUCCESS(vrc))
    32413240        {
     
    36213620    if (RT_SUCCESS(vrc))
    36223621    {
    3623         vrc = pEvent->Wait(30 * 1000);
     3622        vrc = pEvent->Wait(GSTCTL_DEFAULT_TIMEOUT_MS);
    36243623        if (RT_FAILURE(vrc))
    36253624        {
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r104001 r104003  
    403403    uint64_t cbToRead       = cbSize;
    404404
    405     uint32_t uTimeoutMs = 30 * 1000; /* 30s timeout. */
    406 
    407405    int vrc = VINF_SUCCESS;
    408406
     
    410408    {
    411409        uint64_t offActual;
    412         vrc = srcFile->i_seekAt(offCopy, GUEST_FILE_SEEKTYPE_BEGIN, uTimeoutMs, &offActual);
     410        vrc = srcFile->i_seekAt(offCopy, GUEST_FILE_SEEKTYPE_BEGIN, GSTCTL_DEFAULT_TIMEOUT_MS, &offActual);
    413411        if (RT_FAILURE(vrc))
    414412        {
     
    425423        uint32_t cbRead;
    426424        const uint32_t cbChunk = RT_MIN(cbToRead, sizeof(byBuf));
    427         vrc = srcFile->i_readData(cbChunk, uTimeoutMs, byBuf, sizeof(byBuf), &cbRead);
     425        vrc = srcFile->i_readData(cbChunk, GSTCTL_DEFAULT_TIMEOUT_MS, byBuf, sizeof(byBuf), &cbRead);
    428426        if (RT_FAILURE(vrc))
    429427        {
     
    736734    uint64_t cbToRead       = cbSize;
    737735
    738     uint32_t uTimeoutMs = 30 * 1000; /* 30s timeout. */
    739 
    740736    int vrc = VINF_SUCCESS;
    741737
     
    767763        }
    768764
    769         vrc = fileDst->i_writeData(uTimeoutMs, byBuf, (uint32_t)cbRead, NULL /* No partial writes */);
     765        vrc = fileDst->i_writeData(GSTCTL_DEFAULT_TIMEOUT_MS, byBuf, (uint32_t)cbRead, NULL /* No partial writes */);
    770766        if (RT_FAILURE(vrc))
    771767        {
     
    28212817                && addsRunLevel != AdditionsRunLevelType_Desktop))
    28222818    {
    2823         if ((RTTimeSystemMilliTS() - tsStart) > 30 * 1000)
     2819        if ((RTTimeSystemMilliTS() - tsStart) > GSTCTL_DEFAULT_TIMEOUT_MS)
    28242820        {
    28252821            vrc = VERR_TIMEOUT;
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