VirtualBox

Changeset 30131 in vbox for trunk/src


Ignore:
Timestamp:
Jun 9, 2010 5:49:04 PM (15 years ago)
Author:
vboxsync
Message:

AsyncCompletion: Fix hang during migration of an endpoint to a failsafe manager, the new I/O manager needs to be updated earlier or a request might wake up the old I/O manager. Fixed another hang during suspend if the endpoint is on the failsafe manager

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp

    r30111 r30131  
    182182    int rc;
    183183
     184    LogFlowFunc(("pAioMgr=%#p pEndpoint=%#p{%s}\n", pAioMgr, pEndpoint, pEndpoint->Core.pszUri));
     185
     186    /* Update the assigned I/O manager. */
     187    ASMAtomicWritePtr(&pEndpoint->pAioMgr, pAioMgr);
     188
    184189    rc = RTCritSectEnter(&pAioMgr->CritSectBlockingEvent);
    185190    AssertRCReturn(rc, rc);
     
    187192    ASMAtomicWritePtr(&pAioMgr->BlockingEventData.AddEndpoint.pEndpoint, pEndpoint);
    188193    rc = pdmacFileAioMgrWaitForBlockingEvent(pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT_ADD_ENDPOINT);
     194    ASMAtomicWritePtr(&pAioMgr->BlockingEventData.AddEndpoint.pEndpoint, NULL);
    189195
    190196    RTCritSectLeave(&pAioMgr->CritSectBlockingEvent);
    191 
    192     if (RT_SUCCESS(rc))
    193         ASMAtomicWritePtr(&pEndpoint->pAioMgr, pAioMgr);
    194197
    195198    return rc;
     
    205208    ASMAtomicWritePtr(&pAioMgr->BlockingEventData.RemoveEndpoint.pEndpoint, pEndpoint);
    206209    rc = pdmacFileAioMgrWaitForBlockingEvent(pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT_REMOVE_ENDPOINT);
     210    ASMAtomicWritePtr(&pAioMgr->BlockingEventData.RemoveEndpoint.pEndpoint, NULL);
    207211
    208212    RTCritSectLeave(&pAioMgr->CritSectBlockingEvent);
     
    220224    ASMAtomicWritePtr(&pAioMgr->BlockingEventData.CloseEndpoint.pEndpoint, pEndpoint);
    221225    rc = pdmacFileAioMgrWaitForBlockingEvent(pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT_CLOSE_ENDPOINT);
     226    ASMAtomicWritePtr(&pAioMgr->BlockingEventData.CloseEndpoint.pEndpoint, NULL);
    222227
    223228    RTCritSectLeave(&pAioMgr->CritSectBlockingEvent);
     
    655660            /* No configuration supplied, set defaults */
    656661            pEpClassFile->enmEpBackendDefault = PDMACFILEEPBACKEND_NON_BUFFERED;
     662            pEpClassFile->enmMgrTypeOverride  = PDMACEPFILEMGRTYPE_ASYNC;
    657663        }
    658664    }
     
    921927        rc = pdmacFileEpCacheFlush(pEpFile);
    922928        AssertRC(rc);
    923         pdmacFileEpCacheDestroy(pEpFile);
    924929    }
    925930
     
    931936    AssertMsg(pEpFile->cbFile == pEpFile->cbEndpoint,
    932937              ("Endpoint and real file size should match now!\n"));
     938
     939    /* Destroy any per endpoint cache data */
     940    if (pEpFile->fCaching)
     941        pdmacFileEpCacheDestroy(pEpFile);
    933942
    934943    /*
  • trunk/src/VBox/VMM/PDMAsyncCompletionFileFailsafe.cpp

    r29250 r30131  
    210210            }
    211211
     212            ASMAtomicWriteBool(&pAioMgr->fBlockingEventPending, false);
     213            pAioMgr->enmBlockingEvent = PDMACEPFILEAIOMGRBLOCKINGEVENT_INVALID;
     214
    212215            /* Release the waiting thread. */
    213216            rc = RTSemEventSignal(pAioMgr->EventSemBlock);
Note: See TracChangeset for help on using the changeset viewer.

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