VirtualBox

Changeset 66250 in vbox for trunk/src/VBox/Storage


Ignore:
Timestamp:
Mar 26, 2017 9:52:17 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114171
Message:

Storage,DrvVD,Main,VBoxManage: Rename VBOXHDD to VDISK, the VBoxHDD module is long gone:

Location:
trunk/src/VBox/Storage
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VD.cpp

    r66248 r66250  
    9797    void               *pBackendData;
    9898    /** Disk this image is part of */
    99     PVBOXHDD            pDisk;
     99    PVDISK              pDisk;
    100100    /** Flag whether to ignore flush requests. */
    101101    bool                fIgnoreFlush;
     
    222222 * VBox HDD Container main structure, private part.
    223223 */
    224 struct VBOXHDD
     224struct VDISK
    225225{
    226226    /** Structure signature (VDISK_SIGNATURE). */
     
    315315{
    316316    /** Pointer to disk descriptor. */
    317     PVBOXHDD pDisk;
     317    PVDISK pDisk;
    318318    /** Pointer to image descriptor. */
    319319    PVDIMAGE pImage;
     
    350350    struct VDIOCTX * volatile    pIoCtxNext;
    351351    /** Disk this is request is for. */
    352     PVBOXHDD                     pDisk;
     352    PVDISK                     pDisk;
    353353    /** Return code. */
    354354    int                          rcReq;
     
    670670static DECLCALLBACK(int) vdDiscardHelperAsync(PVDIOCTX pIoCtx);
    671671static DECLCALLBACK(int) vdWriteHelperAsync(PVDIOCTX pIoCtx);
    672 static void vdDiskProcessBlockedIoCtx(PVBOXHDD pDisk);
    673 static int vdDiskUnlock(PVBOXHDD pDisk, PVDIOCTX pIoCtxRc);
     672static void vdDiskProcessBlockedIoCtx(PVDISK pDisk);
     673static int vdDiskUnlock(PVDISK pDisk, PVDIOCTX pIoCtxRc);
    674674static DECLCALLBACK(void) vdIoCtxSyncComplete(void *pvUser1, void *pvUser2, int rcReq);
    675675
     
    788788 * internal: issue error message.
    789789 */
    790 static int vdError(PVBOXHDD pDisk, int rc, RT_SRC_POS_DECL,
     790static int vdError(PVDISK pDisk, int rc, RT_SRC_POS_DECL,
    791791                   const char *pszFormat, ...)
    792792{
     
    802802 * internal: thread synchronization, start read.
    803803 */
    804 DECLINLINE(int) vdThreadStartRead(PVBOXHDD pDisk)
     804DECLINLINE(int) vdThreadStartRead(PVDISK pDisk)
    805805{
    806806    int rc = VINF_SUCCESS;
     
    813813 * internal: thread synchronization, finish read.
    814814 */
    815 DECLINLINE(int) vdThreadFinishRead(PVBOXHDD pDisk)
     815DECLINLINE(int) vdThreadFinishRead(PVDISK pDisk)
    816816{
    817817    int rc = VINF_SUCCESS;
     
    824824 * internal: thread synchronization, start write.
    825825 */
    826 DECLINLINE(int) vdThreadStartWrite(PVBOXHDD pDisk)
     826DECLINLINE(int) vdThreadStartWrite(PVDISK pDisk)
    827827{
    828828    int rc = VINF_SUCCESS;
     
    835835 * internal: thread synchronization, finish write.
    836836 */
    837 DECLINLINE(int) vdThreadFinishWrite(PVBOXHDD pDisk)
     837DECLINLINE(int) vdThreadFinishWrite(PVDISK pDisk)
    838838{
    839839    int rc = VINF_SUCCESS;
     
    913913 * internal: add image structure to the end of images list.
    914914 */
    915 static void vdAddImageToList(PVBOXHDD pDisk, PVDIMAGE pImage)
     915static void vdAddImageToList(PVDISK pDisk, PVDIMAGE pImage)
    916916{
    917917    pImage->pPrev = NULL;
     
    938938 * internal: remove image structure from the images list.
    939939 */
    940 static void vdRemoveImageFromList(PVBOXHDD pDisk, PVDIMAGE pImage)
     940static void vdRemoveImageFromList(PVDISK pDisk, PVDIMAGE pImage)
    941941{
    942942    Assert(pDisk->cImages > 0);
     
    991991 * internal: find image by index into the images list.
    992992 */
    993 static PVDIMAGE vdGetImageByNumber(PVBOXHDD pDisk, unsigned nImage)
     993static PVDIMAGE vdGetImageByNumber(PVDISK pDisk, unsigned nImage)
    994994{
    995995    PVDIMAGE pImage = pDisk->pBase;
     
    10131013 * @param   pIoCtx   The I/O context associated with the request.
    10141014 */
    1015 static int vdFilterChainApplyWrite(PVBOXHDD pDisk, uint64_t uOffset, size_t cbWrite,
     1015static int vdFilterChainApplyWrite(PVDISK pDisk, uint64_t uOffset, size_t cbWrite,
    10161016                                   PVDIOCTX pIoCtx)
    10171017{
     
    10421042 * @param   pIoCtx   The I/O context associated with the request.
    10431043 */
    1044 static int vdFilterChainApplyRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead,
     1044static int vdFilterChainApplyRead(PVDISK pDisk, uint64_t uOffset, size_t cbRead,
    10451045                                  PVDIOCTX pIoCtx)
    10461046{
     
    10651065}
    10661066
    1067 DECLINLINE(void) vdIoCtxRootComplete(PVBOXHDD pDisk, PVDIOCTX pIoCtx)
     1067DECLINLINE(void) vdIoCtxRootComplete(PVDISK pDisk, PVDIOCTX pIoCtx)
    10681068{
    10691069    if (   RT_SUCCESS(pIoCtx->rcReq)
     
    10801080 * Initialize the structure members of a given I/O context.
    10811081 */
    1082 DECLINLINE(void) vdIoCtxInit(PVDIOCTX pIoCtx, PVBOXHDD pDisk, VDIOCTXTXDIR enmTxDir,
     1082DECLINLINE(void) vdIoCtxInit(PVDIOCTX pIoCtx, PVDISK pDisk, VDIOCTXTXDIR enmTxDir,
    10831083                             uint64_t uOffset, size_t cbTransfer, PVDIMAGE pImageStart,
    10841084                             PCRTSGBUF pcSgBuf, void *pvAllocation,
     
    12281228 *                             The number of bytes waiting can be less.
    12291229 */
    1230 static int vdDiscardRemoveBlocks(PVBOXHDD pDisk, PVDDISCARDSTATE pDiscard, size_t cbDiscardingNew)
     1230static int vdDiscardRemoveBlocks(PVDISK pDisk, PVDDISCARDSTATE pDiscard, size_t cbDiscardingNew)
    12311231{
    12321232    int rc = VINF_SUCCESS;
     
    13131313 * @param   pDisk    VD disk container.
    13141314 */
    1315 static int vdDiscardStateDestroy(PVBOXHDD pDisk)
     1315static int vdDiscardStateDestroy(PVDISK pDisk)
    13161316{
    13171317    int rc = VINF_SUCCESS;
     
    13391339 * @param   cbRange  Number of bytes to mark as allocated.
    13401340 */
    1341 static int vdDiscardSetRangeAllocated(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRange)
     1341static int vdDiscardSetRangeAllocated(PVDISK pDisk, uint64_t uOffset, size_t cbRange)
    13421342{
    13431343    PVDDISCARDSTATE pDiscard = pDisk->pDiscard;
     
    13811381}
    13821382
    1383 DECLINLINE(PVDIOCTX) vdIoCtxAlloc(PVBOXHDD pDisk, VDIOCTXTXDIR enmTxDir,
     1383DECLINLINE(PVDIOCTX) vdIoCtxAlloc(PVDISK pDisk, VDIOCTXTXDIR enmTxDir,
    13841384                                  uint64_t uOffset, size_t cbTransfer,
    13851385                                  PVDIMAGE pImageStart,PCRTSGBUF pcSgBuf,
     
    13991399}
    14001400
    1401 DECLINLINE(PVDIOCTX) vdIoCtxRootAlloc(PVBOXHDD pDisk, VDIOCTXTXDIR enmTxDir,
     1401DECLINLINE(PVDIOCTX) vdIoCtxRootAlloc(PVDISK pDisk, VDIOCTXTXDIR enmTxDir,
    14021402                                      uint64_t uOffset, size_t cbTransfer,
    14031403                                      PVDIMAGE pImageStart, PCRTSGBUF pcSgBuf,
     
    14231423}
    14241424
    1425 DECLINLINE(void) vdIoCtxDiscardInit(PVDIOCTX pIoCtx, PVBOXHDD pDisk, PCRTRANGE paRanges,
     1425DECLINLINE(void) vdIoCtxDiscardInit(PVDIOCTX pIoCtx, PVDISK pDisk, PCRTRANGE paRanges,
    14261426                                    unsigned cRanges, PFNVDASYNCTRANSFERCOMPLETE pfnComplete,
    14271427                                    void *pvUser1, void *pvUser2, void *pvAllocation,
     
    14521452}
    14531453
    1454 DECLINLINE(PVDIOCTX) vdIoCtxDiscardAlloc(PVBOXHDD pDisk, PCRTRANGE paRanges,
     1454DECLINLINE(PVDIOCTX) vdIoCtxDiscardAlloc(PVDISK pDisk, PCRTRANGE paRanges,
    14551455                                         unsigned cRanges,
    14561456                                         PFNVDASYNCTRANSFERCOMPLETE pfnComplete,
     
    14731473}
    14741474
    1475 DECLINLINE(PVDIOCTX) vdIoCtxChildAlloc(PVBOXHDD pDisk, VDIOCTXTXDIR enmTxDir,
     1475DECLINLINE(PVDIOCTX) vdIoCtxChildAlloc(PVDISK pDisk, VDIOCTXTXDIR enmTxDir,
    14761476                                       uint64_t uOffset, size_t cbTransfer,
    14771477                                       PVDIMAGE pImageStart, PCRTSGBUF pcSgBuf,
     
    15341534}
    15351535
    1536 DECLINLINE(void) vdIoCtxFree(PVBOXHDD pDisk, PVDIOCTX pIoCtx)
     1536DECLINLINE(void) vdIoCtxFree(PVDISK pDisk, PVDIOCTX pIoCtx)
    15371537{
    15381538    Log(("Freeing I/O context %#p\n", pIoCtx));
     
    15491549}
    15501550
    1551 DECLINLINE(void) vdIoTaskFree(PVBOXHDD pDisk, PVDIOTASK pIoTask)
     1551DECLINLINE(void) vdIoTaskFree(PVDISK pDisk, PVDIOTASK pIoTask)
    15521552{
    15531553#ifdef DEBUG
     
    16011601}
    16021602
    1603 DECLINLINE(void) vdIoCtxDefer(PVBOXHDD pDisk, PVDIOCTX pIoCtx)
     1603DECLINLINE(void) vdIoCtxDefer(PVDISK pDisk, PVDIOCTX pIoCtx)
    16041604{
    16051605    LogFlowFunc(("Deferring I/O context pIoCtx=%#p\n", pIoCtx));
     
    17651765 *                   to return the status code for.
    17661766 */
    1767 static int vdDiskProcessWaitingIoCtx(PVBOXHDD pDisk, PVDIOCTX pIoCtxRc)
     1767static int vdDiskProcessWaitingIoCtx(PVDISK pDisk, PVDIOCTX pIoCtxRc)
    17681768{
    17691769    int rc = VERR_VD_ASYNC_IO_IN_PROGRESS;
     
    18501850 * @param   pDisk    The disk structure.
    18511851 */
    1852 static void vdDiskProcessBlockedIoCtx(PVBOXHDD pDisk)
     1852static void vdDiskProcessBlockedIoCtx(PVDISK pDisk)
    18531853{
    18541854    LogFlowFunc(("pDisk=%#p\n", pDisk));
     
    19081908{
    19091909    int rc = VINF_SUCCESS;
    1910     PVBOXHDD pDisk = pIoCtx->pDisk;
     1910    PVDISK pDisk = pIoCtx->pDisk;
    19111911
    19121912    Log(("Defer pIoCtx=%#p\n", pIoCtx));
     
    19411941{
    19421942    int rc = VINF_SUCCESS;
    1943     PVBOXHDD pDisk = pIoCtx->pDisk;
     1943    PVDISK pDisk = pIoCtx->pDisk;
    19441944
    19451945    LogFlowFunc(("pIoCtx=%p\n", pIoCtx));
     
    19641964}
    19651965
    1966 DECLINLINE(bool) vdIoCtxIsDiskLockOwner(PVBOXHDD pDisk, PVDIOCTX pIoCtx)
     1966DECLINLINE(bool) vdIoCtxIsDiskLockOwner(PVDISK pDisk, PVDIOCTX pIoCtx)
    19671967{
    19681968    return pDisk->pIoCtxLockOwner == pIoCtx;
    19691969}
    19701970
    1971 static int vdIoCtxLockDisk(PVBOXHDD pDisk, PVDIOCTX pIoCtx)
     1971static int vdIoCtxLockDisk(PVDISK pDisk, PVDIOCTX pIoCtx)
    19721972{
    19731973    int rc = VINF_SUCCESS;
     
    19881988}
    19891989
    1990 static void vdIoCtxUnlockDisk(PVBOXHDD pDisk, PVDIOCTX pIoCtx, bool fProcessBlockedReqs)
     1990static void vdIoCtxUnlockDisk(PVDISK pDisk, PVDIOCTX pIoCtx, bool fProcessBlockedReqs)
    19911991{
    19921992    RT_NOREF1(pIoCtx);
     
    20122012 * Internal: Reads a given amount of data from the image chain of the disk.
    20132013 **/
    2014 static int vdDiskReadHelper(PVBOXHDD pDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride,
     2014static int vdDiskReadHelper(PVDISK pDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride,
    20152015                            uint64_t uOffset, size_t cbRead, PVDIOCTX pIoCtx, size_t *pcbThisRead)
    20162016{
     
    20562056{
    20572057    int rc;
    2058     PVBOXHDD pDisk                = pIoCtx->pDisk;
     2058    PVDISK pDisk                = pIoCtx->pDisk;
    20592059    size_t cbToRead               = pIoCtx->Req.Io.cbTransfer;
    20602060    uint64_t uOffset              = pIoCtx->Req.Io.uOffset;
     
    22612261 *                                  the read is cut off. A value of 0 disables the cut off.
    22622262 */
    2263 static int vdReadHelperEx(PVBOXHDD pDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride,
     2263static int vdReadHelperEx(PVDISK pDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride,
    22642264                          uint64_t uOffset, void *pvBuf, size_t cbRead,
    22652265                          bool fZeroFreeBlocks, bool fUpdateCache, unsigned cImagesRead)
     
    23012301 * will give us.
    23022302 */
    2303 static int vdReadHelper(PVBOXHDD pDisk, PVDIMAGE pImage, uint64_t uOffset,
     2303static int vdReadHelper(PVDISK pDisk, PVDIMAGE pImage, uint64_t uOffset,
    23042304                        void *pvBuf, size_t cbRead, bool fUpdateCache)
    23052305{
     
    23112311 * internal: mark the disk as not modified.
    23122312 */
    2313 static void vdResetModifiedFlag(PVBOXHDD pDisk)
     2313static void vdResetModifiedFlag(PVDISK pDisk)
    23142314{
    23152315    if (pDisk->uModified & VD_IMAGE_MODIFIED_FLAG)
     
    23362336 * internal: mark the disk as modified.
    23372337 */
    2338 static void vdSetModifiedFlag(PVBOXHDD pDisk)
     2338static void vdSetModifiedFlag(PVDISK pDisk)
    23392339{
    23402340    pDisk->uModified |= VD_IMAGE_MODIFIED_FLAG;
     
    23602360 * write optimizations.
    23612361 */
    2362 static int vdWriteHelperEx(PVBOXHDD pDisk, PVDIMAGE pImage,
     2362static int vdWriteHelperEx(PVDISK pDisk, PVDIMAGE pImage,
    23632363                           PVDIMAGE pImageParentOverride, uint64_t uOffset,
    23642364                           const void *pvBuf, size_t cbWrite,
     
    24002400 * write optimizations.
    24012401 */
    2402 static int vdWriteHelper(PVBOXHDD pDisk, PVDIMAGE pImage, uint64_t uOffset,
     2402static int vdWriteHelper(PVDISK pDisk, PVDIMAGE pImage, uint64_t uOffset,
    24032403                         const void *pvBuf, size_t cbWrite, uint32_t fFlags)
    24042404{
     
    24112411 * to speed up the copy process if possible.
    24122412 */
    2413 static int vdCopyHelper(PVBOXHDD pDiskFrom, PVDIMAGE pImageFrom, PVBOXHDD pDiskTo,
     2413static int vdCopyHelper(PVDISK pDiskFrom, PVDIMAGE pImageFrom, PVDISK pDiskTo,
    24142414                        uint64_t cbSize, unsigned cImagesFromRead, unsigned cImagesToRead,
    24152415                        bool fSuppressRedundantIo, PVDINTERFACEPROGRESS pIfProgress,
     
    25792579 * internal: mark the disk as modified - async version.
    25802580 */
    2581 static int vdSetModifiedFlagAsync(PVBOXHDD pDisk, PVDIOCTX pIoCtx)
     2581static int vdSetModifiedFlagAsync(PVDISK pDisk, PVDIOCTX pIoCtx)
    25822582{
    25832583    int rc = VINF_SUCCESS;
     
    27642764static DECLCALLBACK(int) vdWriteHelperOptimizedAsync(PVDIOCTX pIoCtx)
    27652765{
    2766     PVBOXHDD pDisk = pIoCtx->pDisk;
     2766    PVDISK pDisk = pIoCtx->pDisk;
    27672767    uint64_t uOffset   = pIoCtx->Type.Child.uOffsetSaved;
    27682768    size_t cbThisWrite = pIoCtx->Type.Child.cbTransferParent;
     
    29342934static DECLCALLBACK(int) vdWriteHelperStandardAsync(PVDIOCTX pIoCtx)
    29352935{
    2936     PVBOXHDD pDisk = pIoCtx->pDisk;
     2936    PVDISK pDisk = pIoCtx->pDisk;
    29372937    uint64_t uOffset   = pIoCtx->Type.Child.uOffsetSaved;
    29382938    size_t cbThisWrite = pIoCtx->Type.Child.cbTransferParent;
     
    29992999    uint64_t uOffset = pIoCtx->Req.Io.uOffset;
    30003000    PVDIMAGE pImage  = pIoCtx->Req.Io.pImageCur;
    3001     PVBOXHDD pDisk   = pIoCtx->pDisk;
     3001    PVDISK pDisk   = pIoCtx->pDisk;
    30023002    unsigned fWrite;
    30033003    size_t cbThisWrite;
     
    31763176{
    31773177    int rc = VINF_SUCCESS;
    3178     PVBOXHDD pDisk = pIoCtx->pDisk;
     3178    PVDISK pDisk = pIoCtx->pDisk;
    31793179    PVDIMAGE pImage = pIoCtx->Req.Io.pImageCur;
    31803180
     
    32203220{
    32213221    int rc = VINF_SUCCESS;
    3222     PVBOXHDD pDisk = pIoCtx->pDisk;
     3222    PVDISK pDisk = pIoCtx->pDisk;
    32233223    PVDDISCARDSTATE pDiscard = pDisk->pDiscard;
    32243224    PVDDISCARDBLOCK pBlock = pIoCtx->Req.Discard.pBlock;
     
    32683268 *                             The number of bytes waiting can be less.
    32693269 */
    3270 static int vdDiscardRemoveBlocksAsync(PVBOXHDD pDisk, PVDIOCTX pIoCtx, size_t cbDiscardingNew)
     3270static int vdDiscardRemoveBlocksAsync(PVDISK pDisk, PVDIOCTX pIoCtx, size_t cbDiscardingNew)
    32713271{
    32723272    int rc = VINF_SUCCESS;
     
    33573357static DECLCALLBACK(int) vdDiscardCurrentRangeAsync(PVDIOCTX pIoCtx)
    33583358{
    3359     PVBOXHDD        pDisk         = pIoCtx->pDisk;
     3359    PVDISK        pDisk         = pIoCtx->pDisk;
    33603360    PVDDISCARDSTATE pDiscard      = pDisk->pDiscard;
    33613361    uint64_t        offStart      = pIoCtx->Req.Discard.offCur;
     
    34313431{
    34323432    int rc             = VINF_SUCCESS;
    3433     PVBOXHDD  pDisk    = pIoCtx->pDisk;
     3433    PVDISK  pDisk    = pIoCtx->pDisk;
    34343434    PCRTRANGE paRanges = pIoCtx->Req.Discard.paRanges;
    34353435    unsigned  cRanges  = pIoCtx->Req.Discard.cRanges;
     
    41384138static int vdIoCtxContinue(PVDIOCTX pIoCtx, int rcReq)
    41394139{
    4140     PVBOXHDD pDisk = pIoCtx->pDisk;
     4140    PVDISK pDisk = pIoCtx->pDisk;
    41414141    int rc = VINF_SUCCESS;
    41424142
     
    42384238{
    42394239    int rc = VINF_SUCCESS;
    4240     PVBOXHDD pDisk = pIoCtx->pDisk;
     4240    PVDISK pDisk = pIoCtx->pDisk;
    42414241
    42424242    LogFlowFunc(("pIoStorage=%#p pIoCtx=%#p pfnComplete=%#p pvUser=%#p cbTransfer=%zu rcReq=%Rrc\n",
     
    42984298                               PVDMETAXFER pMetaXfer, int rcReq)
    42994299{
    4300     PVBOXHDD pDisk = pIoStorage->pVDIo->pDisk;
     4300    PVDISK pDisk = pIoStorage->pVDIo->pDisk;
    43014301    RTLISTNODE ListIoCtxWaiting;
    43024302    bool fFlush;
     
    44144414 * @param   pDisk    The disk to process the list for.
    44154415 */
    4416 static void vdIoTaskProcessWaitingList(PVBOXHDD pDisk)
     4416static void vdIoTaskProcessWaitingList(PVDISK pDisk)
    44174417{
    44184418    LogFlowFunc(("pDisk=%#p\n", pDisk));
     
    44594459 * @param   pDisk    The disk.
    44604460 */
    4461 static void vdIoCtxProcessHaltedList(PVBOXHDD pDisk)
     4461static void vdIoCtxProcessHaltedList(PVDISK pDisk)
    44624462{
    44634463    LogFlowFunc(("pDisk=%#p\n", pDisk));
     
    45014501 * @param   pIoCtxRc The I/O context to get the status code from, optional.
    45024502 */
    4503 static int vdDiskUnlock(PVBOXHDD pDisk, PVDIOCTX pIoCtxRc)
     4503static int vdDiskUnlock(PVDISK pDisk, PVDIOCTX pIoCtxRc)
    45044504{
    45054505    int rc = VINF_SUCCESS;
     
    45524552{
    45534553    PVDIOSTORAGE pIoStorage = pIoTask->pIoStorage;
    4554     PVBOXHDD pDisk = pIoStorage->pVDIo->pDisk;
     4554    PVDISK pDisk = pIoStorage->pVDIo->pDisk;
    45554555
    45564556    Log(("Deferring I/O task pIoTask=%p\n", pIoTask));
     
    47544754    int rc = VINF_SUCCESS;
    47554755    PVDIO    pVDIo = (PVDIO)pvUser;
    4756     PVBOXHDD pDisk = pVDIo->pDisk;
     4756    PVDISK pDisk = pVDIo->pDisk;
    47574757
    47584758    LogFlowFunc(("pvUser=%#p pIoStorage=%#p uOffset=%llu pIoCtx=%#p cbRead=%u\n",
     
    48524852    int rc = VINF_SUCCESS;
    48534853    PVDIO    pVDIo = (PVDIO)pvUser;
    4854     PVBOXHDD pDisk = pVDIo->pDisk;
     4854    PVDISK pDisk = pVDIo->pDisk;
    48554855
    48564856    LogFlowFunc(("pvUser=%#p pIoStorage=%#p uOffset=%llu pIoCtx=%#p cbWrite=%u\n",
     
    49524952{
    49534953    PVDIO pVDIo     = (PVDIO)pvUser;
    4954     PVBOXHDD pDisk  = pVDIo->pDisk;
     4954    PVDISK pDisk  = pVDIo->pDisk;
    49554955    int rc = VINF_SUCCESS;
    49564956    RTSGSEG Seg;
     
    50735073{
    50745074    PVDIO    pVDIo = (PVDIO)pvUser;
    5075     PVBOXHDD pDisk = pVDIo->pDisk;
     5075    PVDISK pDisk = pVDIo->pDisk;
    50765076    int rc = VINF_SUCCESS;
    50775077    RTSGSEG Seg;
     
    52295229{
    52305230    PVDIO    pVDIo = (PVDIO)pvUser;
    5231     PVBOXHDD pDisk = pVDIo->pDisk;
     5231    PVDISK pDisk = pVDIo->pDisk;
    52325232    PVDIOSTORAGE pIoStorage;
    52335233
     
    52655265{
    52665266    PVDIO    pVDIo = (PVDIO)pvUser;
    5267     PVBOXHDD pDisk = pVDIo->pDisk;
     5267    PVDISK pDisk = pVDIo->pDisk;
    52685268    int rc = VINF_SUCCESS;
    52695269    PVDIOTASK pIoTask;
     
    53425342{
    53435343    PVDIO    pVDIo = (PVDIO)pvUser;
    5344     PVBOXHDD pDisk = pVDIo->pDisk;
     5344    PVDISK pDisk = pVDIo->pDisk;
    53455345    size_t cbCopied = 0;
    53465346
     
    53625362{
    53635363    PVDIO    pVDIo = (PVDIO)pvUser;
    5364     PVBOXHDD pDisk = pVDIo->pDisk;
     5364    PVDISK pDisk = pVDIo->pDisk;
    53655365    size_t cbCopied = 0;
    53665366
     
    53815381{
    53825382    PVDIO    pVDIo = (PVDIO)pvUser;
    5383     PVBOXHDD pDisk = pVDIo->pDisk;
     5383    PVDISK pDisk = pVDIo->pDisk;
    53845384    size_t cbSet = 0;
    53855385
     
    54025402{
    54035403    PVDIO    pVDIo = (PVDIO)pvUser;
    5404     PVBOXHDD pDisk = pVDIo->pDisk;
     5404    PVDISK pDisk = pVDIo->pDisk;
    54055405    size_t cbCreated = 0;
    54065406
     
    54255425{
    54265426    PVDIO    pVDIo = (PVDIO)pvUser;
    5427     PVBOXHDD pDisk = pVDIo->pDisk;
     5427    PVDISK pDisk = pVDIo->pDisk;
    54285428
    54295429    LogFlowFunc(("pvUser=%#p pIoCtx=%#p rcReq=%Rrc cbCompleted=%zu\n",
     
    54815481    RT_NOREF1(pIoCtx);
    54825482    PVDIO    pVDIo = (PVDIO)pvUser;
    5483     PVBOXHDD pDisk = pVDIo->pDisk;
     5483    PVDISK pDisk = pVDIo->pDisk;
    54845484
    54855485    PVDIMAGE pImage = vdGetImageByNumber(pDisk, VD_LAST_IMAGE);
     
    56545654}
    56555655
    5656 DECLINLINE(int) vdMessageWrapper(PVBOXHDD pDisk, const char *pszFormat, ...)
     5656DECLINLINE(int) vdMessageWrapper(PVDISK pDisk, const char *pszFormat, ...)
    56575657{
    56585658    va_list va;
     
    61426142 * @param   ppDisk          Where to store the reference to HDD container.
    61436143 */
    6144 VBOXDDU_DECL(int) VDCreate(PVDINTERFACE pVDIfsDisk, VDTYPE enmType, PVBOXHDD *ppDisk)
     6144VBOXDDU_DECL(int) VDCreate(PVDINTERFACE pVDIfsDisk, VDTYPE enmType, PVDISK *ppDisk)
    61456145{
    61466146    int rc = VINF_SUCCESS;
    6147     PVBOXHDD pDisk = NULL;
     6147    PVDISK pDisk = NULL;
    61486148
    61496149    LogFlowFunc(("pVDIfsDisk=%#p\n", pVDIfsDisk));
     
    61556155                           rc = VERR_INVALID_PARAMETER);
    61566156
    6157         pDisk = (PVBOXHDD)RTMemAllocZ(sizeof(VBOXHDD));
     6157        pDisk = (PVDISK)RTMemAllocZ(sizeof(VDISK));
    61586158        if (pDisk)
    61596159        {
     
    62256225 * @param   pDisk           Pointer to HDD container.
    62266226 */
    6227 VBOXDDU_DECL(int) VDDestroy(PVBOXHDD pDisk)
     6227VBOXDDU_DECL(int) VDDestroy(PVDISK pDisk)
    62286228{
    62296229    int rc = VINF_SUCCESS;
     
    64116411 * @param   pVDIfsImage     Pointer to the per-image VD interface list.
    64126412 */
    6413 VBOXDDU_DECL(int) VDOpen(PVBOXHDD pDisk, const char *pszBackend,
     6413VBOXDDU_DECL(int) VDOpen(PVDISK pDisk, const char *pszBackend,
    64146414                         const char *pszFilename, unsigned uOpenFlags,
    64156415                         PVDINTERFACE pVDIfsImage)
     
    67386738 * @param   pVDIfsCache     Pointer to the per-cache VD interface list.
    67396739 */
    6740 VBOXDDU_DECL(int) VDCacheOpen(PVBOXHDD pDisk, const char *pszBackend,
     6740VBOXDDU_DECL(int) VDCacheOpen(PVDISK pDisk, const char *pszBackend,
    67416741                              const char *pszFilename, unsigned uOpenFlags,
    67426742                              PVDINTERFACE pVDIfsCache)
     
    69106910}
    69116911
    6912 VBOXDDU_DECL(int) VDFilterAdd(PVBOXHDD pDisk, const char *pszFilter, uint32_t fFlags,
     6912VBOXDDU_DECL(int) VDFilterAdd(PVDISK pDisk, const char *pszFilter, uint32_t fFlags,
    69136913                              PVDINTERFACE pVDIfsFilter)
    69146914{
     
    70217021 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    70227022 */
    7023 VBOXDDU_DECL(int) VDCreateBase(PVBOXHDD pDisk, const char *pszBackend,
     7023VBOXDDU_DECL(int) VDCreateBase(PVDISK pDisk, const char *pszBackend,
    70247024                               const char *pszFilename, uint64_t cbSize,
    70257025                               unsigned uImageFlags, const char *pszComment,
     
    73187318 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    73197319 */
    7320 VBOXDDU_DECL(int) VDCreateDiff(PVBOXHDD pDisk, const char *pszBackend,
     7320VBOXDDU_DECL(int) VDCreateDiff(PVDISK pDisk, const char *pszBackend,
    73217321                               const char *pszFilename, unsigned uImageFlags,
    73227322                               const char *pszComment, PCRTUUID pUuid,
     
    75937593 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    75947594 */
    7595 VBOXDDU_DECL(int) VDCreateCache(PVBOXHDD pDisk, const char *pszBackend,
     7595VBOXDDU_DECL(int) VDCreateCache(PVDISK pDisk, const char *pszBackend,
    75967596                                const char *pszFilename, uint64_t cbSize,
    75977597                                unsigned uImageFlags, const char *pszComment,
     
    78087808 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    78097809 */
    7810 VBOXDDU_DECL(int) VDMerge(PVBOXHDD pDisk, unsigned nImageFrom,
     7810VBOXDDU_DECL(int) VDMerge(PVDISK pDisk, unsigned nImageFrom,
    78117811                          unsigned nImageTo, PVDINTERFACE pVDIfsOperation)
    78127812{
     
    82588258 *                          for the destination operation.
    82598259 */
    8260 VBOXDDU_DECL(int) VDCopyEx(PVBOXHDD pDiskFrom, unsigned nImage, PVBOXHDD pDiskTo,
     8260VBOXDDU_DECL(int) VDCopyEx(PVDISK pDiskFrom, unsigned nImage, PVDISK pDiskTo,
    82618261                           const char *pszBackend, const char *pszFilename,
    82628262                           bool fMoveByRename, uint64_t cbSize,
     
    85898589 *                          for the destination image.
    85908590 */
    8591 VBOXDDU_DECL(int) VDCopy(PVBOXHDD pDiskFrom, unsigned nImage, PVBOXHDD pDiskTo,
     8591VBOXDDU_DECL(int) VDCopy(PVDISK pDiskFrom, unsigned nImage, PVDISK pDiskTo,
    85928592                         const char *pszBackend, const char *pszFilename,
    85938593                         bool fMoveByRename, uint64_t cbSize,
     
    86198619 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    86208620 */
    8621 VBOXDDU_DECL(int) VDCompact(PVBOXHDD pDisk, unsigned nImage,
     8621VBOXDDU_DECL(int) VDCompact(PVDISK pDisk, unsigned nImage,
    86228622                            PVDINTERFACE pVDIfsOperation)
    86238623{
     
    87278727 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    87288728 */
    8729 VBOXDDU_DECL(int) VDResize(PVBOXHDD pDisk, uint64_t cbSize,
     8729VBOXDDU_DECL(int) VDResize(PVDISK pDisk, uint64_t cbSize,
    87308730                           PCVDGEOMETRY pPCHSGeometry,
    87318731                           PCVDGEOMETRY pLCHSGeometry,
     
    88468846}
    88478847
    8848 VBOXDDU_DECL(int) VDPrepareWithFilters(PVBOXHDD pDisk, PVDINTERFACE pVDIfsOperation)
     8848VBOXDDU_DECL(int) VDPrepareWithFilters(PVDISK pDisk, PVDINTERFACE pVDIfsOperation)
    88498849{
    88508850    int rc = VINF_SUCCESS;
     
    90489048 * @param   fDelete         If true, delete the image from the host disk.
    90499049 */
    9050 VBOXDDU_DECL(int) VDClose(PVBOXHDD pDisk, bool fDelete)
     9050VBOXDDU_DECL(int) VDClose(PVDISK pDisk, bool fDelete)
    90519051{
    90529052    int rc = VINF_SUCCESS;
     
    91589158 * @param   fDelete         If true, delete the image from the host disk.
    91599159 */
    9160 VBOXDDU_DECL(int) VDCacheClose(PVBOXHDD pDisk, bool fDelete)
     9160VBOXDDU_DECL(int) VDCacheClose(PVDISK pDisk, bool fDelete)
    91619161{
    91629162    int rc = VINF_SUCCESS;
     
    91989198}
    91999199
    9200 VBOXDDU_DECL(int) VDFilterRemove(PVBOXHDD pDisk, uint32_t fFlags)
     9200VBOXDDU_DECL(int) VDFilterRemove(PVDISK pDisk, uint32_t fFlags)
    92019201{
    92029202    int rc = VINF_SUCCESS;
     
    92569256 * @param   pDisk           Pointer to HDD container.
    92579257 */
    9258 VBOXDDU_DECL(int) VDCloseAll(PVBOXHDD pDisk)
     9258VBOXDDU_DECL(int) VDCloseAll(PVDISK pDisk)
    92599259{
    92609260    int rc = VINF_SUCCESS;
     
    93209320 * @param   pDisk           Pointer to HDD container.
    93219321 */
    9322 VBOXDDU_DECL(int) VDFilterRemoveAll(PVBOXHDD pDisk)
     9322VBOXDDU_DECL(int) VDFilterRemoveAll(PVDISK pDisk)
    93239323{
    93249324    int rc = VINF_SUCCESS;
     
    93749374 * @param   cbRead          Number of bytes to read.
    93759375 */
    9376 VBOXDDU_DECL(int) VDRead(PVBOXHDD pDisk, uint64_t uOffset, void *pvBuf,
     9376VBOXDDU_DECL(int) VDRead(PVDISK pDisk, uint64_t uOffset, void *pvBuf,
    93779377                         size_t cbRead)
    93789378{
     
    94439443 * @param   cbWrite         Number of bytes to write.
    94449444 */
    9445 VBOXDDU_DECL(int) VDWrite(PVBOXHDD pDisk, uint64_t uOffset, const void *pvBuf,
     9445VBOXDDU_DECL(int) VDWrite(PVDISK pDisk, uint64_t uOffset, const void *pvBuf,
    94469446                          size_t cbWrite)
    94479447{
     
    95149514 * @param   pDisk           Pointer to HDD container.
    95159515 */
    9516 VBOXDDU_DECL(int) VDFlush(PVBOXHDD pDisk)
     9516VBOXDDU_DECL(int) VDFlush(PVDISK pDisk)
    95179517{
    95189518    int rc = VINF_SUCCESS;
     
    95689568 * @param   pDisk           Pointer to HDD container.
    95699569 */
    9570 VBOXDDU_DECL(unsigned) VDGetCount(PVBOXHDD pDisk)
     9570VBOXDDU_DECL(unsigned) VDGetCount(PVDISK pDisk)
    95719571{
    95729572    unsigned cImages;
     
    96059605 * @param   pDisk           Pointer to HDD container.
    96069606 */
    9607 VBOXDDU_DECL(bool) VDIsReadOnly(PVBOXHDD pDisk)
     9607VBOXDDU_DECL(bool) VDIsReadOnly(PVDISK pDisk)
    96089608{
    96099609    bool fReadOnly;
     
    96489648 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    96499649 */
    9650 VBOXDDU_DECL(uint32_t) VDGetSectorSize(PVBOXHDD pDisk, unsigned nImage)
     9650VBOXDDU_DECL(uint32_t) VDGetSectorSize(PVDISK pDisk, unsigned nImage)
    96519651{
    96529652    uint64_t cbSector;
     
    96889688 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    96899689 */
    9690 VBOXDDU_DECL(uint64_t) VDGetSize(PVBOXHDD pDisk, unsigned nImage)
     9690VBOXDDU_DECL(uint64_t) VDGetSize(PVDISK pDisk, unsigned nImage)
    96919691{
    96929692    uint64_t cbSize;
     
    97289728 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    97299729 */
    9730 VBOXDDU_DECL(uint64_t) VDGetFileSize(PVBOXHDD pDisk, unsigned nImage)
     9730VBOXDDU_DECL(uint64_t) VDGetFileSize(PVDISK pDisk, unsigned nImage)
    97319731{
    97329732    uint64_t cbSize;
     
    97709770 * @param   pPCHSGeometry   Where to store PCHS geometry. Not NULL.
    97719771 */
    9772 VBOXDDU_DECL(int) VDGetPCHSGeometry(PVBOXHDD pDisk, unsigned nImage,
     9772VBOXDDU_DECL(int) VDGetPCHSGeometry(PVDISK pDisk, unsigned nImage,
    97739773                                    PVDGEOMETRY pPCHSGeometry)
    97749774{
     
    98349834 * @param   pPCHSGeometry   Where to load PCHS geometry from. Not NULL.
    98359835 */
    9836 VBOXDDU_DECL(int) VDSetPCHSGeometry(PVBOXHDD pDisk, unsigned nImage,
     9836VBOXDDU_DECL(int) VDSetPCHSGeometry(PVDISK pDisk, unsigned nImage,
    98379837                                    PCVDGEOMETRY pPCHSGeometry)
    98389838{
     
    99389938 * @param   pLCHSGeometry   Where to store LCHS geometry. Not NULL.
    99399939 */
    9940 VBOXDDU_DECL(int) VDGetLCHSGeometry(PVBOXHDD pDisk, unsigned nImage,
     9940VBOXDDU_DECL(int) VDGetLCHSGeometry(PVDISK pDisk, unsigned nImage,
    99419941                                    PVDGEOMETRY pLCHSGeometry)
    99429942{
     
    1000210002 * @param   pLCHSGeometry   Where to load LCHS geometry from. Not NULL.
    1000310003 */
    10004 VBOXDDU_DECL(int) VDSetLCHSGeometry(PVBOXHDD pDisk, unsigned nImage,
     10004VBOXDDU_DECL(int) VDSetLCHSGeometry(PVDISK pDisk, unsigned nImage,
    1000510005                                    PCVDGEOMETRY pLCHSGeometry)
    1000610006{
     
    1010810108 *                          with VDRegionListFree().
    1010910109 */
    10110 VBOXDDU_DECL(int) VDQueryRegions(PVBOXHDD pDisk, unsigned nImage, uint32_t fFlags,
     10110VBOXDDU_DECL(int) VDQueryRegions(PVDISK pDisk, unsigned nImage, uint32_t fFlags,
    1011110111                                 PPVDREGIONLIST ppRegionList)
    1011210112{
     
    1021910219 * @param   puVersion       Where to store the image version.
    1022010220 */
    10221 VBOXDDU_DECL(int) VDGetVersion(PVBOXHDD pDisk, unsigned nImage,
     10221VBOXDDU_DECL(int) VDGetVersion(PVDISK pDisk, unsigned nImage,
    1022210222                               unsigned *puVersion)
    1022310223{
     
    1026810268 * @param   pBackendInfo    Where to store the backend information.
    1026910269 */
    10270 VBOXDDU_DECL(int) VDBackendInfoSingle(PVBOXHDD pDisk, unsigned nImage,
     10270VBOXDDU_DECL(int) VDBackendInfoSingle(PVDISK pDisk, unsigned nImage,
    1027110271                                      PVDBACKENDINFO pBackendInfo)
    1027210272{
     
    1032010320 * @param   puImageFlags    Where to store the image flags.
    1032110321 */
    10322 VBOXDDU_DECL(int) VDGetImageFlags(PVBOXHDD pDisk, unsigned nImage,
     10322VBOXDDU_DECL(int) VDGetImageFlags(PVDISK pDisk, unsigned nImage,
    1032310323                                  unsigned *puImageFlags)
    1032410324{
     
    1036910369 * @param   puOpenFlags     Where to store the image open flags.
    1037010370 */
    10371 VBOXDDU_DECL(int) VDGetOpenFlags(PVBOXHDD pDisk, unsigned nImage,
     10371VBOXDDU_DECL(int) VDGetOpenFlags(PVDISK pDisk, unsigned nImage,
    1037210372                                 unsigned *puOpenFlags)
    1037310373{
     
    1042010420 * @param   uOpenFlags      Image file open mode, see VD_OPEN_FLAGS_* constants.
    1042110421 */
    10422 VBOXDDU_DECL(int) VDSetOpenFlags(PVBOXHDD pDisk, unsigned nImage,
     10422VBOXDDU_DECL(int) VDSetOpenFlags(PVDISK pDisk, unsigned nImage,
    1042310423                                 unsigned uOpenFlags)
    1042410424{
     
    1048010480 * @param   cbFilename      Size of buffer pszFilename points to.
    1048110481 */
    10482 VBOXDDU_DECL(int) VDGetFilename(PVBOXHDD pDisk, unsigned nImage,
     10482VBOXDDU_DECL(int) VDGetFilename(PVDISK pDisk, unsigned nImage,
    1048310483                                char *pszFilename, unsigned cbFilename)
    1048410484{
     
    1054510545 * @param   cbComment       The size of pszComment buffer. 0 is ok.
    1054610546 */
    10547 VBOXDDU_DECL(int) VDGetComment(PVBOXHDD pDisk, unsigned nImage,
     10547VBOXDDU_DECL(int) VDGetComment(PVDISK pDisk, unsigned nImage,
    1054810548                               char *pszComment, unsigned cbComment)
    1054910549{
     
    1059810598 * @param   pszComment      New comment string (UTF-8). NULL is allowed to reset the comment.
    1059910599 */
    10600 VBOXDDU_DECL(int) VDSetComment(PVBOXHDD pDisk, unsigned nImage,
     10600VBOXDDU_DECL(int) VDSetComment(PVDISK pDisk, unsigned nImage,
    1060110601                               const char *pszComment)
    1060210602{
     
    1064810648 * @param   pUuid           Where to store the image creation UUID.
    1064910649 */
    10650 VBOXDDU_DECL(int) VDGetUuid(PVBOXHDD pDisk, unsigned nImage, PRTUUID pUuid)
     10650VBOXDDU_DECL(int) VDGetUuid(PVDISK pDisk, unsigned nImage, PRTUUID pUuid)
    1065110651{
    1065210652    int rc;
     
    1069510695 * @param   pUuid           New UUID of the image. If NULL, a new UUID is created.
    1069610696 */
    10697 VBOXDDU_DECL(int) VDSetUuid(PVBOXHDD pDisk, unsigned nImage, PCRTUUID pUuid)
     10697VBOXDDU_DECL(int) VDSetUuid(PVDISK pDisk, unsigned nImage, PCRTUUID pUuid)
    1069810698{
    1069910699    int rc;
     
    1074810748 * @param   pUuid           Where to store the image modification UUID.
    1074910749 */
    10750 VBOXDDU_DECL(int) VDGetModificationUuid(PVBOXHDD pDisk, unsigned nImage, PRTUUID pUuid)
     10750VBOXDDU_DECL(int) VDGetModificationUuid(PVDISK pDisk, unsigned nImage, PRTUUID pUuid)
    1075110751{
    1075210752    int rc = VINF_SUCCESS;
     
    1079610796 * @param   pUuid           New modification UUID of the image. If NULL, a new UUID is created.
    1079710797 */
    10798 VBOXDDU_DECL(int) VDSetModificationUuid(PVBOXHDD pDisk, unsigned nImage, PCRTUUID pUuid)
     10798VBOXDDU_DECL(int) VDSetModificationUuid(PVDISK pDisk, unsigned nImage, PCRTUUID pUuid)
    1079910799{
    1080010800    int rc;
     
    1085110851 * @param   pUuid           Where to store the parent image UUID.
    1085210852 */
    10853 VBOXDDU_DECL(int) VDGetParentUuid(PVBOXHDD pDisk, unsigned nImage,
     10853VBOXDDU_DECL(int) VDGetParentUuid(PVDISK pDisk, unsigned nImage,
    1085410854                                  PRTUUID pUuid)
    1085510855{
     
    1089810898 * @param   pUuid           New parent UUID of the image. If NULL, a new UUID is created.
    1089910899 */
    10900 VBOXDDU_DECL(int) VDSetParentUuid(PVBOXHDD pDisk, unsigned nImage,
     10900VBOXDDU_DECL(int) VDSetParentUuid(PVDISK pDisk, unsigned nImage,
    1090110901                                  PCRTUUID pUuid)
    1090210902{
     
    1095010950 * @param   pDisk           Pointer to HDD container.
    1095110951 */
    10952 VBOXDDU_DECL(void) VDDumpImages(PVBOXHDD pDisk)
     10952VBOXDDU_DECL(void) VDDumpImages(PVDISK pDisk)
    1095310953{
    1095410954    int rc2;
     
    1098510985
    1098610986
    10987 VBOXDDU_DECL(int) VDDiscardRanges(PVBOXHDD pDisk, PCRTRANGE paRanges, unsigned cRanges)
     10987VBOXDDU_DECL(int) VDDiscardRanges(PVDISK pDisk, PCRTRANGE paRanges, unsigned cRanges)
    1098810988{
    1098910989    int rc;
     
    1104311043
    1104411044
    11045 VBOXDDU_DECL(int) VDAsyncRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead,
     11045VBOXDDU_DECL(int) VDAsyncRead(PVDISK pDisk, uint64_t uOffset, size_t cbRead,
    1104611046                              PCRTSGBUF pcSgBuf,
    1104711047                              PFNVDASYNCTRANSFERCOMPLETE pfnComplete,
     
    1111511115
    1111611116
    11117 VBOXDDU_DECL(int) VDAsyncWrite(PVBOXHDD pDisk, uint64_t uOffset, size_t cbWrite,
     11117VBOXDDU_DECL(int) VDAsyncWrite(PVDISK pDisk, uint64_t uOffset, size_t cbWrite,
    1111811118                               PCRTSGBUF pcSgBuf,
    1111911119                               PFNVDASYNCTRANSFERCOMPLETE pfnComplete,
     
    1118511185
    1118611186
    11187 VBOXDDU_DECL(int) VDAsyncFlush(PVBOXHDD pDisk, PFNVDASYNCTRANSFERCOMPLETE pfnComplete,
     11187VBOXDDU_DECL(int) VDAsyncFlush(PVDISK pDisk, PFNVDASYNCTRANSFERCOMPLETE pfnComplete,
    1118811188                               void *pvUser1, void *pvUser2)
    1118911189{
     
    1124011240}
    1124111241
    11242 VBOXDDU_DECL(int) VDAsyncDiscardRanges(PVBOXHDD pDisk, PCRTRANGE paRanges, unsigned cRanges,
     11242VBOXDDU_DECL(int) VDAsyncDiscardRanges(PVDISK pDisk, PCRTRANGE paRanges, unsigned cRanges,
    1124311243                                       PFNVDASYNCTRANSFERCOMPLETE pfnComplete,
    1124411244                                       void *pvUser1, void *pvUser2)
  • trunk/src/VBox/Storage/VDVfs.cpp

    r62482 r66250  
    4343{
    4444    /** The volume the VFS file belongs to. */
    45     PVBOXHDD       pDisk;
     45    PVDISK         pDisk;
    4646    /** Current position. */
    4747    uint64_t       offCurPos;
     
    6161 * @param   cbRead   Amount of bytes to read.
    6262 */
    63 static int vdReadHelper(PVBOXHDD pDisk, uint64_t off, void *pvBuf, size_t cbRead)
     63static int vdReadHelper(PVDISK pDisk, uint64_t off, void *pvBuf, size_t cbRead)
    6464{
    6565    int rc = VINF_SUCCESS;
     
    129129 * @param   cbWrite  Amount of bytes to write.
    130130 */
    131 static int vdWriteHelper(PVBOXHDD pDisk, uint64_t off, const void *pvBuf, size_t cbWrite)
     131static int vdWriteHelper(PVDISK pDisk, uint64_t off, const void *pvBuf, size_t cbWrite)
    132132{
    133133    int rc = VINF_SUCCESS;
     
    520520
    521521
    522 VBOXDDU_DECL(int) VDCreateVfsFileFromDisk(PVBOXHDD pDisk, uint32_t fFlags,
     522VBOXDDU_DECL(int) VDCreateVfsFileFromDisk(PVDISK pDisk, uint32_t fFlags,
    523523                                          PRTVFSFILE phVfsFile)
    524524{
  • trunk/src/VBox/Storage/VMDK.cpp

    r66110 r66250  
    33483348 * Internal: create VMDK images for raw disk/partition access.
    33493349 */
    3350 static int vmdkCreateRawImage(PVMDKIMAGE pImage, const PVBOXHDDRAW pRaw,
     3350static int vmdkCreateRawImage(PVMDKIMAGE pImage, const PVDISKRAW pRaw,
    33513351                              uint64_t cbSize)
    33523352{
     
    33543354    PVMDKEXTENT pExtent;
    33553355
    3356     if (pRaw->uFlags & VBOXHDDRAW_DISK)
     3356    if (pRaw->uFlags & VDISKRAW_DISK)
    33573357    {
    33583358        /* Full raw disk access. This requires setting up a descriptor
     
    33833383        pExtent->cNominalSectors = VMDK_BYTE2SECTOR(cbSize);
    33843384        pExtent->uSectorOffset = 0;
    3385         pExtent->enmAccess = (pRaw->uFlags & VBOXHDDRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;
     3385        pExtent->enmAccess = (pRaw->uFlags & VDISKRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;
    33863386        pExtent->fMetaDirty = false;
    33873387
     
    34063406        for (unsigned i = 0; i < pRaw->cPartDescs; i++)
    34073407        {
    3408             PVBOXHDDRAWPARTDESC pPart = &pRaw->pPartDescs[i];
     3408            PVDISKRAWPARTDESC pPart = &pRaw->pPartDescs[i];
    34093409            if (uStart > pPart->uStart)
    34103410                return vdIfError(pImage->pIfError, VERR_INVALID_PARAMETER, RT_SRC_POS,
     
    34523452        for (unsigned i = 0; i < pRaw->cPartDescs; i++)
    34533453        {
    3454             PVBOXHDDRAWPARTDESC pPart = &pRaw->pPartDescs[i];
     3454            PVDISKRAWPARTDESC pPart = &pRaw->pPartDescs[i];
    34553455            pExtent = &pImage->pExtents[cExtents++];
    34563456
     
    35273527                    pExtent->cNominalSectors = VMDK_BYTE2SECTOR(pPart->cbData);
    35283528                    pExtent->uSectorOffset = VMDK_BYTE2SECTOR(pPart->uStartOffset);
    3529                     pExtent->enmAccess = (pPart->uFlags & VBOXHDDRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;
     3529                    pExtent->enmAccess = (pPart->uFlags & VDISKRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;
    35303530                    pExtent->fMetaDirty = false;
    35313531
     
    35643564
    35653565    rc = vmdkDescBaseSetStr(pImage, &pImage->Descriptor, "createType",
    3566                             (pRaw->uFlags & VBOXHDDRAW_DISK) ?
     3566                            (pRaw->uFlags & VDISKRAW_DISK) ?
    35673567                            "fullDevice" : "partitionedDevice");
    35683568    if (RT_FAILURE(rc))
     
    39473947        {
    39483948            /* Raw disk image (includes raw partition). */
    3949             const PVBOXHDDRAW pRaw = (const PVBOXHDDRAW)pszComment;
     3949            const PVDISKRAW pRaw = (const PVDISKRAW)pszComment;
    39503950            /* As the comment is misused, zap it so that no garbage comment
    39513951             * is set below. */
  • trunk/src/VBox/Storage/testcase/tstVD.cpp

    r62729 r66250  
    6767{
    6868    int rc;
    69     PVBOXHDD pVD = NULL;
     69    PVDISK pVD = NULL;
    7070    VDGEOMETRY       PCHS = { 0, 0, 0 };
    7171    VDGEOMETRY       LCHS = { 0, 0, 0 };
     
    122122{
    123123    int rc;
    124     PVBOXHDD         pVD = NULL;
     124    PVDISK         pVD = NULL;
    125125    PVDINTERFACE     pVDIfs = NULL;
    126126    VDINTERFACEERROR VDIfError;
     
    454454}
    455455
    456 static void writeSegmentsToDisk(PVBOXHDD pVD, void *pvBuf, PSEGMENT pSegment)
     456static void writeSegmentsToDisk(PVDISK pVD, void *pvBuf, PSEGMENT pSegment)
    457457{
    458458    while (pSegment->u32Length)
     
    465465}
    466466
    467 static int readAndCompareSegments(PVBOXHDD pVD, void *pvBuf, PSEGMENT pSegment)
     467static int readAndCompareSegments(PVDISK pVD, void *pvBuf, PSEGMENT pSegment)
    468468{
    469469    while (pSegment->u32Length)
     
    501501{
    502502    int rc;
    503     PVBOXHDD pVD = NULL;
     503    PVDISK pVD = NULL;
    504504    char *pszFormat;
    505505    VDTYPE enmType = VDTYPE_INVALID;
     
    625625{
    626626    int rc;
    627     PVBOXHDD pVD = NULL;
     627    PVDISK pVD = NULL;
    628628    VDGEOMETRY PCHS = { 0, 0, 0 };
    629629    VDGEOMETRY LCHS = { 0, 0, 0 };
     
    704704{
    705705    int rc;
    706     PVBOXHDD pVD = NULL;
     706    PVDISK pVD = NULL;
    707707    PVDINTERFACE     pVDIfs = NULL;
    708708    VDINTERFACEERROR VDIfError;
     
    752752        return rc;
    753753
    754     PVBOXHDD pVD = NULL;
     754    PVDISK pVD = NULL;
    755755    PVDINTERFACE     pVDIfs = NULL;
    756756    VDINTERFACEERROR VDIfError;
  • trunk/src/VBox/Storage/testcase/tstVDFill.cpp

    r62729 r66250  
    6060{
    6161    int rc;
    62     PVBOXHDD pVD = NULL;
     62    PVDISK pVD = NULL;
    6363    VDGEOMETRY       PCHS = { 0, 0, 0 };
    6464    VDGEOMETRY       LCHS = { 0, 0, 0 };
  • trunk/src/VBox/Storage/testcase/tstVDIo.cpp

    r65638 r66250  
    9999    char          *pszName;
    100100    /** HDD handle to operate on. */
    101     PVBOXHDD       pVD;
     101    PVDISK       pVD;
    102102    /** Memory disk used for data verification. */
    103103    PVDMEMDISK     pMemDiskVerify;
     
    182182    /** S/G Buffer */
    183183    RTSGBUF       SgBuf;
    184     /** Data segment */
    185     RTSGSEG       DataSeg;
    186184    /** Flag whether the request is outstanding or not. */
    187185    volatile bool fOutstanding;
    188186    /** Buffer to use for reads. */
    189187    void          *pvBufRead;
     188    /** Contiguous buffer pointer backing the segments. */
     189    void          *pvBuf;
    190190    /** Opaque user data. */
    191191    void          *pvUser;
     192    /** Number of segments used for the data buffer. */
     193    uint32_t      cSegs;
     194    /** Array of data segments. */
     195    RTSGSEG       aSegs[10];
    192196} VDIOREQ, *PVDIOREQ;
    193197
     
    209213    /** Chance in percent to get a write. */
    210214    unsigned    uWriteChance;
     215    /** Maximum number of segments to create for one request. */
     216    uint32_t    cSegsMax;
    211217    /** Pointer to the I/O data generator. */
    212218    PVDIORND    pIoRnd;
     
    532538}
    533539
    534 static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint64_t cbIo,
    535                            size_t cbBlkSize, uint64_t offStart, uint64_t offEnd,
     540static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint32_t cSegsMax,
     541                           uint64_t cbIo, size_t cbBlkSize, uint64_t offStart, uint64_t offEnd,
    536542                           unsigned uWriteChance, PVDPATTERN pPattern);
    537543static bool tstVDIoTestRunning(PVDIOTEST pIoTest);
     
    756762
    757763        RTTestSub(pGlob->hTest, "Basic I/O");
    758         rc = tstVDIoTestInit(&IoTest, pGlob, fRandomAcc, cbIo, cbBlkSize, offStart, offEnd, uWriteChance, pPattern);
     764        rc = tstVDIoTestInit(&IoTest, pGlob, fRandomAcc, 5, cbIo, cbBlkSize, offStart, offEnd, uWriteChance, pPattern);
    759765        if (RT_SUCCESS(rc))
    760766        {
     
    804810                                        case VDIOREQTXDIR_READ:
    805811                                        {
    806                                             rc = VDRead(pDisk->pVD, paIoReq[idx].off, paIoReq[idx].DataSeg.pvSeg, paIoReq[idx].cbReq);
     812                                            rc = VDRead(pDisk->pVD, paIoReq[idx].off, paIoReq[idx].aSegs[0].pvSeg, paIoReq[idx].cbReq);
    807813
    808814                                            if (RT_SUCCESS(rc)
     
    810816                                            {
    811817                                                RTSGBUF SgBuf;
    812                                                 RTSgBufInit(&SgBuf, &paIoReq[idx].DataSeg, 1);
     818                                                RTSgBufInit(&SgBuf, &paIoReq[idx].aSegs[0], paIoReq[idx].cSegs);
    813819
    814820                                                if (VDMemDiskCmp(pDisk->pMemDiskVerify, paIoReq[idx].off, paIoReq[idx].cbReq, &SgBuf))
     
    822828                                        case VDIOREQTXDIR_WRITE:
    823829                                        {
    824                                             rc = VDWrite(pDisk->pVD, paIoReq[idx].off, paIoReq[idx].DataSeg.pvSeg, paIoReq[idx].cbReq);
     830                                            rc = VDWrite(pDisk->pVD, paIoReq[idx].off, paIoReq[idx].aSegs[0].pvSeg, paIoReq[idx].cbReq);
    825831
    826832                                            if (RT_SUCCESS(rc)
     
    828834                                            {
    829835                                                RTSGBUF SgBuf;
    830                                                 RTSgBufInit(&SgBuf, &paIoReq[idx].DataSeg, 1);
     836                                                RTSgBufInit(&SgBuf, &paIoReq[idx].aSegs[0], paIoReq[idx].cSegs);
    831837                                                rc = VDMemDiskWrite(pDisk->pMemDiskVerify, paIoReq[idx].off, paIoReq[idx].cbReq, &SgBuf);
    832838                                            }
     
    23712377}
    23722378
    2373 static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint64_t cbIo,
    2374                            size_t cbBlkSize, uint64_t offStart, uint64_t offEnd,
     2379static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint32_t cSegsMax,
     2380                           uint64_t cbIo, size_t cbBlkSize, uint64_t offStart, uint64_t offEnd,
    23752381                           unsigned uWriteChance, PVDPATTERN pPattern)
    23762382{
     
    23842390    pIoTest->offEnd        = offEnd;
    23852391    pIoTest->uWriteChance  = uWriteChance;
     2392    pIoTest->cSegsMax      = cSegsMax;
    23862393    pIoTest->pIoRnd        = pGlob->pIoRnd;
    23872394    pIoTest->pPattern      = pPattern;
     
    24242431}
    24252432
     2433static uint32_t tstVDIoTestReqInitSegments(PVDIOTEST pIoTest, PRTSGSEG paSegs, uint32_t cSegs, void *pvBuf, size_t cbBuf)
     2434{
     2435    uint8_t *pbBuf = (uint8_t *)pvBuf;
     2436    size_t cSectorsLeft = cbBuf / 512;
     2437    uint32_t iSeg = 0;
     2438
     2439    /* Init all but the last segment which needs to take the rest. */
     2440    while (   iSeg < cSegs - 1
     2441           && cSectorsLeft)
     2442    {
     2443        uint32_t cThisSectors = VDIoRndGetU32Ex(pIoTest->pIoRnd, 1, cSectorsLeft / 2);
     2444        size_t cbThisBuf = cThisSectors * 512;
     2445
     2446        paSegs[iSeg].pvSeg = pbBuf;
     2447        paSegs[iSeg].cbSeg = cbThisBuf;
     2448        pbBuf        += cbThisBuf;
     2449        cSectorsLeft -= cThisSectors;
     2450        iSeg++;
     2451    }
     2452
     2453    if (cSectorsLeft)
     2454    {
     2455        paSegs[iSeg].pvSeg = pbBuf;
     2456        paSegs[iSeg].cbSeg = cSectorsLeft * 512;
     2457        iSeg++;
     2458    }
     2459
     2460    return iSeg;
     2461}
     2462
    24262463/**
    24272464 * Returns true with the given chance in percent.
     
    24472484        pIoReq->cbReq = RT_MIN(pIoTest->cbBlkIo, pIoTest->cbIo);
    24482485        pIoTest->cbIo -= pIoReq->cbReq;
    2449         pIoReq->DataSeg.cbSeg = pIoReq->cbReq;
     2486
     2487        void *pvBuf = NULL;
    24502488
    24512489        if (pIoReq->enmTxDir == VDIOREQTXDIR_WRITE)
    24522490        {
    24532491            if (pIoTest->pPattern)
    2454                 rc = tstVDIoPatternGetBuffer(pIoTest->pPattern, &pIoReq->DataSeg.pvSeg, pIoReq->cbReq);
     2492                rc = tstVDIoPatternGetBuffer(pIoTest->pPattern, &pvBuf, pIoReq->cbReq);
    24552493            else
    2456                 rc = VDIoRndGetBuffer(pIoTest->pIoRnd, &pIoReq->DataSeg.pvSeg, pIoReq->cbReq);
     2494                rc = VDIoRndGetBuffer(pIoTest->pIoRnd, &pvBuf, pIoReq->cbReq);
    24572495            AssertRC(rc);
    24582496        }
     
    24602498        {
    24612499            /* Read */
    2462             pIoReq->DataSeg.pvSeg = pIoReq->pvBufRead;
     2500            pvBuf = pIoReq->pvBufRead;
    24632501        }
    24642502
    24652503        if (RT_SUCCESS(rc))
    24662504        {
    2467             RTSgBufInit(&pIoReq->SgBuf, &pIoReq->DataSeg, 1);
     2505            pIoReq->pvBuf = pvBuf;
     2506            uint32_t cSegsMax = VDIoRndGetU32Ex(pIoTest->pIoRnd, 1, RT_MIN(pIoTest->cSegsMax, RT_ELEMENTS(pIoReq->aSegs)));
     2507            pIoReq->cSegs = tstVDIoTestReqInitSegments(pIoTest, &pIoReq->aSegs[0], cSegsMax, pvBuf, pIoReq->cbReq);
     2508            RTSgBufInit(&pIoReq->SgBuf, &pIoReq->aSegs[0], pIoReq->cSegs);
    24682509
    24692510            if (pIoTest->fRandomAccess)
     
    25472588            {
    25482589                RTCritSectEnter(&pDisk->CritSectVerify);
    2549                 RTSgBufReset(&pIoReq->SgBuf);
     2590
     2591                RTSGBUF SgBufCmp;
     2592                RTSGSEG SegCmp;
     2593                SegCmp.pvSeg = pIoReq->pvBuf;
     2594                SegCmp.cbSeg = pIoReq->cbReq;
     2595                RTSgBufInit(&SgBufCmp, &SegCmp, 1);
    25502596
    25512597                if (VDMemDiskCmp(pDisk->pMemDiskVerify, pIoReq->off, pIoReq->cbReq,
    2552                                  &pIoReq->SgBuf))
     2598                                 &SgBufCmp))
    25532599                    RTTestFailed(pDisk->pTestGlob->hTest, "Corrupted disk at offset %llu!\n", pIoReq->off);
    25542600                RTCritSectLeave(&pDisk->CritSectVerify);
     
    25582604            {
    25592605                RTCritSectEnter(&pDisk->CritSectVerify);
    2560                 RTSgBufReset(&pIoReq->SgBuf);
     2606
     2607                RTSGBUF SgBuf;
     2608                RTSGSEG Seg;
     2609                Seg.pvSeg = pIoReq->pvBuf;
     2610                Seg.cbSeg = pIoReq->cbReq;
     2611                RTSgBufInit(&SgBuf, &Seg, 1);
    25612612
    25622613                int rc = VDMemDiskWrite(pDisk->pMemDiskVerify, pIoReq->off, pIoReq->cbReq,
    2563                                         &pIoReq->SgBuf);
     2614                                        &SgBuf);
    25642615                AssertRC(rc);
    25652616                RTCritSectLeave(&pDisk->CritSectVerify);
  • trunk/src/VBox/Storage/testcase/tstVDSnap.cpp

    r62729 r66250  
    125125}
    126126
    127 static int tstVDSnapWrite(PVBOXHDD pVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk, bool fInit)
     127static int tstVDSnapWrite(PVDISK pVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk, bool fInit)
    128128{
    129129    RT_NOREF1(cbDisk);
     
    152152}
    153153
    154 static int tstVDSnapReadVerify(PVBOXHDD pVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk)
     154static int tstVDSnapReadVerify(PVDISK pVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk)
    155155{
    156156    RT_NOREF1(cbDisk);
     
    218218{
    219219    int rc;
    220     PVBOXHDD pVD = NULL;
     220    PVDISK pVD = NULL;
    221221    VDGEOMETRY       PCHS = { 0, 0, 0 };
    222222    VDGEOMETRY       LCHS = { 0, 0, 0 };
  • trunk/src/VBox/Storage/testcase/vbox-img.cpp

    r66249 r66250  
    270270    }
    271271
    272     PVBOXHDD pVD = NULL;
     272    PVDISK pVD = NULL;
    273273    rc = VDCreate(pVDIfs, enmType, &pVD);
    274274    if (RT_FAILURE(rc))
     
    406406    }
    407407
    408     PVBOXHDD pVD = NULL;
     408    PVDISK pVD = NULL;
    409409    rc = VDCreate(pVDIfs, enmType, &pVD);
    410410    if (RT_FAILURE(rc))
     
    10201020    const char *pszDstFormat = NULL;
    10211021    const char *pszVariant = NULL;
    1022     PVBOXHDD pSrcDisk = NULL;
    1023     PVBOXHDD pDstDisk = NULL;
     1022    PVDISK pSrcDisk = NULL;
     1023    PVDISK pDstDisk = NULL;
    10241024    unsigned uImageFlags = VD_IMAGE_FLAGS_NONE;
    10251025    PVDINTERFACE pIfsImageInput = NULL;
     
    12591259{
    12601260    int rc = VINF_SUCCESS;
    1261     PVBOXHDD pDisk = NULL;
     1261    PVDISK pDisk = NULL;
    12621262    const char *pszFilename = NULL;
    12631263
     
    13181318{
    13191319    int rc = VINF_SUCCESS;
    1320     PVBOXHDD pDisk = (PVBOXHDD)pvUser;
     1320    PVDISK pDisk = (PVDISK)pvUser;
    13211321
    13221322    /* Take shortcut if possible. */
     
    13771377static DECLCALLBACK(int) vboximgDvmWrite(void *pvUser, uint64_t off, const void *pvBuf, size_t cbWrite)
    13781378{
    1379     PVBOXHDD pDisk = (PVBOXHDD)pvUser;
     1379    PVDISK pDisk = (PVDISK)pvUser;
    13801380    return VDWrite(pDisk, off, pvBuf, cbWrite);
    13811381}
     
    14091409{
    14101410    int rc = VINF_SUCCESS;
    1411     PVBOXHDD pDisk = NULL;
     1411    PVDISK pDisk = NULL;
    14121412    const char *pszFilename = NULL;
    14131413    bool fFilesystemAware = false;
     
    15901590{
    15911591    int rc = VINF_SUCCESS;
    1592     PVBOXHDD pDisk = NULL;
     1592    PVDISK pDisk = NULL;
    15931593    const char *pszFilename = NULL;
    15941594    uint64_t cbSize = 0;
     
    16861686{
    16871687    int rc = VINF_SUCCESS;
    1688     PVBOXHDD pDisk = NULL;
     1688    PVDISK pDisk = NULL;
    16891689    const char *pszFilename = NULL;
    16901690    const char *pszBackend  = "VDI";
     
    18541854{
    18551855    int rc = VINF_SUCCESS;
    1856     PVBOXHDD pDisk = NULL;
     1856    PVDISK pDisk = NULL;
    18571857    const char *pszFilename = NULL;
    18581858
     
    19111911{
    19121912    int rc = VINF_SUCCESS;
    1913     PVBOXHDD pDisk = NULL;
     1913    PVDISK pDisk = NULL;
    19141914    const char *pszFilename = NULL;
    19151915    uint64_t    cbNew = 0;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette