Changeset 9565 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Jun 10, 2008 11:39:40 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp
r9560 r9565 1108 1108 * diff images. Some image formats don't distinguish between normal 1109 1109 * and diff images, so this must be corrected here. */ 1110 if (VBOX_FAILURE(rc)) 1111 enmImageType = VD_IMAGE_TYPE_INVALID; 1110 1112 if ( VBOX_SUCCESS(rc) 1111 1113 && !(uOpenFlags & VD_OPEN_FLAGS_INFO)) 1112 1114 { 1113 rc = VERR_VDI_INVALID_TYPE; 1114 break; 1115 } 1116 if ( pDisk->cImages == 0 1117 && ( enmImageType != VD_IMAGE_TYPE_FIXED 1118 || enmImageType != VD_IMAGE_TYPE_NORMAL)) 1119 { 1120 rc = VERR_VDI_INVALID_TYPE; 1121 break; 1122 } 1123 else if (pDisk->cImages != 0) 1124 { 1125 if ( enmImageType != VD_IMAGE_TYPE_NORMAL 1126 || enmImageType != VD_IMAGE_TYPE_DIFF) 1115 if ( pDisk->cImages == 0 1116 && ( enmImageType != VD_IMAGE_TYPE_FIXED 1117 || enmImageType != VD_IMAGE_TYPE_NORMAL)) 1127 1118 { 1128 1119 rc = VERR_VDI_INVALID_TYPE; 1129 1120 break; 1130 1121 } 1131 else 1132 enmImageType = VD_IMAGE_TYPE_DIFF; 1122 else if (pDisk->cImages != 0) 1123 { 1124 if ( enmImageType != VD_IMAGE_TYPE_NORMAL 1125 || enmImageType != VD_IMAGE_TYPE_DIFF) 1126 { 1127 rc = VERR_VDI_INVALID_TYPE; 1128 break; 1129 } 1130 else 1131 enmImageType = VD_IMAGE_TYPE_DIFF; 1132 } 1133 1133 } 1134 1134 pImage->enmImageType = enmImageType; … … 2777 2777 AssertPtrBreakStmt(pImage, rc = VERR_VDI_IMAGE_NOT_FOUND); 2778 2778 2779 *penmType = pImage->enmImageType; 2779 if ( pImage->enmImageType >= VD_IMAGE_TYPE_FIRST 2780 && pImage->enmImageType <= VD_IMAGE_TYPE_DIFF) 2781 { 2782 *penmType = pImage->enmImageType; 2783 rc = VINF_SUCCESS; 2784 } 2785 else 2786 rc = VERR_VDI_INVALID_TYPE; 2780 2787 } while (0); 2781 2788
Note:
See TracChangeset
for help on using the changeset viewer.