Index: /trunk/src/VBox/Storage/VMDK.cpp
===================================================================
--- /trunk/src/VBox/Storage/VMDK.cpp	(revision 97254)
+++ /trunk/src/VBox/Storage/VMDK.cpp	(revision 97255)
@@ -3,4 +3,5 @@
  * VMDK disk image, core code.
  */
+
 /*
  * Copyright (C) 2006-2022 Oracle and/or its affiliates.
@@ -33,4 +34,5 @@
 #include <VBox/vd-plugin.h>
 #include <VBox/err.h>
+
 #include <iprt/assert.h>
 #include <iprt/alloc.h>
@@ -92,4 +94,5 @@
 # define DKIOCUNLOCKPHYSICALEXTENTS _IO(  'd', 83)
 #endif /* RT_OS_DARWIN */
+
 #include "VDBackends.h"
 
@@ -98,47 +101,68 @@
 *   Constants And Macros, Structures and Typedefs                                                                                *
 *********************************************************************************************************************************/
+
 /** Maximum encoded string size (including NUL) we allow for VMDK images.
  * Deliberately not set high to avoid running out of descriptor space. */
 #define VMDK_ENCODED_COMMENT_MAX 1024
+
 /** VMDK descriptor DDB entry for PCHS cylinders. */
 #define VMDK_DDB_GEO_PCHS_CYLINDERS "ddb.geometry.cylinders"
+
 /** VMDK descriptor DDB entry for PCHS heads. */
 #define VMDK_DDB_GEO_PCHS_HEADS "ddb.geometry.heads"
+
 /** VMDK descriptor DDB entry for PCHS sectors. */
 #define VMDK_DDB_GEO_PCHS_SECTORS "ddb.geometry.sectors"
+
 /** VMDK descriptor DDB entry for LCHS cylinders. */
 #define VMDK_DDB_GEO_LCHS_CYLINDERS "ddb.geometry.biosCylinders"
+
 /** VMDK descriptor DDB entry for LCHS heads. */
 #define VMDK_DDB_GEO_LCHS_HEADS "ddb.geometry.biosHeads"
+
 /** VMDK descriptor DDB entry for LCHS sectors. */
 #define VMDK_DDB_GEO_LCHS_SECTORS "ddb.geometry.biosSectors"
+
 /** VMDK descriptor DDB entry for image UUID. */
 #define VMDK_DDB_IMAGE_UUID "ddb.uuid.image"
+
 /** VMDK descriptor DDB entry for image modification UUID. */
 #define VMDK_DDB_MODIFICATION_UUID "ddb.uuid.modification"
+
 /** VMDK descriptor DDB entry for parent image UUID. */
 #define VMDK_DDB_PARENT_UUID "ddb.uuid.parent"
+
 /** VMDK descriptor DDB entry for parent image modification UUID. */
 #define VMDK_DDB_PARENT_MODIFICATION_UUID "ddb.uuid.parentmodification"
+
 /** No compression for streamOptimized files. */
 #define VMDK_COMPRESSION_NONE 0
+
 /** Deflate compression for streamOptimized files. */
 #define VMDK_COMPRESSION_DEFLATE 1
+
 /** Marker that the actual GD value is stored in the footer. */
 #define VMDK_GD_AT_END 0xffffffffffffffffULL
+
 /** Marker for end-of-stream in streamOptimized images. */
 #define VMDK_MARKER_EOS 0
+
 /** Marker for grain table block in streamOptimized images. */
 #define VMDK_MARKER_GT 1
+
 /** Marker for grain directory block in streamOptimized images. */
 #define VMDK_MARKER_GD 2
+
 /** Marker for footer in streamOptimized images. */
 #define VMDK_MARKER_FOOTER 3
+
 /** Marker for unknown purpose in streamOptimized images.
  * Shows up in very recent images created by vSphere, but only sporadically.
  * They "forgot" to document that one in the VMDK specification. */
 #define VMDK_MARKER_UNSPECIFIED 4
+
 /** Dummy marker for "don't check the marker value". */
 #define VMDK_MARKER_IGNORE 0xffffffffU
+
 /**
  * Magic number for hosted images created by VMware Workstation 4, VMware
@@ -146,4 +170,5 @@
  */
 #define VMDK_SPARSE_MAGICNUMBER 0x564d444b /* 'V' 'M' 'D' 'K' */
+
 /** VMDK sector size in bytes. */
 #define VMDK_SECTOR_SIZE 512
@@ -154,4 +179,5 @@
 /** Grain table size in bytes */
 #define VMDK_GRAIN_TABLE_SIZE 2048
+
 /**
  * VMDK hosted binary extent header. The "Sparse" is a total misnomer, as
@@ -181,9 +207,12 @@
 } SparseExtentHeader;
 #pragma pack()
+
 /** The maximum allowed descriptor size in the extent header in sectors. */
 #define VMDK_SPARSE_DESCRIPTOR_SIZE_MAX UINT64_C(20480) /* 10MB */
+
 /** VMDK capacity for a single chunk when 2G splitting is turned on. Should be
  * divisible by the default grain size (64K) */
 #define VMDK_2G_SPLIT_SIZE (2047 * 1024 * 1024)
+
 /** VMDK streamOptimized file format marker. The type field may or may not
  * be actually valid, but there's always data to read there. */
@@ -196,8 +225,12 @@
 } VMDKMARKER, *PVMDKMARKER;
 #pragma pack()
+
+
 /** Convert sector number/size to byte offset/size. */
 #define VMDK_SECTOR2BYTE(u) ((uint64_t)(u) << 9)
+
 /** Convert byte offset/size to sector number/size. */
 #define VMDK_BYTE2SECTOR(u) ((u) >> 9)
+
 /**
  * VMDK extent type.
@@ -214,4 +247,5 @@
     VMDKETYPE_VMFS
 } VMDKETYPE, *PVMDKETYPE;
+
 /**
  * VMDK access type for a extent.
@@ -226,6 +260,8 @@
     VMDKACCESS_READWRITE
 } VMDKACCESS, *PVMDKACCESS;
+
 /** Forward declaration for PVMDKIMAGE. */
 typedef struct VMDKIMAGE *PVMDKIMAGE;
+
 /**
  * Extents files entry. Used for opening a particular file only once.
@@ -252,4 +288,5 @@
     struct VMDKFILE *pPrev;
 } VMDKFILE, *PVMDKFILE;
+
 /**
  * VMDK extent data structure.
@@ -332,8 +369,10 @@
     struct VMDKIMAGE *pImage;
 } VMDKEXTENT, *PVMDKEXTENT;
+
 /**
  * Grain table cache size. Allocated per image.
  */
 #define VMDK_GT_CACHE_SIZE 256
+
 /**
  * Grain table block size. Smaller than an actual grain table block to allow
@@ -342,4 +381,6 @@
  */
 #define VMDK_GT_CACHELINE_SIZE 128
+
+
 /**
  * Maximum number of lines in a descriptor file. Not worth the effort of
@@ -349,4 +390,5 @@
  */
 #define VMDK_DESCRIPTOR_LINES_MAX   1100U
+
 /**
  * Parsed descriptor information. Allows easy access and update of the
@@ -372,4 +414,6 @@
     unsigned    aNextLines[VMDK_DESCRIPTOR_LINES_MAX];
 } VMDKDESCRIPTOR, *PVMDKDESCRIPTOR;
+
+
 /**
  * Cache entry for translating extent/sector to a sector number in that
@@ -385,4 +429,5 @@
     uint32_t    aGTData[VMDK_GT_CACHELINE_SIZE];
 } VMDKGTCACHEENTRY, *PVMDKGTCACHEENTRY;
+
 /**
  * Cache data structure for blocks of grain table entries. For now this is a
@@ -398,4 +443,5 @@
     unsigned            cEntries;
 } VMDKGTCACHE, *PVMDKGTCACHE;
+
 /**
  * Complete VMDK image data structure. Mainly a collection of extents and a few
@@ -408,12 +454,16 @@
     /** Descriptor file if applicable. */
     PVMDKFILE         pFile;
+
     /** Pointer to the per-disk VD interface list. */
     PVDINTERFACE      pVDIfsDisk;
     /** Pointer to the per-image VD interface list. */
     PVDINTERFACE      pVDIfsImage;
+
     /** Error interface. */
     PVDINTERFACEERROR pIfError;
     /** I/O interface. */
     PVDINTERFACEIOINT pIfIo;
+
+
     /** Pointer to the image extents. */
     PVMDKEXTENT     pExtents;
@@ -423,4 +473,5 @@
      * times only once (happens mainly with raw partition access). */
     PVMDKFILE       pFiles;
+
     /**
      * Pointer to an array of segment entries for async I/O.
@@ -432,4 +483,5 @@
     /** Entries available in the segments array. */
     unsigned        cSegments;
+
     /** Open flags passed by VBoxHD layer. */
     unsigned        uOpenFlags;
@@ -450,4 +502,5 @@
     /** Parent image modification UUID. */
     RTUUID          ParentModificationUuid;
+
     /** Pointer to grain table cache, if this image contains sparse extents. */
     PVMDKGTCACHE    pGTCache;
@@ -461,4 +514,6 @@
     VDREGIONLIST    RegionList;
 } VMDKIMAGE;
+
+
 /** State for the input/output callout of the inflate reader/deflate writer. */
 typedef struct VMDKCOMPRESSIO
@@ -473,4 +528,6 @@
     void *pvCompGrain;
 } VMDKCOMPRESSIO;
+
+
 /** Tracks async grain allocation. */
 typedef struct VMDKGRAINALLOCASYNC
@@ -494,4 +551,5 @@
     uint64_t    uRGTSector;
 } VMDKGRAINALLOCASYNC, *PVMDKGRAINALLOCASYNC;
+
 /**
  * State information for vmdkRename() and helpers.
@@ -536,4 +594,5 @@
 *   Static Variables                                                                                                             *
 *********************************************************************************************************************************/
+
 /** NULL-terminated array of supported file extensions. */
 static const VDFILEEXTENSION s_aVmdkFileExtensions[] =
@@ -542,4 +601,5 @@
     {NULL, VDTYPE_INVALID}
 };
+
 /** NULL-terminated array of configuration option. */
 static const VDCONFIGINFO s_aVmdkConfigInfo[] =
@@ -550,4 +610,5 @@
     { "BootSector",                     NULL,                             VDCFGVALUETYPE_BYTES,        0 },
     { "Relative",                       NULL,                             VDCFGVALUETYPE_INTEGER,      0 },
+
     /* End of options list */
     { NULL,                             NULL,                             VDCFGVALUETYPE_INTEGER,      0 }
@@ -558,13 +619,17 @@
 *   Internal Functions                                                                                                           *
 *********************************************************************************************************************************/
+
 static void vmdkFreeStreamBuffers(PVMDKEXTENT pExtent);
 static int vmdkFreeExtentData(PVMDKIMAGE pImage, PVMDKEXTENT pExtent,
                               bool fDelete);
+
 static int vmdkCreateExtents(PVMDKIMAGE pImage, unsigned cExtents);
 static int vmdkFlushImage(PVMDKIMAGE pImage, PVDIOCTX pIoCtx);
 static int vmdkSetImageComment(PVMDKIMAGE pImage, const char *pszComment);
 static int vmdkFreeImage(PVMDKIMAGE pImage, bool fDelete, bool fFlush);
+
 static DECLCALLBACK(int) vmdkAllocGrainComplete(void *pBackendData, PVDIOCTX pIoCtx,
                                                 void *pvUser, int rcReq);
+
 /**
  * Internal: open a file (using a file descriptor cache to ensure each file
@@ -576,4 +641,5 @@
     int rc = VINF_SUCCESS;
     PVMDKFILE pVmdkFile;
+
     for (pVmdkFile = pImage->pFiles;
          pVmdkFile != NULL;
@@ -584,8 +650,11 @@
             Assert(fOpen == pVmdkFile->fOpen);
             pVmdkFile->uReferences++;
+
             *ppVmdkFile = pVmdkFile;
+
             return rc;
         }
     }
+
     /* If we get here, there's no matching entry in the cache. */
     pVmdkFile = (PVMDKFILE)RTMemAllocZ(sizeof(VMDKFILE));
@@ -595,4 +664,5 @@
         return VERR_NO_MEMORY;
     }
+
     pVmdkFile->pszFilename = RTStrDup(pszFilename);
     if (!pVmdkFile->pszFilename)
@@ -602,4 +672,5 @@
         return VERR_NO_MEMORY;
     }
+
     if (pszBasename)
     {
@@ -613,5 +684,7 @@
         }
     }
+
     pVmdkFile->fOpen = fOpen;
+
     rc = vdIfIoIntFileOpen(pImage->pIfIo, pszFilename, fOpen,
                            &pVmdkFile->pStorage);
@@ -632,6 +705,8 @@
         *ppVmdkFile = NULL;
     }
+
     return rc;
 }
+
 /**
  * Internal: close a file, updating the file descriptor cache.
@@ -641,5 +716,7 @@
     int rc = VINF_SUCCESS;
     PVMDKFILE pVmdkFile = *ppVmdkFile;
+
     AssertPtr(pVmdkFile);
+
     pVmdkFile->fDelete |= fDelete;
     Assert(pVmdkFile->uReferences);
@@ -649,7 +726,9 @@
         PVMDKFILE pPrev;
         PVMDKFILE pNext;
+
         /* Unchain the element from the list. */
         pPrev = pVmdkFile->pPrev;
         pNext = pVmdkFile->pNext;
+
         if (pNext)
             pNext->pPrev = pPrev;
@@ -658,5 +737,7 @@
         else
             pImage->pFiles = pNext;
+
         rc = vdIfIoIntFileClose(pImage->pIfIo, pVmdkFile->pStorage);
+
         bool fFileDel = pVmdkFile->fDelete;
         if (   pVmdkFile->pszBasename
@@ -671,4 +752,5 @@
                 fFileDel = false;
         }
+
         if (fFileDel)
         {
@@ -684,7 +766,9 @@
         RTMemFree(pVmdkFile);
     }
+
     *ppVmdkFile = NULL;
     return rc;
 }
+
 /*#define VMDK_USE_BLOCK_DECOMP_API - test and enable */
 #ifndef VMDK_USE_BLOCK_DECOMP_API
@@ -693,4 +777,5 @@
     VMDKCOMPRESSIO *pInflateState = (VMDKCOMPRESSIO *)pvUser;
     size_t cbInjected = 0;
+
     Assert(cbBuf);
     if (pInflateState->iOffset < 0)
@@ -718,4 +803,5 @@
 }
 #endif
+
 /**
  * Internal: read from a file and inflate the compressed data,
@@ -733,4 +819,5 @@
     VMDKMARKER *pMarker = (VMDKMARKER *)pExtent->pvCompGrain;
     size_t cbCompSize, cbActuallyRead;
+
     if (!pcvMarker)
     {
@@ -747,4 +834,5 @@
         pMarker->cbSize = RT_H2LE_U32(pMarker->cbSize);
     }
+
     cbCompSize = RT_LE2H_U32(pMarker->cbSize);
     if (cbCompSize == 0)
@@ -753,8 +841,10 @@
         return VERR_VD_VMDK_INVALID_FORMAT;
     }
+
     /* Sanity check - the expansion ratio should be much less than 2. */
     Assert(cbCompSize < 2 * cbToRead);
     if (cbCompSize >= 2 * cbToRead)
         return VERR_VD_VMDK_INVALID_FORMAT;
+
     /* Compressed grain marker. Data follows immediately. */
     rc = vdIfIoIntFileReadSync(pImage->pIfIo, pExtent->pFile->pStorage,
@@ -766,4 +856,5 @@
                                           512)
                                - RT_UOFFSETOF(VMDKMARKER, uType));
+
     if (puLBA)
         *puLBA = RT_LE2H_U64(pMarker->uSector);
@@ -772,4 +863,5 @@
                                   + RT_UOFFSETOF(VMDKMARKER, uType),
                                   512);
+
 #ifdef VMDK_USE_BLOCK_DECOMP_API
     rc = RTZipBlockDecompress(RTZIPTYPE_ZLIB, 0 /*fFlags*/,
@@ -782,4 +874,5 @@
     InflateState.cbCompGrain = cbCompSize + RT_UOFFSETOF(VMDKMARKER, uType);
     InflateState.pvCompGrain = pExtent->pvCompGrain;
+
     rc = RTZipDecompCreate(&pZip, &InflateState, vmdkFileInflateHelper);
     if (RT_FAILURE(rc))
@@ -798,7 +891,9 @@
     return rc;
 }
