Changeset 66250 in vbox for trunk/src/VBox/Storage
- Timestamp:
- Mar 26, 2017 9:52:17 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114171
- Location:
- trunk/src/VBox/Storage
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VD.cpp
r66248 r66250 97 97 void *pBackendData; 98 98 /** Disk this image is part of */ 99 PV BOXHDDpDisk;99 PVDISK pDisk; 100 100 /** Flag whether to ignore flush requests. */ 101 101 bool fIgnoreFlush; … … 222 222 * VBox HDD Container main structure, private part. 223 223 */ 224 struct V BOXHDD224 struct VDISK 225 225 { 226 226 /** Structure signature (VDISK_SIGNATURE). */ … … 315 315 { 316 316 /** Pointer to disk descriptor. */ 317 PV BOXHDDpDisk;317 PVDISK pDisk; 318 318 /** Pointer to image descriptor. */ 319 319 PVDIMAGE pImage; … … 350 350 struct VDIOCTX * volatile pIoCtxNext; 351 351 /** Disk this is request is for. */ 352 PV BOXHDDpDisk;352 PVDISK pDisk; 353 353 /** Return code. */ 354 354 int rcReq; … … 670 670 static DECLCALLBACK(int) vdDiscardHelperAsync(PVDIOCTX pIoCtx); 671 671 static DECLCALLBACK(int) vdWriteHelperAsync(PVDIOCTX pIoCtx); 672 static void vdDiskProcessBlockedIoCtx(PV BOXHDDpDisk);673 static int vdDiskUnlock(PV BOXHDDpDisk, PVDIOCTX pIoCtxRc);672 static void vdDiskProcessBlockedIoCtx(PVDISK pDisk); 673 static int vdDiskUnlock(PVDISK pDisk, PVDIOCTX pIoCtxRc); 674 674 static DECLCALLBACK(void) vdIoCtxSyncComplete(void *pvUser1, void *pvUser2, int rcReq); 675 675 … … 788 788 * internal: issue error message. 789 789 */ 790 static int vdError(PV BOXHDDpDisk, int rc, RT_SRC_POS_DECL,790 static int vdError(PVDISK pDisk, int rc, RT_SRC_POS_DECL, 791 791 const char *pszFormat, ...) 792 792 { … … 802 802 * internal: thread synchronization, start read. 803 803 */ 804 DECLINLINE(int) vdThreadStartRead(PV BOXHDDpDisk)804 DECLINLINE(int) vdThreadStartRead(PVDISK pDisk) 805 805 { 806 806 int rc = VINF_SUCCESS; … … 813 813 * internal: thread synchronization, finish read. 814 814 */ 815 DECLINLINE(int) vdThreadFinishRead(PV BOXHDDpDisk)815 DECLINLINE(int) vdThreadFinishRead(PVDISK pDisk) 816 816 { 817 817 int rc = VINF_SUCCESS; … … 824 824 * internal: thread synchronization, start write. 825 825 */ 826 DECLINLINE(int) vdThreadStartWrite(PV BOXHDDpDisk)826 DECLINLINE(int) vdThreadStartWrite(PVDISK pDisk) 827 827 { 828 828 int rc = VINF_SUCCESS; … … 835 835 * internal: thread synchronization, finish write. 836 836 */ 837 DECLINLINE(int) vdThreadFinishWrite(PV BOXHDDpDisk)837 DECLINLINE(int) vdThreadFinishWrite(PVDISK pDisk) 838 838 { 839 839 int rc = VINF_SUCCESS; … … 913 913 * internal: add image structure to the end of images list. 914 914 */ 915 static void vdAddImageToList(PV BOXHDDpDisk, PVDIMAGE pImage)915 static void vdAddImageToList(PVDISK pDisk, PVDIMAGE pImage) 916 916 { 917 917 pImage->pPrev = NULL; … … 938 938 * internal: remove image structure from the images list. 939 939 */ 940 static void vdRemoveImageFromList(PV BOXHDDpDisk, PVDIMAGE pImage)940 static void vdRemoveImageFromList(PVDISK pDisk, PVDIMAGE pImage) 941 941 { 942 942 Assert(pDisk->cImages > 0); … … 991 991 * internal: find image by index into the images list. 992 992 */ 993 static PVDIMAGE vdGetImageByNumber(PV BOXHDDpDisk, unsigned nImage)993 static PVDIMAGE vdGetImageByNumber(PVDISK pDisk, unsigned nImage) 994 994 { 995 995 PVDIMAGE pImage = pDisk->pBase; … … 1013 1013 * @param pIoCtx The I/O context associated with the request. 1014 1014 */ 1015 static int vdFilterChainApplyWrite(PV BOXHDDpDisk, uint64_t uOffset, size_t cbWrite,1015 static int vdFilterChainApplyWrite(PVDISK pDisk, uint64_t uOffset, size_t cbWrite, 1016 1016 PVDIOCTX pIoCtx) 1017 1017 { … … 1042 1042 * @param pIoCtx The I/O context associated with the request. 1043 1043 */ 1044 static int vdFilterChainApplyRead(PV BOXHDDpDisk, uint64_t uOffset, size_t cbRead,1044 static int vdFilterChainApplyRead(PVDISK pDisk, uint64_t uOffset, size_t cbRead, 1045 1045 PVDIOCTX pIoCtx) 1046 1046 { … … 1065 1065 } 1066 1066 1067 DECLINLINE(void) vdIoCtxRootComplete(PV BOXHDDpDisk, PVDIOCTX pIoCtx)1067 DECLINLINE(void) vdIoCtxRootComplete(PVDISK pDisk, PVDIOCTX pIoCtx) 1068 1068 { 1069 1069 if ( RT_SUCCESS(pIoCtx->rcReq) … … 1080 1080 * Initialize the structure members of a given I/O context. 1081 1081 */ 1082 DECLINLINE(void) vdIoCtxInit(PVDIOCTX pIoCtx, PV BOXHDDpDisk, VDIOCTXTXDIR enmTxDir,1082 DECLINLINE(void) vdIoCtxInit(PVDIOCTX pIoCtx, PVDISK pDisk, VDIOCTXTXDIR enmTxDir, 1083 1083 uint64_t uOffset, size_t cbTransfer, PVDIMAGE pImageStart, 1084 1084 PCRTSGBUF pcSgBuf, void *pvAllocation, … … 1228 1228 * The number of bytes waiting can be less. 1229 1229 */ 1230 static int vdDiscardRemoveBlocks(PV BOXHDDpDisk, PVDDISCARDSTATE pDiscard, size_t cbDiscardingNew)1230 static int vdDiscardRemoveBlocks(PVDISK pDisk, PVDDISCARDSTATE pDiscard, size_t cbDiscardingNew) 1231 1231 { 1232 1232 int rc = VINF_SUCCESS; … … 1313 1313 * @param pDisk VD disk container. 1314 1314 */ 1315 static int vdDiscardStateDestroy(PV BOXHDDpDisk)1315 static int vdDiscardStateDestroy(PVDISK pDisk) 1316 1316 { 1317 1317 int rc = VINF_SUCCESS; … … 1339 1339 * @param cbRange Number of bytes to mark as allocated. 1340 1340 */ 1341 static int vdDiscardSetRangeAllocated(PV BOXHDDpDisk, uint64_t uOffset, size_t cbRange)1341 static int vdDiscardSetRangeAllocated(PVDISK pDisk, uint64_t uOffset, size_t cbRange) 1342 1342 { 1343 1343 PVDDISCARDSTATE pDiscard = pDisk->pDiscard; … … 1381 1381 } 1382 1382 1383 DECLINLINE(PVDIOCTX) vdIoCtxAlloc(PV BOXHDDpDisk, VDIOCTXTXDIR enmTxDir,1383 DECLINLINE(PVDIOCTX) vdIoCtxAlloc(PVDISK pDisk, VDIOCTXTXDIR enmTxDir, 1384 1384 uint64_t uOffset, size_t cbTransfer, 1385 1385 PVDIMAGE pImageStart,PCRTSGBUF pcSgBuf, … … 1399 1399 } 1400 1400 1401 DECLINLINE(PVDIOCTX) vdIoCtxRootAlloc(PV BOXHDDpDisk, VDIOCTXTXDIR enmTxDir,1401 DECLINLINE(PVDIOCTX) vdIoCtxRootAlloc(PVDISK pDisk, VDIOCTXTXDIR enmTxDir, 1402 1402 uint64_t uOffset, size_t cbTransfer, 1403 1403 PVDIMAGE pImageStart, PCRTSGBUF pcSgBuf, … … 1423 1423 } 1424 1424 1425 DECLINLINE(void) vdIoCtxDiscardInit(PVDIOCTX pIoCtx, PV BOXHDDpDisk, PCRTRANGE paRanges,1425 DECLINLINE(void) vdIoCtxDiscardInit(PVDIOCTX pIoCtx, PVDISK pDisk, PCRTRANGE paRanges, 1426 1426 unsigned cRanges, PFNVDASYNCTRANSFERCOMPLETE pfnComplete, 1427 1427 void *pvUser1, void *pvUser2, void *pvAllocation, … … 1452 1452 } 1453 1453 1454 DECLINLINE(PVDIOCTX) vdIoCtxDiscardAlloc(PV BOXHDDpDisk, PCRTRANGE paRanges,1454 DECLINLINE(PVDIOCTX) vdIoCtxDiscardAlloc(PVDISK pDisk, PCRTRANGE paRanges, 1455 1455 unsigned cRanges, 1456 1456 PFNVDASYNCTRANSFERCOMPLETE pfnComplete, … … 1473 1473 } 1474 1474 1475 DECLINLINE(PVDIOCTX) vdIoCtxChildAlloc(PV BOXHDDpDisk, VDIOCTXTXDIR enmTxDir,1475 DECLINLINE(PVDIOCTX) vdIoCtxChildAlloc(PVDISK pDisk, VDIOCTXTXDIR enmTxDir, 1476 1476 uint64_t uOffset, size_t cbTransfer, 1477 1477 PVDIMAGE pImageStart, PCRTSGBUF pcSgBuf, … … 1534 1534 } 1535 1535 1536 DECLINLINE(void) vdIoCtxFree(PV BOXHDDpDisk, PVDIOCTX pIoCtx)1536 DECLINLINE(void) vdIoCtxFree(PVDISK pDisk, PVDIOCTX pIoCtx) 1537 1537 { 1538 1538 Log(("Freeing I/O context %#p\n", pIoCtx)); … … 1549 1549 } 1550 1550 1551 DECLINLINE(void) vdIoTaskFree(PV BOXHDDpDisk, PVDIOTASK pIoTask)1551 DECLINLINE(void) vdIoTaskFree(PVDISK pDisk, PVDIOTASK pIoTask) 1552 1552 { 1553 1553 #ifdef DEBUG … … 1601 1601 } 1602 1602 1603 DECLINLINE(void) vdIoCtxDefer(PV BOXHDDpDisk, PVDIOCTX pIoCtx)1603 DECLINLINE(void) vdIoCtxDefer(PVDISK pDisk, PVDIOCTX pIoCtx) 1604 1604 { 1605 1605 LogFlowFunc(("Deferring I/O context pIoCtx=%#p\n", pIoCtx)); … … 1765 1765 * to return the status code for. 1766 1766 */ 1767 static int vdDiskProcessWaitingIoCtx(PV BOXHDDpDisk, PVDIOCTX pIoCtxRc)1767 static int vdDiskProcessWaitingIoCtx(PVDISK pDisk, PVDIOCTX pIoCtxRc) 1768 1768 { 1769 1769 int rc = VERR_VD_ASYNC_IO_IN_PROGRESS; … … 1850 1850 * @param pDisk The disk structure. 1851 1851 */ 1852 static void vdDiskProcessBlockedIoCtx(PV BOXHDDpDisk)1852 static void vdDiskProcessBlockedIoCtx(PVDISK pDisk) 1853 1853 { 1854 1854 LogFlowFunc(("pDisk=%#p\n", pDisk)); … … 1908 1908 { 1909 1909 int rc = VINF_SUCCESS; 1910 PV BOXHDDpDisk = pIoCtx->pDisk;1910 PVDISK pDisk = pIoCtx->pDisk; 1911 1911 1912 1912 Log(("Defer pIoCtx=%#p\n", pIoCtx)); … … 1941 1941 { 1942 1942 int rc = VINF_SUCCESS; 1943 PV BOXHDDpDisk = pIoCtx->pDisk;1943 PVDISK pDisk = pIoCtx->pDisk; 1944 1944 1945 1945 LogFlowFunc(("pIoCtx=%p\n", pIoCtx)); … … 1964 1964 } 1965 1965 1966 DECLINLINE(bool) vdIoCtxIsDiskLockOwner(PV BOXHDDpDisk, PVDIOCTX pIoCtx)1966 DECLINLINE(bool) vdIoCtxIsDiskLockOwner(PVDISK pDisk, PVDIOCTX pIoCtx) 1967 1967 { 1968 1968 return pDisk->pIoCtxLockOwner == pIoCtx; 1969 1969 } 1970 1970 1971 static int vdIoCtxLockDisk(PV BOXHDDpDisk, PVDIOCTX pIoCtx)1971 static int vdIoCtxLockDisk(PVDISK pDisk, PVDIOCTX pIoCtx) 1972 1972 { 1973 1973 int rc = VINF_SUCCESS; … … 1988 1988 } 1989 1989 1990 static void vdIoCtxUnlockDisk(PV BOXHDDpDisk, PVDIOCTX pIoCtx, bool fProcessBlockedReqs)1990 static void vdIoCtxUnlockDisk(PVDISK pDisk, PVDIOCTX pIoCtx, bool fProcessBlockedReqs) 1991 1991 { 1992 1992 RT_NOREF1(pIoCtx); … … 2012 2012 * Internal: Reads a given amount of data from the image chain of the disk. 2013 2013 **/ 2014 static int vdDiskReadHelper(PV BOXHDDpDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride,2014 static int vdDiskReadHelper(PVDISK pDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride, 2015 2015 uint64_t uOffset, size_t cbRead, PVDIOCTX pIoCtx, size_t *pcbThisRead) 2016 2016 { … … 2056 2056 { 2057 2057 int rc; 2058 PV BOXHDDpDisk = pIoCtx->pDisk;2058 PVDISK pDisk = pIoCtx->pDisk; 2059 2059 size_t cbToRead = pIoCtx->Req.Io.cbTransfer; 2060 2060 uint64_t uOffset = pIoCtx->Req.Io.uOffset; … … 2261 2261 * the read is cut off. A value of 0 disables the cut off. 2262 2262 */ 2263 static int vdReadHelperEx(PV BOXHDDpDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride,2263 static int vdReadHelperEx(PVDISK pDisk, PVDIMAGE pImage, PVDIMAGE pImageParentOverride, 2264 2264 uint64_t uOffset, void *pvBuf, size_t cbRead, 2265 2265 bool fZeroFreeBlocks, bool fUpdateCache, unsigned cImagesRead) … … 2301 2301 * will give us. 2302 2302 */ 2303 static int vdReadHelper(PV BOXHDDpDisk, PVDIMAGE pImage, uint64_t uOffset,2303 static int vdReadHelper(PVDISK pDisk, PVDIMAGE pImage, uint64_t uOffset, 2304 2304 void *pvBuf, size_t cbRead, bool fUpdateCache) 2305 2305 { … … 2311 2311 * internal: mark the disk as not modified. 2312 2312 */ 2313 static void vdResetModifiedFlag(PV BOXHDDpDisk)2313 static void vdResetModifiedFlag(PVDISK pDisk) 2314 2314 { 2315 2315 if (pDisk->uModified & VD_IMAGE_MODIFIED_FLAG) … … 2336 2336 * internal: mark the disk as modified. 2337 2337 */ 2338 static void vdSetModifiedFlag(PV BOXHDDpDisk)2338 static void vdSetModifiedFlag(PVDISK pDisk) 2339 2339 { 2340 2340 pDisk->uModified |= VD_IMAGE_MODIFIED_FLAG; … … 2360 2360 * write optimizations. 2361 2361 */ 2362 static int vdWriteHelperEx(PV BOXHDDpDisk, PVDIMAGE pImage,2362 static int vdWriteHelperEx(PVDISK pDisk, PVDIMAGE pImage, 2363 2363 PVDIMAGE pImageParentOverride, uint64_t uOffset, 2364 2364 const void *pvBuf, size_t cbWrite, … … 2400 2400 * write optimizations. 2401 2401 */ 2402 static int vdWriteHelper(PV BOXHDDpDisk, PVDIMAGE pImage, uint64_t uOffset,2402 static int vdWriteHelper(PVDISK pDisk, PVDIMAGE pImage, uint64_t uOffset, 2403 2403 const void *pvBuf, size_t cbWrite, uint32_t fFlags) 2404 2404 { … … 2411 2411 * to speed up the copy process if possible. 2412 2412 */ 2413 static int vdCopyHelper(PV BOXHDD pDiskFrom, PVDIMAGE pImageFrom, PVBOXHDDpDiskTo,2413 static int vdCopyHelper(PVDISK pDiskFrom, PVDIMAGE pImageFrom, PVDISK pDiskTo, 2414 2414 uint64_t cbSize, unsigned cImagesFromRead, unsigned cImagesToRead, 2415 2415 bool fSuppressRedundantIo, PVDINTERFACEPROGRESS pIfProgress, … … 2579 2579 * internal: mark the disk as modified - async version. 2580 2580 */ 2581 static int vdSetModifiedFlagAsync(PV BOXHDDpDisk, PVDIOCTX pIoCtx)2581 static int vdSetModifiedFlagAsync(PVDISK pDisk, PVDIOCTX pIoCtx) 2582 2582 { 2583 2583 int rc = VINF_SUCCESS; … … 2764 2764 static DECLCALLBACK(int) vdWriteHelperOptimizedAsync(PVDIOCTX pIoCtx) 2765 2765 { 2766 PV BOXHDDpDisk = pIoCtx->pDisk;2766 PVDISK pDisk = pIoCtx->pDisk; 2767 2767 uint64_t uOffset = pIoCtx->Type.Child.uOffsetSaved; 2768 2768 size_t cbThisWrite = pIoCtx->Type.Child.cbTransferParent; … … 2934 2934 static DECLCALLBACK(int) vdWriteHelperStandardAsync(PVDIOCTX pIoCtx) 2935 2935 { 2936 PV BOXHDDpDisk = pIoCtx->pDisk;2936 PVDISK pDisk = pIoCtx->pDisk; 2937 2937 uint64_t uOffset = pIoCtx->Type.Child.uOffsetSaved; 2938 2938 size_t cbThisWrite = pIoCtx->Type.Child.cbTransferParent; … … 2999 2999 uint64_t uOffset = pIoCtx->Req.Io.uOffset; 3000 3000 PVDIMAGE pImage = pIoCtx->Req.Io.pImageCur; 3001 PV BOXHDDpDisk = pIoCtx->pDisk;3001 PVDISK pDisk = pIoCtx->pDisk; 3002 3002 unsigned fWrite; 3003 3003 size_t cbThisWrite; … … 3176 3176 { 3177 3177 int rc = VINF_SUCCESS; 3178 PV BOXHDDpDisk = pIoCtx->pDisk;3178 PVDISK pDisk = pIoCtx->pDisk; 3179 3179 PVDIMAGE pImage = pIoCtx->Req.Io.pImageCur; 3180 3180 … … 3220 3220 { 3221 3221 int rc = VINF_SUCCESS; 3222 PV BOXHDDpDisk = pIoCtx->pDisk;3222 PVDISK pDisk = pIoCtx->pDisk; 3223 3223 PVDDISCARDSTATE pDiscard = pDisk->pDiscard; 3224 3224 PVDDISCARDBLOCK pBlock = pIoCtx->Req.Discard.pBlock; … … 3268 3268 * The number of bytes waiting can be less. 3269 3269 */ 3270 static int vdDiscardRemoveBlocksAsync(PV BOXHDDpDisk, PVDIOCTX pIoCtx, size_t cbDiscardingNew)3270 static int vdDiscardRemoveBlocksAsync(PVDISK pDisk, PVDIOCTX pIoCtx, size_t cbDiscardingNew) 3271 3271 { 3272 3272 int rc = VINF_SUCCESS; … … 3357 3357 static DECLCALLBACK(int) vdDiscardCurrentRangeAsync(PVDIOCTX pIoCtx) 3358 3358 { 3359 PV BOXHDDpDisk = pIoCtx->pDisk;3359 PVDISK pDisk = pIoCtx->pDisk; 3360 3360 PVDDISCARDSTATE pDiscard = pDisk->pDiscard; 3361 3361 uint64_t offStart = pIoCtx->Req.Discard.offCur; … … 3431 3431 { 3432 3432 int rc = VINF_SUCCESS; 3433 PV BOXHDDpDisk = pIoCtx->pDisk;3433 PVDISK pDisk = pIoCtx->pDisk; 3434 3434 PCRTRANGE paRanges = pIoCtx->Req.Discard.paRanges; 3435 3435 unsigned cRanges = pIoCtx->Req.Discard.cRanges; … … 4138 4138 static int vdIoCtxContinue(PVDIOCTX pIoCtx, int rcReq) 4139 4139 { 4140 PV BOXHDDpDisk = pIoCtx->pDisk;4140 PVDISK pDisk = pIoCtx->pDisk; 4141 4141 int rc = VINF_SUCCESS; 4142 4142 … … 4238 4238 { 4239 4239 int rc = VINF_SUCCESS; 4240 PV BOXHDDpDisk = pIoCtx->pDisk;4240 PVDISK pDisk = pIoCtx->pDisk; 4241 4241 4242 4242 LogFlowFunc(("pIoStorage=%#p pIoCtx=%#p pfnComplete=%#p pvUser=%#p cbTransfer=%zu rcReq=%Rrc\n", … … 4298 4298 PVDMETAXFER pMetaXfer, int rcReq) 4299 4299 { 4300 PV BOXHDDpDisk = pIoStorage->pVDIo->pDisk;4300 PVDISK pDisk = pIoStorage->pVDIo->pDisk; 4301 4301 RTLISTNODE ListIoCtxWaiting; 4302 4302 bool fFlush; … … 4414 4414 * @param pDisk The disk to process the list for. 4415 4415 */ 4416 static void vdIoTaskProcessWaitingList(PV BOXHDDpDisk)4416 static void vdIoTaskProcessWaitingList(PVDISK pDisk) 4417 4417 { 4418 4418 LogFlowFunc(("pDisk=%#p\n", pDisk)); … … 4459 4459 * @param pDisk The disk. 4460 4460 */ 4461 static void vdIoCtxProcessHaltedList(PV BOXHDDpDisk)4461 static void vdIoCtxProcessHaltedList(PVDISK pDisk) 4462 4462 { 4463 4463 LogFlowFunc(("pDisk=%#p\n", pDisk)); … … 4501 4501 * @param pIoCtxRc The I/O context to get the status code from, optional. 4502 4502 */ 4503 static int vdDiskUnlock(PV BOXHDDpDisk, PVDIOCTX pIoCtxRc)4503 static int vdDiskUnlock(PVDISK pDisk, PVDIOCTX pIoCtxRc) 4504 4504 { 4505 4505 int rc = VINF_SUCCESS; … … 4552 4552 { 4553 4553 PVDIOSTORAGE pIoStorage = pIoTask->pIoStorage; 4554 PV BOXHDDpDisk = pIoStorage->pVDIo->pDisk;4554 PVDISK pDisk = pIoStorage->pVDIo->pDisk; 4555 4555 4556 4556 Log(("Deferring I/O task pIoTask=%p\n", pIoTask)); … … 4754 4754 int rc = VINF_SUCCESS; 4755 4755 PVDIO pVDIo = (PVDIO)pvUser; 4756 PV BOXHDDpDisk = pVDIo->pDisk;4756 PVDISK pDisk = pVDIo->pDisk; 4757 4757 4758 4758 LogFlowFunc(("pvUser=%#p pIoStorage=%#p uOffset=%llu pIoCtx=%#p cbRead=%u\n", … … 4852 4852 int rc = VINF_SUCCESS; 4853 4853 PVDIO pVDIo = (PVDIO)pvUser; 4854 PV BOXHDDpDisk = pVDIo->pDisk;4854 PVDISK pDisk = pVDIo->pDisk; 4855 4855 4856 4856 LogFlowFunc(("pvUser=%#p pIoStorage=%#p uOffset=%llu pIoCtx=%#p cbWrite=%u\n", … … 4952 4952 { 4953 4953 PVDIO pVDIo = (PVDIO)pvUser; 4954 PV BOXHDDpDisk = pVDIo->pDisk;4954 PVDISK pDisk = pVDIo->pDisk; 4955 4955 int rc = VINF_SUCCESS; 4956 4956 RTSGSEG Seg; … … 5073 5073 { 5074 5074 PVDIO pVDIo = (PVDIO)pvUser; 5075 PV BOXHDDpDisk = pVDIo->pDisk;5075 PVDISK pDisk = pVDIo->pDisk; 5076 5076 int rc = VINF_SUCCESS; 5077 5077 RTSGSEG Seg; … … 5229 5229 { 5230 5230 PVDIO pVDIo = (PVDIO)pvUser; 5231 PV BOXHDDpDisk = pVDIo->pDisk;5231 PVDISK pDisk = pVDIo->pDisk; 5232 5232 PVDIOSTORAGE pIoStorage; 5233 5233 … … 5265 5265 { 5266 5266 PVDIO pVDIo = (PVDIO)pvUser; 5267 PV BOXHDDpDisk = pVDIo->pDisk;5267 PVDISK pDisk = pVDIo->pDisk; 5268 5268 int rc = VINF_SUCCESS; 5269 5269 PVDIOTASK pIoTask; … … 5342 5342 { 5343 5343 PVDIO pVDIo = (PVDIO)pvUser; 5344 PV BOXHDDpDisk = pVDIo->pDisk;5344 PVDISK pDisk = pVDIo->pDisk; 5345 5345 size_t cbCopied = 0; 5346 5346 … … 5362 5362 { 5363 5363 PVDIO pVDIo = (PVDIO)pvUser; 5364 PV BOXHDDpDisk = pVDIo->pDisk;5364 PVDISK pDisk = pVDIo->pDisk; 5365 5365 size_t cbCopied = 0; 5366 5366 … … 5381 5381 { 5382 5382 PVDIO pVDIo = (PVDIO)pvUser; 5383 PV BOXHDDpDisk = pVDIo->pDisk;5383 PVDISK pDisk = pVDIo->pDisk; 5384 5384 size_t cbSet = 0; 5385 5385 … … 5402 5402 { 5403 5403 PVDIO pVDIo = (PVDIO)pvUser; 5404 PV BOXHDDpDisk = pVDIo->pDisk;5404 PVDISK pDisk = pVDIo->pDisk; 5405 5405 size_t cbCreated = 0; 5406 5406 … … 5425 5425 { 5426 5426 PVDIO pVDIo = (PVDIO)pvUser; 5427 PV BOXHDDpDisk = pVDIo->pDisk;5427 PVDISK pDisk = pVDIo->pDisk; 5428 5428 5429 5429 LogFlowFunc(("pvUser=%#p pIoCtx=%#p rcReq=%Rrc cbCompleted=%zu\n", … … 5481 5481 RT_NOREF1(pIoCtx); 5482 5482 PVDIO pVDIo = (PVDIO)pvUser; 5483 PV BOXHDDpDisk = pVDIo->pDisk;5483 PVDISK pDisk = pVDIo->pDisk; 5484 5484 5485 5485 PVDIMAGE pImage = vdGetImageByNumber(pDisk, VD_LAST_IMAGE); … … 5654 5654 } 5655 5655 5656 DECLINLINE(int) vdMessageWrapper(PV BOXHDDpDisk, const char *pszFormat, ...)5656 DECLINLINE(int) vdMessageWrapper(PVDISK pDisk, const char *pszFormat, ...) 5657 5657 { 5658 5658 va_list va; … … 6142 6142 * @param ppDisk Where to store the reference to HDD container. 6143 6143 */ 6144 VBOXDDU_DECL(int) VDCreate(PVDINTERFACE pVDIfsDisk, VDTYPE enmType, PV BOXHDD*ppDisk)6144 VBOXDDU_DECL(int) VDCreate(PVDINTERFACE pVDIfsDisk, VDTYPE enmType, PVDISK *ppDisk) 6145 6145 { 6146 6146 int rc = VINF_SUCCESS; 6147 PV BOXHDDpDisk = NULL;6147 PVDISK pDisk = NULL; 6148 6148 6149 6149 LogFlowFunc(("pVDIfsDisk=%#p\n", pVDIfsDisk)); … … 6155 6155 rc = VERR_INVALID_PARAMETER); 6156 6156 6157 pDisk = (PV BOXHDD)RTMemAllocZ(sizeof(VBOXHDD));6157 pDisk = (PVDISK)RTMemAllocZ(sizeof(VDISK)); 6158 6158 if (pDisk) 6159 6159 { … … 6225 6225 * @param pDisk Pointer to HDD container. 6226 6226 */ 6227 VBOXDDU_DECL(int) VDDestroy(PV BOXHDDpDisk)6227 VBOXDDU_DECL(int) VDDestroy(PVDISK pDisk) 6228 6228 { 6229 6229 int rc = VINF_SUCCESS; … … 6411 6411 * @param pVDIfsImage Pointer to the per-image VD interface list. 6412 6412 */ 6413 VBOXDDU_DECL(int) VDOpen(PV BOXHDDpDisk, const char *pszBackend,6413 VBOXDDU_DECL(int) VDOpen(PVDISK pDisk, const char *pszBackend, 6414 6414 const char *pszFilename, unsigned uOpenFlags, 6415 6415 PVDINTERFACE pVDIfsImage) … … 6738 6738 * @param pVDIfsCache Pointer to the per-cache VD interface list. 6739 6739 */ 6740 VBOXDDU_DECL(int) VDCacheOpen(PV BOXHDDpDisk, const char *pszBackend,6740 VBOXDDU_DECL(int) VDCacheOpen(PVDISK pDisk, const char *pszBackend, 6741 6741 const char *pszFilename, unsigned uOpenFlags, 6742 6742 PVDINTERFACE pVDIfsCache) … … 6910 6910 } 6911 6911 6912 VBOXDDU_DECL(int) VDFilterAdd(PV BOXHDDpDisk, const char *pszFilter, uint32_t fFlags,6912 VBOXDDU_DECL(int) VDFilterAdd(PVDISK pDisk, const char *pszFilter, uint32_t fFlags, 6913 6913 PVDINTERFACE pVDIfsFilter) 6914 6914 { … … 7021 7021 * @param pVDIfsOperation Pointer to the per-operation VD interface list. 7022 7022 */ 7023 VBOXDDU_DECL(int) VDCreateBase(PV BOXHDDpDisk, const char *pszBackend,7023 VBOXDDU_DECL(int) VDCreateBase(PVDISK pDisk, const char *pszBackend, 7024 7024 const char *pszFilename, uint64_t cbSize, 7025 7025 unsigned uImageFlags, const char *pszComment, … … 7318 7318 * @param pVDIfsOperation Pointer to the per-operation VD interface list. 7319 7319 */ 7320 VBOXDDU_DECL(int) VDCreateDiff(PV BOXHDDpDisk, const char *pszBackend,7320 VBOXDDU_DECL(int) VDCreateDiff(PVDISK pDisk, const char *pszBackend, 7321 7321 const char *pszFilename, unsigned uImageFlags, 7322 7322 const char *pszComment, PCRTUUID pUuid, … … 7593 7593 * @param pVDIfsOperation Pointer to the per-operation VD interface list. 7594 7594 */ 7595 VBOXDDU_DECL(int) VDCreateCache(PV BOXHDDpDisk, const char *pszBackend,7595 VBOXDDU_DECL(int) VDCreateCache(PVDISK pDisk, const char *pszBackend, 7596 7596 const char *pszFilename, uint64_t cbSize, 7597 7597 unsigned uImageFlags, const char *pszComment, … … 7808 7808 * @param pVDIfsOperation Pointer to the per-operation VD interface list. 7809 7809 */ 7810 VBOXDDU_DECL(int) VDMerge(PV BOXHDDpDisk, unsigned nImageFrom,7810 VBOXDDU_DECL(int) VDMerge(PVDISK pDisk, unsigned nImageFrom, 7811 7811 unsigned nImageTo, PVDINTERFACE pVDIfsOperation) 7812 7812 { … … 8258 8258 * for the destination operation. 8259 8259 */ 8260 VBOXDDU_DECL(int) VDCopyEx(PV BOXHDD pDiskFrom, unsigned nImage, PVBOXHDDpDiskTo,8260 VBOXDDU_DECL(int) VDCopyEx(PVDISK pDiskFrom, unsigned nImage, PVDISK pDiskTo, 8261 8261 const char *pszBackend, const char *pszFilename, 8262 8262 bool fMoveByRename, uint64_t cbSize, … … 8589 8589 * for the destination image. 8590 8590 */ 8591 VBOXDDU_DECL(int) VDCopy(PV BOXHDD pDiskFrom, unsigned nImage, PVBOXHDDpDiskTo,8591 VBOXDDU_DECL(int) VDCopy(PVDISK pDiskFrom, unsigned nImage, PVDISK pDiskTo, 8592 8592 const char *pszBackend, const char *pszFilename, 8593 8593 bool fMoveByRename, uint64_t cbSize, … … 8619 8619 * @param pVDIfsOperation Pointer to the per-operation VD interface list. 8620 8620 */ 8621 VBOXDDU_DECL(int) VDCompact(PV BOXHDDpDisk, unsigned nImage,8621 VBOXDDU_DECL(int) VDCompact(PVDISK pDisk, unsigned nImage, 8622 8622 PVDINTERFACE pVDIfsOperation) 8623 8623 { … … 8727 8727 * @param pVDIfsOperation Pointer to the per-operation VD interface list. 8728 8728 */ 8729 VBOXDDU_DECL(int) VDResize(PV BOXHDDpDisk, uint64_t cbSize,8729 VBOXDDU_DECL(int) VDResize(PVDISK pDisk, uint64_t cbSize, 8730 8730 PCVDGEOMETRY pPCHSGeometry, 8731 8731 PCVDGEOMETRY pLCHSGeometry, … … 8846 8846 } 8847 8847 8848 VBOXDDU_DECL(int) VDPrepareWithFilters(PV BOXHDDpDisk, PVDINTERFACE pVDIfsOperation)8848 VBOXDDU_DECL(int) VDPrepareWithFilters(PVDISK pDisk, PVDINTERFACE pVDIfsOperation) 8849 8849 { 8850 8850 int rc = VINF_SUCCESS; … … 9048 9048 * @param fDelete If true, delete the image from the host disk. 9049 9049 */ 9050 VBOXDDU_DECL(int) VDClose(PV BOXHDDpDisk, bool fDelete)9050 VBOXDDU_DECL(int) VDClose(PVDISK pDisk, bool fDelete) 9051 9051 { 9052 9052 int rc = VINF_SUCCESS; … … 9158 9158 * @param fDelete If true, delete the image from the host disk. 9159 9159 */ 9160 VBOXDDU_DECL(int) VDCacheClose(PV BOXHDDpDisk, bool fDelete)9160 VBOXDDU_DECL(int) VDCacheClose(PVDISK pDisk, bool fDelete) 9161 9161 { 9162 9162 int rc = VINF_SUCCESS; … … 9198 9198 } 9199 9199 9200 VBOXDDU_DECL(int) VDFilterRemove(PV BOXHDDpDisk, uint32_t fFlags)9200 VBOXDDU_DECL(int) VDFilterRemove(PVDISK pDisk, uint32_t fFlags) 9201 9201 { 9202 9202 int rc = VINF_SUCCESS; … … 9256 9256 * @param pDisk Pointer to HDD container. 9257 9257 */ 9258 VBOXDDU_DECL(int) VDCloseAll(PV BOXHDDpDisk)9258 VBOXDDU_DECL(int) VDCloseAll(PVDISK pDisk) 9259 9259 { 9260 9260 int rc = VINF_SUCCESS; … … 9320 9320 * @param pDisk Pointer to HDD container. 9321 9321 */ 9322 VBOXDDU_DECL(int) VDFilterRemoveAll(PV BOXHDDpDisk)9322 VBOXDDU_DECL(int) VDFilterRemoveAll(PVDISK pDisk) 9323 9323 { 9324 9324 int rc = VINF_SUCCESS; … … 9374 9374 * @param cbRead Number of bytes to read. 9375 9375 */ 9376 VBOXDDU_DECL(int) VDRead(PV BOXHDDpDisk, uint64_t uOffset, void *pvBuf,9376 VBOXDDU_DECL(int) VDRead(PVDISK pDisk, uint64_t uOffset, void *pvBuf, 9377 9377 size_t cbRead) 9378 9378 { … … 9443 9443 * @param cbWrite Number of bytes to write. 9444 9444 */ 9445 VBOXDDU_DECL(int) VDWrite(PV BOXHDDpDisk, uint64_t uOffset, const void *pvBuf,9445 VBOXDDU_DECL(int) VDWrite(PVDISK pDisk, uint64_t uOffset, const void *pvBuf, 9446 9446 size_t cbWrite) 9447 9447 { … … 9514 9514 * @param pDisk Pointer to HDD container. 9515 9515 */ 9516 VBOXDDU_DECL(int) VDFlush(PV BOXHDDpDisk)9516 VBOXDDU_DECL(int) VDFlush(PVDISK pDisk) 9517 9517 { 9518 9518 int rc = VINF_SUCCESS; … … 9568 9568 * @param pDisk Pointer to HDD container. 9569 9569 */ 9570 VBOXDDU_DECL(unsigned) VDGetCount(PV BOXHDDpDisk)9570 VBOXDDU_DECL(unsigned) VDGetCount(PVDISK pDisk) 9571 9571 { 9572 9572 unsigned cImages; … … 9605 9605 * @param pDisk Pointer to HDD container. 9606 9606 */ 9607 VBOXDDU_DECL(bool) VDIsReadOnly(PV BOXHDDpDisk)9607 VBOXDDU_DECL(bool) VDIsReadOnly(PVDISK pDisk) 9608 9608 { 9609 9609 bool fReadOnly; … … 9648 9648 * @param nImage Image number, counts from 0. 0 is always base image of container. 9649 9649 */ 9650 VBOXDDU_DECL(uint32_t) VDGetSectorSize(PV BOXHDDpDisk, unsigned nImage)9650 VBOXDDU_DECL(uint32_t) VDGetSectorSize(PVDISK pDisk, unsigned nImage) 9651 9651 { 9652 9652 uint64_t cbSector; … … 9688 9688 * @param nImage Image number, counts from 0. 0 is always base image of container. 9689 9689 */ 9690 VBOXDDU_DECL(uint64_t) VDGetSize(PV BOXHDDpDisk, unsigned nImage)9690 VBOXDDU_DECL(uint64_t) VDGetSize(PVDISK pDisk, unsigned nImage) 9691 9691 { 9692 9692 uint64_t cbSize; … … 9728 9728 * @param nImage Image number, counts from 0. 0 is always base image of container. 9729 9729 */ 9730 VBOXDDU_DECL(uint64_t) VDGetFileSize(PV BOXHDDpDisk, unsigned nImage)9730 VBOXDDU_DECL(uint64_t) VDGetFileSize(PVDISK pDisk, unsigned nImage) 9731 9731 { 9732 9732 uint64_t cbSize; … … 9770 9770 * @param pPCHSGeometry Where to store PCHS geometry. Not NULL. 9771 9771 */ 9772 VBOXDDU_DECL(int) VDGetPCHSGeometry(PV BOXHDDpDisk, unsigned nImage,9772 VBOXDDU_DECL(int) VDGetPCHSGeometry(PVDISK pDisk, unsigned nImage, 9773 9773 PVDGEOMETRY pPCHSGeometry) 9774 9774 { … … 9834 9834 * @param pPCHSGeometry Where to load PCHS geometry from. Not NULL. 9835 9835 */ 9836 VBOXDDU_DECL(int) VDSetPCHSGeometry(PV BOXHDDpDisk, unsigned nImage,9836 VBOXDDU_DECL(int) VDSetPCHSGeometry(PVDISK pDisk, unsigned nImage, 9837 9837 PCVDGEOMETRY pPCHSGeometry) 9838 9838 { … … 9938 9938 * @param pLCHSGeometry Where to store LCHS geometry. Not NULL. 9939 9939 */ 9940 VBOXDDU_DECL(int) VDGetLCHSGeometry(PV BOXHDDpDisk, unsigned nImage,9940 VBOXDDU_DECL(int) VDGetLCHSGeometry(PVDISK pDisk, unsigned nImage, 9941 9941 PVDGEOMETRY pLCHSGeometry) 9942 9942 { … … 10002 10002 * @param pLCHSGeometry Where to load LCHS geometry from. Not NULL. 10003 10003 */ 10004 VBOXDDU_DECL(int) VDSetLCHSGeometry(PV BOXHDDpDisk, unsigned nImage,10004 VBOXDDU_DECL(int) VDSetLCHSGeometry(PVDISK pDisk, unsigned nImage, 10005 10005 PCVDGEOMETRY pLCHSGeometry) 10006 10006 { … … 10108 10108 * with VDRegionListFree(). 10109 10109 */ 10110 VBOXDDU_DECL(int) VDQueryRegions(PV BOXHDDpDisk, unsigned nImage, uint32_t fFlags,10110 VBOXDDU_DECL(int) VDQueryRegions(PVDISK pDisk, unsigned nImage, uint32_t fFlags, 10111 10111 PPVDREGIONLIST ppRegionList) 10112 10112 { … … 10219 10219 * @param puVersion Where to store the image version. 10220 10220 */ 10221 VBOXDDU_DECL(int) VDGetVersion(PV BOXHDDpDisk, unsigned nImage,10221 VBOXDDU_DECL(int) VDGetVersion(PVDISK pDisk, unsigned nImage, 10222 10222 unsigned *puVersion) 10223 10223 { … … 10268 10268 * @param pBackendInfo Where to store the backend information. 10269 10269 */ 10270 VBOXDDU_DECL(int) VDBackendInfoSingle(PV BOXHDDpDisk, unsigned nImage,10270 VBOXDDU_DECL(int) VDBackendInfoSingle(PVDISK pDisk, unsigned nImage, 10271 10271 PVDBACKENDINFO pBackendInfo) 10272 10272 { … … 10320 10320 * @param puImageFlags Where to store the image flags. 10321 10321 */ 10322 VBOXDDU_DECL(int) VDGetImageFlags(PV BOXHDDpDisk, unsigned nImage,10322 VBOXDDU_DECL(int) VDGetImageFlags(PVDISK pDisk, unsigned nImage, 10323 10323 unsigned *puImageFlags) 10324 10324 { … … 10369 10369 * @param puOpenFlags Where to store the image open flags. 10370 10370 */ 10371 VBOXDDU_DECL(int) VDGetOpenFlags(PV BOXHDDpDisk, unsigned nImage,10371 VBOXDDU_DECL(int) VDGetOpenFlags(PVDISK pDisk, unsigned nImage, 10372 10372 unsigned *puOpenFlags) 10373 10373 { … … 10420 10420 * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. 10421 10421 */ 10422 VBOXDDU_DECL(int) VDSetOpenFlags(PV BOXHDDpDisk, unsigned nImage,10422 VBOXDDU_DECL(int) VDSetOpenFlags(PVDISK pDisk, unsigned nImage, 10423 10423 unsigned uOpenFlags) 10424 10424 { … … 10480 10480 * @param cbFilename Size of buffer pszFilename points to. 10481 10481 */ 10482 VBOXDDU_DECL(int) VDGetFilename(PV BOXHDDpDisk, unsigned nImage,10482 VBOXDDU_DECL(int) VDGetFilename(PVDISK pDisk, unsigned nImage, 10483 10483 char *pszFilename, unsigned cbFilename) 10484 10484 { … … 10545 10545 * @param cbComment The size of pszComment buffer. 0 is ok. 10546 10546 */ 10547 VBOXDDU_DECL(int) VDGetComment(PV BOXHDDpDisk, unsigned nImage,10547 VBOXDDU_DECL(int) VDGetComment(PVDISK pDisk, unsigned nImage, 10548 10548 char *pszComment, unsigned cbComment) 10549 10549 { … … 10598 10598 * @param pszComment New comment string (UTF-8). NULL is allowed to reset the comment. 10599 10599 */ 10600 VBOXDDU_DECL(int) VDSetComment(PV BOXHDDpDisk, unsigned nImage,10600 VBOXDDU_DECL(int) VDSetComment(PVDISK pDisk, unsigned nImage, 10601 10601 const char *pszComment) 10602 10602 { … … 10648 10648 * @param pUuid Where to store the image creation UUID. 10649 10649 */ 10650 VBOXDDU_DECL(int) VDGetUuid(PV BOXHDDpDisk, unsigned nImage, PRTUUID pUuid)10650 VBOXDDU_DECL(int) VDGetUuid(PVDISK pDisk, unsigned nImage, PRTUUID pUuid) 10651 10651 { 10652 10652 int rc; … … 10695 10695 * @param pUuid New UUID of the image. If NULL, a new UUID is created. 10696 10696 */ 10697 VBOXDDU_DECL(int) VDSetUuid(PV BOXHDDpDisk, unsigned nImage, PCRTUUID pUuid)10697 VBOXDDU_DECL(int) VDSetUuid(PVDISK pDisk, unsigned nImage, PCRTUUID pUuid) 10698 10698 { 10699 10699 int rc; … … 10748 10748 * @param pUuid Where to store the image modification UUID. 10749 10749 */ 10750 VBOXDDU_DECL(int) VDGetModificationUuid(PV BOXHDDpDisk, unsigned nImage, PRTUUID pUuid)10750 VBOXDDU_DECL(int) VDGetModificationUuid(PVDISK pDisk, unsigned nImage, PRTUUID pUuid) 10751 10751 { 10752 10752 int rc = VINF_SUCCESS; … … 10796 10796 * @param pUuid New modification UUID of the image. If NULL, a new UUID is created. 10797 10797 */ 10798 VBOXDDU_DECL(int) VDSetModificationUuid(PV BOXHDDpDisk, unsigned nImage, PCRTUUID pUuid)10798 VBOXDDU_DECL(int) VDSetModificationUuid(PVDISK pDisk, unsigned nImage, PCRTUUID pUuid) 10799 10799 { 10800 10800 int rc; … … 10851 10851 * @param pUuid Where to store the parent image UUID. 10852 10852 */ 10853 VBOXDDU_DECL(int) VDGetParentUuid(PV BOXHDDpDisk, unsigned nImage,10853 VBOXDDU_DECL(int) VDGetParentUuid(PVDISK pDisk, unsigned nImage, 10854 10854 PRTUUID pUuid) 10855 10855 { … … 10898 10898 * @param pUuid New parent UUID of the image. If NULL, a new UUID is created. 10899 10899 */ 10900 VBOXDDU_DECL(int) VDSetParentUuid(PV BOXHDDpDisk, unsigned nImage,10900 VBOXDDU_DECL(int) VDSetParentUuid(PVDISK pDisk, unsigned nImage, 10901 10901 PCRTUUID pUuid) 10902 10902 { … … 10950 10950 * @param pDisk Pointer to HDD container. 10951 10951 */ 10952 VBOXDDU_DECL(void) VDDumpImages(PV BOXHDDpDisk)10952 VBOXDDU_DECL(void) VDDumpImages(PVDISK pDisk) 10953 10953 { 10954 10954 int rc2; … … 10985 10985 10986 10986 10987 VBOXDDU_DECL(int) VDDiscardRanges(PV BOXHDDpDisk, PCRTRANGE paRanges, unsigned cRanges)10987 VBOXDDU_DECL(int) VDDiscardRanges(PVDISK pDisk, PCRTRANGE paRanges, unsigned cRanges) 10988 10988 { 10989 10989 int rc; … … 11043 11043 11044 11044 11045 VBOXDDU_DECL(int) VDAsyncRead(PV BOXHDDpDisk, uint64_t uOffset, size_t cbRead,11045 VBOXDDU_DECL(int) VDAsyncRead(PVDISK pDisk, uint64_t uOffset, size_t cbRead, 11046 11046 PCRTSGBUF pcSgBuf, 11047 11047 PFNVDASYNCTRANSFERCOMPLETE pfnComplete, … … 11115 11115 11116 11116 11117 VBOXDDU_DECL(int) VDAsyncWrite(PV BOXHDDpDisk, uint64_t uOffset, size_t cbWrite,11117 VBOXDDU_DECL(int) VDAsyncWrite(PVDISK pDisk, uint64_t uOffset, size_t cbWrite, 11118 11118 PCRTSGBUF pcSgBuf, 11119 11119 PFNVDASYNCTRANSFERCOMPLETE pfnComplete, … … 11185 11185 11186 11186 11187 VBOXDDU_DECL(int) VDAsyncFlush(PV BOXHDDpDisk, PFNVDASYNCTRANSFERCOMPLETE pfnComplete,11187 VBOXDDU_DECL(int) VDAsyncFlush(PVDISK pDisk, PFNVDASYNCTRANSFERCOMPLETE pfnComplete, 11188 11188 void *pvUser1, void *pvUser2) 11189 11189 { … … 11240 11240 } 11241 11241 11242 VBOXDDU_DECL(int) VDAsyncDiscardRanges(PV BOXHDDpDisk, PCRTRANGE paRanges, unsigned cRanges,11242 VBOXDDU_DECL(int) VDAsyncDiscardRanges(PVDISK pDisk, PCRTRANGE paRanges, unsigned cRanges, 11243 11243 PFNVDASYNCTRANSFERCOMPLETE pfnComplete, 11244 11244 void *pvUser1, void *pvUser2) -
trunk/src/VBox/Storage/VDVfs.cpp
r62482 r66250 43 43 { 44 44 /** The volume the VFS file belongs to. */ 45 PV BOXHDDpDisk;45 PVDISK pDisk; 46 46 /** Current position. */ 47 47 uint64_t offCurPos; … … 61 61 * @param cbRead Amount of bytes to read. 62 62 */ 63 static int vdReadHelper(PV BOXHDDpDisk, uint64_t off, void *pvBuf, size_t cbRead)63 static int vdReadHelper(PVDISK pDisk, uint64_t off, void *pvBuf, size_t cbRead) 64 64 { 65 65 int rc = VINF_SUCCESS; … … 129 129 * @param cbWrite Amount of bytes to write. 130 130 */ 131 static int vdWriteHelper(PV BOXHDDpDisk, uint64_t off, const void *pvBuf, size_t cbWrite)131 static int vdWriteHelper(PVDISK pDisk, uint64_t off, const void *pvBuf, size_t cbWrite) 132 132 { 133 133 int rc = VINF_SUCCESS; … … 520 520 521 521 522 VBOXDDU_DECL(int) VDCreateVfsFileFromDisk(PV BOXHDDpDisk, uint32_t fFlags,522 VBOXDDU_DECL(int) VDCreateVfsFileFromDisk(PVDISK pDisk, uint32_t fFlags, 523 523 PRTVFSFILE phVfsFile) 524 524 { -
trunk/src/VBox/Storage/VMDK.cpp
r66110 r66250 3348 3348 * Internal: create VMDK images for raw disk/partition access. 3349 3349 */ 3350 static int vmdkCreateRawImage(PVMDKIMAGE pImage, const PV BOXHDDRAW pRaw,3350 static int vmdkCreateRawImage(PVMDKIMAGE pImage, const PVDISKRAW pRaw, 3351 3351 uint64_t cbSize) 3352 3352 { … … 3354 3354 PVMDKEXTENT pExtent; 3355 3355 3356 if (pRaw->uFlags & V BOXHDDRAW_DISK)3356 if (pRaw->uFlags & VDISKRAW_DISK) 3357 3357 { 3358 3358 /* Full raw disk access. This requires setting up a descriptor … … 3383 3383 pExtent->cNominalSectors = VMDK_BYTE2SECTOR(cbSize); 3384 3384 pExtent->uSectorOffset = 0; 3385 pExtent->enmAccess = (pRaw->uFlags & V BOXHDDRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;3385 pExtent->enmAccess = (pRaw->uFlags & VDISKRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE; 3386 3386 pExtent->fMetaDirty = false; 3387 3387 … … 3406 3406 for (unsigned i = 0; i < pRaw->cPartDescs; i++) 3407 3407 { 3408 PV BOXHDDRAWPARTDESC pPart = &pRaw->pPartDescs[i];3408 PVDISKRAWPARTDESC pPart = &pRaw->pPartDescs[i]; 3409 3409 if (uStart > pPart->uStart) 3410 3410 return vdIfError(pImage->pIfError, VERR_INVALID_PARAMETER, RT_SRC_POS, … … 3452 3452 for (unsigned i = 0; i < pRaw->cPartDescs; i++) 3453 3453 { 3454 PV BOXHDDRAWPARTDESC pPart = &pRaw->pPartDescs[i];3454 PVDISKRAWPARTDESC pPart = &pRaw->pPartDescs[i]; 3455 3455 pExtent = &pImage->pExtents[cExtents++]; 3456 3456 … … 3527 3527 pExtent->cNominalSectors = VMDK_BYTE2SECTOR(pPart->cbData); 3528 3528 pExtent->uSectorOffset = VMDK_BYTE2SECTOR(pPart->uStartOffset); 3529 pExtent->enmAccess = (pPart->uFlags & V BOXHDDRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;3529 pExtent->enmAccess = (pPart->uFlags & VDISKRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE; 3530 3530 pExtent->fMetaDirty = false; 3531 3531 … … 3564 3564 3565 3565 rc = vmdkDescBaseSetStr(pImage, &pImage->Descriptor, "createType", 3566 (pRaw->uFlags & V BOXHDDRAW_DISK) ?3566 (pRaw->uFlags & VDISKRAW_DISK) ? 3567 3567 "fullDevice" : "partitionedDevice"); 3568 3568 if (RT_FAILURE(rc)) … … 3947 3947 { 3948 3948 /* Raw disk image (includes raw partition). */ 3949 const PV BOXHDDRAW pRaw = (const PVBOXHDDRAW)pszComment;3949 const PVDISKRAW pRaw = (const PVDISKRAW)pszComment; 3950 3950 /* As the comment is misused, zap it so that no garbage comment 3951 3951 * is set below. */ -
trunk/src/VBox/Storage/testcase/tstVD.cpp
r62729 r66250 67 67 { 68 68 int rc; 69 PV BOXHDDpVD = NULL;69 PVDISK pVD = NULL; 70 70 VDGEOMETRY PCHS = { 0, 0, 0 }; 71 71 VDGEOMETRY LCHS = { 0, 0, 0 }; … … 122 122 { 123 123 int rc; 124 PV BOXHDDpVD = NULL;124 PVDISK pVD = NULL; 125 125 PVDINTERFACE pVDIfs = NULL; 126 126 VDINTERFACEERROR VDIfError; … … 454 454 } 455 455 456 static void writeSegmentsToDisk(PV BOXHDDpVD, void *pvBuf, PSEGMENT pSegment)456 static void writeSegmentsToDisk(PVDISK pVD, void *pvBuf, PSEGMENT pSegment) 457 457 { 458 458 while (pSegment->u32Length) … … 465 465 } 466 466 467 static int readAndCompareSegments(PV BOXHDDpVD, void *pvBuf, PSEGMENT pSegment)467 static int readAndCompareSegments(PVDISK pVD, void *pvBuf, PSEGMENT pSegment) 468 468 { 469 469 while (pSegment->u32Length) … … 501 501 { 502 502 int rc; 503 PV BOXHDDpVD = NULL;503 PVDISK pVD = NULL; 504 504 char *pszFormat; 505 505 VDTYPE enmType = VDTYPE_INVALID; … … 625 625 { 626 626 int rc; 627 PV BOXHDDpVD = NULL;627 PVDISK pVD = NULL; 628 628 VDGEOMETRY PCHS = { 0, 0, 0 }; 629 629 VDGEOMETRY LCHS = { 0, 0, 0 }; … … 704 704 { 705 705 int rc; 706 PV BOXHDDpVD = NULL;706 PVDISK pVD = NULL; 707 707 PVDINTERFACE pVDIfs = NULL; 708 708 VDINTERFACEERROR VDIfError; … … 752 752 return rc; 753 753 754 PV BOXHDDpVD = NULL;754 PVDISK pVD = NULL; 755 755 PVDINTERFACE pVDIfs = NULL; 756 756 VDINTERFACEERROR VDIfError; -
trunk/src/VBox/Storage/testcase/tstVDFill.cpp
r62729 r66250 60 60 { 61 61 int rc; 62 PV BOXHDDpVD = NULL;62 PVDISK pVD = NULL; 63 63 VDGEOMETRY PCHS = { 0, 0, 0 }; 64 64 VDGEOMETRY LCHS = { 0, 0, 0 }; -
trunk/src/VBox/Storage/testcase/tstVDIo.cpp
r65638 r66250 99 99 char *pszName; 100 100 /** HDD handle to operate on. */ 101 PV BOXHDDpVD;101 PVDISK pVD; 102 102 /** Memory disk used for data verification. */ 103 103 PVDMEMDISK pMemDiskVerify; … … 182 182 /** S/G Buffer */ 183 183 RTSGBUF SgBuf; 184 /** Data segment */185 RTSGSEG DataSeg;186 184 /** Flag whether the request is outstanding or not. */ 187 185 volatile bool fOutstanding; 188 186 /** Buffer to use for reads. */ 189 187 void *pvBufRead; 188 /** Contiguous buffer pointer backing the segments. */ 189 void *pvBuf; 190 190 /** Opaque user data. */ 191 191 void *pvUser; 192 /** Number of segments used for the data buffer. */ 193 uint32_t cSegs; 194 /** Array of data segments. */ 195 RTSGSEG aSegs[10]; 192 196 } VDIOREQ, *PVDIOREQ; 193 197 … … 209 213 /** Chance in percent to get a write. */ 210 214 unsigned uWriteChance; 215 /** Maximum number of segments to create for one request. */ 216 uint32_t cSegsMax; 211 217 /** Pointer to the I/O data generator. */ 212 218 PVDIORND pIoRnd; … … 532 538 } 533 539 534 static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint 64_t cbIo,535 size_t cbBlkSize, uint64_t offStart, uint64_t offEnd,540 static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint32_t cSegsMax, 541 uint64_t cbIo, size_t cbBlkSize, uint64_t offStart, uint64_t offEnd, 536 542 unsigned uWriteChance, PVDPATTERN pPattern); 537 543 static bool tstVDIoTestRunning(PVDIOTEST pIoTest); … … 756 762 757 763 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); 759 765 if (RT_SUCCESS(rc)) 760 766 { … … 804 810 case VDIOREQTXDIR_READ: 805 811 { 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); 807 813 808 814 if (RT_SUCCESS(rc) … … 810 816 { 811 817 RTSGBUF SgBuf; 812 RTSgBufInit(&SgBuf, &paIoReq[idx]. DataSeg, 1);818 RTSgBufInit(&SgBuf, &paIoReq[idx].aSegs[0], paIoReq[idx].cSegs); 813 819 814 820 if (VDMemDiskCmp(pDisk->pMemDiskVerify, paIoReq[idx].off, paIoReq[idx].cbReq, &SgBuf)) … … 822 828 case VDIOREQTXDIR_WRITE: 823 829 { 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); 825 831 826 832 if (RT_SUCCESS(rc) … … 828 834 { 829 835 RTSGBUF SgBuf; 830 RTSgBufInit(&SgBuf, &paIoReq[idx]. DataSeg, 1);836 RTSgBufInit(&SgBuf, &paIoReq[idx].aSegs[0], paIoReq[idx].cSegs); 831 837 rc = VDMemDiskWrite(pDisk->pMemDiskVerify, paIoReq[idx].off, paIoReq[idx].cbReq, &SgBuf); 832 838 } … … 2371 2377 } 2372 2378 2373 static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint 64_t cbIo,2374 size_t cbBlkSize, uint64_t offStart, uint64_t offEnd,2379 static int tstVDIoTestInit(PVDIOTEST pIoTest, PVDTESTGLOB pGlob, bool fRandomAcc, uint32_t cSegsMax, 2380 uint64_t cbIo, size_t cbBlkSize, uint64_t offStart, uint64_t offEnd, 2375 2381 unsigned uWriteChance, PVDPATTERN pPattern) 2376 2382 { … … 2384 2390 pIoTest->offEnd = offEnd; 2385 2391 pIoTest->uWriteChance = uWriteChance; 2392 pIoTest->cSegsMax = cSegsMax; 2386 2393 pIoTest->pIoRnd = pGlob->pIoRnd; 2387 2394 pIoTest->pPattern = pPattern; … … 2424 2431 } 2425 2432 2433 static 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 2426 2463 /** 2427 2464 * Returns true with the given chance in percent. … … 2447 2484 pIoReq->cbReq = RT_MIN(pIoTest->cbBlkIo, pIoTest->cbIo); 2448 2485 pIoTest->cbIo -= pIoReq->cbReq; 2449 pIoReq->DataSeg.cbSeg = pIoReq->cbReq; 2486 2487 void *pvBuf = NULL; 2450 2488 2451 2489 if (pIoReq->enmTxDir == VDIOREQTXDIR_WRITE) 2452 2490 { 2453 2491 if (pIoTest->pPattern) 2454 rc = tstVDIoPatternGetBuffer(pIoTest->pPattern, &p IoReq->DataSeg.pvSeg, pIoReq->cbReq);2492 rc = tstVDIoPatternGetBuffer(pIoTest->pPattern, &pvBuf, pIoReq->cbReq); 2455 2493 else 2456 rc = VDIoRndGetBuffer(pIoTest->pIoRnd, &p IoReq->DataSeg.pvSeg, pIoReq->cbReq);2494 rc = VDIoRndGetBuffer(pIoTest->pIoRnd, &pvBuf, pIoReq->cbReq); 2457 2495 AssertRC(rc); 2458 2496 } … … 2460 2498 { 2461 2499 /* Read */ 2462 p IoReq->DataSeg.pvSeg= pIoReq->pvBufRead;2500 pvBuf = pIoReq->pvBufRead; 2463 2501 } 2464 2502 2465 2503 if (RT_SUCCESS(rc)) 2466 2504 { 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); 2468 2509 2469 2510 if (pIoTest->fRandomAccess) … … 2547 2588 { 2548 2589 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); 2550 2596 2551 2597 if (VDMemDiskCmp(pDisk->pMemDiskVerify, pIoReq->off, pIoReq->cbReq, 2552 & pIoReq->SgBuf))2598 &SgBufCmp)) 2553 2599 RTTestFailed(pDisk->pTestGlob->hTest, "Corrupted disk at offset %llu!\n", pIoReq->off); 2554 2600 RTCritSectLeave(&pDisk->CritSectVerify); … … 2558 2604 { 2559 2605 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); 2561 2612 2562 2613 int rc = VDMemDiskWrite(pDisk->pMemDiskVerify, pIoReq->off, pIoReq->cbReq, 2563 & pIoReq->SgBuf);2614 &SgBuf); 2564 2615 AssertRC(rc); 2565 2616 RTCritSectLeave(&pDisk->CritSectVerify); -
trunk/src/VBox/Storage/testcase/tstVDSnap.cpp
r62729 r66250 125 125 } 126 126 127 static int tstVDSnapWrite(PV BOXHDDpVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk, bool fInit)127 static int tstVDSnapWrite(PVDISK pVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk, bool fInit) 128 128 { 129 129 RT_NOREF1(cbDisk); … … 152 152 } 153 153 154 static int tstVDSnapReadVerify(PV BOXHDDpVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk)154 static int tstVDSnapReadVerify(PVDISK pVD, PVDDISKSEG paDiskSegments, uint32_t cDiskSegments, uint64_t cbDisk) 155 155 { 156 156 RT_NOREF1(cbDisk); … … 218 218 { 219 219 int rc; 220 PV BOXHDDpVD = NULL;220 PVDISK pVD = NULL; 221 221 VDGEOMETRY PCHS = { 0, 0, 0 }; 222 222 VDGEOMETRY LCHS = { 0, 0, 0 }; -
trunk/src/VBox/Storage/testcase/vbox-img.cpp
r66249 r66250 270 270 } 271 271 272 PV BOXHDDpVD = NULL;272 PVDISK pVD = NULL; 273 273 rc = VDCreate(pVDIfs, enmType, &pVD); 274 274 if (RT_FAILURE(rc)) … … 406 406 } 407 407 408 PV BOXHDDpVD = NULL;408 PVDISK pVD = NULL; 409 409 rc = VDCreate(pVDIfs, enmType, &pVD); 410 410 if (RT_FAILURE(rc)) … … 1020 1020 const char *pszDstFormat = NULL; 1021 1021 const char *pszVariant = NULL; 1022 PV BOXHDDpSrcDisk = NULL;1023 PV BOXHDDpDstDisk = NULL;1022 PVDISK pSrcDisk = NULL; 1023 PVDISK pDstDisk = NULL; 1024 1024 unsigned uImageFlags = VD_IMAGE_FLAGS_NONE; 1025 1025 PVDINTERFACE pIfsImageInput = NULL; … … 1259 1259 { 1260 1260 int rc = VINF_SUCCESS; 1261 PV BOXHDDpDisk = NULL;1261 PVDISK pDisk = NULL; 1262 1262 const char *pszFilename = NULL; 1263 1263 … … 1318 1318 { 1319 1319 int rc = VINF_SUCCESS; 1320 PV BOXHDD pDisk = (PVBOXHDD)pvUser;1320 PVDISK pDisk = (PVDISK)pvUser; 1321 1321 1322 1322 /* Take shortcut if possible. */ … … 1377 1377 static DECLCALLBACK(int) vboximgDvmWrite(void *pvUser, uint64_t off, const void *pvBuf, size_t cbWrite) 1378 1378 { 1379 PV BOXHDD pDisk = (PVBOXHDD)pvUser;1379 PVDISK pDisk = (PVDISK)pvUser; 1380 1380 return VDWrite(pDisk, off, pvBuf, cbWrite); 1381 1381 } … … 1409 1409 { 1410 1410 int rc = VINF_SUCCESS; 1411 PV BOXHDDpDisk = NULL;1411 PVDISK pDisk = NULL; 1412 1412 const char *pszFilename = NULL; 1413 1413 bool fFilesystemAware = false; … … 1590 1590 { 1591 1591 int rc = VINF_SUCCESS; 1592 PV BOXHDDpDisk = NULL;1592 PVDISK pDisk = NULL; 1593 1593 const char *pszFilename = NULL; 1594 1594 uint64_t cbSize = 0; … … 1686 1686 { 1687 1687 int rc = VINF_SUCCESS; 1688 PV BOXHDDpDisk = NULL;1688 PVDISK pDisk = NULL; 1689 1689 const char *pszFilename = NULL; 1690 1690 const char *pszBackend = "VDI"; … … 1854 1854 { 1855 1855 int rc = VINF_SUCCESS; 1856 PV BOXHDDpDisk = NULL;1856 PVDISK pDisk = NULL; 1857 1857 const char *pszFilename = NULL; 1858 1858 … … 1911 1911 { 1912 1912 int rc = VINF_SUCCESS; 1913 PV BOXHDDpDisk = NULL;1913 PVDISK pDisk = NULL; 1914 1914 const char *pszFilename = NULL; 1915 1915 uint64_t cbNew = 0;
Note:
See TracChangeset
for help on using the changeset viewer.