- Timestamp:
- Jun 16, 2016 3:06:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/testcase/tstVDFill.cpp
r61710 r61731 54 54 } 55 55 56 static int tstFill(const char *pszFilename, const char *pszFormat, uint64_t cbDisk, uint64_t cbFill)56 static int tstFill(const char *pszFilename, const char *pszFormat, bool fStreamOptimized, uint64_t cbDisk, uint64_t cbFill) 57 57 { 58 58 int rc; … … 100 100 101 101 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, 104 104 NULL, NULL); 105 105 CHECK("VDCreateBase()"); … … 143 143 "--filename <filename> Filename of the image\n" 144 144 "--format <VDI|VMDK|...> Format to use\n" 145 "--streamoptimized Use the stream optimized format\n" 145 146 "--help Show this text\n"); 146 147 } … … 148 149 static const RTGETOPTDEF g_aOptions[] = 149 150 { 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 } 155 157 }; 156 158 … … 166 168 const char *pszFilename = NULL; 167 169 const char *pszFormat = NULL; 170 bool fStreamOptimized = false; 168 171 169 172 rc = VDInit(); … … 191 194 pszFormat = ValueUnion.psz; 192 195 break; 196 case 'r': 197 fStreamOptimized = true; 198 break; 193 199 case 'h': 194 200 default: … … 213 219 RTRandAdvSeed(g_hRand, 0x12345678); 214 220 215 rc = tstFill(pszFilename, pszFormat, cbDisk, cbFill);221 rc = tstFill(pszFilename, pszFormat, fStreamOptimized, cbDisk, cbFill); 216 222 if (RT_FAILURE(rc)) 217 223 RTPrintf("tstVDFill: Filling disk failed! rc=%Rrc\n", rc);
Note:
See TracChangeset
for help on using the changeset viewer.