儲存庫 vbox 的更動 17110
- 時間撮記:
- 2009-2-25 上午08:58:45 (16 年 以前)
- 位置:
- trunk/src/VBox/Devices/Storage/testcase
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Storage/testcase/Makefile.kmk
r15366 r17110 27 27 # probably will go away soon. Testcase only now. 28 28 # 29 #ifdef VBOX_WITH_TESTCASES 30 # PROGRAMS += vditool 31 # ifeq ($(KBUILD_TARGET),l4) 32 # vditool_TEMPLATE = VBOXLNXHOSTR3EXE 33 # vditool_LIBS = \ 34 # $(PATH_LIB)/VBoxDDULnxHostR3.a \ 35 # $(PATH_LIB)/RuntimeLnxHostR3.a 36 # else 37 # vditool_TEMPLATE = VBOXR3TSTEXE 38 # vditool_LIBS = $(LIB_DDU) $(LIB_RUNTIME) 39 # endif 40 # vditool_SOURCES = vditool.cpp 41 #endif 29 ifdef VBOX_WITH_TESTCASES 30 PROGRAMS += vditool 31 vditool_TEMPLATE = VBOXR3TSTEXE 32 vditool_LIBS = $(LIB_DDU) $(LIB_RUNTIME) 33 vditool_SOURCES = vditool.cpp 34 endif 42 35 43 36 -
trunk/src/VBox/Devices/Storage/testcase/vditool.cpp
r14831 r17110 45 45 static int UsageExit() 46 46 { 47 RTPrintf("Usage: vditool <Command> [Params]\n" \ 48 "Commands and params:\n" \ 49 " NEW Filename Mbytes - create new image;\n" \ 50 " DD Filename DDFilename - create new image from DD format image;\n" \ 51 " CONVERT Filename - convert VDI image from old format;\n" \ 52 " DUMP Filename - debug dump;\n" \ 53 " RESETGEO Filename - reset geometry information;\n" \ 54 " COPY FromImage ToImage - make image copy;\n" \ 55 " COPYDD FromImage DDFilename - make a DD copy of the image;\n" \ 56 " SHRINK Filename - optimize (reduce) VDI image size.\n"); 47 RTPrintf("Usage: vditool <Command> [Params]\n" 48 "Commands and params:\n" 49 " NEW Filename Mbytes - create new image\n" 50 #if 0 51 " DD Filename DDFilename - create new image from DD format image\n" 52 " CONVERT Filename - convert VDI image from old format\n" 53 " DUMP Filename - debug dump\n" 54 " RESETGEO Filename - reset geometry information\n" 55 " COPY FromImage ToImage - make image copy\n" 56 " COPYDD FromImage DDFilename - make a DD copy of the image\n" 57 " SHRINK Filename - optimize (reduce) VDI image size\n" 58 #endif 59 ); 57 60 return 1; 58 61 } … … 104 107 return rc; 105 108 106 rc = VDICreateBaseImage(pszUtf8Filename, 107 VDI_IMAGE_TYPE_NORMAL, 108 (uint64_t)cMBs * (uint64_t)(1024 * 1024), 109 "Newly created test image", NULL, NULL); 110 return PrintDone(rc); 111 } 112 109 PVBOXHDD hdd; 110 rc = VDCreate(NULL, &hdd); 111 if (RT_FAILURE(rc)) 112 return PrintDone(rc); 113 114 PDMMEDIAGEOMETRY geo = { 0 }; /* auto-detect */ 115 rc = VDCreateBase(hdd, "vdi", pszUtf8Filename, 116 VD_IMAGE_TYPE_NORMAL, 117 (uint64_t)cMBs * _1M, 118 VD_IMAGE_FLAGS_NONE, 119 "Newly created test image", 120 &geo, &geo, NULL, 121 VD_OPEN_FLAGS_NORMAL, 122 NULL, NULL); 123 return PrintDone(rc); 124 } 125 126 #if 0 113 127 static int ConvertDDImage(const char *pszFilename, const char *pszDDFilename) 114 128 { … … 189 203 return rc; 190 204 } 191 205 #endif 206 207 #if 0 192 208 static DECLCALLBACK(int) ProcessCallback(PVM pVM, unsigned uPercent, void *pvUser) 193 209 { … … 205 221 return VINF_SUCCESS; 206 222 } 207 223 #endif 224 225 #if 0 208 226 static int ConvertOldImage(const char *pszFilename) 209 227 { … … 223 241 return PrintDone(rc); 224 242 } 225 243 #endif 244 245 #if 0 226 246 static int DumpImage(const char *pszFilename) 227 247 { … … 242 262 return PrintDone(rc); 243 263 } 244 264 #endif 265 266 #if 0 245 267 static int ResetImageGeometry(const char *pszFilename) 246 268 { … … 263 285 return PrintDone(rc); 264 286 } 265 287 #endif 288 289 #if 0 266 290 static int CopyImage(const char *pszDstFile, const char *pszSrcFile) 267 291 { … … 284 308 return PrintDone(rc); 285 309 } 286 310 #endif 311 312 #if 0 287 313 static int CopyToDD(const char *pszDstFile, const char *pszSrcFile) 288 314 { … … 331 357 return PrintDone(rc); 332 358 } 333 359 #endif 360 361 #if 0 334 362 static int ShrinkImage(const char *pszFilename) 335 363 { … … 349 377 return PrintDone(rc); 350 378 } 379 #endif 351 380 352 381 int main(int argc, char **argv) … … 356 385 357 386 RTR3Init(); 358 RTPrintf("vditool Copyright (c) 2008 Sun Microsystems, Inc.\n\n"); 387 RTPrintf("vditool -- for internal use only!\n" 388 "Copyright (c) 2009 Sun Microsystems, Inc.\n\n"); 359 389 360 390 /* … … 386 416 if (RT_FAILURE(rc)) 387 417 return SyntaxError("Invalid number!"); 388 if ( cMBs < 2 389 || cMBs > 1024*1024) 418 if (cMBs < 2 || cMBs > _1M) 390 419 { 391 420 RTPrintf("error: Disk size %RU32 (MB) is not within the range %u-%u!\n", 392 cMBs, 2, 1024*1024);421 cMBs, 2, _1M); 393 422 return 1; 394 423 } … … 396 425 rc = NewImage(argv[2], cMBs); 397 426 } 427 #if 0 398 428 else if (strcmp(szCmd, "DD") == 0) 399 429 { … … 438 468 rc = ShrinkImage(argv[2]); 439 469 } 470 #endif 440 471 else 441 472 return SyntaxError("Invalid command!");
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器