+
 static DECLCALLBACK(int) vmdkFileDeflateHelper(void *pvUser, const void *pvBuf, size_t cbBuf)
 {
     VMDKCOMPRESSIO *pDeflateState = (VMDKCOMPRESSIO *)pvUser;
+
     Assert(cbBuf);
     if (pDeflateState->iOffset < 0)
@@ -817,4 +912,5 @@
     return VINF_SUCCESS;
 }
+
 /**
  * Internal: deflate the uncompressed data and write to a file,
@@ -829,8 +925,10 @@
     PRTZIPCOMP pZip = NULL;
     VMDKCOMPRESSIO DeflateState;
+
     DeflateState.pImage = pImage;
     DeflateState.iOffset = -1;
     DeflateState.cbCompGrain = pExtent->cbCompGrain;
     DeflateState.pvCompGrain = pExtent->pvCompGrain;
+
     rc = RTZipCompCreate(&pZip, &DeflateState, vmdkFileDeflateHelper,
                          RTZIPTYPE_ZLIB, RTZIPLEVEL_DEFAULT);
@@ -845,4 +943,5 @@
         Assert(   DeflateState.iOffset > 0
                && (size_t)DeflateState.iOffset <= DeflateState.cbCompGrain);
+
         /* pad with zeroes to get to a full sector size */
         uint32_t uSize = DeflateState.iOffset;
@@ -854,6 +953,8 @@
             uSize = uSizeAlign;
         }
+
         if (pcbMarkerData)
             *pcbMarkerData = uSize;
+
         /* Compressed grain marker. Data follows immediately. */
         VMDKMARKER *pMarker = (VMDKMARKER *)pExtent->pvCompGrain;
@@ -868,4 +969,6 @@
     return rc;
 }
+
+
 /**
  * Internal: check if all files are closed, prevent leaking resources.
@@ -875,4 +978,5 @@
     int rc = VINF_SUCCESS, rc2;
     PVMDKFILE pVmdkFile;
+
     Assert(pImage->pFiles == NULL);
     for (pVmdkFile = pImage->pFiles;
@@ -883,5 +987,7 @@
                 pVmdkFile->pszFilename));
         pImage->pFiles = pVmdkFile->pNext;
+
         rc2 = vmdkFileClose(pImage, &pVmdkFile, pVmdkFile->fDelete);
+
         if (RT_SUCCESS(rc))
             rc = rc2;
@@ -889,4 +995,5 @@
     return rc;
 }
+
 /**
  * Internal: truncate a string (at a UTF8 code point boundary) and encode the
@@ -897,5 +1004,7 @@
     char szEnc[VMDK_ENCODED_COMMENT_MAX + 3];
     char *pszDst = szEnc;
+
     AssertPtr(psz);
+
     for (; *psz; psz = RTStrNextCp(psz))
     {
@@ -928,4 +1037,5 @@
     return RTStrDup(szEnc);
 }
+
 /**
  * Internal: decode a string and store it into the specified string.
@@ -935,7 +1045,10 @@
     int rc = VINF_SUCCESS;
     char szBuf[4];
+
     if (!cb)
         return VERR_BUFFER_OVERFLOW;
+
     AssertPtr(psz);
+
     for (; *pszEncoded; pszEncoded = RTStrNextCp(pszEncoded))
     {
@@ -960,4 +1073,5 @@
         else
             pszDst = RTStrPutCp(pszDst, Cp);
+
         /* Need to leave space for terminating NUL. */
         if ((size_t)(pszDst - szBuf) + 1 >= cb)
@@ -972,4 +1086,5 @@
     return rc;
 }
+
 /**
  * Internal: free all buffers associated with grain directories.
@@ -988,4 +1103,5 @@
     }
 }
+
 /**
  * Internal: allocate the compressed/uncompressed buffers for streamOptimized
@@ -995,4 +1111,5 @@
 {
     int rc = VINF_SUCCESS;
+
     if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
     {
@@ -1013,8 +1130,10 @@
             rc = VERR_NO_MEMORY;
     }
+
     if (RT_FAILURE(rc))
         vmdkFreeStreamBuffers(pExtent);
     return rc;
 }
+
 /**
  * Internal: allocate all buffers associated with grain directories.
@@ -1025,4 +1144,5 @@
     int rc = VINF_SUCCESS;
     size_t cbGD = pExtent->cGDEntries * sizeof(uint32_t);
+
     pExtent->pGD = (uint32_t *)RTMemAllocZ(cbGD);
     if (RT_LIKELY(pExtent->pGD))
@@ -1037,8 +1157,10 @@
     else
         rc = VERR_NO_MEMORY;
+
     if (RT_FAILURE(rc))
         vmdkFreeGrainDirectory(pExtent);
     return rc;
 }
+
 /**
  * Converts the grain directory from little to host endianess.
@@ -1051,7 +1173,9 @@
 {
     uint32_t *pGDTmp = pGD;
+
     for (uint32_t i = 0; i < cGDEntries; i++, pGDTmp++)
         *pGDTmp = RT_LE2H_U32(*pGDTmp);
 }
+
 /**
  * Read the grain directory and allocated grain tables verifying them against
@@ -1066,7 +1190,9 @@
     int rc = VINF_SUCCESS;
     size_t cbGD = pExtent->cGDEntries * sizeof(uint32_t);
+
     AssertReturn((   pExtent->enmType == VMDKETYPE_HOSTED_SPARSE
                   && pExtent->uSectorGD != VMDK_GD_AT_END
                   && pExtent->uSectorRGD != VMDK_GD_AT_END), VERR_INTERNAL_ERROR);
+
     rc = vmdkAllocGrainDirectory(pImage, pExtent);
     if (RT_SUCCESS(rc))
@@ -1080,4 +1206,5 @@
         {
             vmdkGrainDirectoryConvToHost(pExtent->pGD, pExtent->cGDEntries);
+
             if (   pExtent->uSectorRGD
                 && !(pImage->uOpenFlags & VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS))
@@ -1091,16 +1218,21 @@
                 {
                     vmdkGrainDirectoryConvToHost(pExtent->pRGD, pExtent->cGDEntries);
+
                     /* Check grain table and redundant grain table for consistency. */
                     size_t cbGT = pExtent->cGTEntries * sizeof(uint32_t);
                     size_t cbGTBuffers = cbGT; /* Start with space for one GT. */
                     size_t cbGTBuffersMax = _1M;
+
                     uint32_t *pTmpGT1 = (uint32_t *)RTMemAlloc(cbGTBuffers);
                     uint32_t *pTmpGT2 = (uint32_t *)RTMemAlloc(cbGTBuffers);
+
                     if (   !pTmpGT1
                         || !pTmpGT2)
                         rc = VERR_NO_MEMORY;
+
                     size_t i = 0;
                     uint32_t *pGDTmp = pExtent->pGD;
                     uint32_t *pRGDTmp = pExtent->pRGD;
+
                     /* Loop through all entries. */
                     while (i < pExtent->cGDEntries)
@@ -1109,4 +1241,5 @@
                         uint32_t uRGTStart = *pRGDTmp;
                         size_t   cbGTRead = cbGT;
+
                         /* If no grain table is allocated skip the entry. */
                         if (*pGDTmp == 0 && *pRGDTmp == 0)
@@ -1115,4 +1248,5 @@
                             continue;
                         }
+
                         if (*pGDTmp == 0 || *pRGDTmp == 0 || *pGDTmp == *pRGDTmp)
                         {
@@ -1124,7 +1258,9 @@
                             break;
                         }
+
                         i++;
                         pGDTmp++;
                         pRGDTmp++;
+
                         /*
                          * Read a few tables at once if adjacent to decrease the number
@@ -1140,4 +1276,5 @@
                                 continue;
                             }
+
                             if (*pGDTmp == 0 || *pRGDTmp == 0 || *pGDTmp == *pRGDTmp)
                             {
@@ -1149,8 +1286,10 @@
                                 break;
                             }
+
                             /* Check that the start offsets are adjacent.*/
                             if (   VMDK_SECTOR2BYTE(uGTStart) + cbGTRead != VMDK_SECTOR2BYTE(*pGDTmp)
                                 || VMDK_SECTOR2BYTE(uRGTStart) + cbGTRead != VMDK_SECTOR2BYTE(*pRGDTmp))
                                 break;
+
                             i++;
                             pGDTmp++;
@@ -1158,4 +1297,5 @@
                             cbGTRead += cbGT;
                         }
+
                         /* Increase buffers if required. */
                         if (   RT_SUCCESS(rc)
@@ -1175,4 +1315,5 @@
                             else
                                 rc = VERR_NO_MEMORY;
+
                             if (rc == VERR_NO_MEMORY)
                             {
@@ -1181,8 +1322,10 @@
                                 i -= cbGTRead / cbGT;
                                 cbGTRead = cbGT;
+
                                 /* Don't try to increase the buffer again in the next run. */
                                 cbGTBuffersMax = cbGTBuffers;
                             }
                         }
+
                         if (RT_SUCCESS(rc))
                         {
@@ -1217,4 +1360,5 @@
                         }
                     } /* while (i < pExtent->cGDEntries) */
+
                     /** @todo figure out what to do for unclean VMDKs. */
                     if (pTmpGT1)
@@ -1232,8 +1376,10 @@
                            N_("VMDK: could not read grain directory in '%s': %Rrc"), pExtent->pszFullname, rc);
     }
+
     if (RT_FAILURE(rc))
         vmdkFreeGrainDirectory(pExtent);
     return rc;
 }
+
 /**
  * Creates a new grain directory for the given extent at the given start sector.
@@ -1254,4 +1400,5 @@
     size_t cbGTRounded;
     uint64_t cbOverhead;
+
     if (fPreAlloc)
     {
@@ -1267,4 +1414,5 @@
         cbOverhead = VMDK_SECTOR2BYTE(uStartSector) + cbGDRounded;
     }
+
     /* For streamOptimized extents there is only one grain directory,
      * and for all others take redundant grain directory into account. */
@@ -1281,8 +1429,10 @@
         rc = vdIfIoIntFileSetSize(pImage->pIfIo, pExtent->pFile->pStorage, cbOverhead);
     }
+
     if (RT_SUCCESS(rc))
     {
         pExtent->uAppendPosition = cbOverhead;
         pExtent->cOverheadSectors = VMDK_BYTE2SECTOR(cbOverhead);
+
         if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
         {
@@ -1295,4 +1445,5 @@
             pExtent->uSectorGD = uStartSector + VMDK_BYTE2SECTOR(cbGDRounded + cbGTRounded);
         }
+
         rc = vmdkAllocStreamBuffers(pImage, pExtent);
         if (RT_SUCCESS(rc))
@@ -1304,4 +1455,5 @@
                 uint32_t uGTSectorLE;
                 uint64_t uOffsetSectors;
+
                 if (pExtent->pRGD)
                 {
@@ -1323,4 +1475,5 @@
                     }
                 }
+
                 if (RT_SUCCESS(rc))
                 {
@@ -1345,8 +1498,10 @@
         }
     }
+
     if (RT_FAILURE(rc))
         vmdkFreeGrainDirectory(pExtent);
     return rc;
 }
+
 /**
  * Unquotes the given string returning the result in a separate buffer.
@@ -1366,7 +1521,9 @@
     char *pszQ;
     char *pszUnquoted;
+
     /* Skip over whitespace. */
     while (*pszStr == ' ' || *pszStr == '\t')
         pszStr++;
+
     if (*pszStr != '"')
     {
@@ -1383,4 +1540,5 @@
                              pImage->pszFilename, pszStart);
     }
+
     pszUnquoted = (char *)RTMemTmpAlloc(pszQ - pszStr + 1);
     if (!pszUnquoted)
@@ -1393,4 +1551,5 @@
     return VINF_SUCCESS;
 }
+
 static int vmdkDescInitStr(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                            const char *pszLine)
@@ -1398,13 +1557,17 @@
     char *pEnd = pDescriptor->aLines[pDescriptor->cLines];
     ssize_t cbDiff = strlen(pszLine) + 1;
+
     if (    pDescriptor->cLines >= VMDK_DESCRIPTOR_LINES_MAX - 1
         &&  pEnd - pDescriptor->aLines[0] > (ptrdiff_t)pDescriptor->cbDescAlloc - cbDiff)
         return vdIfError(pImage->pIfError, VERR_BUFFER_OVERFLOW, RT_SRC_POS, N_("VMDK: descriptor too big in '%s'"), pImage->pszFilename);
+
     memcpy(pEnd, pszLine, cbDiff);
     pDescriptor->cLines++;
     pDescriptor->aLines[pDescriptor->cLines] = pEnd + cbDiff;
     pDescriptor->fDirty = true;
+
     return VINF_SUCCESS;
 }
+
 static bool vmdkDescGetStr(PVMDKDESCRIPTOR pDescriptor, unsigned uStart,
                            const char *pszKey, const char **ppszValue)
@@ -1412,4 +1575,5 @@
     size_t cbKey = strlen(pszKey);
     const char *pszValue;
+
     while (uStart != 0)
     {
@@ -1430,4 +1594,5 @@
     return !!uStart;
 }
+
 static int vmdkDescSetStr(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                           unsigned uStart,
@@ -1437,4 +1602,5 @@
     size_t cbKey = strlen(pszKey);
     unsigned uLast = 0;
+
     while (uStart != 0)
     {
@@ -1471,4 +1637,5 @@
                 > (ptrdiff_t)pDescriptor->cbDescAlloc - cbDiff)
                 return vdIfError(pImage->pIfError, VERR_BUFFER_OVERFLOW, RT_SRC_POS, N_("VMDK: descriptor too big in '%s'"), pImage->pszFilename);
+
             memmove(pszTmp + cbNewVal, pszTmp + cbOldVal,
                     pDescriptor->aLines[pDescriptor->cLines] - pszTmp - cbOldVal);
@@ -1533,4 +1700,5 @@
         for (unsigned i = uStart + 1; i <= pDescriptor->cLines; i++)
             pDescriptor->aLines[i] += cbDiff;
+
         /* Adjust starting line numbers of following descriptor sections. */
         if (uStart <= pDescriptor->uFirstExtent)
@@ -1542,8 +1710,10 @@
     return VINF_SUCCESS;
 }
+
 static int vmdkDescBaseGetU32(PVMDKDESCRIPTOR pDescriptor, const char *pszKey,
                               uint32_t *puValue)
 {
     const char *pszValue;
+
     if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDesc, pszKey,
                         &pszValue))
@@ -1551,4 +1721,5 @@
     return RTStrToUInt32Ex(pszValue, NULL, 10, puValue);
 }
+
 /**
  * Returns the value of the given key as a string allocating the necessary memory.
@@ -1567,4 +1738,5 @@
     const char *pszValue;
     char *pszValueUnquoted;
+
     if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDesc, pszKey,
                         &pszValue))
@@ -1576,8 +1748,10 @@
     return rc;
 }
+
 static int vmdkDescBaseSetStr(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                               const char *pszKey, const char *pszValue)
 {
     char *pszValueQuoted;
+
     RTStrAPrintf(&pszValueQuoted, "\"%s\"", pszValue);
     if (!pszValueQuoted)
@@ -1588,4 +1762,5 @@
     return rc;
 }
+
 static void vmdkDescExtRemoveDummy(PVMDKIMAGE pImage,
                                    PVMDKDESCRIPTOR pDescriptor)
@@ -1594,6 +1769,8 @@
     unsigned uEntry = pDescriptor->uFirstExtent;
     ssize_t cbDiff;
+
     if (!uEntry)
         return;
+
     cbDiff = strlen(pDescriptor->aLines[uEntry]) + 1;
     /* Move everything including \0 in the entry marking the end of buffer. */
@@ -1611,6 +1788,8 @@
     if (pDescriptor->uFirstDDB)
         pDescriptor->uFirstDDB--;
+
     return;
 }
+
 static int vmdkDescExtInsert(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                              VMDKACCESS enmAccess, uint64_t cNominalSectors,
@@ -1624,6 +1803,8 @@
     char szExt[1024];
     ssize_t cbDiff;
+
     Assert((unsigned)enmAccess < RT_ELEMENTS(apszAccess));
     Assert((unsigned)enmType < RT_ELEMENTS(apszType));
+
     /* Find last entry in extent description. */
     while (uStart)
@@ -1633,4 +1814,5 @@
         uStart = pDescriptor->aNextLines[uStart];
     }
+
     if (enmType == VMDKETYPE_ZERO)
     {
@@ -1651,4 +1833,5 @@
     }
     cbDiff = strlen(szExt) + 1;
