VirtualBox

Changeset 55964 in vbox


Ignore:
Timestamp:
May 20, 2015 11:38:57 AM (10 years ago)
Author:
vboxsync
Message:

Storage/VD: Make sure the disk is destroyed when destroying the driver instance, the power off callback is not called when the driver is destroyed during driver chain replumbing (reconfiguring media after taking a snapshot for example)

File:
1 edited

Legend:

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

    r55871 r55964  
    23302330
    23312331/**
    2332  * @copydoc FNPDMDRVPOWEROFF
     2332 * Worker for the power off or destruct callback.
     2333 *
     2334 * @returns nothing.
     2335 * @param   pDrvIns    The driver instance.
    23332336 */
    2334 static DECLCALLBACK(void) drvvdPowerOff(PPDMDRVINS pDrvIns)
    2335 {
    2336     PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     2337static void drvvdPowerOffOrDestruct(PPDMDRVINS pDrvIns)
     2338{
    23372339    PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK);
    23382340    LogFlowFunc(("\n"));
     
    23652367    }
    23662368    drvvdFreeImages(pThis);
     2369}
     2370
     2371/**
     2372 * @copydoc FNPDMDRVPOWEROFF
     2373 */
     2374static DECLCALLBACK(void) drvvdPowerOff(PPDMDRVINS pDrvIns)
     2375{
     2376    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     2377    drvvdPowerOffOrDestruct(pDrvIns);
    23672378}
    23682379
     
    24712482    LogFlowFunc(("\n"));
    24722483
     2484    /*
     2485     * Make sure the block cache and disks are closed when this driver is
     2486     * destroyed. This method will get called without calling the power off
     2487     * callback first when we reconfigure the driver chain after a snapshot.
     2488     */
     2489    drvvdPowerOffOrDestruct(pDrvIns);
    24732490    if (pThis->MergeLock != NIL_RTSEMRW)
    24742491    {
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