Changeset 90808 in vbox
- Timestamp:
- Aug 23, 2021 7:36:07 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146443
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VD.cpp
r90807 r90808 8729 8729 LogFlowFunc(("pDisk=%#p nImage=%u pLCHSGeometry=%#p\n", 8730 8730 pDisk, nImage, pLCHSGeometry)); 8731 /* sanity check */ 8732 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); 8733 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8734 8735 /* Check arguments. */ 8736 AssertPtrReturn(pLCHSGeometry, VERR_INVALID_POINTER); 8737 8731 8738 do 8732 8739 { 8733 /* sanity check */8734 AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);8735 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));8736 8737 /* Check arguments. */8738 AssertMsgBreakStmt(VALID_PTR(pLCHSGeometry),8739 ("pLCHSGeometry=%#p\n", pLCHSGeometry),8740 rc = VERR_INVALID_PARAMETER);8741 8740 8742 8741 rc2 = vdThreadStartRead(pDisk); … … 8783 8782 pDisk, nImage, pLCHSGeometry, pLCHSGeometry->cCylinders, 8784 8783 pLCHSGeometry->cHeads, pLCHSGeometry->cSectors)); 8784 /* sanity check */ 8785 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); 8786 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8787 8788 /* Check arguments. */ 8789 AssertPtrReturn(pLCHSGeometry, VERR_INVALID_POINTER); 8790 AssertMsgReturn( pLCHSGeometry->cHeads <= 255 8791 && pLCHSGeometry->cSectors <= 63, 8792 ("LCHS=%u/%u/%u\n", pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors), 8793 VERR_INVALID_PARAMETER); 8794 8785 8795 do 8786 8796 { 8787 /* sanity check */8788 AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);8789 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));8790 8791 /* Check arguments. */8792 AssertMsgBreakStmt( VALID_PTR(pLCHSGeometry)8793 && pLCHSGeometry->cHeads <= 2558794 && pLCHSGeometry->cSectors <= 63,8795 ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry,8796 pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads,8797 pLCHSGeometry->cSectors),8798 rc = VERR_INVALID_PARAMETER);8799 8800 8797 rc2 = vdThreadStartWrite(pDisk); 8801 8798 AssertRC(rc2); … … 8877 8874 LogFlowFunc(("pDisk=%#p nImage=%u fFlags=%#x ppRegionList=%#p\n", 8878 8875 pDisk, nImage, fFlags, ppRegionList)); 8876 /* sanity check */ 8877 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); 8878 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8879 8880 /* Check arguments. */ 8881 AssertPtrReturn(ppRegionList, VERR_INVALID_POINTER); 8882 8879 8883 do 8880 8884 { 8881 /* sanity check */8882 AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);8883 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));8884 8885 /* Check arguments. */8886 AssertMsgBreakStmt(VALID_PTR(ppRegionList),8887 ("ppRegionList=%#p\n", ppRegionList),8888 rc = VERR_INVALID_PARAMETER);8889 8890 8885 rc2 = vdThreadStartRead(pDisk); 8891 8886 AssertRC(rc2); … … 8932 8927 LogFlowFunc(("pDisk=%#p nImage=%u puVersion=%#p\n", 8933 8928 pDisk, nImage, puVersion)); 8929 /* sanity check */ 8930 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); 8931 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8932 8933 /* Check arguments. */ 8934 AssertPtrReturn(puVersion, VERR_INVALID_POINTER); 8935 8934 8936 do 8935 8937 { 8936 /* sanity check */8937 AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);8938 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));8939 8940 /* Check arguments. */8941 AssertMsgBreakStmt(VALID_PTR(puVersion),8942 ("puVersion=%#p\n", puVersion),8943 rc = VERR_INVALID_PARAMETER);8944 8945 8938 rc2 = vdThreadStartRead(pDisk); 8946 8939 AssertRC(rc2); … … 8953 8946 } while (0); 8954 8947 8955 if (RT_UNLIKELY(fLockRead)) 8948 if (RT_UNLIKELY(fLockRead)) /** @todo r=bird: This prediction is utter rubbish! Good example why avoid them... */ 8956 8949 { 8957 8950 rc2 = vdThreadFinishRead(pDisk); … … 8968 8961 { 8969 8962 int rc = VINF_SUCCESS; 8970 int rc2;8971 bool fLockRead = false;8972 8963 8973 8964 LogFlowFunc(("pDisk=%#p nImage=%u pBackendInfo=%#p\n", 8974 8965 pDisk, nImage, pBackendInfo)); 8975 do 8976 { 8977 /* sanity check */ 8978 AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER); 8979 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8980 8981 /* Check arguments. */ 8982 AssertMsgBreakStmt(VALID_PTR(pBackendInfo), 8983 ("pBackendInfo=%#p\n", pBackendInfo), 8984 rc = VERR_INVALID_PARAMETER); 8985 8986 rc2 = vdThreadStartRead(pDisk); 8987 AssertRC(rc2); 8988 fLockRead = true; 8989 8990 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 8991 AssertPtrBreakStmt(pImage, rc = VERR_VD_IMAGE_NOT_FOUND); 8992 8966 /* sanity check */ 8967 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); 8968 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8969 8970 /* Check arguments. */ 8971 AssertPtrReturn(pBackendInfo, VERR_INVALID_POINTER); 8972 8973 int rc2 = vdThreadStartRead(pDisk); 8974 AssertRC(rc2); 8975 8976 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 8977 AssertPtr(pImage); 8978 if (pImage) 8979 { 8993 8980 pBackendInfo->pszBackend = pImage->Backend->pszBackendName; 8994 8981 pBackendInfo->uBackendCaps = pImage->Backend->uBackendCaps; 8995 8982 pBackendInfo->paFileExtensions = pImage->Backend->paFileExtensions; 8996 8983 pBackendInfo->paConfigInfo = pImage->Backend->paConfigInfo; 8997 } while (0); 8998 8999 if (RT_UNLIKELY(fLockRead)) 9000 { 9001 rc2 = vdThreadFinishRead(pDisk); 9002 AssertRC(rc2); 9003 } 8984 } 8985 else 8986 rc = VERR_VD_IMAGE_NOT_FOUND; 8987 8988 rc2 = vdThreadFinishRead(pDisk); 8989 AssertRC(rc2); 9004 8990 9005 8991 LogFlowFunc(("returns %Rrc\n", rc));
Note:
See TracChangeset
for help on using the changeset viewer.