+
     /* Check for buffer overflow. */
     if (   (pDescriptor->cLines >= VMDK_DESCRIPTOR_LINES_MAX - 1)
@@ -1656,4 +1839,5 @@
             - pDescriptor->aLines[0] > (ptrdiff_t)pDescriptor->cbDescAlloc - cbDiff))
         return vdIfError(pImage->pIfError, VERR_BUFFER_OVERFLOW, RT_SRC_POS, N_("VMDK: descriptor too big in '%s'"), pImage->pszFilename);
+
     for (unsigned i = pDescriptor->cLines + 1; i > uLast + 1; i--)
     {
@@ -1674,10 +1858,13 @@
     for (unsigned i = uStart + 1; i <= pDescriptor->cLines; i++)
         pDescriptor->aLines[i] += cbDiff;
+
     /* Adjust starting line numbers of following descriptor sections. */
     if (uStart <= pDescriptor->uFirstDDB)
         pDescriptor->uFirstDDB++;
+
     pDescriptor->fDirty = true;
     return VINF_SUCCESS;
 }
+
 /**
  * Returns the value of the given key from the DDB as a string allocating
@@ -1697,4 +1884,5 @@
     const char *pszValue;
     char *pszValueUnquoted;
+
     if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey,
                         &pszValue))
@@ -1706,4 +1894,5 @@
     return rc;
 }
+
 static int vmdkDescDDBGetU32(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                              const char *pszKey, uint32_t *puValue)
@@ -1711,4 +1900,5 @@
     const char *pszValue;
     char *pszValueUnquoted;
+
     if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey,
                         &pszValue))
@@ -1721,4 +1911,5 @@
     return rc;
 }
+
 static int vmdkDescDDBGetUuid(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                               const char *pszKey, PRTUUID pUuid)
@@ -1726,4 +1917,5 @@
     const char *pszValue;
     char *pszValueUnquoted;
+
     if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey,
                         &pszValue))
@@ -1736,4 +1928,5 @@
     return rc;
 }
+
 static int vmdkDescDDBSetStr(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                              const char *pszKey, const char *pszVal)
@@ -1741,4 +1934,5 @@
     int rc;
     char *pszValQuoted;
+
     if (pszVal)
     {
@@ -1755,8 +1949,10 @@
     return rc;
 }
+
 static int vmdkDescDDBSetUuid(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                               const char *pszKey, PCRTUUID pUuid)
 {
     char *pszUuid;
+
     RTStrAPrintf(&pszUuid, "\"%RTuuid\"", pUuid);
     if (!pszUuid)
@@ -1767,8 +1963,10 @@
     return rc;
 }
+
 static int vmdkDescDDBSetU32(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor,
                              const char *pszKey, uint32_t uValue)
 {
     char *pszValue;
+
     RTStrAPrintf(&pszValue, "\"%d\"", uValue);
     if (!pszValue)
@@ -1779,4 +1977,5 @@
     return rc;
 }
+
 /**
  * Splits the descriptor data into individual lines checking for correct line
@@ -1792,4 +1991,5 @@
     unsigned cLine = 0;
     int rc = VINF_SUCCESS;
+
     while (   RT_SUCCESS(rc)
            && *pszTmp != '\0')
@@ -1802,4 +2002,5 @@
             break;
         }
+
         while (*pszTmp != '\0' && *pszTmp != '\n')
         {
@@ -1819,6 +2020,8 @@
             pszTmp++;
         }
+
         if (RT_FAILURE(rc))
             break;
+
         /* Get rid of LF character. */
         if (*pszTmp == '\n')
@@ -1828,4 +2031,5 @@
         }
     }
+
     if (RT_SUCCESS(rc))
     {
@@ -1834,6 +2038,8 @@
         pDesc->aLines[cLine] = pszTmp;
     }
+
     return rc;
 }
+
 static int vmdkPreprocessDescriptor(PVMDKIMAGE pImage, char *pDescData,
                                     size_t cbDescData, PVMDKDESCRIPTOR pDescriptor)
@@ -1852,4 +2058,5 @@
         {
             unsigned uLastNonEmptyLine = 0;
+
             /* Initialize those, because we need to be able to reopen an image. */
             pDescriptor->uFirstDesc = 0;
@@ -1917,6 +2124,8 @@
         }
     }
+
     return rc;
 }
+
 static int vmdkDescSetPCHSGeometry(PVMDKIMAGE pImage,
                                    PCVDGEOMETRY pPCHSGeometry)
@@ -1937,4 +2146,5 @@
     return rc;
 }
+
 static int vmdkDescSetLCHSGeometry(PVMDKIMAGE pImage,
                                    PCVDGEOMETRY pLCHSGeometry)
@@ -1947,4 +2157,5 @@
     rc = vmdkDescDDBSetU32(pImage, &pImage->Descriptor,
                            VMDK_DDB_GEO_LCHS_HEADS,
+
                            pLCHSGeometry->cHeads);
     if (RT_FAILURE(rc))
@@ -1955,4 +2166,5 @@
     return rc;
 }
+
 static int vmdkCreateDescriptor(PVMDKIMAGE pImage, char *pDescData,
                                 size_t cbDescData, PVMDKDESCRIPTOR pDescriptor)
@@ -1966,4 +2178,5 @@
     pDescriptor->aLines[pDescriptor->cLines] = pDescData;
     memset(pDescriptor->aNextLines, '\0', sizeof(pDescriptor->aNextLines));
+
     int rc = vmdkDescInitStr(pImage, pDescriptor, "# Disk DescriptorFile");
     if (RT_SUCCESS(rc))
@@ -1997,4 +2210,5 @@
     {
         pDescriptor->uFirstDDB = pDescriptor->cLines - 1;
+
         /* Now that the framework is in place, use the normal functions to insert
          * the remaining keys. */
@@ -2009,6 +2223,8 @@
     if (RT_SUCCESS(rc))
         rc = vmdkDescDDBSetStr(pImage, pDescriptor, "ddb.adapterType", "ide");
+
     return rc;
 }
+
 static int vmdkParseDescriptor(PVMDKIMAGE pImage, char *pDescData, size_t cbDescData)
 {
@@ -2017,8 +2233,10 @@
     unsigned uLine;
     unsigned i;
+
     rc = vmdkPreprocessDescriptor(pImage, pDescData, cbDescData,
                                   &pImage->Descriptor);
     if (RT_FAILURE(rc))
         return rc;
+
     /* Check version, must be 1. */
     uint32_t uVersion;
@@ -2028,4 +2246,5 @@
     if (uVersion != 1)
         return vdIfError(pImage->pIfError, VERR_VD_VMDK_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VMDK: unsupported format version in descriptor in '%s'"), pImage->pszFilename);
+
     /* Get image creation type and determine image flags. */
     char *pszCreateType = NULL;   /* initialized to make gcc shut up */
@@ -2045,4 +2264,5 @@
         pImage->uImageFlags |= VD_IMAGE_FLAGS_FIXED | VD_VMDK_IMAGE_FLAGS_ESX;
     RTMemTmpFree(pszCreateType);
+
     /* Count the number of extent config entries. */
     for (uLine = pImage->Descriptor.uFirstExtent, cExtents = 0;
@@ -2050,4 +2270,5 @@
          uLine = pImage->Descriptor.aNextLines[uLine], cExtents++)
         /* nothing */;
+
     if (!pImage->pDescData && cExtents != 1)
     {
@@ -2055,4 +2276,5 @@
         return vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: monolithic image may only have one extent in '%s'"), pImage->pszFilename);
     }
+
     if (pImage->pDescData)
     {
@@ -2062,8 +2284,10 @@
             return rc;
     }
+
     for (i = 0, uLine = pImage->Descriptor.uFirstExtent;
          i < cExtents; i++, uLine = pImage->Descriptor.aNextLines[uLine])
     {
         char *pszLine = pImage->Descriptor.aLines[uLine];
+
         /* Access type of the extent. */
         if (!strncmp(pszLine, "RW", 2))
@@ -2086,4 +2310,5 @@
         if (*pszLine++ != ' ')
             return vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);
+
         /* Nominal size of the extent. */
         rc = RTStrToUInt64Ex(pszLine, &pszLine, 10,
@@ -2093,4 +2318,5 @@
         if (*pszLine++ != ' ')
             return vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);
+
         /* Type of the extent. */
         if (!strncmp(pszLine, "SPARSE", 6))
@@ -2116,4 +2342,5 @@
         else
             return vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);
+
         if (pImage->pExtents[i].enmType == VMDKETYPE_ZERO)
         {
@@ -2130,4 +2357,5 @@
             if (*pszLine++ != ' ')
                 return vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);
+
             /* Basename of the image. Surrounded by quotes. */
             char *pszBasename;
@@ -2148,8 +2376,10 @@
                 }
             }
+
             if (*pszLine != '\0')
                 return vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);
         }
     }
+
     /* Determine PCHS geometry (autogenerate if necessary). */
     rc = vmdkDescDDBGetU32(pImage, &pImage->Descriptor,
@@ -2186,4 +2416,5 @@
         pImage->PCHSGeometry.cSectors = 63;
     }
+
     /* Determine LCHS geometry (set to 0 if not specified). */
     rc = vmdkDescDDBGetU32(pImage, &pImage->Descriptor,
@@ -2216,4 +2447,5 @@
         pImage->LCHSGeometry.cSectors = 0;
     }
+
     /* Get image UUID. */
     rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor, VMDK_DDB_IMAGE_UUID,
@@ -2239,4 +2471,5 @@
     else if (RT_FAILURE(rc))
         return rc;
+
     /* Get image modification UUID. */
     rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor,
@@ -2264,4 +2497,5 @@
     else if (RT_FAILURE(rc))
         return rc;
+
     /* Get UUID of parent image. */
     rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor, VMDK_DDB_PARENT_UUID,
@@ -2287,4 +2521,5 @@
     else if (RT_FAILURE(rc))
         return rc;
+
     /* Get parent image modification UUID. */
     rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor,
@@ -2310,6 +2545,8 @@
     else if (RT_FAILURE(rc))
         return rc;
+
     return VINF_SUCCESS;
 }
+
 /**
  * Internal : Prepares the descriptor to write to the image.
@@ -2319,4 +2556,5 @@
 {
     int rc = VINF_SUCCESS;
+
     /*
      * Allocate temporary descriptor buffer.
@@ -2327,10 +2565,13 @@
     char *pszDescriptor = (char *)RTMemAllocZ(cbDescriptor);
     size_t offDescriptor = 0;
+
     if (!pszDescriptor)
         return VERR_NO_MEMORY;
+
     for (unsigned i = 0; i < pImage->Descriptor.cLines; i++)
     {
         const char *psz = pImage->Descriptor.aLines[i];
         size_t cb = strlen(psz);
+
         /*
          * Increase the descriptor if there is no limit and
@@ -2348,4 +2589,5 @@
                 char *pszDescriptorNew = NULL;
                 LogFlow(("Increasing descriptor cache\n"));
+
                 pszDescriptorNew = (char *)RTMemRealloc(pszDescriptor, cbDescriptor + cb + 4 * _1K);
                 if (!pszDescriptorNew)
@@ -2358,4 +2600,5 @@
             }
         }
+
         if (cb > 0)
         {
@@ -2363,7 +2606,9 @@
             offDescriptor += cb;
         }
+
         memcpy(pszDescriptor + offDescriptor, "\n", 1);
         offDescriptor++;
     }
+
     if (RT_SUCCESS(rc))
     {
@@ -2373,6 +2618,8 @@
     else if (pszDescriptor)
         RTMemFree(pszDescriptor);
+
     return rc;
 }
+
 /**
  * Internal: write/update the descriptor part of the image.
@@ -2386,4 +2633,5 @@
     void *pvDescriptor = NULL;
     size_t cbDescriptor;
+
     if (pImage->pDescData)
     {
@@ -2403,4 +2651,5 @@
     if (pDescFile == NULL)
         return VERR_INVALID_PARAMETER;
+
     rc = vmdkDescriptorPrepare(pImage, cbLimit, &pvDescriptor, &cbDescriptor);
     if (RT_SUCCESS(rc))
@@ -2414,4 +2663,5 @@
             rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: error writing descriptor in '%s'"), pImage->pszFilename);
     }
+
     if (RT_SUCCESS(rc) && !cbLimit)
     {
@@ -2420,10 +2670,14 @@
             rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: error truncating descriptor in '%s'"), pImage->pszFilename);
     }
+
     if (RT_SUCCESS(rc))
         pImage->Descriptor.fDirty = false;
+
     if (pvDescriptor)
         RTMemFree(pvDescriptor);
     return rc;
-}
+
+}
+
 /**
  * Internal: validate the consistency check values in a binary header.
@@ -2459,4 +2713,5 @@
     return rc;
 }
+
 /**
  * Internal: read metadata belonging to an extent with binary header, i.e.
@@ -2468,4 +2723,5 @@
     SparseExtentHeader Header;
     int rc;
+
     if (!fMagicAlreadyRead)
         rc = vdIfIoIntFileReadSync(pImage->pIfIo, pExtent->pFile->pStorage, 0,
@@ -2480,4 +2736,5 @@
                                    - RT_UOFFSETOF(SparseExtentHeader, version));
     }
+
     if (RT_SUCCESS(rc))
     {
@@ -2486,7 +2743,9 @@
         {
             uint64_t cbFile = 0;
+
             if (    (RT_LE2H_U32(Header.flags) & RT_BIT(17))
                 &&  RT_LE2H_U64(Header.gdOffset) == VMDK_GD_AT_END)
                 pExtent->fFooter = true;
+
             if (   !(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
                 || (   pExtent->fFooter
@@ -2497,8 +2756,10 @@
                     rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: cannot get size of '%s'"), pExtent->pszFullname);
             }
+
             if (RT_SUCCESS(rc))
             {
                 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
                     pExtent->uAppendPosition = RT_ALIGN_64(cbFile, 512);
+
                 if (   pExtent->fFooter
                     && (   !(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
@@ -2514,4 +2775,5 @@
                         rc = VERR_VD_VMDK_INVALID_HEADER;
                     }
+
                     if (RT_SUCCESS(rc))
                         rc = vmdkValidateHeader(pImage, pExtent, &Header);
@@ -2519,4 +2781,5 @@
                     pExtent->uAppendPosition = 0;
                 }
+
                 if (RT_SUCCESS(rc))
                 {
@@ -2541,7 +2804,9 @@
                         pExtent->uSectorRGD     = 0;
                     }
+
                     if (pExtent->uDescriptorSector && !pExtent->cDescriptorSectors)
                         rc = vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS,
                                        N_("VMDK: inconsistent embedded descriptor config in '%s'"), pExtent->pszFullname);
+
                     if (   RT_SUCCESS(rc)
                         && (   pExtent->uSectorGD == VMDK_GD_AT_END
@@ -2551,4 +2816,5 @@
                         rc = vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS,
                                        N_("VMDK: cannot resolve grain directory offset in '%s'"), pExtent->pszFullname);
+
                     if (RT_SUCCESS(rc))
                     {
@@ -2561,4 +2827,5 @@
                             pExtent->cSectorsPerGDE = cSectorsPerGDE;
                             pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE;
+
                             /* Fix up the number of descriptor sectors, as some flat images have
                              * really just one, and this causes failures when inserting the UUID
@@ -2583,8 +2850,11 @@
         rc = VERR_VD_VMDK_INVALID_HEADER;
     }
+
     if (RT_FAILURE(rc))
         vmdkFreeExtentData(pImage, pExtent, false);
+
     return rc;
 }
+
 /**
  * Internal: read additional metadata belonging to an extent. For those
@@ -2594,4 +2864,5 @@
 {
     int rc = VINF_SUCCESS;
+
 /* disabled the check as there are too many truncated vmdk images out there */
 #ifdef VBOX_WITH_VMDK_STRICT_SIZE_CHECK
@@ -2633,4 +2904,5 @@
                     if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
                         pExtent->uAppendPosition = 0;
+
                     if (   !(pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
                         || !(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
@@ -2646,8 +2918,11 @@
         }
     }
+
     if (RT_FAILURE(rc))
         vmdkFreeExtentData(pImage, pExtent, false);
+
     return rc;
 }
