VirtualBox

Changeset 55871 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
May 15, 2015 7:50:49 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
100327
Message:

Storage/DrvVD: Fix VM hang during power off because of an order mismatch in the driver termination for the iSCSI over internal network case. DevINIP is destructed before DrvVD and closing the iSCSI connection fails. Moved closing of the disk to the power off instead of destruction stage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r55770 r55871  
    23302330
    23312331/**
     2332 * @copydoc FNPDMDRVPOWEROFF
     2333 */
     2334static DECLCALLBACK(void) drvvdPowerOff(PPDMDRVINS pDrvIns)
     2335{
     2336    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     2337    PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK);
     2338    LogFlowFunc(("\n"));
     2339
     2340    RTSEMFASTMUTEX mutex;
     2341    ASMAtomicXchgHandle(&pThis->MergeCompleteMutex, NIL_RTSEMFASTMUTEX, &mutex);
     2342    if (mutex != NIL_RTSEMFASTMUTEX)
     2343    {
     2344        /* Request the semaphore to wait until a potentially running merge
     2345         * operation has been finished. */
     2346        int rc = RTSemFastMutexRequest(mutex);
     2347        AssertRC(rc);
     2348        pThis->fMergePending = false;
     2349        rc = RTSemFastMutexRelease(mutex);
     2350        AssertRC(rc);
     2351        rc = RTSemFastMutexDestroy(mutex);
     2352        AssertRC(rc);
     2353    }
     2354
     2355    if (RT_VALID_PTR(pThis->pBlkCache))
     2356    {
     2357        PDMR3BlkCacheRelease(pThis->pBlkCache);
     2358        pThis->pBlkCache = NULL;
     2359    }
     2360
     2361    if (RT_VALID_PTR(pThis->pDisk))
     2362    {
     2363        VDDestroy(pThis->pDisk);
     2364        pThis->pDisk = NULL;
     2365    }
     2366    drvvdFreeImages(pThis);
     2367}
     2368
     2369/**
    23322370 * VM resume notification that we use to undo what the temporary read-only image
    23332371 * mode set by drvvdSuspend.
     
    24322470    PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK);
    24332471    LogFlowFunc(("\n"));
    2434 
    2435     RTSEMFASTMUTEX mutex;
    2436     ASMAtomicXchgHandle(&pThis->MergeCompleteMutex, NIL_RTSEMFASTMUTEX, &mutex);
    2437     if (mutex != NIL_RTSEMFASTMUTEX)
    2438     {
    2439         /* Request the semaphore to wait until a potentially running merge
    2440          * operation has been finished. */
    2441         int rc = RTSemFastMutexRequest(mutex);
    2442         AssertRC(rc);
    2443         pThis->fMergePending = false;
    2444         rc = RTSemFastMutexRelease(mutex);
    2445         AssertRC(rc);
    2446         rc = RTSemFastMutexDestroy(mutex);
    2447         AssertRC(rc);
    2448     }
    2449 
    2450     if (RT_VALID_PTR(pThis->pBlkCache))
    2451     {
    2452         PDMR3BlkCacheRelease(pThis->pBlkCache);
    2453         pThis->pBlkCache = NULL;
    2454     }
    2455 
    2456     if (RT_VALID_PTR(pThis->pDisk))
    2457     {
    2458         VDDestroy(pThis->pDisk);
    2459         pThis->pDisk = NULL;
    2460     }
    2461     drvvdFreeImages(pThis);
    24622472
    24632473    if (pThis->MergeLock != NIL_RTSEMRW)
     
    33183328    NULL,
    33193329    /* pfnPowerOff */
    3320     NULL,
     3330    drvvdPowerOff,
    33213331    /* pfnSoftReset */
    33223332    NULL,
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