Changeset 18566 in vbox
- Timestamp:
- Mar 31, 2009 12:28:49 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/VBox/VBoxHDD.h (modified) (2 diffs)
-
include/VBox/err.h (modified) (1 diff)
-
src/VBox/Devices/Storage/VmdkHDDCore.cpp (modified) (16 diffs)
-
src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp (modified) (1 diff)
-
src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp (modified) (3 diffs)
-
src/VBox/Main/idl/VirtualBox.xidl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxHDD.h
r18558 r18566 84 84 /** VMDK: stream optimized image, read only. */ 85 85 #define VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED (0x0004) 86 /** VMDK: ESX variant, use in addition to other flags. */ 87 #define VD_VMDK_IMAGE_FLAGS_ESX (0x0008) 86 88 /** VDI: Fill new blocks with zeroes while expanding image file. Only valid 87 89 * for newly created images, never set for opened existing images. */ … … 89 91 90 92 /** Mask of valid image flags for VMDK. */ 91 #define VD_VMDK_IMAGE_FLAGS_MASK (VD_IMAGE_FLAGS_FIXED | VD_IMAGE_FLAGS_DIFF | VD_IMAGE_FLAGS_NONE | VD_VMDK_IMAGE_FLAGS_SPLIT_2G | VD_VMDK_IMAGE_FLAGS_RAWDISK | VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED) 93 #define VD_VMDK_IMAGE_FLAGS_MASK ( VD_IMAGE_FLAGS_FIXED | VD_IMAGE_FLAGS_DIFF | VD_IMAGE_FLAGS_NONE \ 94 | VD_VMDK_IMAGE_FLAGS_SPLIT_2G | VD_VMDK_IMAGE_FLAGS_RAWDISK \ 95 | VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED | VD_VMDK_IMAGE_FLAGS_ESX) 92 96 93 97 /** Mask of valid image flags for VDI. */ -
trunk/include/VBox/err.h
r18230 r18566 1082 1082 /** Asynchronous I/O is not finished yet. */ 1083 1083 #define VERR_VD_ASYNC_IO_IN_PROGRESS (-3210) 1084 /** The image is too small or too large for this format. */ 1085 #define VERR_VD_INVALID_SIZE (-3211) 1084 1086 /** Generic: Invalid image file header. Use this for plugins. */ 1085 1087 #define VERR_VD_GEN_INVALID_HEADER (-3220) -
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r18505 r18566 198 198 VMDKETYPE_FLAT, 199 199 /** Zero extent. */ 200 VMDKETYPE_ZERO 200 VMDKETYPE_ZERO, 201 /** VMFS extent, used by ESX. */ 202 VMDKETYPE_VMFS 201 203 #ifdef VBOX_WITH_VMDK_ESX 202 204 , … … 1649 1651 { 1650 1652 static const char *apszAccess[] = { "NOACCESS", "RDONLY", "RW" }; 1651 static const char *apszType[] = { "", "SPARSE", "FLAT", "ZERO" };1653 static const char *apszType[] = { "", "SPARSE", "FLAT", "ZERO", "VMFS" }; 1652 1654 char *pszTmp; 1653 1655 unsigned uStart = pDescriptor->uFirstExtent, uLast = 0; 1654 1656 char szExt[1024]; 1655 1657 ssize_t cbDiff; 1658 1659 Assert((int)enmAccess < RT_ELEMENTS(apszAccess)); 1660 Assert((int)enmType < RT_ELEMENTS(apszType)); 1656 1661 1657 1662 /* Find last entry in extent description. */ … … 2073 2078 else if (!strcmp(pszCreateType, "streamOptimized")) 2074 2079 pImage->uImageFlags |= VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED; 2080 else if (!strcmp(pszCreateType, "vmfs")) 2081 pImage->uImageFlags |= VD_IMAGE_FLAGS_FIXED | VD_VMDK_IMAGE_FLAGS_ESX; 2075 2082 RTStrFree((char *)(void *)pszCreateType); 2076 2083 … … 2148 2155 { 2149 2156 pImage->pExtents[i].enmType = VMDKETYPE_ZERO; 2157 pszLine += 4; 2158 } 2159 else if (!strncmp(pszLine, "VMFS", 4)) 2160 { 2161 pImage->pExtents[i].enmType = VMDKETYPE_VMFS; 2150 2162 pszLine += 4; 2151 2163 } … … 3010 3022 PVMDKEXTENT pExtent = &pImage->pExtents[i]; 3011 3023 3012 if ( (pExtent->enmType != VMDKETYPE_FLAT) 3013 && (pExtent->enmType != VMDKETYPE_ZERO)) 3024 if ( pExtent->enmType != VMDKETYPE_FLAT 3025 && pExtent->enmType != VMDKETYPE_ZERO 3026 && pExtent->enmType != VMDKETYPE_VMFS) 3014 3027 { 3015 3028 /* … … 3094 3107 } 3095 3108 break; 3109 case VMDKETYPE_VMFS: 3096 3110 case VMDKETYPE_FLAT: 3097 3111 rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname, … … 3617 3631 } 3618 3632 else 3619 pExtent->enmType = VMDKETYPE_FLAT; 3633 { 3634 if (uImageFlags & VD_VMDK_IMAGE_FLAGS_ESX) 3635 pExtent->enmType = VMDKETYPE_VMFS; 3636 else 3637 pExtent->enmType = VMDKETYPE_FLAT; 3638 } 3620 3639 3621 3640 pExtent->enmAccess = VMDKACCESS_READWRITE; … … 3648 3667 if (uImageFlags & VD_IMAGE_FLAGS_FIXED) 3649 3668 { 3650 pszDescType = (cExtents == 1) 3651 ? "monolithicFlat" : "twoGbMaxExtentFlat"; 3669 if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_ESX) 3670 pszDescType = "vmfs"; 3671 else 3672 pszDescType = (cExtents == 1) 3673 ? "monolithicFlat" : "twoGbMaxExtentFlat"; 3652 3674 } 3653 3675 else … … 3942 3964 break; 3943 3965 #endif /* VBOX_WITH_VMDK_ESX */ 3966 case VMDKETYPE_VMFS: 3944 3967 case VMDKETYPE_FLAT: 3945 3968 /* Nothing to do. */ … … 3958 3981 case VMDKETYPE_ESX_SPARSE: 3959 3982 #endif /* VBOX_WITH_VMDK_ESX */ 3983 case VMDKETYPE_VMFS: 3960 3984 case VMDKETYPE_FLAT: 3961 3985 /** @todo implement proper path absolute check. */ … … 4462 4486 } 4463 4487 4488 /* Check size. Maximum 2TB-64K for sparse images, otherwise unlimited. */ 4489 if ( !cbSize 4490 || (!(uImageFlags & VD_IMAGE_FLAGS_FIXED) && cbSize >= _1T * 2 - _64K)) 4491 { 4492 rc = VERR_VD_INVALID_SIZE; 4493 goto out; 4494 } 4495 4464 4496 /* Check remaining arguments. */ 4465 4497 if ( !VALID_PTR(pszFilename) … … 4902 4934 } 4903 4935 break; 4936 case VMDKETYPE_VMFS: 4904 4937 case VMDKETYPE_FLAT: 4905 4938 rc = vmdkFileReadAt(pExtent->pFile, … … 5076 5109 } 5077 5110 break; 5111 case VMDKETYPE_VMFS: 5078 5112 case VMDKETYPE_FLAT: 5079 5113 /* Clip write range to remain in this extent. */ … … 5684 5718 for (unsigned i = 0; i < pImage->cExtents; i++) 5685 5719 { 5686 if ( (pImage->pExtents[i].enmType != VMDKETYPE_FLAT) 5687 && (pImage->pExtents[i].enmType != VMDKETYPE_ZERO)) 5720 if ( pImage->pExtents[i].enmType != VMDKETYPE_FLAT 5721 && pImage->pExtents[i].enmType != VMDKETYPE_ZERO 5722 && pImage->pExtents[i].enmType != VMDKETYPE_VMFS) 5688 5723 { 5689 5724 fAsyncIOSupported = false; … … 5742 5777 switch (pExtent->enmType) 5743 5778 { 5779 case VMDKETYPE_VMFS: 5744 5780 case VMDKETYPE_FLAT: 5745 5781 { … … 5878 5914 switch (pExtent->enmType) 5879 5915 { 5916 case VMDKETYPE_VMFS: 5880 5917 case VMDKETYPE_FLAT: 5881 5918 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r18388 r18566 85 85 || !RTStrNICmp(psz, "streamoptimized", len)) 86 86 DiskVariant |= HardDiskVariant_VmdkStreamOptimized; 87 else if (!RTStrNICmp(psz, "esx", len)) 88 DiskVariant |= HardDiskVariant_VmdkESX; 87 89 else 88 90 rc = VERR_PARSE_ERROR; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r18403 r18566 324 324 " --size <megabytes>\n" 325 325 " [--format VDI|VMDK|VHD] (default: VDI)\n" 326 " [--variant Standard,Fixed,Split2G,Stream Optimized]\n"326 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 327 327 " [--type normal|writethrough] (default: normal)\n" 328 328 " [--comment <comment>]\n" … … 343 343 RTPrintf("VBoxManage clonehd <uuid>|<filename> <outputfile>\n" 344 344 " [--format VDI|VMDK|VHD|RAW|<other>]\n" 345 " [--variant Standard,Fixed,Split2G,Stream Optimized]\n"345 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 346 346 " [--type normal|writethrough|immutable]\n" 347 347 " [--remember]\n" … … 353 353 RTPrintf("VBoxManage convertfromraw <filename> <outputfile>\n" 354 354 " [--format VDI|VMDK|VHD]\n" 355 " [--variant Standard,Fixed,Split2G,Stream Optimized]\n"355 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 356 356 "VBoxManage convertfromraw stdin <outputfile> <bytes>\n" 357 357 " [--format VDI|VMDK|VHD]\n" 358 " [--variant Standard,Fixed,Split2G,Stream Optimized]\n"358 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 359 359 "\n"); 360 360 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r18412 r18566 8746 8746 <enum 8747 8747 name="HardDiskVariant" 8748 uuid=" 99334b63-7ed0-4f61-8a7e-7ec3e20dd912"8748 uuid="eb7fc6b3-ae23-4c5d-a1f6-e3522dd1efb0" 8749 8749 > 8750 8750 <desc> … … 8769 8769 </desc> 8770 8770 </const> 8771 <const name="Fixed" value="0x1000"> 8771 <const name="VmdkESX" value="0x08"> 8772 <desc> 8773 VMDK format variant used on ESX products. 8774 </desc> 8775 </const> 8776 <const name="Fixed" value="0x10000"> 8772 8777 <desc> 8773 8778 Fixed image. Only allowed for base images. 8774 8779 </desc> 8775 8780 </const> 8776 <const name="Diff" value="0x2000 ">8781 <const name="Diff" value="0x20000"> 8777 8782 <desc> 8778 8783 Fixed image. Only allowed for base images.
Note:
See TracChangeset
for help on using the changeset viewer.

