Changeset 32531 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Sep 15, 2010 5:04:48 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 65913
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r31568 r32531 555 555 /* just try it */ 556 556 char *pszFormat = NULL; 557 int rc = VDGetFormat(NULL , argv[1], &pszFormat);557 int rc = VDGetFormat(NULL /* pVDIfsDisk */, argv[1], &pszFormat); 558 558 if (RT_FAILURE(rc)) 559 559 { … … 616 616 /* just try it */ 617 617 char *pszFormat = NULL; 618 int rc = VDGetFormat(NULL , argv[0], &pszFormat);618 int rc = VDGetFormat(NULL /* pVDIfsDisk */, argv[0], &pszFormat); 619 619 if (RT_FAILURE(rc)) 620 620 { … … 848 848 else 849 849 { 850 return errorSyntax(USAGE_LISTPARTITIONS, "Invalid parameter '%s'", Utf8Str(argv[i]).c_str());850 return errorSyntax(USAGE_LISTPARTITIONS, "Invalid parameter '%s'", argv[i]); 851 851 } 852 852 } … … 910 910 { 911 911 HRESULT rc = S_OK; 912 Bstr filename;912 Utf8Str filename; 913 913 const char *pszMBRFilename = NULL; 914 914 Utf8Str rawdisk; … … 972 972 #endif /* RT_OS_LINUX */ 973 973 else 974 return errorSyntax(USAGE_CREATERAWVMDK, "Invalid parameter '%s'", Utf8Str(argv[i]).c_str());974 return errorSyntax(USAGE_CREATERAWVMDK, "Invalid parameter '%s'", argv[i]); 975 975 } 976 976 … … 1444 1444 LCHS.cHeads = 0; 1445 1445 LCHS.cSectors = 0; 1446 vrc = VDCreateBase(pDisk, "VMDK", Utf8Str(filename).c_str(), cbSize,1446 vrc = VDCreateBase(pDisk, "VMDK", filename.c_str(), cbSize, 1447 1447 VD_IMAGE_FLAGS_FIXED | VD_VMDK_IMAGE_FLAGS_RAWDISK, 1448 1448 (char *)&RawDescriptor, &PCHS, &LCHS, NULL, … … 1453 1453 goto out; 1454 1454 } 1455 RTPrintf("RAW host disk access VMDK file %s created successfully.\n", Utf8Str(filename).c_str());1455 RTPrintf("RAW host disk access VMDK file %s created successfully.\n", filename.c_str()); 1456 1456 1457 1457 VDCloseAll(pDisk); … … 1475 1475 { 1476 1476 ComPtr<IMedium> hardDisk; 1477 CHECK_ERROR(aVirtualBox, OpenMedium( filename, DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam()));1477 CHECK_ERROR(aVirtualBox, OpenMedium(Bstr(filename), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam())); 1478 1478 } 1479 1479 … … 1487 1487 static int CmdRenameVMDK(int argc, char **argv, ComPtr<IVirtualBox> aVirtualBox, ComPtr<ISession> aSession) 1488 1488 { 1489 Bstr src;1490 Bstr dst;1489 Utf8Str src; 1490 Utf8Str dst; 1491 1491 /* Parse the arguments. */ 1492 1492 for (int i = 0; i < argc; i++) … … 1512 1512 else 1513 1513 { 1514 return errorSyntax(USAGE_RENAMEVMDK, "Invalid parameter '%s'", Utf8Str(argv[i]).c_str());1514 return errorSyntax(USAGE_RENAMEVMDK, "Invalid parameter '%s'", argv[i]); 1515 1515 } 1516 1516 } … … 1543 1543 else 1544 1544 { 1545 vrc = VDOpen(pDisk, "VMDK", Utf8Str(src).c_str(), VD_OPEN_FLAGS_NORMAL, NULL);1545 vrc = VDOpen(pDisk, "VMDK", src.c_str(), VD_OPEN_FLAGS_NORMAL, NULL); 1546 1546 if (RT_FAILURE(vrc)) 1547 1547 { … … 1550 1550 else 1551 1551 { 1552 vrc = VDCopy(pDisk, 0, pDisk, "VMDK", Utf8Str(dst).c_str(), true, 0, VD_IMAGE_FLAGS_NONE, NULL, NULL, NULL, NULL);1552 vrc = VDCopy(pDisk, 0, pDisk, "VMDK", dst.c_str(), true, 0, VD_IMAGE_FLAGS_NONE, NULL, NULL, NULL, NULL); 1553 1553 if (RT_FAILURE(vrc)) 1554 1554 { … … 1563 1563 static int CmdConvertToRaw(int argc, char **argv, ComPtr<IVirtualBox> aVirtualBox, ComPtr<ISession> aSession) 1564 1564 { 1565 Bstr srcformat;1566 Bstr src;1567 Bstr dst;1565 Utf8Str srcformat; 1566 Utf8Str src; 1567 Utf8Str dst; 1568 1568 bool fWriteToStdOut = false; 1569 1569 … … 1594 1594 else 1595 1595 { 1596 return errorSyntax(USAGE_CONVERTTORAW, "Invalid parameter '%s'", Utf8Str(argv[i]).c_str());1596 return errorSyntax(USAGE_CONVERTTORAW, "Invalid parameter '%s'", argv[i]); 1597 1597 } 1598 1598 } … … 1630 1630 outFile = 1; 1631 1631 else 1632 vrc = RTFileOpen(&outFile, Utf8Str(dst).c_str(), RTFILE_O_WRITE | RTFILE_O_CREATE | RTFILE_O_DENY_ALL);1632 vrc = RTFileOpen(&outFile, dst.c_str(), RTFILE_O_WRITE | RTFILE_O_CREATE | RTFILE_O_DENY_ALL); 1633 1633 if (RT_FAILURE(vrc)) 1634 1634 { 1635 1635 VDCloseAll(pDisk); 1636 RTPrintf("Error while creating destination file \"%s\": %Rrc\n", Utf8Str(dst).c_str(), vrc);1636 RTPrintf("Error while creating destination file \"%s\": %Rrc\n", dst.c_str(), vrc); 1637 1637 return 1; 1638 1638 } … … 1641 1641 { 1642 1642 char *pszFormat = NULL; 1643 vrc = VDGetFormat(NULL , Utf8Str(src).c_str(), &pszFormat);1643 vrc = VDGetFormat(NULL /* pVDIfsDisk */, src.c_str(), &pszFormat); 1644 1644 if (RT_FAILURE(vrc)) 1645 1645 { … … 1648 1648 { 1649 1649 RTFileClose(outFile); 1650 RTFileDelete( Utf8Str(dst).c_str());1650 RTFileDelete(dst.c_str()); 1651 1651 } 1652 1652 RTPrintf("No file format specified and autodetect failed - please specify format: %Rrc\n", vrc); … … 1656 1656 RTStrFree(pszFormat); 1657 1657 } 1658 vrc = VDOpen(pDisk, Utf8Str(srcformat).c_str(), Utf8Str(src).c_str(), VD_OPEN_FLAGS_READONLY, NULL);1658 vrc = VDOpen(pDisk, srcformat.c_str(), src.c_str(), VD_OPEN_FLAGS_READONLY, NULL); 1659 1659 if (RT_FAILURE(vrc)) 1660 1660 { … … 1663 1663 { 1664 1664 RTFileClose(outFile); 1665 RTFileDelete( Utf8Str(dst).c_str());1665 RTFileDelete(dst.c_str()); 1666 1666 } 1667 1667 RTPrintf("Error while opening the source image: %Rrc\n", vrc); … … 1676 1676 if (pvBuf) 1677 1677 { 1678 RTPrintf("Converting image \"%s\" with size %RU64 bytes (%RU64MB) to raw...\n", Utf8Str(src).c_str(), cbSize, (cbSize + _1M - 1) / _1M);1678 RTPrintf("Converting image \"%s\" with size %RU64 bytes (%RU64MB) to raw...\n", src.c_str(), cbSize, (cbSize + _1M - 1) / _1M); 1679 1679 while (offFile < cbSize) 1680 1680 { … … 1694 1694 { 1695 1695 RTFileClose(outFile); 1696 RTFileDelete( Utf8Str(dst).c_str());1696 RTFileDelete(dst.c_str()); 1697 1697 } 1698 1698 RTPrintf("Error copying image data: %Rrc\n", vrc); … … 1707 1707 { 1708 1708 RTFileClose(outFile); 1709 RTFileDelete( Utf8Str(dst).c_str());1709 RTFileDelete(dst.c_str()); 1710 1710 } 1711 1711 RTPrintf("Error allocating read buffer: %Rrc\n", vrc); … … 1721 1721 static int CmdConvertHardDisk(int argc, char **argv, ComPtr<IVirtualBox> aVirtualBox, ComPtr<ISession> aSession) 1722 1722 { 1723 Bstr srcformat;1724 Bstr dstformat;1725 Bstr src;1726 Bstr dst;1723 Utf8Str srcformat; 1724 Utf8Str dstformat; 1725 Utf8Str src; 1726 Utf8Str dst; 1727 1727 int vrc; 1728 1728 PVBOXHDD pSrcDisk = NULL; … … 1760 1760 else 1761 1761 { 1762 return errorSyntax(USAGE_CONVERTHD, "Invalid parameter '%s'", Utf8Str(argv[i]).c_str());1762 return errorSyntax(USAGE_CONVERTHD, "Invalid parameter '%s'", argv[i]); 1763 1763 } 1764 1764 } … … 1788 1788 { 1789 1789 char *pszFormat = NULL; 1790 vrc = VDGetFormat(NULL , Utf8Str(src).c_str(), &pszFormat);1790 vrc = VDGetFormat(NULL /* pVDIfsDisk */, src.c_str(), &pszFormat); 1791 1791 if (RT_FAILURE(vrc)) 1792 1792 { … … 1806 1806 1807 1807 /* Open the input image */ 1808 vrc = VDOpen(pSrcDisk, Utf8Str(srcformat).c_str(), Utf8Str(src).c_str(), VD_OPEN_FLAGS_READONLY, NULL);1808 vrc = VDOpen(pSrcDisk, srcformat.c_str(), src.c_str(), VD_OPEN_FLAGS_READONLY, NULL); 1809 1809 if (RT_FAILURE(vrc)) 1810 1810 { … … 1825 1825 1826 1826 uint64_t cbSize = VDGetSize(pSrcDisk, VD_LAST_IMAGE); 1827 RTPrintf("Converting image \"%s\" with size %RU64 bytes (%RU64MB)...\n", Utf8Str(src).c_str(), cbSize, (cbSize + _1M - 1) / _1M);1827 RTPrintf("Converting image \"%s\" with size %RU64 bytes (%RU64MB)...\n", src.c_str(), cbSize, (cbSize + _1M - 1) / _1M); 1828 1828 1829 1829 /* Create the output image */ 1830 vrc = VDCopy(pSrcDisk, VD_LAST_IMAGE, pDstDisk, Utf8Str(dstformat).c_str(), 1831 Utf8Str(dst).c_str(), false, 0, VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED, NULL, NULL, NULL, NULL); 1830 vrc = VDCopy(pSrcDisk, VD_LAST_IMAGE, pDstDisk, dstformat.c_str(), 1831 dst.c_str(), false, 0, VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED, 1832 NULL, NULL, NULL, NULL); 1832 1833 if (RT_FAILURE(vrc)) 1833 1834 { … … 2034 2035 2035 2036 /* default: */ 2036 return errorSyntax(USAGE_ALL, "Invalid command '%s'", Utf8Str(a->argv[0]).c_str());2037 } 2038 2037 return errorSyntax(USAGE_ALL, "Invalid command '%s'", a->argv[0]); 2038 } 2039 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r32081 r32531 153 153 { "--size", 's', RTGETOPT_REQ_UINT64 }, 154 154 { "-size", 's', RTGETOPT_REQ_UINT64 }, // deprecated 155 { "--sizebyte", 'S', RTGETOPT_REQ_UINT64 }, 155 156 { "--format", 'o', RTGETOPT_REQ_STRING }, 156 157 { "-format", 'o', RTGETOPT_REQ_STRING }, // deprecated … … 174 175 int vrc; 175 176 Bstr filename; 176 uint64_t size MB= 0;177 uint64_t size = 0; 177 178 Bstr format = "VDI"; 178 179 MediumVariant_T DiskVariant = MediumVariant_Standard; … … 196 197 197 198 case 's': // --size 198 sizeMB = ValueUnion.u64; 199 size = ValueUnion.u64 * _1M; 200 break; 201 202 case 'S': // --sizebyte 203 size = ValueUnion.u64; 199 204 break; 200 205 … … 256 261 /* check the outcome */ 257 262 if ( !filename 258 || size MB== 0)263 || size == 0) 259 264 return errorSyntax(USAGE_CREATEHD, "Parameters --filename and --size are required"); 260 265 … … 287 292 288 293 ComPtr<IProgress> progress; 289 CHECK_ERROR(hardDisk, CreateBaseStorage(size MB, DiskVariant, progress.asOutParam()));294 CHECK_ERROR(hardDisk, CreateBaseStorage(size, DiskVariant, progress.asOutParam())); 290 295 if (SUCCEEDED(rc) && progress) 291 296 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r32448 r32531 485 485 { 486 486 RTPrintf("VBoxManage createhd --filename <filename>\n" 487 " --size <megabytes> \n"487 " --size <megabytes>|--sizebyte <bytes>\n" 488 488 " [--format VDI|VMDK|VHD] (default: VDI)\n" 489 489 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r31698 r32531 839 839 systemProperties->COMGETTER(MaxGuestCPUCount)(&ulValue); 840 840 RTPrintf("Maximum guest CPU count: %u\n", ulValue); 841 systemProperties->COMGETTER( MaxVDISize)(&i64Value);842 RTPrintf(" Maximum VDI size: %lld Megabytes\n", i64Value);841 systemProperties->COMGETTER(InfoVDSize)(&i64Value); 842 RTPrintf("Virtual disk limit (info): %lld Bytes\n", i64Value); 843 843 systemProperties->COMGETTER(NetworkAdapterCount)(&ulValue); 844 844 RTPrintf("Maximum Network Adapter count: %u\n", ulValue);
Note:
See TracChangeset
for help on using the changeset viewer.