Changeset 13835 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Nov 5, 2008 2:34:43 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r13580 r13835 423 423 { 424 424 int rc = RTStrToInt64Ex(argv[2], NULL, 0, &offDelta); 425 if ( VBOX_FAILURE(rc))425 if (RT_FAILURE(rc)) 426 426 return errorArgument(argv[0], "Failed to read delta '%s', rc=%Vrc\n", argv[2], rc); 427 427 } … … 435 435 { 436 436 int rc = RTStrToUInt64Ex(argv[4], NULL, 0, &ModuleAddress); 437 if ( VBOX_FAILURE(rc))437 if (RT_FAILURE(rc)) 438 438 return errorArgument(argv[0], "Failed to read module address '%s', rc=%Vrc\n", argv[4], rc); 439 439 } … … 443 443 { 444 444 int rc = RTStrToUInt64Ex(argv[5], NULL, 0, &ModuleSize); 445 if ( VBOX_FAILURE(rc))445 if (RT_FAILURE(rc)) 446 446 return errorArgument(argv[0], "Failed to read module size '%s', rc=%Vrc\n", argv[5], rc); 447 447 } … … 480 480 /* just try it */ 481 481 int rc = VDISetImageUUIDs(argv[0], uuid.raw(), NULL, NULL, NULL); 482 if ( VBOX_FAILURE(rc))482 if (RT_FAILURE(rc)) 483 483 { 484 484 RTPrintf("Error while setting a new UUID: %Vrc (%d)\n", rc, rc); … … 509 509 memset(pPart->aPartitions, '\0', sizeof(pPart->aPartitions)); 510 510 rc = RTFileReadAt(File, 0, &aBuffer, sizeof(aBuffer), NULL); 511 if ( VBOX_FAILURE(rc))511 if (RT_FAILURE(rc)) 512 512 return rc; 513 513 if (aBuffer[510] != 0x55 || aBuffer[511] != 0xaa) … … 561 561 { 562 562 rc = RTFileReadAt(File, (uStart + uOffset) * 512, &aBuffer, sizeof(aBuffer), NULL); 563 if ( VBOX_FAILURE(rc))563 if (RT_FAILURE(rc)) 564 564 return rc; 565 565 … … 704 704 RTFILE RawFile; 705 705 int vrc = RTFileOpen(&RawFile, rawdisk.raw(), RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 706 if ( VBOX_FAILURE(vrc))706 if (RT_FAILURE(vrc)) 707 707 { 708 708 RTPrintf("Error opening the raw disk: %Vrc\n", vrc); … … 712 712 HOSTPARTITIONS partitions; 713 713 vrc = partRead(RawFile, &partitions); 714 if ( VBOX_FAILURE(vrc))714 if (RT_FAILURE(vrc)) 715 715 return vrc; 716 716 … … 821 821 RTFILE RawFile; 822 822 int vrc = RTFileOpen(&RawFile, rawdisk.raw(), RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 823 if ( VBOX_FAILURE(vrc))823 if (RT_FAILURE(vrc)) 824 824 { 825 825 RTPrintf("Error opening the raw disk '%s': %Vrc\n", rawdisk.raw(), vrc); … … 964 964 * creating the VMDK, so no real harm done. */ 965 965 vrc = RTFileGetSize(RawFile, &cbSize); 966 if ( VBOX_FAILURE(vrc))966 if (RT_FAILURE(vrc)) 967 967 { 968 968 RTPrintf("Error getting the size of the raw disk '%s': %Vrc\n", rawdisk.raw(), vrc); … … 1000 1000 { 1001 1001 vrc = RTStrToUInt32Ex(p, &pszNext, 0, &u32); 1002 if ( VBOX_FAILURE(vrc))1002 if (RT_FAILURE(vrc)) 1003 1003 { 1004 1004 RTPrintf("Incorrect value in partitions parameter\n"); … … 1018 1018 1019 1019 vrc = partRead(RawFile, &partitions); 1020 if ( VBOX_FAILURE(vrc))1020 if (RT_FAILURE(vrc)) 1021 1021 { 1022 1022 RTPrintf("Error reading the partition information from '%s'\n", rawdisk.raw()); … … 1059 1059 vrc = RTStrAPrintf(&pszRawName, "%s%u", rawdisk.raw(), 1060 1060 partitions.aPartitions[i].uIndex); 1061 if ( VBOX_FAILURE(vrc))1061 if (RT_FAILURE(vrc)) 1062 1062 { 1063 1063 RTPrintf("Error creating reference to individual partition %u, rc=%Vrc\n", … … 1120 1120 } 1121 1121 vrc = RTFileReadAt(RawFile, partitions.aPartitions[i].uPartDataStart * 512, pPartData, (size_t)RawDescriptor.pPartitions[i].cbPartitionData, NULL); 1122 if ( VBOX_FAILURE(vrc))1122 if (RT_FAILURE(vrc)) 1123 1123 { 1124 1124 RTPrintf("Cannot read partition data from raw device '%s': %Vrc\n", rawdisk.raw(), vrc); … … 1131 1131 RTFILE MBRFile; 1132 1132 vrc = RTFileOpen(&MBRFile, pszMBRFilename, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 1133 if ( VBOX_FAILURE(vrc))1133 if (RT_FAILURE(vrc)) 1134 1134 { 1135 1135 RTPrintf("Cannot open replacement MBR file '%s' specified with -mbr: %Vrc\n", pszMBRFilename, vrc); … … 1138 1138 vrc = RTFileReadAt(MBRFile, 0, pPartData, 0x1be, NULL); 1139 1139 RTFileClose(MBRFile); 1140 if ( VBOX_FAILURE(vrc))1140 if (RT_FAILURE(vrc)) 1141 1141 { 1142 1142 RTPrintf("Cannot read replacement MBR file '%s': %Vrc\n", pszMBRFilename, vrc); … … 1162 1162 1163 1163 vrc = VDCreate(&vdInterfaceError, &pDisk); 1164 if ( VBOX_FAILURE(vrc))1164 if (RT_FAILURE(vrc)) 1165 1165 { 1166 1166 RTPrintf("Error while creating the virtual disk container: %Vrc\n", vrc); … … 1181 1181 VD_VMDK_IMAGE_FLAGS_RAWDISK, (char *)&RawDescriptor, 1182 1182 &PCHS, &LCHS, NULL, VD_OPEN_FLAGS_NORMAL, NULL, NULL); 1183 if ( VBOX_FAILURE(vrc))1183 if (RT_FAILURE(vrc)) 1184 1184 { 1185 1185 RTPrintf("Error while creating the raw disk VMDK: %Vrc\n", vrc); … … 1218 1218 out: 1219 1219 RTPrintf("The raw disk vmdk file was not created\n"); 1220 return VBOX_SUCCESS(vrc) ? 0 : 1;1220 return RT_SUCCESS(vrc) ? 0 : 1; 1221 1221 } 1222 1222 … … 1271 1271 1272 1272 vrc = VDCreate(&vdInterfaceError, &pDisk); 1273 if ( VBOX_FAILURE(vrc))1273 if (RT_FAILURE(vrc)) 1274 1274 { 1275 1275 RTPrintf("Error while creating the virtual disk container: %Vrc\n", vrc); … … 1279 1279 { 1280 1280 vrc = VDOpen(pDisk, "VMDK", Utf8Str(src).raw(), VD_OPEN_FLAGS_NORMAL, NULL); 1281 if ( VBOX_FAILURE(vrc))1281 if (RT_FAILURE(vrc)) 1282 1282 { 1283 1283 RTPrintf("Error while opening the source image: %Vrc\n", vrc); … … 1286 1286 { 1287 1287 vrc = VDCopy(pDisk, 0, pDisk, "VMDK", Utf8Str(dst).raw(), true, 0, NULL, NULL, NULL); 1288 if ( VBOX_FAILURE(vrc))1288 if (RT_FAILURE(vrc)) 1289 1289 { 1290 1290 RTPrintf("Error while renaming the image: %Vrc\n", vrc); … … 1352 1352 1353 1353 vrc = VDCreate(&vdInterfaceError, &pDisk); 1354 if ( VBOX_FAILURE(vrc))1354 if (RT_FAILURE(vrc)) 1355 1355 { 1356 1356 RTPrintf("Error while creating the virtual disk container: %Vrc\n", vrc); … … 1365 1365 else 1366 1366 vrc = RTFileOpen(&outFile, Utf8Str(dst).raw(), RTFILE_O_OPEN | RTFILE_O_CREATE | RTFILE_O_WRITE | RTFILE_O_DENY_ALL); 1367 if ( VBOX_FAILURE(vrc))1367 if (RT_FAILURE(vrc)) 1368 1368 { 1369 1369 VDCloseAll(pDisk); … … 1376 1376 char *pszFormat = NULL; 1377 1377 vrc = VDGetFormat(Utf8Str(src).raw(), &pszFormat); 1378 if ( VBOX_FAILURE(vrc))1378 if (RT_FAILURE(vrc)) 1379 1379 { 1380 1380 VDCloseAll(pDisk); … … 1391 1391 } 1392 1392 vrc = VDOpen(pDisk, Utf8Str(srcformat).raw(), Utf8Str(src).raw(), VD_OPEN_FLAGS_READONLY, NULL); 1393 if ( VBOX_FAILURE(vrc))1393 if (RT_FAILURE(vrc)) 1394 1394 { 1395 1395 VDCloseAll(pDisk); … … 1415 1415 size_t cb = cbSize - offFile >= (uint64_t)cbBuf ? cbBuf : (size_t)(cbSize - offFile); 1416 1416 vrc = VDRead(pDisk, offFile, pvBuf, cb); 1417 if ( VBOX_FAILURE(vrc))1417 if (RT_FAILURE(vrc)) 1418 1418 break; 1419 1419 vrc = RTFileWrite(outFile, pvBuf, cb, NULL); 1420 if ( VBOX_FAILURE(vrc))1420 if (RT_FAILURE(vrc)) 1421 1421 break; 1422 1422 offFile += cb; 1423 1423 } 1424 if ( VBOX_FAILURE(vrc))1424 if (RT_FAILURE(vrc)) 1425 1425 { 1426 1426 VDCloseAll(pDisk); … … 1522 1522 char *pszFormat = NULL; 1523 1523 vrc = VDGetFormat(Utf8Str(src).raw(), &pszFormat); 1524 if ( VBOX_FAILURE(vrc))1524 if (RT_FAILURE(vrc)) 1525 1525 { 1526 1526 RTPrintf("No file format specified and autodetect failed - please specify format: %Vrc\n", vrc); … … 1532 1532 1533 1533 vrc = VDCreate(&vdInterfaceError, &pSrcDisk); 1534 if ( VBOX_FAILURE(vrc))1534 if (RT_FAILURE(vrc)) 1535 1535 { 1536 1536 RTPrintf("Error while creating the source virtual disk container: %Vrc\n", vrc); … … 1540 1540 /* Open the input image */ 1541 1541 vrc = VDOpen(pSrcDisk, Utf8Str(srcformat).raw(), Utf8Str(src).raw(), VD_OPEN_FLAGS_READONLY, NULL); 1542 if ( VBOX_FAILURE(vrc))1542 if (RT_FAILURE(vrc)) 1543 1543 { 1544 1544 RTPrintf("Error while opening the source image: %Vrc\n", vrc); … … 1551 1551 1552 1552 vrc = VDCreate(&vdInterfaceError, &pDstDisk); 1553 if ( VBOX_FAILURE(vrc))1553 if (RT_FAILURE(vrc)) 1554 1554 { 1555 1555 RTPrintf("Error while creating the destination virtual disk container: %Vrc\n", vrc); … … 1563 1563 vrc = VDCopy(pSrcDisk, VD_LAST_IMAGE, pDstDisk, Utf8Str(dstformat).raw(), 1564 1564 Utf8Str(dst).raw(), false, 0, NULL, NULL, NULL); 1565 if ( VBOX_FAILURE(vrc))1565 if (RT_FAILURE(vrc)) 1566 1566 { 1567 1567 RTPrintf("Error while copying the image: %Vrc\n", vrc); … … 1576 1576 VDCloseAll(pSrcDisk); 1577 1577 1578 return VBOX_SUCCESS(vrc) ? 0 : 1;1578 return RT_SUCCESS(vrc) ? 0 : 1; 1579 1579 } 1580 1580 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r13692 r13835 3349 3349 RTPrintf("Shrinking '%lS': 0%%", fileName.raw()); 3350 3350 int vrc = VDIShrinkImage(Utf8Str(fileName).raw(), hardDiskProgressCallback, &uProcent); 3351 if ( VBOX_FAILURE(vrc))3351 if (RT_FAILURE(vrc)) 3352 3352 { 3353 3353 RTPrintf("Error while shrinking hard disk image: %Vrc\n", vrc); … … 3439 3439 else 3440 3440 rc = RTFileOpen(&File, argv[arg], RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 3441 if ( VBOX_FAILURE(rc))3441 if (RT_FAILURE(rc)) 3442 3442 { 3443 3443 RTPrintf("File=\"%s\" open error: %Rrf\n", argv[arg], rc); … … 3451 3451 else 3452 3452 rc = RTFileGetSize(File, &cbFile); 3453 if ( VBOX_SUCCESS(rc))3453 if (RT_SUCCESS(rc)) 3454 3454 { 3455 3455 RTPrintf("Creating %s image with size %RU64 bytes (%RU64MB)...\n", (enmImgType == VDI_IMAGE_TYPE_FIXED) ? "fixed" : "dynamic", cbFile, (cbFile + _1M - 1) / _1M); … … 3460 3460 cbFile, 3461 3461 pszComment, NULL, NULL); 3462 if ( VBOX_SUCCESS(rc))3462 if (RT_SUCCESS(rc)) 3463 3463 { 3464 3464 PVDIDISK pVdi = VDIDiskCreate(); 3465 3465 rc = VDIDiskOpenImage(pVdi, argv[arg + 1], VDI_OPEN_FLAGS_NORMAL); 3466 if ( VBOX_SUCCESS(rc))3466 if (RT_SUCCESS(rc)) 3467 3467 { 3468 3468 /* alloc work buffer. */ … … 3478 3478 cbBuffer : (size_t) (cbFile - offFile); 3479 3479 rc = RTFileRead(File, pvBuf, cbToRead, &cbRead); 3480 if ( VBOX_FAILURE(rc) || !cbRead)3480 if (RT_FAILURE(rc) || !cbRead) 3481 3481 break; 3482 3482 rc = VDIDiskWrite(pVdi, offFile, pvBuf, cbRead); 3483 if ( VBOX_FAILURE(rc))3483 if (RT_FAILURE(rc)) 3484 3484 break; 3485 3485 offFile += cbRead; … … 3494 3494 } 3495 3495 3496 if ( VBOX_FAILURE(rc))3496 if (RT_FAILURE(rc)) 3497 3497 { 3498 3498 /* delete image on error */ … … 3561 3561 char *pszNext; 3562 3562 int rc = RTStrToUInt64Ex(argv[i], &pszNext, 0, &lun); 3563 if ( VBOX_FAILURE(rc) || *pszNext != '\0' || lun >= 16384)3563 if (RT_FAILURE(rc) || *pszNext != '\0' || lun >= 16384) 3564 3564 return errorArgument("Invalid LUN number '%s'", argv[i]); 3565 3565 if (lun <= 255) … … 3581 3581 char *pszNext; 3582 3582 int rc = RTStrToUInt64Ex(argv[i], &pszNext, 0, &lun); 3583 if ( VBOX_FAILURE(rc) || *pszNext != '\0')3583 if (RT_FAILURE(rc) || *pszNext != '\0') 3584 3584 return errorArgument("Invalid encoded LUN number '%s'", argv[i]); 3585 3585 } … … 3684 3684 return errorArgument("Missing argument to '%s'", argv[i]); 3685 3685 i++; 3686 if ( VBOX_FAILURE(RTUuidFromStr(&id, argv[i])))3686 if (RT_FAILURE(RTUuidFromStr(&id, argv[i]))) 3687 3687 return errorArgument("Invalid UUID format %s\n", argv[i]); 3688 3688 } … … 3742 3742 char *pszNext; 3743 3743 int rc = RTStrToUInt32Ex(psz, &pszNext, 10, &u32); 3744 if ( VBOX_SUCCESS(rc)3744 if ( RT_SUCCESS(rc) 3745 3745 && *pszNext == '\0' 3746 3746 && u32 >= 1 … … 4799 4799 /* 2nd try: try with the real name, important on Linux+libhal */ 4800 4800 char szPathReal[RTPATH_MAX]; 4801 if ( VBOX_FAILURE(RTPathReal(dvd + 5, szPathReal, sizeof(szPathReal))))4801 if (RT_FAILURE(RTPathReal(dvd + 5, szPathReal, sizeof(szPathReal)))) 4802 4802 { 4803 4803 errorArgument("Invalid host DVD drive name");
Note:
See TracChangeset
for help on using the changeset viewer.