VirtualBox

Changeset 61731 in vbox for trunk/src


Ignore:
Timestamp:
Jun 16, 2016 3:06:20 PM (9 years ago)
Author:
vboxsync
Message:

Storage/tstVDFill: Add flag for stream optimized variants

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/tstVDFill.cpp

    r61710 r61731  
    5454}
    5555
    56 static int tstFill(const char *pszFilename, const char *pszFormat, uint64_t cbDisk, uint64_t cbFill)
     56static int tstFill(const char *pszFilename, const char *pszFormat, bool fStreamOptimized, uint64_t cbDisk, uint64_t cbFill)
    5757{
    5858    int rc;
     
    100100
    101101    rc = VDCreateBase(pVD, pszFormat, pszFilename, cbDisk,
    102                       VD_IMAGE_FLAGS_NONE, "Test image",
    103                       &PCHS, &LCHS, NULL, VD_OPEN_FLAGS_NORMAL,
     102                      fStreamOptimized ? VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED : VD_IMAGE_FLAGS_NONE,
     103                      "Test image", &PCHS, &LCHS, NULL, VD_OPEN_FLAGS_NORMAL,
    104104                      NULL, NULL);
    105105    CHECK("VDCreateBase()");
     
    143143             "--filename <filename>       Filename of the image\n"
    144144             "--format <VDI|VMDK|...>     Format to use\n"
     145             "--streamoptimized           Use the stream optimized format\n"
    145146             "--help                      Show this text\n");
    146147}
     
    148149static const RTGETOPTDEF g_aOptions[] =
    149150{
    150     { "--disk-size",   's', RTGETOPT_REQ_UINT64 },
    151     { "--fill-size",   'f', RTGETOPT_REQ_UINT64 },
    152     { "--filename",    'p', RTGETOPT_REQ_STRING },
    153     { "--format",      't', RTGETOPT_REQ_STRING },
    154     { "--help",        'h', RTGETOPT_REQ_NOTHING }
     151    { "--disk-size",       's', RTGETOPT_REQ_UINT64 },
     152    { "--fill-size",       'f', RTGETOPT_REQ_UINT64 },
     153    { "--filename",        'p', RTGETOPT_REQ_STRING },
     154    { "--format",          't', RTGETOPT_REQ_STRING },
     155    { "--streamoptimized", 'r', RTGETOPT_REQ_NOTHING },
     156    { "--help",            'h', RTGETOPT_REQ_NOTHING }
    155157};
    156158
     
    166168    const char *pszFilename = NULL;
    167169    const char *pszFormat = NULL;
     170    bool fStreamOptimized = false;
    168171
    169172    rc = VDInit();
     
    191194                pszFormat = ValueUnion.psz;
    192195                break;
     196            case 'r':
     197                fStreamOptimized = true;
     198                break;
    193199            case 'h':
    194200            default:
     
    213219    RTRandAdvSeed(g_hRand, 0x12345678);
    214220
    215     rc = tstFill(pszFilename, pszFormat, cbDisk, cbFill);
     221    rc = tstFill(pszFilename, pszFormat, fStreamOptimized, cbDisk, cbFill);
    216222    if (RT_FAILURE(rc))
    217223        RTPrintf("tstVDFill: Filling disk failed! rc=%Rrc\n", rc);
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