Changeset 31776 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Aug 19, 2010 9:48:44 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64962
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/ISCSIHDDCore.cpp
r31714 r31776 5568 5568 iscsiComposeName, 5569 5569 /* pfnCompact */ 5570 NULL, 5571 /* pfnResize */ 5570 5572 NULL 5571 5573 }; -
trunk/src/VBox/Devices/Storage/ParallelsHDDCore.cpp
r31184 r31776 1435 1435 genericFileComposeName, 1436 1436 /* pfnCompact */ 1437 NULL, 1438 /* pfnResize */ 1437 1439 NULL 1438 1440 }; -
trunk/src/VBox/Devices/Storage/RawHDDCore.cpp
r30555 r31776 1343 1343 genericFileComposeName, 1344 1344 /* pfnCompact */ 1345 NULL, 1346 /* pfnResize */ 1345 1347 NULL 1346 1348 }; -
trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
r31586 r31776 4908 4908 4909 4909 /** 4910 * Resizes the the given disk image to the given size. 4911 * 4912 * @return VBox status 4913 * @return VERR_VD_IMAGE_READ_ONLY if image is not writable. 4914 * @return VERR_NOT_SUPPORTED if this kind of image can be compacted, but 4915 * 4916 * @param pDisk Pointer to the HDD container. 4917 * @param cbSize New size of the image. 4918 * @param pPCHSGeometry Pointer to the new physical disk geometry <= (16383,16,63). Not NULL. 4919 * @param pLCHSGeometry Pointer to the new logical disk geometry <= (x,255,63). Not NULL. 4920 * @param pVDIfsOperation Pointer to the per-operation VD interface list. 4921 */ 4922 VBOXDDU_DECL(int) VDResize(PVBOXHDD pDisk, uint64_t cbSize, 4923 PCPDMMEDIAGEOMETRY pPCHSGeometry, 4924 PCPDMMEDIAGEOMETRY pLCHSGeometry, 4925 PVDINTERFACE pVDIfsOperation) 4926 { 4927 int rc = VINF_SUCCESS; 4928 int rc2; 4929 bool fLockRead = false, fLockWrite = false; 4930 4931 LogFlowFunc(("pDisk=%#p cbSize=%llu pVDIfsOperation=%#p\n", 4932 pDisk, cbSize, pVDIfsOperation)); 4933 4934 PVDINTERFACE pIfProgress = VDInterfaceGet(pVDIfsOperation, 4935 VDINTERFACETYPE_PROGRESS); 4936 PVDINTERFACEPROGRESS pCbProgress = NULL; 4937 if (pIfProgress) 4938 pCbProgress = VDGetInterfaceProgress(pIfProgress); 4939 4940 do { 4941 /* Check arguments. */ 4942 AssertMsgBreakStmt(VALID_PTR(pDisk), ("pDisk=%#p\n", pDisk), 4943 rc = VERR_INVALID_PARAMETER); 4944 AssertMsg(pDisk->u32Signature == VBOXHDDDISK_SIGNATURE, 4945 ("u32Signature=%08x\n", pDisk->u32Signature)); 4946 4947 rc2 = vdThreadStartRead(pDisk); 4948 AssertRC(rc2); 4949 fLockRead = true; 4950 4951 /* Not supported if the disk has child images attached. */ 4952 AssertMsgBreakStmt(pDisk->cImages == 1, ("cImages=%u\n", pDisk->cImages), 4953 rc = VERR_NOT_SUPPORTED); 4954 4955 PVDIMAGE pImage = pDisk->pBase; 4956 4957 /* If there is no compact callback for not file based backends then 4958 * the backend doesn't need compaction. No need to make much fuss about 4959 * this. For file based ones signal this as not yet supported. */ 4960 if (!pImage->Backend->pfnResize) 4961 { 4962 if (pImage->Backend->uBackendCaps & VD_CAP_FILE) 4963 rc = VERR_NOT_SUPPORTED; 4964 else 4965 rc = VINF_SUCCESS; 4966 break; 4967 } 4968 4969 rc2 = vdThreadFinishRead(pDisk); 4970 AssertRC(rc2); 4971 fLockRead = false; 4972 4973 rc2 = vdThreadStartWrite(pDisk); 4974 AssertRC(rc2); 4975 fLockWrite = true; 4976 4977 rc = pImage->Backend->pfnResize(pImage->pvBackendData, 4978 cbSize, 4979 pPCHSGeometry, 4980 pLCHSGeometry, 4981 0, 99, 4982 pDisk->pVDIfsDisk, 4983 pImage->pVDIfsImage, 4984 pVDIfsOperation); 4985 } while (0); 4986 4987 if (RT_UNLIKELY(fLockWrite)) 4988 { 4989 rc2 = vdThreadFinishWrite(pDisk); 4990 AssertRC(rc2); 4991 } 4992 else if (RT_UNLIKELY(fLockRead)) 4993 { 4994 rc2 = vdThreadFinishRead(pDisk); 4995 AssertRC(rc2); 4996 } 4997 4998 if (RT_SUCCESS(rc)) 4999 { 5000 if (pCbProgress && pCbProgress->pfnProgress) 5001 pCbProgress->pfnProgress(pIfProgress->pvUser, 100); 5002 } 5003 5004 LogFlowFunc(("returns %Rrc\n", rc)); 5005 return rc; 5006 } 5007 5008 /** 4910 5009 * Closes the last opened image file in HDD container. 4911 5010 * If previous image file was opened in read-only mode (the normal case) and -
trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
r31185 r31776 2615 2615 genericFileComposeName, 2616 2616 /* pfnCompact */ 2617 vdiCompact 2617 vdiCompact, 2618 /* pfnResize */ 2619 NULL 2618 2620 }; 2619 2621 -
trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp
r31379 r31776 2753 2753 genericFileComposeLocation, 2754 2754 /* pfnComposeName */ 2755 genericFileComposeName 2755 genericFileComposeName, 2756 /* pfnCompact */ 2757 NULL, 2758 /* pfnResize */ 2759 NULL 2756 2760 }; -
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r31380 r31776 6883 6883 genericFileComposeLocation, 6884 6884 /* pfnComposeName */ 6885 genericFileComposeName 6885 genericFileComposeName, 6886 /* pfnCompact */ 6887 NULL, 6888 /* pfnResize */ 6889 NULL 6886 6890 };
Note:
See TracChangeset
for help on using the changeset viewer.