+
 /**
  * Internal: write/update the metadata for a sparse extent.
@@ -2657,4 +2932,5 @@
 {
     SparseExtentHeader Header;
+
     memset(&Header, '\0', sizeof(Header));
     Header.magicNumber = RT_H2LE_U32(VMDK_SPARSE_MAGICNUMBER);
@@ -2699,4 +2975,5 @@
     Header.doubleEndLineChar2 = '\n';
     Header.compressAlgorithm = RT_H2LE_U16(pExtent->uCompression);
+
     int rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pExtent->pFile->pStorage,
                                     uOffset, &Header, sizeof(Header),
@@ -2706,4 +2983,5 @@
     return rc;
 }
+
 /**
  * Internal: free the buffers used for streamOptimized images.
@@ -2722,4 +3000,5 @@
     }
 }
+
 /**
  * Internal: free the memory used by the extent data structure, optionally
@@ -2735,4 +3014,5 @@
 {
     int rc = VINF_SUCCESS;
+
     vmdkFreeGrainDirectory(pExtent);
     if (pExtent->pDescData)
@@ -2761,6 +3041,8 @@
     }
     vmdkFreeStreamBuffers(pExtent);
+
     return rc;
 }
+
 /**
  * Internal: allocate grain table cache if necessary for this image.
@@ -2769,4 +3051,5 @@
 {
     PVMDKEXTENT pExtent;
+
     /* Allocate grain table cache if any sparse extent is present. */
     for (unsigned i = 0; i < pImage->cExtents; i++)
@@ -2788,6 +3071,8 @@
         }
     }
+
     return VINF_SUCCESS;
 }
+
 /**
  * Internal: allocate the given number of extents.
@@ -2817,6 +3102,8 @@
     else
         rc = VERR_NO_MEMORY;
+
     return rc;
 }
+
 /**
  * Internal: allocate and describes an additional, file-backed extent
@@ -2962,4 +3249,5 @@
                 {
                     uint64_t cDescriptorSectorsOld = pExtent->cDescriptorSectors;
+
                     pExtent->cDescriptorSectors = 4;
                     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
@@ -3026,6 +3314,8 @@
             rc = VERR_NO_MEMORY;
     }
+
     return rc;
 }
+
 /**
  * Reads the descriptor from a pure text file.
@@ -3114,4 +3404,5 @@
                         else
                             pExtent->pszFullname = NULL;
+
                         unsigned uOpenFlags = pImage->uOpenFlags | ((pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0);
                         switch (pExtent->enmType)
@@ -3134,4 +3425,5 @@
                                 if (RT_FAILURE(rc))
                                     break;
+
                                 /* Mark extent as unclean if opened in read-write mode. */
                                 if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
@@ -3170,6 +3462,8 @@
     else if (RT_SUCCESS(rc))
         rc = vdIfError(pImage->pIfError, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: descriptor in '%s' is too short"), pImage->pszFilename);
+
     return rc;
 }
+
 /**
  * Read and process the descriptor based on the image type.
@@ -3182,4 +3476,5 @@
 {
     uint32_t u32Magic;
+
     /* Read magic (if present). */
     int rc = vdIfIoIntFileReadSync(pImage->pIfIo, pFile->pStorage, 0,
@@ -3198,6 +3493,8 @@
         rc = VERR_VD_VMDK_INVALID_HEADER;
     }
+
     return rc;
 }
+
 /**
  * Internal: Open an image, constructing all necessary data structures.
@@ -3209,4 +3506,5 @@
     pImage->pIfIo      = VDIfIoIntGet(pImage->pVDIfsImage);
     AssertPtrReturn(pImage->pIfIo, VERR_INVALID_PARAMETER);
+
     /*
      * Open the image.
@@ -3221,4 +3519,5 @@
     {
         pImage->pFile = pFile;
+
         rc = vmdkDescriptorRead(pImage, pFile);
         if (RT_SUCCESS(rc))
@@ -3238,4 +3537,5 @@
                 }
             }
+
             /* Update the image metadata now in case has changed. */
             rc = vmdkFlushImage(pImage, NULL);
@@ -3257,6 +3557,8 @@
                              ||  pExtent->enmType == VMDKETYPE_ZERO)
                         pImage->uImageFlags |= VD_IMAGE_FLAGS_FIXED;
+
                     pImage->cbSize += VMDK_SECTOR2BYTE(pExtent->cNominalSectors);
                 }
+
                 if (   !(pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
                     || !(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
@@ -3268,4 +3570,5 @@
     /* else: Do NOT signal an appropriate error here, as the VD layer has the
      *       choice of retrying the open if it failed. */
+
     if (RT_SUCCESS(rc))
     {
@@ -3273,4 +3576,5 @@
         pImage->RegionList.fFlags   = 0;
         pImage->RegionList.cRegions = 1;
+
         pRegion->offRegion            = 0; /* Disk start. */
         pRegion->cbBlock              = 512;
@@ -3285,4 +3589,5 @@
     return rc;
 }
+
 /**
  * Frees a raw descriptor.
@@ -3293,6 +3598,8 @@
     if (!pRawDesc)
         return VINF_SUCCESS;
+
     RTStrFree(pRawDesc->pszRawDisk);
     pRawDesc->pszRawDisk = NULL;
+
     /* Partitions: */
     for (unsigned i = 0; i < pRawDesc->cPartDescs; i++)
@@ -3300,12 +3607,16 @@
         RTStrFree(pRawDesc->pPartDescs[i].pszRawDevice);
         pRawDesc->pPartDescs[i].pszRawDevice = NULL;
+
         RTMemFree(pRawDesc->pPartDescs[i].pvPartitionData);
         pRawDesc->pPartDescs[i].pvPartitionData = NULL;
     }
+
     RTMemFree(pRawDesc->pPartDescs);
     pRawDesc->pPartDescs = NULL;
+
     RTMemFree(pRawDesc);
     return VINF_SUCCESS;
 }
+
 /**
  * Helper that grows the raw partition descriptor table by @a cToAdd entries,
@@ -3324,4 +3635,5 @@
         pRawDesc->cPartDescs = cNew;
         pRawDesc->pPartDescs = paNew;
+
         *ppRet = &paNew[cOld];
         return VINF_SUCCESS;
@@ -3332,4 +3644,5 @@
                      pImage->pszFilename, cOld, cNew);
 }
+
 /**
  * @callback_method_impl{FNRTSORTCMP}
@@ -3341,4 +3654,5 @@
     return iDelta < 0 ? -1 : iDelta > 0 ? 1 : 0;
 }
+
 /**
  * Post processes the partition descriptors.
@@ -3352,4 +3666,5 @@
      */
     RTSortShell(pRawDesc->pPartDescs, pRawDesc->cPartDescs, sizeof(pRawDesc->pPartDescs[0]), vmdkRawDescPartComp, NULL);
+
     /*
      * Check that we don't have overlapping descriptors.  If we do, that's an
@@ -3366,4 +3681,5 @@
                              paPartDescs[i].pvPartitionData ? " (data)" : "");
         offLast -= 1;
+
         if (i + 1 < pRawDesc->cPartDescs && offLast >= paPartDescs[i + 1].offStartInVDisk)
             return vdIfError(pImage->pIfError, VERR_FILESYSTEM_CORRUPT /*?*/, RT_SRC_POS,
@@ -3378,6 +3694,9 @@
                              paPartDescs[i].pvPartitionData ? " (data)" : "", cbSize);
     }
+
     return VINF_SUCCESS;
 }
+
+
 #ifdef RT_OS_LINUX
 /**
@@ -3402,4 +3721,5 @@
     size_t const cchDir = RTPathEnsureTrailingSeparator(pszBlockDevDir, cbBlockDevDir);
     AssertReturn(cchDir > 0, VERR_BUFFER_OVERFLOW);
+
     RTDIR hDir = NIL_RTDIR;
     int rc = RTDirOpen(&hDir, pszBlockDevDir);
@@ -3419,4 +3739,5 @@
                     rc = RTStrCopy(&pszBlockDevDir[cchDir], cbBlockDevDir - cchDir, Entry.szName);
                     AssertContinue(RT_SUCCESS(rc)); /* should not happen! */
+
                     dev_t uThisDevNo = ~uDevToLocate;
                     rc = RTLinuxSysFsReadDevNumFile(&uThisDevNo, "%s/dev", pszBlockDevDir);
@@ -3448,5 +3769,8 @@
 }
 #endif /* RT_OS_LINUX */
+
 #ifdef RT_OS_FREEBSD
+
+
 /**
  * Reads the config data from the provider and returns offset and size
@@ -3461,4 +3785,5 @@
     gconfig *pConfEntry;
     int rc = VERR_NOT_FOUND;
+
     /*
      * Required parameters are located in the list containing key/value pairs.
@@ -3491,4 +3816,6 @@
     return rc;
 }
+
+
 /**
  * Searches the partition specified by name and calculates its size and absolute offset.
@@ -3509,4 +3836,5 @@
     AssertReturn(pcbAbsoluteOffset,  VERR_INVALID_PARAMETER);
     AssertReturn(pcbSize,            VERR_INVALID_PARAMETER);
+
     ggeom *pParentGeom;
     int rc = VERR_NOT_FOUND;
@@ -3521,4 +3849,5 @@
     if (RT_FAILURE(rc))
         return rc;
+
     gprovider *pProvider;
     /*
@@ -3532,4 +3861,5 @@
             return vmdkReadPartitionsParamsFromProvider(pProvider, pcbAbsoluteOffset, pcbSize);
     }
+
     /*
      * No provider found. Go over the parent geom again
@@ -3541,4 +3871,5 @@
      * provider
      */
+
     LIST_FOREACH(pProvider, &pParentGeom->lg_provider, lg_provider)
     {
@@ -3548,4 +3879,5 @@
         if (RT_FAILURE(rc))
             return rc;
+
         uint64_t cbProviderOffset = 0;
         uint64_t cbProviderSize = 0;
@@ -3558,7 +3890,10 @@
         }
     }
+
     return VERR_NOT_FOUND;
 }
 #endif
+
+
 /**
  * Attempts to verify the raw partition path.
@@ -3570,4 +3905,5 @@
 {
     RT_NOREF(pImage, pPartDesc, idxPartition, pszRawDrive, hRawDrive, cbSector, hVol);
+
     /*
      * Try open the raw partition device.
@@ -3579,4 +3915,5 @@
                          N_("VMDK: Image path: '%s'. Failed to open partition #%u on '%s' via '%s' (%Rrc)"),
                          pImage->pszFilename, idxPartition, pszRawDrive, pPartDesc->pszRawDevice, rc);
+
     /*
      * Compare the partition UUID if we can get it.
@@ -3584,4 +3921,5 @@
 #ifdef RT_OS_WINDOWS
     DWORD cbReturned;
+
     /* 1. Get the device numbers for both handles, they should have the same disk. */
     STORAGE_DEVICE_NUMBER DevNum1;
@@ -3592,4 +3930,5 @@
                        N_("VMDK: Image path: '%s'. IOCTL_STORAGE_GET_DEVICE_NUMBER failed on '%s': %u"),
                        pImage->pszFilename, pszRawDrive, GetLastError());
+
     STORAGE_DEVICE_NUMBER DevNum2;
     RT_ZERO(DevNum2);
@@ -3683,6 +4022,8 @@
             rc = VERR_NO_TMP_MEMORY;
     }
+
 #elif defined(RT_OS_LINUX)
     RT_NOREF(hVol);
+
     /* Stat the two devices first to get their device numbers.  (We probably
        could make some assumptions here about the major & minor number assignments
@@ -3705,8 +4046,10 @@
         {
             rc = vmdkFindSysBlockDevPath(pImage, szSysPath, sizeof(szSysPath), StDrive.st_rdev, pszRawDrive);
+
             /* Now, scan the directories under that again for a partition device
                matching the hRawPart device's number: */
             if (RT_SUCCESS(rc))
                 rc = vmdkFindSysBlockDevPath(pImage, szSysPath, sizeof(szSysPath), StPart.st_rdev, pPartDesc->pszRawDevice);
+
             /* Having found the /sys/block/device/partition/ path, we can finally
                read the partition attributes and compare with hVol. */
@@ -3721,4 +4064,5 @@
                                    pImage->pszFilename, idxPartition, pPartDesc->pszRawDevice, pszRawDrive, iLnxPartition, idxPartition);
                 /* else: ignore failure? */
+
                 /* start offset: */
                 uint32_t const cbLnxSector = 512; /* It's hardcoded in the Linux kernel */
@@ -3734,4 +4078,5 @@
                     /* else: ignore failure? */
                 }
+
                 /* the size: */
                 if (RT_SUCCESS(rc))
@@ -3750,4 +4095,5 @@
         /* else: We've got nothing to work on, so only do content comparison. */
     }
+
 #elif defined(RT_OS_FREEBSD)
     char szDriveDevName[256];
@@ -3780,4 +4126,6 @@
                 rc = vdIfError(pImage->pIfError, VERR_GENERAL_FAILURE, RT_SRC_POS,
                                N_("VMDK: Image path: '%s'. 'PART' class not found in the GEOM tree"), pImage->pszFilename);
+
+
             if (RT_SUCCESS(rc))
             {
@@ -3802,4 +4150,5 @@
                                    pImage->pszFilename, pPartDesc->pszRawDevice, pszRawDrive, rc);
             }
+
             geom_deletetree(&geomMesh);
         }
@@ -3808,6 +4157,8 @@
                            N_("VMDK: Image path: '%s'. geom_gettree failed: %d"), pImage->pszFilename, err);
     }
+
 #elif defined(RT_OS_SOLARIS)
     RT_NOREF(hVol);
+
     dk_cinfo dkiDriveInfo;
     dk_cinfo dkiPartInfo;
@@ -3857,4 +4208,5 @@
              * using another way. If there is an error, it returns errno which will be handled below.
              */
+
             uint32_t numPartition = (uint32_t)dkiPartInfo.dki_partition;
             if (numPartition > NDKMAP)
@@ -3891,4 +4243,5 @@
                            N_("VMDK: Image path: '%s'. Partition #%u path ('%s') verification failed on '%s': Start offset %RI64, expected %RU64"),
                            pImage->pszFilename, idxPartition, pPartDesc->pszRawDevice, pszRawDrive, cbOffset, pPartDesc->offStartInVDisk);
+
         if (RT_SUCCESS(rc) && cbSize != pPartDesc->cbData)
             rc = vdIfError(pImage->pIfError, VERR_MISMATCH, RT_SRC_POS,
@@ -3966,4 +4319,5 @@
 #else
     RT_NOREF(hVol); /* PORTME */
+    rc = VERR_NOT_SUPPORTED;
 #endif
     if (RT_SUCCESS(rc))
@@ -3981,4 +4335,5 @@
         {
             uint8_t *pbSector2 = pbSector1 + cbToCompare;
+
             /* Do the comparing, we repeat if it fails and the data might be volatile. */
             uint64_t uPrevCrc1 = 0;
@@ -3996,4 +4351,5 @@
                         {
                             rc = VERR_MISMATCH;
+
                             /* Do data stability checks before repeating: */
                             uint64_t const uCrc1 = RTCrc64(pbSector1, cbToCompare);
@@ -4028,4 +4384,5 @@
                     offMissmatch++;
                 int cbSample = (int)RT_MIN(cbToCompare - offMissmatch, 16);
+
                 if (cStable > 0)
                     rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
@@ -4041,4 +4398,5 @@
                 }
             }
+
             RTMemTmpFree(pbSector1);
         }
@@ -4051,4 +4409,5 @@
     return rc;
 }
+
 #ifdef RT_OS_WINDOWS
 /**
@@ -4072,4 +4431,5 @@
 }
 #endif /* RT_OS_WINDOWS */
+
 /**
  * Worker for vmdkMakeRawDescriptor that adds partition descriptors when the
@@ -4088,14 +4448,18 @@
 {
     *phVolToRelease = NIL_RTDVMVOLUME;
+
     /* Check sanity/understanding. */
     Assert(fPartitions);
     Assert((fPartitions & fPartitionsReadOnly) == fPartitionsReadOnly); /* RO should be a sub-set */
+
     /*
      * Allocate on descriptor for each volume up front.
      */
     uint32_t const cVolumes = RTDvmMapGetValidVolumes(hVolMgr);
+
     PVDISKRAWPARTDESC paPartDescs = NULL;
     int rc = vmdkRawDescAppendPartDesc(pImage, pRawDesc, cVolumes, &paPartDescs);
     AssertRCReturn(rc, rc);
+
     /*
      * Enumerate the partitions (volumes) on the disk and create descriptors for each of them.
@@ -4120,4 +4484,5 @@
         Assert(cRefs != UINT32_MAX); RT_NOREF(cRefs);
         *phVolToRelease = hVol = hVolNext;
+
         /*
          * Depending on the fPartitions selector and associated read-only mask,
@@ -4126,4 +4491,5 @@
          */
         paPartDescs[i].cbData = RTDvmVolumeGetSize(hVol);
