Changeset 63150 in vbox for trunk/src/VBox
- Timestamp:
- Aug 8, 2016 11:34:01 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VMDK.cpp
r62757 r63150 3224 3224 goto out; 3225 3225 3226 /*3227 * We have to check for the asynchronous open flag. The3228 * extents are parsed and the type of all are known now.3229 * Check if every extent is either FLAT or ZERO.3230 */3231 if (uOpenFlags & VD_OPEN_FLAGS_ASYNC_IO)3232 {3233 unsigned cFlatExtents = 0;3234 3235 for (unsigned i = 0; i < pImage->cExtents; i++)3236 {3237 pExtent = &pImage->pExtents[i];3238 3239 if (( pExtent->enmType != VMDKETYPE_FLAT3240 && pExtent->enmType != VMDKETYPE_ZERO3241 && pExtent->enmType != VMDKETYPE_VMFS)3242 || ((pImage->pExtents[i].enmType == VMDKETYPE_FLAT) && (cFlatExtents > 0)))3243 {3244 /*3245 * Opened image contains at least one none flat or zero extent.3246 * Return error but don't set error message as the caller3247 * has the chance to open in non async I/O mode.3248 */3249 rc = VERR_NOT_SUPPORTED;3250 goto out;3251 }3252 if (pExtent->enmType == VMDKETYPE_FLAT)3253 cFlatExtents++;3254 }3255 }3256 3257 3226 for (unsigned i = 0; i < pImage->cExtents; i++) 3258 3227 { … … 3749 3718 if (uImageFlags & VD_IMAGE_FLAGS_FIXED) 3750 3719 { 3720 unsigned uPercentEnd = uPercentStart + uPercentSpan; 3751 3721 rc = vdIfIoIntFileSetAllocationSize(pImage->pIfIo, pExtent->pFile->pStorage, cbExtent, 3752 0 /* fFlags */, pfnProgress, pvUser, uPercentStart + cbOffset * uPercentSpan / cbSize, uPercentSpan / cExtents); 3722 0 /* fFlags */, pfnProgress, pvUser, uPercentStart + cbOffset * uPercentSpan / cbSize, 3723 cbExtent * uPercentSpan / cbSize); 3753 3724 if (RT_FAILURE(rc)) 3754 3725 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not set size of new file '%s'"), pExtent->pszFullname); … … 4358 4329 } 4359 4330 } 4360 else 4331 else if (!fDelete) 4361 4332 vmdkFlushImage(pImage, NULL); 4362 4333
Note:
See TracChangeset
for help on using the changeset viewer.