VirtualBox

Changeset 43861 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 13, 2012 10:35:55 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
82046
Message:

Storage: Introduce new flag to skip unnecessary consistency checks in the VMDK backend while opening an image in readonly mode to speed up opening snapshots

File:
1 edited

Legend:

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

    r42073 r43861  
    21422142    bool        fDiscard = false;
    21432143    bool        fInformAboutZeroBlocks = false;
     2144    bool        fSkipConsistencyChecks = false;
    21442145    unsigned    iLevel = 0;
    21452146    PCFGMNODE   pCurNode = pCfg;
     
    21592160                                          "HostIPStack\0UseNewIo\0BootAcceleration\0BootAccelerationBuffer\0"
    21602161                                          "SetupMerge\0MergeSource\0MergeTarget\0BwGroup\0Type\0BlockCache\0"
    2161                                           "CachePath\0CacheFormat\0Discard\0InformAboutZeroBlocks\0");
     2162                                          "CachePath\0CacheFormat\0Discard\0InformAboutZeroBlocks\0"
     2163                                          "SkipConsistencyChecks\0");
    21622164        }
    21632165        else
     
    22992301                rc = PDMDRV_SET_ERROR(pDrvIns, rc,
    23002302                                      N_("DrvVD: Configuration error: Querying \"InformAboutZeroBlocks\" as boolean failed"));
     2303                break;
     2304            }
     2305            rc = CFGMR3QueryBoolDef(pCurNode, "SkipConsistencyChecks", &fSkipConsistencyChecks, true);
     2306            if (RT_FAILURE(rc))
     2307            {
     2308                rc = PDMDRV_SET_ERROR(pDrvIns, rc,
     2309                                      N_("DrvVD: Configuration error: Querying \"SKipConsistencyChecks\" as boolean failed"));
    23012310                break;
    23022311            }
     
    24052414    if (pThis->pDrvMediaAsyncPort && fUseNewIo)
    24062415        pThis->fAsyncIOSupported = true;
     2416
     2417    uint64_t tsStart = RTTimeNanoTS();
    24072418
    24082419    unsigned iImageIdx = 0;
     
    26032614        if (fInformAboutZeroBlocks)
    26042615            uOpenFlags |= VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS;
     2616        if (   (uOpenFlags & VD_OPEN_FLAGS_READONLY)
     2617            && fSkipConsistencyChecks)
     2618            uOpenFlags |= VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS;
    26052619
    26062620        /* Try to open backend in async I/O mode first. */
     
    26622676        pCurNode = CFGMR3GetParent(pCurNode);
    26632677    }
     2678
     2679    LogRel(("VD: Opening the disk took %lld ns\n", RTTimeNanoTS() - tsStart));
    26642680
    26652681    /* Open the cache image if set. */
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