+
         uint64_t offVolumeEndIgnored = 0;
         rc = RTDvmVolumeQueryRange(hVol, &paPartDescs[i].offStartInVDisk, &offVolumeEndIgnored);
@@ -4133,4 +4499,5 @@
                              pImage->pszFilename, i, pszRawDrive, rc);
         Assert(paPartDescs[i].cbData == offVolumeEndIgnored + 1 - paPartDescs[i].offStartInVDisk);
+
         /* Note! The index must match IHostDrivePartition::number. */
         uint32_t idxPartition = RTDvmVolumeGetIndex(hVol, RTDVMVOLIDX_HOST);
@@ -4141,4 +4508,5 @@
             if (fPartitionsReadOnly & RT_BIT_32(idxPartition))
                 paPartDescs[i].uFlags |= VDISKRAW_READONLY;
+
             if (!fRelative)
             {
@@ -4161,4 +4529,5 @@
                  */
                 paPartDescs[i].offStartInDevice = 0;
+
 #if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
                 /* /dev/rdisk1 -> /dev/rdisk1s2 (s=slice) */
@@ -4214,4 +4583,5 @@
 #endif
                 AssertPtrReturn(paPartDescs[i].pszRawDevice, VERR_NO_STR_MEMORY);
+
                 rc = vmdkRawDescVerifyPartitionPath(pImage, &paPartDescs[i], idxPartition, pszRawDrive, hRawDrive, cbSector, hVol);
                 AssertRCReturn(rc, rc);
@@ -4225,6 +4595,8 @@
         }
     } /* for each volume */
+
     RTDvmVolumeRelease(hVol);
     *phVolToRelease = NIL_RTDVMVOLUME;
+
     /*
      * Check that we found all the partitions the user selected.
@@ -4241,6 +4613,8 @@
                              pImage->pszFilename, pszRawDrive, szLeft);
     }
+
     return VINF_SUCCESS;
 }
+
 /**
  * Worker for vmdkMakeRawDescriptor that adds partition descriptors with copies
@@ -4273,8 +4647,10 @@
                          pImage->pszFilename, pszRawDrive, rc);
     AssertReturn(cLocations > 0 && cLocations < _16M, VERR_INTERNAL_ERROR_5);
+
     /* We can allocate the partition descriptors here to save an intentation level. */
     PVDISKRAWPARTDESC paPartDescs = NULL;
     rc = vmdkRawDescAppendPartDesc(pImage, pRawDesc, (uint32_t)cLocations, &paPartDescs);
     AssertRCReturn(rc, rc);
+
     /* Allocate the result table and repeat the location table query: */
     PRTDVMTABLELOCATION paLocations = (PRTDVMTABLELOCATION)RTMemAllocZ(sizeof(paLocations[0]) * cLocations);
@@ -4356,4 +4732,5 @@
     return rc;
 }
+
 /**
  * Opens the volume manager for the raw drive when in selected-partition mode.
@@ -4371,4 +4748,5 @@
 {
     *phVolMgr = NIL_RTDVM;
+
     RTVFSFILE hVfsFile = NIL_RTVFSFILE;
     int rc = RTVfsFileFromRTFile(hRawDrive, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE, true /*fLeaveOpen*/, &hVfsFile);
@@ -4377,11 +4755,15 @@
                          N_("VMDK: Image path: '%s'.  RTVfsFileFromRTFile failed for '%s' handle (%Rrc)"),
                          pImage->pszFilename, pszRawDrive, rc);
+
     RTDVM hVolMgr = NIL_RTDVM;
     rc = RTDvmCreate(&hVolMgr, hVfsFile, cbSector, 0 /*fFlags*/);
+
     RTVfsFileRelease(hVfsFile);
+
     if (RT_FAILURE(rc))
         return vdIfError(pImage->pIfError, rc, RT_SRC_POS,
                          N_("VMDK: Image path: '%s'. Failed to create volume manager instance for '%s' (%Rrc)"),
                          pImage->pszFilename, pszRawDrive, rc);
+
     rc = RTDvmMapOpen(hVolMgr);
     if (RT_SUCCESS(rc))
@@ -4394,4 +4776,5 @@
                      pImage->pszFilename, pszRawDrive, rc);
 }
+
 /**
  * Opens the raw drive device and get the sizes for it.
@@ -4417,4 +4800,5 @@
                          N_("VMDK: Image path: '%s'. Failed to open the raw drive '%s' for reading (%Rrc)"),
                          pImage->pszFilename, pszRawDrive, rc);
+
     /*
      * Get the sector size.
@@ -4465,4 +4849,5 @@
     return rc;
 }
+
 /**
  * Reads the raw disk configuration, leaving initalization and cleanup to the
@@ -4481,4 +4866,5 @@
         return vdIfError(pImage->pIfError, VERR_INVALID_PARAMETER, RT_SRC_POS,
                          N_("VMDK: Image path: '%s'. Getting config interface failed"), pImage->pszFilename);
+
     /*
      * RawDrive = path
@@ -4489,4 +4875,5 @@
                          N_("VMDK: Image path: '%s'. Getting 'RawDrive' configuration failed (%Rrc)"), pImage->pszFilename, rc);
     AssertPtrReturn(*ppszRawDrive, VERR_INTERNAL_ERROR_3);
+
     /*
      * Partitions=n[r][,...]
@@ -4494,4 +4881,5 @@
     uint32_t const cMaxPartitionBits = sizeof(*pfPartitions) * 8 /* ASSUMES 8 bits per char */;
     *pfPartitions = *pfPartitionsReadOnly = 0;
+
     rc = VDCFGQueryStringAlloc(pImgCfg, "Partitions", ppszFreeMe);
     if (RT_SUCCESS(rc))
@@ -4527,4 +4915,5 @@
                                  pImage->pszFilename, psz);
         }
+
         RTStrFree(*ppszFreeMe);
         *ppszFreeMe = NULL;
@@ -4533,4 +4922,5 @@
         return vdIfError(pImage->pIfError, rc, RT_SRC_POS,
                          N_("VMDK: Image path: '%s'. Getting 'Partitions' configuration failed (%Rrc)"), pImage->pszFilename, rc);
+
     /*
      * BootSector=base64
@@ -4552,4 +4942,5 @@
                              N_("VMDK: Image path: '%s'. Custom bootsector for '%s' is way too big: %zu bytes, max 4MB"),
                              pImage->pszFilename, *ppszRawDrive, cbBootSector);
+
         /* Refuse the boot sector if whole-drive.  This used to be done quietly,
            however, bird disagrees and thinks the user should be told that what
@@ -4560,4 +4951,5 @@
                              N_("VMDK: Image path: '%s'. Custom bootsector for '%s' is not supported for whole-drive configurations, only when selecting partitions"),
                              pImage->pszFilename, *ppszRawDrive);
+
         *pcbBootSector = (size_t)cbBootSector;
         *ppvBootSector = RTMemAlloc((size_t)cbBootSector);
@@ -4566,4 +4958,5 @@
                              N_("VMDK: Image path: '%s'. Failed to allocate %zd bytes for the custom bootsector for '%s'"),
                              pImage->pszFilename, cbBootSector, *ppszRawDrive);
+
         rc = RTBase64Decode(*ppszFreeMe, *ppvBootSector, cbBootSector, NULL /*pcbActual*/, NULL /*ppszEnd*/);
         if (RT_FAILURE(rc))
@@ -4571,4 +4964,5 @@
                               N_("VMDK: Image path: '%s'. Base64 decoding of the custom boot sector for '%s' failed (%Rrc)"),
                               pImage->pszFilename, *ppszRawDrive, rc);
+
         RTStrFree(*ppszFreeMe);
         *ppszFreeMe = NULL;
@@ -4577,4 +4971,5 @@
         return vdIfError(pImage->pIfError, rc, RT_SRC_POS,
                          N_("VMDK: Image path: '%s'. Getting 'BootSector' configuration failed (%Rrc)"), pImage->pszFilename, rc);
+
     /*
      * Relative=0/1
@@ -4604,6 +4999,8 @@
         *pfRelative = false;
 #endif
+
     return VINF_SUCCESS;
 }
+
 /**
  * Creates a raw drive (nee disk) descriptor.
@@ -4624,4 +5021,5 @@
     /* Make sure it's NULL. */
     *ppRaw = NULL;
+
     /*
      * Read the configuration.
@@ -4675,4 +5073,5 @@
                     //pRawDesc->cPartDescs = 0;
                     //pRawDesc->pPartDescs = NULL;
+
                     /* We need to parse the partition map to complete the descriptor: */
                     RTDVM hVolMgr = NIL_RTDVM;
@@ -4686,4 +5085,5 @@
                             pRawDesc->enmPartitioningType = enmFormatType == RTDVMFORMATTYPE_MBR
                                                           ? VDISKPARTTYPE_MBR : VDISKPARTTYPE_GPT;
+
                             /* Add copies of the partition tables:  */
                             rc = vmdkRawDescDoCopyPartitionTables(pImage, hVolMgr, pRawDesc, pszRawDrive, hRawDrive,
@@ -4697,4 +5097,5 @@
                                                              fPartitions, fPartitionsReadOnly, fRelative, &hVolRelease);
                                 RTDvmVolumeRelease(hVolRelease);
+
                                 /* Finally, sort the partition and check consistency (overlaps, etc): */
                                 if (RT_SUCCESS(rc))
@@ -4740,4 +5141,5 @@
     return rc;
 }
+
 /**
  * Internal: create VMDK images for raw disk/partition access.
@@ -4748,4 +5150,5 @@
     int rc = VINF_SUCCESS;
     PVMDKEXTENT pExtent;
+
     if (pRaw->uFlags & VDISKRAW_DISK)
     {
@@ -4762,4 +5165,5 @@
         if (RT_FAILURE(rc))
             return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new file '%s'"), pImage->pszFilename);
+
         /* Set up basename for extent description. Cannot use StrDup. */
         size_t cbBasename = strlen(pRaw->pszRawDisk) + 1;
@@ -4778,4 +5182,5 @@
         pExtent->enmAccess = (pRaw->uFlags & VDISKRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;
         pExtent->fMetaDirty = false;
+
         /* Open flat image, the raw disk. */
         rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszBasename, pExtent->pszFullname,
@@ -4790,4 +5195,5 @@
          * file, write the partition information to a flat extent and
          * open all the (flat) raw disk partitions. */
+
         /* First pass over the partition data areas to determine how many
          * extents we need. One data area can require up to 2 extents, as
@@ -4801,4 +5207,5 @@
                 return vdIfError(pImage->pIfError, VERR_INVALID_PARAMETER, RT_SRC_POS,
                                  N_("VMDK: incorrect partition data area ordering set up by the caller in '%s'"), pImage->pszFilename);
+
             if (uStart < pPart->offStartInVDisk)
                 cExtents++;
@@ -4809,7 +5216,9 @@
         if (uStart != cbSize)
             cExtents++;
+
         rc = vmdkCreateExtents(pImage, cExtents);
         if (RT_FAILURE(rc))
             return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new extent list in '%s'"), pImage->pszFilename);
+
         /* Create raw partition descriptor file. */
         rc = vmdkFileOpen(pImage, &pImage->pFile, NULL, pImage->pszFilename,
@@ -4818,4 +5227,5 @@
         if (RT_FAILURE(rc))
             return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new file '%s'"), pImage->pszFilename);
+
         /* Create base filename for the partition table extent. */
         /** @todo remove fixed buffer without creating memory leaks. */
@@ -4832,4 +5242,5 @@
                     pszBaseBase, pszSuff);
         RTStrFree(pszBaseBase);
+
         /* Second pass over the partitions, now define all extents. */
         uint64_t uPartOffset = 0;
@@ -4840,4 +5251,5 @@
             PVDISKRAWPARTDESC pPart = &pRaw->pPartDescs[i];
             pExtent = &pImage->pExtents[cExtents++];
+
             if (uStart < pPart->offStartInVDisk)
             {
@@ -4853,4 +5265,5 @@
             }
             uStart = pPart->offStartInVDisk + pPart->cbData;
+
             if (pPart->pvPartitionData)
             {
@@ -4862,4 +5275,5 @@
                 memcpy(pszBasename, pszPartition, cbBasename);
                 pExtent->pszBasename = pszBasename;
+
                 /* Set up full name for partition extent. */
                 char *pszDirname = RTStrDup(pImage->pszFilename);
@@ -4877,4 +5291,5 @@
                 pExtent->enmAccess = VMDKACCESS_READWRITE;
                 pExtent->fMetaDirty = false;
+
                 /* Create partition table flat image. */
                 rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszBasename, pExtent->pszFullname,
@@ -4911,4 +5326,5 @@
                     pExtent->enmAccess = (pPart->uFlags & VDISKRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;
                     pExtent->fMetaDirty = false;
+
                     /* Open flat image, the raw partition. */
                     rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszBasename, pExtent->pszFullname,
@@ -4943,4 +5359,5 @@
         }
     }
+
     rc = vmdkDescBaseSetStr(pImage, &pImage->Descriptor, "createType",
                             (pRaw->uFlags & VDISKRAW_DISK) ?
@@ -4950,4 +5367,5 @@
     return rc;
 }
+
 /**
  * Internal: create a regular (i.e. file-backed) VMDK image.
@@ -4961,4 +5379,5 @@
     uint64_t cbOffset = 0;
     uint64_t cbRemaining = cbSize;
+
     if (uImageFlags & VD_VMDK_IMAGE_FLAGS_SPLIT_2G)
     {
@@ -4972,8 +5391,10 @@
     if (RT_FAILURE(rc))
         return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new extent list in '%s'"), pImage->pszFilename);
+
     /* Basename strings needed for constructing the extent names. */
     char *pszBasenameSubstr = RTPathFilename(pImage->pszFilename);
     AssertPtr(pszBasenameSubstr);
     size_t cbBasenameSubstr = strlen(pszBasenameSubstr) + 1;
+
     /* Create separate descriptor file if necessary. */
     if (cExtents != 1 || (uImageFlags & VD_IMAGE_FLAGS_FIXED))
@@ -4987,4 +5408,5 @@
     else
         pImage->pFile = NULL;
+
     /* Set up all extents. */
     for (unsigned i = 0; i < cExtents; i++)
@@ -4992,4 +5414,5 @@
         PVMDKEXTENT pExtent = &pImage->pExtents[i];
         uint64_t cbExtent = cbRemaining;
+
         /* Set up fullname/basename for extent description. Cannot use StrDup
          * for basename, as it is not guaranteed that the memory can be freed
@@ -5048,4 +5471,5 @@
             return VERR_NO_STR_MEMORY;
         pExtent->pszFullname = pszFullname;
+
         /* Create file for extent. */
         rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszBasename, pExtent->pszFullname,
@@ -5063,4 +5487,5 @@
                 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not set size of new file '%s'"), pExtent->pszFullname);
         }
+
         /* Place descriptor file information (where integrated). */
         if (cExtents == 1 && !(uImageFlags & VD_IMAGE_FLAGS_FIXED))
@@ -5072,4 +5497,5 @@
             pImage->pDescData = NULL;
         }
+
         if (!(uImageFlags & VD_IMAGE_FLAGS_FIXED))
         {
@@ -5099,4 +5525,5 @@
                 pExtent->enmType = VMDKETYPE_FLAT;
         }
+
         pExtent->enmAccess = VMDKACCESS_READWRITE;
         pExtent->fUncleanShutdown = true;
@@ -5104,4 +5531,5 @@
         pExtent->uSectorOffset = 0;
         pExtent->fMetaDirty = true;
+
         if (!(uImageFlags & VD_IMAGE_FLAGS_FIXED))
         {
@@ -5115,9 +5543,13 @@
                 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new grain directory in '%s'"), pExtent->pszFullname);
         }
+
         cbOffset += cbExtent;
+
         if (RT_SUCCESS(rc))
             vdIfProgress(pIfProgress, uPercentStart + cbOffset * uPercentSpan / cbSize);
+
         cbRemaining -= cbExtent;
     }
+
     if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_ESX)
     {
@@ -5128,4 +5560,5 @@
             return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not set controller type to lsilogic in '%s'"), pImage->pszFilename);
     }
+
     const char *pszDescType = NULL;
     if (uImageFlags & VD_IMAGE_FLAGS_FIXED)
@@ -5153,4 +5586,5 @@
     return rc;
 }
