Changeset 72883 in vbox
- Timestamp:
- Jul 4, 2018 3:22:02 PM (6 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r69500 r72883 84 84 else if (!RTStrNICmp(psz, "esx", len)) 85 85 uMediumVariant |= MediumVariant_VmdkESX; 86 else if (!RTStrNICmp(psz, "formatted", len)) 87 uMediumVariant |= MediumVariant_Formatted; 86 88 else 87 89 rc = VERR_PARSE_ERROR; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r72476 r72883 966 966 " [--diffparent <uuid>|<filename>\n" 967 967 " [--format VDI|VMDK|VHD] (default: VDI)\n" 968 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 968 " [--variant Standard,Fixed,Split2G,Stream,ESX,\n" 969 " Formatted]\n" 969 970 "\n", SEP); 970 971 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r72703 r72883 14762 14762 </desc> 14763 14763 </const> 14764 <const name="Formatted" value="0x20000000"> 14765 <desc> 14766 Special flag which requests formatting the disk image. Right now 14767 supported for floppy images only. 14768 </desc> 14769 </const> 14764 14770 <const name="NoCreateDir" value="0x40000000"> 14765 14771 <desc> … … 15853 15859 <desc> 15854 15860 Starts creating a hard disk storage unit (fixed/dynamic, according 15855 to the variant flags) in inthe background. The previous storage unit15861 to the variant flags) in the background. The previous storage unit 15856 15862 created for this object, if any, must first be deleted using 15857 15863 <link to="#deleteStorage"/>, otherwise the operation will fail. -
trunk/src/VBox/Main/include/MediumImpl.h
r72703 r72883 220 220 const ComObjPtr<Progress> &aProgress); 221 221 222 HRESULT i_cloneToEx(const ComObjPtr<Medium> &aTarget, ULONGaVariant,222 HRESULT i_cloneToEx(const ComObjPtr<Medium> &aTarget, MediumVariant_T aVariant, 223 223 const ComObjPtr<Medium> &aParent, IProgress **aProgress, 224 224 uint32_t idxSrcImageSame, uint32_t idxDstImageSame); -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r72509 r72883 1250 1250 srcLock.release(); 1251 1251 rc = pLMedium->i_cloneToEx(pTarget, 1252 srcVar,1252 (MediumVariant_T)srcVar, 1253 1253 pNewParent, 1254 1254 progress2.asOutParam(), -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r72703 r72883 38 38 #include <iprt/memsafer.h> 39 39 #include <iprt/base64.h> 40 #include <iprt/vfs.h> 41 #include <iprt/fsvfs.h> 40 42 41 43 #include <VBox/vd.h> … … 2594 2596 m->strFormat.c_str()); 2595 2597 2598 if ( (mediumVariantFlags & MediumVariant_Formatted) 2599 && i_getDeviceType() != DeviceType_Floppy) 2600 throw setError(VBOX_E_NOT_SUPPORTED, 2601 tr("Medium variant 'formatted' applies to floppy images only")); 2602 2596 2603 if (m->state != MediumState_NotCreated) 2597 2604 throw i_setStateError(); … … 2610 2617 pTask = new Medium::CreateBaseTask(this, pProgress, aLogicalSize, 2611 2618 (MediumVariant_T)mediumVariantFlags); 2612 //(MediumVariant_T)aVariant);2613 2619 rc = pTask->rc(); 2614 2620 AssertComRC(rc); … … 2749 2755 } 2750 2756 2757 if (mediumVariantFlags & MediumVariant_Formatted) 2758 { 2759 delete pMediumLockList; 2760 return setError(VBOX_E_NOT_SUPPORTED, 2761 tr("Medium variant 'formatted' applies to floppy images only")); 2762 } 2763 2751 2764 rc = i_createDiffStorage(diff, (MediumVariant_T)mediumVariantFlags, pMediumLockList, 2752 2765 &pProgress, false /* aWait */); … … 2915 2928 for (size_t i = 0; i < aVariant.size(); i++) 2916 2929 mediumVariantFlags |= (ULONG)aVariant[i]; 2930 } 2931 2932 if (mediumVariantFlags & MediumVariant_Formatted) 2933 { 2934 delete pSourceMediumLockList; 2935 delete pTargetMediumLockList; 2936 throw setError(VBOX_E_NOT_SUPPORTED, 2937 tr("Medium variant 'formatted' applies to floppy images only")); 2917 2938 } 2918 2939 … … 6227 6248 false /* fMoveByRename */, 6228 6249 0 /* cbSize */, 6229 aVariant & ~ MediumVariant_NoCreateDir,6250 aVariant & ~(MediumVariant_NoCreateDir | MediumVariant_Formatted), 6230 6251 NULL /* pDstUuid */, 6231 6252 VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_SEQUENTIAL, … … 6376 6397 * @return 6377 6398 */ 6378 HRESULT Medium::i_cloneToEx(const ComObjPtr<Medium> &aTarget, ULONGaVariant,6399 HRESULT Medium::i_cloneToEx(const ComObjPtr<Medium> &aTarget, MediumVariant_T aVariant, 6379 6400 const ComObjPtr<Medium> &aParent, IProgress **aProgress, 6380 6401 uint32_t idxSrcImageSame, uint32_t idxDstImageSame) … … 6480 6501 6481 6502 /* setup task object to carry out the operation asynchronously */ 6482 pTask = new Medium::CloneTask(this, pProgress, aTarget, 6483 (MediumVariant_T)aVariant, 6503 pTask = new Medium::CloneTask(this, pProgress, aTarget, aVariant, 6484 6504 aParent, idxSrcImageSame, 6485 6505 idxDstImageSame, pSourceMediumLockList, … … 8187 8207 location.c_str(), 8188 8208 task.mSize, 8189 task.mVariant & ~ MediumVariant_NoCreateDir,8209 task.mVariant & ~(MediumVariant_NoCreateDir | MediumVariant_Formatted), 8190 8210 NULL, 8191 8211 &geo, … … 8204 8224 throw setError(VBOX_E_FILE_ERROR, 8205 8225 tr("Could not create the medium storage unit '%s'%s"), 8226 location.c_str(), i_vdError(vrc).c_str()); 8227 } 8228 8229 if (task.mVariant & MediumVariant_Formatted) 8230 { 8231 RTVFSFILE hVfsFile; 8232 vrc = RTVfsFileOpenNormal(location.c_str(), RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_ALL, &hVfsFile); 8233 if (RT_FAILURE(vrc)) 8234 throw setError(VBOX_E_FILE_ERROR, 8235 tr("Opening medium storage unit '%s' failed%s"), 8236 location.c_str(), i_vdError(vrc).c_str()); 8237 vrc = RTFsFatVolFormat(hVfsFile, 0 /* offVol */, 0 /* cbVol */, RTFSFATVOL_FMT_F_QUICK, 8238 0 /* cbSector */, 0 /* cbSectorPerCluster */, RTFSFATTYPE_INVALID, 8239 0 /* cHeads */, 0 /* cSectorsPerTrack*/, 0 /* bMedia */, 8240 0 /* cRootDirEntries */, 0 /* cHiddenSectors */, 8241 NULL /* pErrInfo */); 8242 RTVfsFileRelease(hVfsFile); 8243 if (RT_FAILURE(vrc)) 8244 throw setError(VBOX_E_FILE_ERROR, 8245 tr("Formatting medium storage unit '%s' failed%s"), 8206 8246 location.c_str(), i_vdError(vrc).c_str()); 8207 8247 } … … 8379 8419 targetFormat.c_str(), 8380 8420 targetLocation.c_str(), 8381 (task.mVariant & ~(MediumVariant_NoCreateDir | MediumVariant_VmdkESX)) | VD_IMAGE_FLAGS_DIFF, 8421 (task.mVariant & ~(MediumVariant_NoCreateDir | MediumVariant_Formatted | MediumVariant_VmdkESX)) 8422 | VD_IMAGE_FLAGS_DIFF, 8382 8423 NULL, 8383 8424 targetId.raw(), … … 8975 9016 false /* fMoveByRename */, 8976 9017 0 /* cbSize */, 8977 task.mVariant & ~ MediumVariant_NoCreateDir,9018 task.mVariant & ~(MediumVariant_NoCreateDir | MediumVariant_Formatted), 8978 9019 targetId.raw(), 8979 9020 VD_OPEN_FLAGS_NORMAL | m->uOpenFlagsDef, … … 8993 9034 task.midxSrcImageSame, 8994 9035 task.midxDstImageSame, 8995 task.mVariant & ~ MediumVariant_NoCreateDir,9036 task.mVariant & ~(MediumVariant_NoCreateDir | MediumVariant_Formatted), 8996 9037 targetId.raw(), 8997 9038 VD_OPEN_FLAGS_NORMAL | m->uOpenFlagsDef, … … 9864 9905 false /* fMoveByRename */, 9865 9906 0 /* cbSize */, 9866 task.mVariant & ~ MediumVariant_NoCreateDir,9907 task.mVariant & ~(MediumVariant_NoCreateDir | MediumVariant_Formatted), 9867 9908 targetId.raw(), 9868 9909 VD_OPEN_FLAGS_NORMAL,
Note:
See TracChangeset
for help on using the changeset viewer.