VirtualBox

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


Ignore:
Timestamp:
Jul 10, 2012 7:21:50 AM (12 years ago)
Author:
vboxsync
Message:

DrvVD: Add InformAboutZeroBlocks CFGM key

File:
1 edited

Legend:

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

    r40282 r42071  
    21412141    bool        fUseBlockCache = false;
    21422142    bool        fDiscard = false;
     2143    bool        fInformAboutZeroBlocks = false;
    21432144    unsigned    iLevel = 0;
    21442145    PCFGMNODE   pCurNode = pCfg;
     
    21582159                                          "HostIPStack\0UseNewIo\0BootAcceleration\0BootAccelerationBuffer\0"
    21592160                                          "SetupMerge\0MergeSource\0MergeTarget\0BwGroup\0Type\0BlockCache\0"
    2160                                           "CachePath\0CacheFormat\0Discard\0");
     2161                                          "CachePath\0CacheFormat\0Discard\0InformAboutZeroBlocks\0");
    21612162        }
    21622163        else
     
    22912292                rc = PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRIVER_INVALID_PROPERTIES,
    22922293                                      N_("DrvVD: Configuration error: Both \"ReadOnly\" and \"Discard\" are set"));
     2294                break;
     2295            }
     2296            rc = CFGMR3QueryBoolDef(pCurNode, "InformAboutZeroBlocks", &fInformAboutZeroBlocks, false);
     2297            if (RT_FAILURE(rc))
     2298            {
     2299                rc = PDMDRV_SET_ERROR(pDrvIns, rc,
     2300                                      N_("DrvVD: Configuration error: Querying \"Discard\" as boolean failed"));
    22932301                break;
    22942302            }
     
    25932601        if (fDiscard && iLevel == 0)
    25942602            uOpenFlags |= VD_OPEN_FLAGS_DISCARD;
     2603        if (fInformAboutZeroBlocks)
     2604            uOpenFlags |= VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS;
    25952605
    25962606        /* Try to open backend in async I/O mode first. */
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