+
 /**
  * Internal: Create a real stream optimized VMDK using only linear writes.
@@ -5161,12 +5595,16 @@
     if (RT_FAILURE(rc))
         return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new extent list in '%s'"), pImage->pszFilename);
+
     /* Basename strings needed for constructing the extent names. */
     const char *pszBasenameSubstr = RTPathFilename(pImage->pszFilename);
     AssertPtr(pszBasenameSubstr);
     size_t cbBasenameSubstr = strlen(pszBasenameSubstr) + 1;
+
     /* No separate descriptor file. */
     pImage->pFile = NULL;
+
     /* Set up all extents. */
     PVMDKEXTENT pExtent = &pImage->pExtents[0];
+
     /* Set up fullname/basename for extent description. Cannot use StrDup
      * for basename, as it is not guaranteed that the memory can be freed
@@ -5178,4 +5616,5 @@
     memcpy(pszBasename, pszBasenameSubstr, cbBasenameSubstr);
     pExtent->pszBasename = pszBasename;
+
     char *pszBasedirectory = RTStrDup(pImage->pszFilename);
     RTPathStripFilename(pszBasedirectory);
@@ -5185,4 +5624,5 @@
         return VERR_NO_STR_MEMORY;
     pExtent->pszFullname = pszFullname;
+
     /* Create file for extent. Make it write only, no reading allowed. */
     rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszBasename, pExtent->pszFullname,
@@ -5192,4 +5632,5 @@
     if (RT_FAILURE(rc))
         return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new file '%s'"), pExtent->pszFullname);
+
     /* Place descriptor file information. */
     pExtent->uDescriptorSector = 1;
@@ -5198,4 +5639,5 @@
     pExtent->pDescData = pImage->pDescData;
     pImage->pDescData = NULL;
+
     uint64_t cSectorsPerGDE, cSectorsPerGD;
     pExtent->enmType = VMDKETYPE_HOSTED_SPARSE;
@@ -5207,4 +5649,5 @@
     pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE;
     cSectorsPerGD = (pExtent->cGDEntries + (512 / sizeof(uint32_t) - 1)) / (512 / sizeof(uint32_t));
+
     /* The spec says version is 1 for all VMDKs, but the vast
      * majority of streamOptimized VMDKs actually contain
@@ -5213,4 +5656,5 @@
     pExtent->uCompression = VMDK_COMPRESSION_DEFLATE;
     pExtent->fFooter = true;
+
     pExtent->enmAccess = VMDKACCESS_READONLY;
     pExtent->fUncleanShutdown = false;
@@ -5218,4 +5662,5 @@
     pExtent->uSectorOffset = 0;
     pExtent->fMetaDirty = true;
+
     /* Create grain directory, without preallocating it straight away. It will
      * be constructed on the fly when writing out the data and written when
@@ -5226,10 +5671,13 @@
     if (RT_FAILURE(rc))
         return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new grain directory in '%s'"), pExtent->pszFullname);
+
     rc = vmdkDescBaseSetStr(pImage, &pImage->Descriptor, "createType",
                             "streamOptimized");
     if (RT_FAILURE(rc))
         rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not set the image type in '%s'"), pImage->pszFilename);
+
     return rc;
 }
+
 /**
  * Initializes the UUID fields in the DDB.
@@ -5267,6 +5715,8 @@
         rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
                        N_("VMDK: error storing image UUID in new descriptor in '%s'"), pImage->pszFilename);
+
     return rc;
 }
+
 /**
  * Internal: The actual code for creating any VMDK variant currently in
@@ -5281,7 +5731,9 @@
 {
     pImage->uImageFlags = uImageFlags;
+
     pImage->pIfError = VDIfErrorGet(pImage->pVDIfsDisk);
     pImage->pIfIo = VDIfIoIntGet(pImage->pVDIfsImage);
     AssertPtrReturn(pImage->pIfIo, VERR_INVALID_PARAMETER);
+
     int rc = vmdkCreateDescriptor(pImage, pImage->pDescData, pImage->cbDescAlloc,
                                   &pImage->Descriptor);
@@ -5295,4 +5747,5 @@
             if (RT_FAILURE(rc))
                 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could get raw descriptor for '%s'"), pImage->pszFilename);
+
             rc = vmdkCreateRawImage(pImage, pRaw, cbSize);
             vmdkRawDescFree(pRaw);
@@ -5310,11 +5763,15 @@
                                         uPercentSpan * 95 / 100);
         }
+
         if (RT_SUCCESS(rc))
         {
             vdIfProgress(pIfProgress, uPercentStart + uPercentSpan * 98 / 100);
+
             pImage->cbSize = cbSize;
+
             for (unsigned i = 0; i < pImage->cExtents; i++)
             {
                 PVMDKEXTENT pExtent = &pImage->pExtents[i];
+
                 rc = vmdkDescExtInsert(pImage, &pImage->Descriptor, pExtent->enmAccess,
                                        pExtent->cNominalSectors, pExtent->enmType,
@@ -5326,6 +5783,8 @@
                 }
             }
+
             if (RT_SUCCESS(rc))
                 vmdkDescExtRemoveDummy(pImage, &pImage->Descriptor);
+
             if (   RT_SUCCESS(rc)
                 && pPCHSGeometry->cCylinders != 0
@@ -5333,4 +5792,5 @@
                 && pPCHSGeometry->cSectors != 0)
                 rc = vmdkDescSetPCHSGeometry(pImage, pPCHSGeometry);
+
             if (   RT_SUCCESS(rc)
                 && pLCHSGeometry->cCylinders != 0
@@ -5338,14 +5798,19 @@
                 && pLCHSGeometry->cSectors != 0)
                 rc = vmdkDescSetLCHSGeometry(pImage, pLCHSGeometry);
+
             pImage->LCHSGeometry = *pLCHSGeometry;
             pImage->PCHSGeometry = *pPCHSGeometry;
+
             pImage->ImageUuid = *pUuid;
             RTUuidClear(&pImage->ParentUuid);
             RTUuidClear(&pImage->ModificationUuid);
             RTUuidClear(&pImage->ParentModificationUuid);
+
             if (RT_SUCCESS(rc))
                 rc = vmdkCreateImageDdbUuidsInit(pImage);
+
             if (RT_SUCCESS(rc))
                 rc = vmdkAllocateGrainTableCache(pImage);
+
             if (RT_SUCCESS(rc))
             {
@@ -5354,7 +5819,9 @@
                     rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: cannot set image comment in '%s'"), pImage->pszFilename);
             }
+
             if (RT_SUCCESS(rc))
             {
                 vdIfProgress(pIfProgress, uPercentStart + uPercentSpan * 99 / 100);
+
                 if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
                 {
@@ -5381,4 +5848,6 @@
     else
         rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new descriptor in '%s'"), pImage->pszFilename);
+
+
     if (RT_SUCCESS(rc))
     {
@@ -5386,4 +5855,5 @@
         pImage->RegionList.fFlags   = 0;
         pImage->RegionList.cRegions = 1;
+
         pRegion->offRegion            = 0; /* Disk start. */
         pRegion->cbBlock              = 512;
@@ -5393,4 +5863,5 @@
         pRegion->cbMetadata           = 0;
         pRegion->cRegionBlocksOrBytes = pImage->cbSize;
+
         vdIfProgress(pIfProgress, uPercentStart + uPercentSpan);
     }
@@ -5399,4 +5870,5 @@
     return rc;
 }
+
 /**
  * Internal: Update image comment.
@@ -5411,4 +5883,5 @@
             return VERR_NO_MEMORY;
     }
+
     int rc = vmdkDescDDBSetStr(pImage, &pImage->Descriptor,
                                "ddb.comment", pszCommentEncoded);
@@ -5419,4 +5892,5 @@
     return VINF_SUCCESS;
 }
+
 /**
  * Internal. Clear the grain table buffer for real stream optimized writing.
@@ -5429,4 +5903,5 @@
                VMDK_GT_CACHELINE_SIZE * sizeof(uint32_t));
 }
+
 /**
  * Internal. Flush the grain table buffer for real stream optimized writing.
@@ -5437,4 +5912,5 @@
     int rc = VINF_SUCCESS;
     uint32_t cCacheLines = RT_ALIGN(pExtent->cGTEntries, VMDK_GT_CACHELINE_SIZE) / VMDK_GT_CACHELINE_SIZE;
+
     /* VMware does not write out completely empty grain tables in the case
      * of streamOptimized images, which according to my interpretation of
@@ -5458,4 +5934,5 @@
     if (fAllZero)
         return VINF_SUCCESS;
+
     uint64_t uFileOffset = pExtent->uAppendPosition;
     if (!uFileOffset)
@@ -5463,4 +5940,5 @@
     /* Align to sector, as the previous write could have been any size. */
     uFileOffset = RT_ALIGN_64(uFileOffset, 512);
+
     /* Grain table marker. */
     uint8_t aMarker[512];
@@ -5473,7 +5951,10 @@
     AssertRC(rc);
     uFileOffset += 512;
+
     if (!pExtent->pGD || pExtent->pGD[uGDEntry])
         return VERR_INTERNAL_ERROR;
+
     pExtent->pGD[uGDEntry] = VMDK_BYTE2SECTOR(uFileOffset);
+
     for (uint32_t i = 0; i < cCacheLines; i++)
     {
@@ -5483,4 +5964,5 @@
         for (uint32_t j = 0; j < VMDK_GT_CACHELINE_SIZE; j++, pGTTmp++)
             *pGTTmp = RT_H2LE_U32(*pGTTmp);
+
         rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pExtent->pFile->pStorage, uFileOffset,
                                     &pImage->pGTCache->aGTCache[i].aGTData[0],
@@ -5494,4 +5976,5 @@
     return rc;
 }
+
 /**
  * Internal. Free all allocated space for representing an image, and optionally
@@ -5501,4 +5984,5 @@
 {
     int rc = VINF_SUCCESS;
+
     /* Freeing a never allocated image (e.g. because the open failed) is
      * not signalled as an error. After all nothing bad happens. */
@@ -5526,4 +6010,5 @@
                         pImage->pExtents[i].fMetaDirty = true;
                     }
+
                     /* From now on it's not safe to append any more data. */
                     pImage->pExtents[i].uAppendPosition = 0;
@@ -5531,4 +6016,5 @@
             }
         }
+
         if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
         {
@@ -5549,10 +6035,13 @@
                     AssertRC(rc);
                 }
+
                 uint64_t uFileOffset = pExtent->uAppendPosition;
                 if (!uFileOffset)
                     return VERR_INTERNAL_ERROR;
                 uFileOffset = RT_ALIGN_64(uFileOffset, 512);
+
                 /* From now on it's not safe to append any more data. */
                 pExtent->uAppendPosition = 0;
+
                 /* Grain directory marker. */
                 uint8_t aMarker[512];
@@ -5565,4 +6054,5 @@
                 AssertRC(rc);
                 uFileOffset += 512;
+
                 /* Write grain directory in little endian style. The array will
                  * not be used after this, so convert in place. */
@@ -5574,4 +6064,5 @@
                                             pExtent->cGDEntries * sizeof(uint32_t));
                 AssertRC(rc);
+
                 pExtent->uSectorGD = VMDK_BYTE2SECTOR(uFileOffset);
                 pExtent->uSectorRGD = VMDK_BYTE2SECTOR(uFileOffset);
@@ -5579,4 +6070,5 @@
                                           + pExtent->cGDEntries * sizeof(uint32_t),
                                           512);
+
                 /* Footer marker. */
                 memset(pMarker, '\0', sizeof(aMarker));
@@ -5586,7 +6078,9 @@
                                             uFileOffset, aMarker, sizeof(aMarker));
                 AssertRC(rc);
+
                 uFileOffset += 512;
                 rc = vmdkWriteMetaSparseExtent(pImage, pExtent, uFileOffset, NULL);
                 AssertRC(rc);
+
                 uFileOffset += 512;
                 /* End-of-stream marker. */
@@ -5599,4 +6093,5 @@
         else if (!fDelete && fFlush)
             vmdkFlushImage(pImage, NULL);
+
         if (pImage->pExtents != NULL)
         {
@@ -5620,4 +6115,5 @@
         if (RT_SUCCESS(rc))
             rc = rc2; /* Propogate any error when closing the file. */
+
         if (pImage->pGTCache)
         {
@@ -5631,7 +6127,9 @@
         }
     }
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /**
  * Internal. Flush image data (and metadata) to disk.
@@ -5641,7 +6139,9 @@
     PVMDKEXTENT pExtent;
     int rc = VINF_SUCCESS;
+
     /* Update descriptor if changed. */
     if (pImage->Descriptor.fDirty)
         rc = vmdkWriteDescriptor(pImage, pIoCtx);
+
     if (RT_SUCCESS(rc))
     {
@@ -5679,6 +6179,8 @@
                 }
             }
+
             if (RT_FAILURE(rc))
                 break;
+
             switch (pExtent->enmType)
             {
@@ -5702,6 +6204,8 @@
         }
     }
+
     return rc;
 }
+
 /**
  * Internal. Find extent corresponding to the sector number in the disk.
@@ -5712,4 +6216,5 @@
     PVMDKEXTENT pExtent = NULL;
     int rc = VINF_SUCCESS;
+
     for (unsigned i = 0; i < pImage->cExtents; i++)
     {
@@ -5722,10 +6227,13 @@
         offSector -= pImage->pExtents[i].cNominalSectors;
     }
+
     if (pExtent)
         *ppExtent = pExtent;
     else
         rc = VERR_IO_SECTOR_NOT_FOUND;
+
     return rc;
 }
+
 /**
  * Internal. Hash function for placing the grain table hash entries.
@@ -5738,4 +6246,5 @@
     return (uSector + uExtent) % pCache->cEntries;
 }
+
 /**
  * Internal. Get sector number in the extent file from the relative sector
@@ -5752,4 +6261,5 @@
     uint32_t aGTDataTmp[VMDK_GT_CACHELINE_SIZE];
     int rc;
+
     /* For newly created and readonly/sequentially opened streamOptimized
      * images this must be a no-op, as the grain directory is not there. */
@@ -5763,4 +6273,5 @@
         return VINF_SUCCESS;
     }
+
     uGDIndex = uSector / pExtent->cSectorsPerGDE;
     if (uGDIndex >= pExtent->cGDEntries)
@@ -5774,4 +6285,5 @@
         return VINF_SUCCESS;
     }
+
     uGTBlock = uSector / (pExtent->cSectorsPerGrain * VMDK_GT_CACHELINE_SIZE);
     uGTHash = vmdkGTCacheHash(pCache, uGTBlock, pExtent->uExtent);
@@ -5802,4 +6314,5 @@
     return VINF_SUCCESS;
 }
+
 /**
  * Internal. Writes the grain and also if necessary the grain tables.
@@ -5816,4 +6329,5 @@
     const void *pData;
     int rc;
+
     /* Very strict requirements: always write at least one full grain, with
      * proper alignment. Everything else would require reading of already
@@ -5828,6 +6342,8 @@
         || uSector + VMDK_BYTE2SECTOR(cbWrite) > pExtent->cNominalSectors)
         return VERR_INVALID_PARAMETER;
+
     /* Clip write range to at most the rest of the grain. */
     cbWrite = RT_MIN(cbWrite, VMDK_SECTOR2BYTE(pExtent->cSectorsPerGrain - uSector % pExtent->cSectorsPerGrain));
+
     /* Do not allow to go back. */
     uGrain = uSector / pExtent->cSectorsPerGrain;
@@ -5838,4 +6354,5 @@
     if (uGrain < pExtent->uLastGrainAccess)
         return VERR_VD_VMDK_INVALID_WRITE;
+
     /* Zero byte write optimization. Since we don't tell VBoxHDD that we need
      * to allocate something, we also need to detect the situation ourself. */
@@ -5843,4 +6360,5 @@
         && vdIfIoIntIoCtxIsZero(pImage->pIfIo, pIoCtx, cbWrite, true /* fAdvance */))
         return VINF_SUCCESS;
+
     if (uGDEntry != uLastGDEntry)
     {
@@ -5856,4 +6374,5 @@
         }
     }
+
     uint64_t uFileOffset;
     uFileOffset = pExtent->uAppendPosition;
@@ -5862,4 +6381,5 @@
     /* Align to sector, as the previous write could have been any size. */
     uFileOffset = RT_ALIGN_64(uFileOffset, 512);
+
     /* Paranoia check: extent type, grain table buffer presence and
      * grain table buffer space. Also grain table entry must be clear. */
@@ -5869,6 +6389,8 @@
         || pImage->pGTCache->aGTCache[uCacheLine].aGTData[uCacheEntry])
         return VERR_INTERNAL_ERROR;
+
     /* Update grain table entry. */
     pImage->pGTCache->aGTCache[uCacheLine].aGTData[uCacheEntry] = VMDK_BYTE2SECTOR(uFileOffset);
+
     if (cbWrite != VMDK_SECTOR2BYTE(pExtent->cSectorsPerGrain))
     {
@@ -5883,4 +6405,5 @@
         unsigned cSegments = 1;
         size_t cbSeg = 0;
+
         cbSeg = vdIfIoIntIoCtxSegArrayCreate(pImage->pIfIo, pIoCtx, &Segment,
                                              &cSegments, VMDK_SECTOR2BYTE(pExtent->cSectorsPerGrain));
@@ -5899,6 +6422,8 @@
     pExtent->uLastGrainAccess = uGrain;
     pExtent->uAppendPosition += cbGrain;
+
     return rc;
 }
+
 /**
  * Internal: Updates the grain table during grain allocation.
@@ -5914,9 +6439,12 @@
     uint64_t uSector = pGrainAlloc->uSector;
     PVMDKGTCACHEENTRY pGTCacheEntry;
+
     LogFlowFunc(("pImage=%#p pExtent=%#p pCache=%#p pIoCtx=%#p pGrainAlloc=%#p\n",
                  pImage, pExtent, pCache, pIoCtx, pGrainAlloc));
+
     uGTSector = pGrainAlloc->uGTSector;
     uRGTSector = pGrainAlloc->uRGTSector;
     LogFlow(("uGTSector=%llu uRGTSector=%llu\n", uGTSector, uRGTSector));
+
     /* Update the grain table (and the cache). */
     uGTBlock = uSector / (pExtent->cSectorsPerGrain * VMDK_GT_CACHELINE_SIZE);
@@ -5981,7 +6509,9 @@
             return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: cannot write updated backup grain table in '%s'"), pExtent->pszFullname);
     }
+
     LogFlowFunc(("leaving rc=%Rrc\n", rc));
     return rc;
 }
+
 /**
  * Internal - complete the grain allocation by updating disk grain table if required.
@@ -5993,9 +6523,12 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     PVMDKGRAINALLOCASYNC pGrainAlloc = (PVMDKGRAINALLOCASYNC)pvUser;
+
     LogFlowFunc(("pBackendData=%#p pIoCtx=%#p pvUser=%#p rcReq=%Rrc\n",
                  pBackendData, pIoCtx, pvUser, rcReq));
+
     pGrainAlloc->cIoXfersPending--;
     if (!pGrainAlloc->cIoXfersPending && pGrainAlloc->fGTUpdateNeeded)
         rc = vmdkAllocGrainGTUpdate(pImage, pGrainAlloc->pExtent, pIoCtx, pGrainAlloc);
+
     if (!pGrainAlloc->cIoXfersPending)
     {
@@ -6003,7 +6536,9 @@
         RTMemFree(pGrainAlloc);
     }
+
     LogFlowFunc(("Leaving rc=%Rrc\n", rc));
     return rc;
 }
+
 /**
  * Internal. Allocates a new grain table (if necessary).
@@ -6017,11 +6552,15 @@
     PVMDKGRAINALLOCASYNC pGrainAlloc = NULL;
     int rc;
+
     LogFlowFunc(("pCache=%#p pExtent=%#p pIoCtx=%#p uSector=%llu cbWrite=%llu\n",
                  pCache, pExtent, pIoCtx, uSector, cbWrite));
+
     pGrainAlloc = (PVMDKGRAINALLOCASYNC)RTMemAllocZ(sizeof(VMDKGRAINALLOCASYNC));
     if (!pGrainAlloc)
         return VERR_NO_MEMORY;
+
     pGrainAlloc->pExtent = pExtent;
     pGrainAlloc->uSector = uSector;
+
     uGDIndex = uSector / pExtent->cSectorsPerGDE;
     if (uGDIndex >= pExtent->cGDEntries)
@@ -6038,4 +6577,5 @@
     {
         LogFlow(("Allocating new grain table\n"));
+
         /* There is no grain table referenced by this grain directory
          * entry. So there is absolutely no data in this area. Allocate
@@ -6048,6 +6588,8 @@
         }
         Assert(!(uFileOffset % 512));
+
         uFileOffset = RT_ALIGN_64(uFileOffset, 512);
         uGTSector = VMDK_BYTE2SECTOR(uFileOffset);
+
         /* Normally the grain table is preallocated for hosted sparse extents
          * that support more than 32 bit sector numbers. So this shouldn't
@@ -6058,4 +6600,5 @@
             return VERR_VD_VMDK_INVALID_HEADER;
         }
+
         /* Write grain table by writing the required number of grain table
          * cache chunks. Allocate memory dynamically here or we flood the
@@ -6063,4 +6606,5 @@
         size_t cbGTDataTmp = pExtent->cGTEntries * sizeof(uint32_t);
         uint32_t *paGTDataTmp = (uint32_t *)RTMemTmpAllocZ(cbGTDataTmp);
+
         if (!paGTDataTmp)
         {
@@ -6068,4 +6612,5 @@
             return VERR_NO_MEMORY;
         }
+
         memset(paGTDataTmp, '\0', cbGTDataTmp);
         rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pExtent->pFile->pStorage,
@@ -6083,4 +6628,5 @@
         pExtent->uAppendPosition = RT_ALIGN_64(  pExtent->uAppendPosition
                                                + cbGTDataTmp, 512);
+
         if (pExtent->pRGD)
         {
@@ -6091,4 +6637,5 @@
             Assert(!(uFileOffset % 512));
             uRGTSector = VMDK_BYTE2SECTOR(uFileOffset);
+
             /* Normally the redundant grain table is preallocated for hosted
              * sparse extents that support more than 32 bit sector numbers. So
@@ -6099,4 +6646,5 @@
                 return VERR_VD_VMDK_INVALID_HEADER;
             }
+
             /* Write grain table by writing the required number of grain table
              * cache chunks. Allocate memory dynamically here or we flood the
@@ -6113,7 +6661,10 @@
                 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: cannot write backup grain table allocation in '%s'"), pExtent->pszFullname);
             }
+
             pExtent->uAppendPosition = pExtent->uAppendPosition + cbGTDataTmp;
         }
+
         RTMemTmpFree(paGTDataTmp);
+
         /* Update the grain directory on disk (doing it before writing the
          * grain table will result in a garbled extent if the operation is
@@ -6141,4 +6692,5 @@
                 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: cannot write backup grain directory entry in '%s'"), pExtent->pszFullname);
         }
+
         /* As the final step update the in-memory copy of the GDs. */
         pExtent->pGD[uGDIndex] = uGTSector;
@@ -6146,12 +6698,16 @@
             pExtent->pRGD[uGDIndex] = uRGTSector;
     }
+
     LogFlow(("uGTSector=%llu uRGTSector=%llu\n", uGTSector, uRGTSector));
     pGrainAlloc->uGTSector = uGTSector;
     pGrainAlloc->uRGTSector = uRGTSector;
+
     uFileOffset = pExtent->uAppendPosition;
     if (!uFileOffset)
         return VERR_INTERNAL_ERROR;
     Assert(!(uFileOffset % 512));
+
     pGrainAlloc->uGrainOffset = uFileOffset;
+
     if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
     {
@@ -6159,9 +6715,12 @@
                         ("Accesses to stream optimized images must be synchronous\n"),
                         VERR_INVALID_STATE);
+
         if (cbWrite != VMDK_SECTOR2BYTE(pExtent->cSectorsPerGrain))
             return vdIfError(pImage->pIfError, VERR_INTERNAL_ERROR, RT_SRC_POS, N_("VMDK: not enough data for a compressed data block in '%s'"), pExtent->pszFullname);
+
         /* Invalidate cache, just in case some code incorrectly allows mixing
          * of reads and writes. Normally shouldn't be needed. */
         pExtent->uGrainSectorAbs = 0;
+
         /* Write compressed data block and the markers. */
         uint32_t cbGrain = 0;
@@ -6169,7 +6728,9 @@
         RTSGSEG Segment;
         unsigned cSegments = 1;
+
         cbSeg = vdIfIoIntIoCtxSegArrayCreate(pImage->pIfIo, pIoCtx, &Segment,
                                              &cSegments, cbWrite);
         Assert(cbSeg == cbWrite);
+
         rc = vmdkFileDeflateSync(pImage, pExtent, uFileOffset,
                                  Segment.pvSeg, cbWrite, uSector, &cbGrain);
@@ -6192,7 +6753,10 @@
         else if (RT_FAILURE(rc))
             return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: cannot write allocated data block in '%s'"), pExtent->pszFullname);
+
         pExtent->uAppendPosition += cbWrite;
     }
+
     rc = vmdkAllocGrainGTUpdate(pImage, pExtent, pIoCtx, pGrainAlloc);
+
     if (!pGrainAlloc->cIoXfersPending)
     {
@@ -6200,7 +6764,10 @@
         RTMemFree(pGrainAlloc);
     }
+
     LogFlowFunc(("leaving rc=%Rrc\n", rc));
+
     return rc;
 }
+
 /**
  * Internal. Reads the contents by sequentially going over the compressed
@@ -6212,9 +6779,12 @@
 {
     int rc;
+
     LogFlowFunc(("pImage=%#p pExtent=%#p uSector=%llu pIoCtx=%#p cbRead=%llu\n",
                  pImage, pExtent, uSector, pIoCtx, cbRead));
+
     AssertMsgReturn(vdIfIoIntIoCtxIsSynchronous(pImage->pIfIo, pIoCtx),
                     ("Async I/O not supported for sequential stream optimized images\n"),
                     VERR_INVALID_STATE);
+
     /* Do not allow to go back. */
     uint32_t uGrain = uSector / pExtent->cSectorsPerGrain;
@@ -6222,8 +6792,10 @@
         return VERR_VD_VMDK_INVALID_STATE;
     pExtent->uLastGrainAccess = uGrain;
+
     /* After a previous error do not attempt to recover, as it would need
      * seeking (in the general case backwards which is forbidden). */
     if (!pExtent->uGrainSectorAbs)
         return VERR_VD_VMDK_INVALID_STATE;
+
     /* Check if we need to read something from the image or if what we have
      * in the buffer is good to fulfill the request. */
@@ -6232,4 +6804,5 @@
         uint32_t uGrainSectorAbs =   pExtent->uGrainSectorAbs
                                    + VMDK_BYTE2SECTOR(pExtent->cbGrainStreamRead);
+
         /* Get the marker from the next data block - and skip everything which
          * is not a compressed grain. If it's a compressed grain which is for
@@ -6246,4 +6819,5 @@
             Marker.uSector = RT_LE2H_U64(Marker.uSector);
             Marker.cbSize = RT_LE2H_U32(Marker.cbSize);
+
             if (Marker.cbSize == 0)
             {
@@ -6324,5 +6898,7 @@
             }
         } while (Marker.uType != VMDK_MARKER_EOS);
+
         pExtent->uGrainSectorAbs = uGrainSectorAbs;
+
         if (!pExtent->cbGrainStreamRead && Marker.uType == VMDK_MARKER_EOS)
         {
@@ -6333,4 +6909,5 @@
         }
     }
+
     if (pExtent->uGrain > uSector / pExtent->cSectorsPerGrain)
     {
@@ -6340,4 +6917,5 @@
         return VERR_VD_BLOCK_FREE;
     }
+
     uint32_t uSectorInGrain = uSector % pExtent->cSectorsPerGrain;
     vdIfIoIntIoCtxCopyTo(pImage->pIfIo, pIoCtx,
@@ -6347,4 +6925,5 @@
     return VINF_SUCCESS;
 }
+
 /**
  * Replaces a fragment of a string with the specified string.
@@ -6415,4 +6994,6 @@
     return pszNewStr;
 }
+
+
 /** @copydoc VDIMAGEBACKEND::pfnProbe */
 static DECLCALLBACK(int) vmdkProbe(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
@@ -6442,4 +7023,5 @@
         vmdkFreeImage(pImage, false, false /*fFlush*/);
         RTMemFree(pImage);
+
         if (RT_SUCCESS(rc))
             *penmType = VDTYPE_HDD;
@@ -6447,7 +7029,9 @@
     else
         rc = VERR_NO_MEMORY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnOpen */
 static DECLCALLBACK(int) vmdkOpen(const char *pszFilename, unsigned uOpenFlags,
@@ -6456,11 +7040,14 @@
 {
     RT_NOREF1(enmType); /**< @todo r=klaus make use of the type info. */
+
     LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n",
                  pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
     int rc;
+
     /* Check open flags. All valid flags are supported. */
     AssertReturn(!(uOpenFlags & ~VD_OPEN_FLAGS_MASK), VERR_INVALID_PARAMETER);
     AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
     AssertReturn(*pszFilename != '\0', VERR_INVALID_PARAMETER);
+
 
     PVMDKIMAGE pImage = (PVMDKIMAGE)RTMemAllocZ(RT_UOFFSETOF(VMDKIMAGE, RegionList.aRegions[1]));
@@ -6475,4 +7062,5 @@
         pImage->pVDIfsDisk = pVDIfsDisk;
         pImage->pVDIfsImage = pVDIfsImage;
+
         rc = vmdkOpenImage(pImage, uOpenFlags);
         if (RT_SUCCESS(rc))
@@ -6483,7 +7071,9 @@
     else
         rc = VERR_NO_MEMORY;
+
     LogFlowFunc(("returns %Rrc (pBackendData=%#p)\n", rc, *ppBackendData));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnCreate */
 static DECLCALLBACK(int) vmdkCreate(const char *pszFilename, uint64_t cbSize,
@@ -6499,8 +7089,10 @@
                  pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
     int rc;
+
     /* Check the VD container type and image flags. */
     if (   enmType != VDTYPE_HDD
         || (uImageFlags & ~VD_VMDK_IMAGE_FLAGS_MASK) != 0)
         return VERR_VD_INVALID_TYPE;
+
     /* Check size. Maximum 256TB-64K for sparse images, otherwise unlimited. */
     if (   !(uImageFlags & VD_VMDK_IMAGE_FLAGS_RAWDISK)
@@ -6508,8 +7100,10 @@
             || (!(uImageFlags & VD_IMAGE_FLAGS_FIXED) && cbSize >= _1T * 256 - _64K)))
         return VERR_VD_INVALID_SIZE;
+
     /* Check image flags for invalid combinations. */
     if (   (uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
         && (uImageFlags & ~(VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED | VD_IMAGE_FLAGS_DIFF)))
         return VERR_INVALID_PARAMETER;
+
     /* Check open flags. All valid flags are supported. */
     AssertReturn(!(uOpenFlags & ~VD_OPEN_FLAGS_MASK), VERR_INVALID_PARAMETER);
@@ -6521,8 +7115,10 @@
                    && !(uImageFlags & VD_IMAGE_FLAGS_FIXED)),
                  VERR_INVALID_PARAMETER);
+
     PVMDKIMAGE pImage = (PVMDKIMAGE)RTMemAllocZ(RT_UOFFSETOF(VMDKIMAGE, RegionList.aRegions[1]));
     if (RT_LIKELY(pImage))
     {
         PVDINTERFACEPROGRESS pIfProgress = VDIfProgressGet(pVDIfsOperation);
+
         pImage->pszFilename = pszFilename;
         pImage->pFile = NULL;
@@ -6555,7 +7151,9 @@
                     rc = vmdkOpenImage(pImage, uOpenFlags);
                 }
+
                 if (RT_SUCCESS(rc))
                     *ppBackendData = pImage;
             }
+
             if (RT_FAILURE(rc))
                 RTMemFree(pImage->pDescData);
@@ -6563,4 +7161,5 @@
         else
             rc = VERR_NO_MEMORY;
+
         if (RT_FAILURE(rc))
             RTMemFree(pImage);
@@ -6568,7 +7167,9 @@
     else
         rc = VERR_NO_MEMORY;
+
     LogFlowFunc(("returns %Rrc (pBackendData=%#p)\n", rc, *ppBackendData));
     return rc;
 }
+
 /**
  * Prepares the state for renaming a VMDK image, setting up the state and allocating
@@ -6583,6 +7184,9 @@
 {
     AssertReturn(RTPathFilename(pszFilename) != NULL, VERR_INVALID_PARAMETER);
+
     int rc = VINF_SUCCESS;
+
     memset(&pRenameState->DescriptorCopy, 0, sizeof(pRenameState->DescriptorCopy));
+
     /*
      * Allocate an array to store both old and new names of renamed files
@@ -6610,4 +7214,5 @@
             pRenameState->fEmbeddedDesc = true;
         }
+
         /* Save the descriptor content. */
         pRenameState->DescriptorCopy.cLines = pImage->Descriptor.cLines;
@@ -6621,4 +7226,5 @@
             }
         }
+
         if (RT_SUCCESS(rc))
         {
@@ -6627,7 +7233,9 @@
             AssertReturn(pRenameState->pszNewBaseName, VERR_NO_STR_MEMORY);
             RTPathStripSuffix(pRenameState->pszNewBaseName);
+
             pRenameState->pszOldBaseName = RTStrDup(RTPathFilename(pImage->pszFilename));
             AssertReturn(pRenameState->pszOldBaseName, VERR_NO_STR_MEMORY);
             RTPathStripSuffix(pRenameState->pszOldBaseName);
+
             /* Prepare both old and new full names used for string replacement.
                Note! Must abspath the stuff here, so the strstr weirdness later in
@@ -6637,10 +7245,13 @@
             AssertReturn(pRenameState->pszNewFullName, VERR_NO_STR_MEMORY);
             RTPathStripSuffix(pRenameState->pszNewFullName);
+
             pRenameState->pszOldFullName = RTPathAbsDup(pImage->pszFilename);
             AssertReturn(pRenameState->pszOldFullName, VERR_NO_STR_MEMORY);
             RTPathStripSuffix(pRenameState->pszOldFullName);
+
             /* Save the old name for easy access to the old descriptor file. */
             pRenameState->pszOldDescName = RTStrDup(pImage->pszFilename);
             AssertReturn(pRenameState->pszOldDescName, VERR_NO_STR_MEMORY);
+
             /* Save old image name. */
             pRenameState->pszOldImageName = pImage->pszFilename;
@@ -6649,6 +7260,8 @@
     else
         rc = VERR_NO_TMP_MEMORY;
+
     return rc;
 }
+
 /**
  * Destroys the given rename state, freeing all allocated memory.
@@ -6694,4 +7307,5 @@
         RTStrFree(pRenameState->pszNewFullName);
 }
+
 /**
  * Rolls back the rename operation to the original state.
@@ -6704,4 +7318,5 @@
 {
     int rc = VINF_SUCCESS;
+
     if (!pRenameState->fImageFreed)
     {
@@ -6712,4 +7327,5 @@
         vmdkFreeImage(pImage, false, true /*fFlush*/);
     }
+
     /* Rename files back. */
     for (unsigned i = 0; i <= pRenameState->cExtents; i++)
@@ -6750,6 +7366,8 @@
     pImage->pszFilename = pRenameState->pszOldImageName;
     rc = vmdkOpenImage(pImage, pImage->uOpenFlags);
+
     return rc;
 }
+
 /**
  * Rename worker doing the real work.
@@ -6764,4 +7382,5 @@
     int rc = VINF_SUCCESS;
     unsigned i, line;
+
     /* Update the descriptor with modified extent names. */
     for (i = 0, line = pImage->Descriptor.uFirstExtent;
@@ -6780,4 +7399,5 @@
         pImage->Descriptor.aLines[line] = pRenameState->apszNewLines[i];
     }
+
     if (RT_SUCCESS(rc))
     {
@@ -6786,4 +7406,5 @@
         /* Flush the descriptor now, in case it is embedded. */
         vmdkFlushImage(pImage, NULL);
+
         /* Close and rename/move extents. */
         for (i = 0; i < pRenameState->cExtents; i++)
@@ -6803,4 +7424,5 @@
             if (RT_FAILURE(rc))
                 break;;
+
             /* Rename the extent file. */
             rc = vdIfIoIntFileMove(pImage->pIfIo, pExtent->pszFullname, pRenameState->apszNewName[i], 0);
@@ -6810,4 +7432,5 @@
             pRenameState->apszOldName[i] = RTStrDup(pExtent->pszFullname);
         }
+
         if (RT_SUCCESS(rc))
         {
@@ -6817,4 +7440,5 @@
             {
                 pRenameState->fImageFreed = true;
+
                 /* Last elements of new/old name arrays are intended for
                  * storing descriptor's names.
@@ -6831,6 +7455,8 @@
                     }
                 }
+
                 /* Update pImage with the new information. */
                 pImage->pszFilename = pszFilename;
+
                 /* Open the new image. */
                 rc = vmdkOpenImage(pImage, pImage->uOpenFlags);
@@ -6838,13 +7464,18 @@
         }
     }
+
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnRename */
 static DECLCALLBACK(int) vmdkRename(void *pBackendData, const char *pszFilename)
 {
     LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
+
     PVMDKIMAGE  pImage  = (PVMDKIMAGE)pBackendData;
     VMDKRENAMESTATE RenameState;
+
     memset(&RenameState, 0, sizeof(RenameState));
+
     /* Check arguments. */
     AssertPtrReturn(pImage, VERR_INVALID_POINTER);
@@ -6852,8 +7483,10 @@
     AssertReturn(*pszFilename != '\0', VERR_INVALID_PARAMETER);
     AssertReturn(!(pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_RAWDISK), VERR_INVALID_PARAMETER);
+
     int rc = vmdkRenameStatePrepare(pImage, &RenameState, pszFilename);
     if (RT_SUCCESS(rc))
     {
         /* --- Up to this point we have not done any damage yet. --- */
+
         rc = vmdkRenameWorker(pImage, &RenameState, pszFilename);
         /* Roll back all changes in case of failure. */
@@ -6864,8 +7497,10 @@
         }
     }
+
     vmdkRenameStateDestroy(&RenameState);
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnClose */
 static DECLCALLBACK(int) vmdkClose(void *pBackendData, bool fDelete)
@@ -6873,9 +7508,12 @@
     LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     int rc = vmdkFreeImage(pImage, fDelete, true /*fFlush*/);
     RTMemFree(pImage);
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnRead */
 static DECLCALLBACK(int) vmdkRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
@@ -6885,4 +7523,5 @@
                  pBackendData, uOffset, pIoCtx, cbToRead, pcbActuallyRead));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtr(pImage);
     Assert(uOffset % 512 == 0);
@@ -6891,4 +7530,5 @@
     AssertReturn(cbToRead, VERR_INVALID_PARAMETER);
     AssertReturn(uOffset + cbToRead <= pImage->cbSize, VERR_INVALID_PARAMETER);
+
     /* Find the extent and check access permissions as defined in the extent descriptor. */
     PVMDKEXTENT pExtent;
@@ -6901,4 +7541,5 @@
         /* Clip read range to remain in this extent. */
         cbToRead = RT_MIN(cbToRead, VMDK_SECTOR2BYTE(pExtent->uSectorOffset + pExtent->cNominalSectors - uSectorExtentRel));
+
         /* Handle the read according to the current extent type. */
         switch (pExtent->enmType)
@@ -6907,4 +7548,5 @@
             {
                 uint64_t uSectorExtentAbs;
+
                 rc = vmdkGetSector(pImage, pIoCtx, pExtent, uSectorExtentRel, &uSectorExtentAbs);
                 if (RT_FAILURE(rc))
@@ -6930,4 +7572,5 @@
                         AssertMsg(vdIfIoIntIoCtxIsSynchronous(pImage->pIfIo, pIoCtx),
                                   ("Async I/O is not supported for stream optimized VMDK's\n"));
+
                         uint32_t uSectorInGrain = uSectorExtentRel % pExtent->cSectorsPerGrain;
                         uSectorExtentAbs -= uSectorInGrain;
@@ -6970,4 +7613,5 @@
             {
                 size_t cbSet;
+
                 cbSet = vdIfIoIntIoCtxSet(pImage->pIfIo, pIoCtx, 0, cbToRead);
                 Assert(cbSet == cbToRead);
@@ -6980,7 +7624,9 @@
     else if (RT_SUCCESS(rc))
         rc = VERR_VD_VMDK_INVALID_STATE;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnWrite */
 static DECLCALLBACK(int) vmdkWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
@@ -6992,4 +7638,5 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc;
+
     AssertPtr(pImage);
     Assert(uOffset % 512 == 0);
@@ -6997,4 +7644,5 @@
     AssertPtrReturn(pIoCtx, VERR_INVALID_POINTER);
     AssertReturn(cbToWrite, VERR_INVALID_PARAMETER);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7002,4 +7650,5 @@
         uint64_t uSectorExtentRel;
         uint64_t uSectorExtentAbs;
+
         /* No size check here, will do that later when the extent is located.
          * There are sparse images out there which according to the spec are
@@ -7008,4 +7657,5 @@
          * grain boundaries, and with the nominal size not being a multiple of the
          * grain size), this would prevent writing to the last grain. */
+
         rc = vmdkFindExtent(pImage, VMDK_BYTE2SECTOR(uOffset),
                             &pExtent, &uSectorExtentRel);
@@ -7105,4 +7755,5 @@
                 }
             }
+
             if (pcbWriteProcess)
                 *pcbWriteProcess = cbToWrite;
@@ -7111,13 +7762,17 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnFlush */
 static DECLCALLBACK(int) vmdkFlush(void *pBackendData, PVDIOCTX pIoCtx)
 {
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     return vmdkFlushImage(pImage, pIoCtx);
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetVersion */
 static DECLCALLBACK(unsigned) vmdkGetVersion(void *pBackendData)
@@ -7125,7 +7780,10 @@
     LogFlowFunc(("pBackendData=%#p\n", pBackendData));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, 0);
+
     return VMDK_IMAGE_VERSION;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetFileSize */
 static DECLCALLBACK(uint64_t) vmdkGetFileSize(void *pBackendData)
@@ -7134,5 +7792,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     uint64_t cb = 0;
+
     AssertPtrReturn(pImage, 0);
+
     if (pImage->pFile != NULL)
     {
@@ -7152,7 +7812,9 @@
         }
     }
+
     LogFlowFunc(("returns %lld\n", cb));
     return cb;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetPCHSGeometry */
 static DECLCALLBACK(int) vmdkGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
@@ -7161,12 +7823,16 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (pImage->PCHSGeometry.cCylinders)
         *pPCHSGeometry = pImage->PCHSGeometry;
     else
         rc = VERR_VD_GEOMETRY_NOT_SET;
+
     LogFlowFunc(("returns %Rrc (PCHS=%u/%u/%u)\n", rc, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetPCHSGeometry */
 static DECLCALLBACK(int) vmdkSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
@@ -7176,5 +7842,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7190,7 +7858,9 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetLCHSGeometry */
 static DECLCALLBACK(int) vmdkGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
@@ -7199,12 +7869,16 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (pImage->LCHSGeometry.cCylinders)
         *pLCHSGeometry = pImage->LCHSGeometry;
     else
         rc = VERR_VD_GEOMETRY_NOT_SET;
+
     LogFlowFunc(("returns %Rrc (LCHS=%u/%u/%u)\n", rc, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetLCHSGeometry */
 static DECLCALLBACK(int) vmdkSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
@@ -7214,5 +7888,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7228,7 +7904,9 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnQueryRegions */
 static DECLCALLBACK(int) vmdkQueryRegions(void *pBackendData, PCVDREGIONLIST *ppRegionList)
@@ -7236,9 +7914,12 @@
     LogFlowFunc(("pBackendData=%#p ppRegionList=%#p\n", pBackendData, ppRegionList));
     PVMDKIMAGE pThis = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pThis, VERR_VD_NOT_OPENED);
+
     *ppRegionList = &pThis->RegionList;
     LogFlowFunc(("returns %Rrc\n", VINF_SUCCESS));
     return VINF_SUCCESS;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnRegionListRelease */
 static DECLCALLBACK(void) vmdkRegionListRelease(void *pBackendData, PCVDREGIONLIST pRegionList)
@@ -7248,6 +7929,8 @@
     PVMDKIMAGE pThis = (PVMDKIMAGE)pBackendData;
     AssertPtr(pThis); RT_NOREF(pThis);
+
     /* Nothing to do here. */
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetImageFlags */
 static DECLCALLBACK(unsigned) vmdkGetImageFlags(void *pBackendData)
@@ -7255,8 +7938,11 @@
     LogFlowFunc(("pBackendData=%#p\n", pBackendData));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, 0);
+
     LogFlowFunc(("returns %#x\n", pImage->uImageFlags));
     return pImage->uImageFlags;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetOpenFlags */
 static DECLCALLBACK(unsigned) vmdkGetOpenFlags(void *pBackendData)
@@ -7264,8 +7950,11 @@
     LogFlowFunc(("pBackendData=%#p\n", pBackendData));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, 0);
+
     LogFlowFunc(("returns %#x\n", pImage->uOpenFlags));
     return pImage->uOpenFlags;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetOpenFlags */
 static DECLCALLBACK(int) vmdkSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
@@ -7274,4 +7963,5 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc;
+
     /* Image must be opened and the new flags must be valid. */
     if (!pImage || (uOpenFlags & ~(  VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_INFO
@@ -7296,7 +7986,9 @@
         }
     }
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetComment */
 static DECLCALLBACK(int) vmdkGetComment(void *pBackendData, char *pszComment, size_t cbComment)
@@ -7304,5 +7996,7 @@
     LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     char *pszCommentEncoded = NULL;
     int rc = vmdkDescDDBGetStr(pImage, &pImage->Descriptor,
@@ -7313,4 +8007,5 @@
         rc = VINF_SUCCESS;
     }
+
     if (RT_SUCCESS(rc))
     {
@@ -7319,10 +8014,13 @@
         else if (pszComment)
                 *pszComment = '\0';
+
         if (pszCommentEncoded)
             RTMemTmpFree(pszCommentEncoded);
     }
+
     LogFlowFunc(("returns %Rrc comment='%s'\n", rc, pszComment));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetComment */
 static DECLCALLBACK(int) vmdkSetComment(void *pBackendData, const char *pszComment)
@@ -7331,5 +8029,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7341,7 +8041,9 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetUuid */
 static DECLCALLBACK(int) vmdkGetUuid(void *pBackendData, PRTUUID pUuid)
@@ -7349,9 +8051,13 @@
     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     *pUuid = pImage->ImageUuid;
+
     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VINF_SUCCESS, pUuid));
     return VINF_SUCCESS;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetUuid */
 static DECLCALLBACK(int) vmdkSetUuid(void *pBackendData, PCRTUUID pUuid)
@@ -7360,5 +8066,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7377,7 +8085,9 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetModificationUuid */
 static DECLCALLBACK(int) vmdkGetModificationUuid(void *pBackendData, PRTUUID pUuid)
@@ -7385,9 +8095,13 @@
     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     *pUuid = pImage->ModificationUuid;
+
     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VINF_SUCCESS, pUuid));
     return VINF_SUCCESS;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetModificationUuid */
 static DECLCALLBACK(int) vmdkSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
@@ -7396,5 +8110,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7416,7 +8132,9 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetParentUuid */
 static DECLCALLBACK(int) vmdkGetParentUuid(void *pBackendData, PRTUUID pUuid)
@@ -7424,9 +8142,13 @@
     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     *pUuid = pImage->ParentUuid;
+
     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VINF_SUCCESS, pUuid));
     return VINF_SUCCESS;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetParentUuid */
 static DECLCALLBACK(int) vmdkSetParentUuid(void *pBackendData, PCRTUUID pUuid)
@@ -7435,5 +8157,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7452,7 +8176,9 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnGetParentModificationUuid */
 static DECLCALLBACK(int) vmdkGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
@@ -7460,9 +8186,13 @@
     LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     *pUuid = pImage->ParentModificationUuid;
+
     LogFlowFunc(("returns %Rrc (%RTuuid)\n", VINF_SUCCESS, pUuid));
     return VINF_SUCCESS;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnSetParentModificationUuid */
 static DECLCALLBACK(int) vmdkSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
@@ -7471,5 +8201,7 @@
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
     int rc = VINF_SUCCESS;
+
     AssertPtrReturn(pImage, VERR_VD_NOT_OPENED);
+
     if (!(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY))
     {
@@ -7487,11 +8219,14 @@
     else
         rc = VERR_VD_IMAGE_READ_ONLY;
+
     LogFlowFunc(("returns %Rrc\n", rc));
     return rc;
 }
+
 /** @copydoc VDIMAGEBACKEND::pfnDump */
 static DECLCALLBACK(void) vmdkDump(void *pBackendData)
 {
     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
+
     AssertPtrReturnVoid(pImage);
     vdIfErrorMessage(pImage->pIfError, "Header: Geometry PCHS=%u/%u/%u LCHS=%u/%u/%u cbSector=%llu\n",
@@ -7715,4 +8450,5 @@
     return rc;
 }
+
 
 const VDIMAGEBACKEND g_VmdkBackend =
