Changeset 15366 in vbox for trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
- Timestamp:
- Dec 12, 2008 1:50:32 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r14967 r15366 758 758 else if (CpQ == '\0') 759 759 { 760 rc = VERR_VD I_INVALID_HEADER;760 rc = VERR_VD_VMDK_INVALID_HEADER; 761 761 break; 762 762 } … … 859 859 RTMemTmpFree(pTmpGT1); 860 860 RTMemTmpFree(pTmpGT2); 861 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: inconsistent references to grain directory in '%s'"), pExtent->pszFullname);861 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: inconsistent references to grain directory in '%s'"), pExtent->pszFullname); 862 862 goto out; 863 863 } … … 884 884 RTMemTmpFree(pTmpGT1); 885 885 RTMemTmpFree(pTmpGT2); 886 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: inconsistency between grain table and backup grain table in '%s'"), pExtent->pszFullname);886 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: inconsistency between grain table and backup grain table in '%s'"), pExtent->pszFullname); 887 887 goto out; 888 888 } … … 1003 1003 pszStr++; 1004 1004 if (*pszStr++ != '"') 1005 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrectly quoted value in descriptor in '%s'"), pImage->pszFilename);1005 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrectly quoted value in descriptor in '%s'"), pImage->pszFilename); 1006 1006 1007 1007 pszQ = (char *)strchr(pszStr, '"'); 1008 1008 if (pszQ == NULL) 1009 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrectly quoted value in descriptor in '%s'"), pImage->pszFilename);1009 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrectly quoted value in descriptor in '%s'"), pImage->pszFilename); 1010 1010 pszUnquoted = (char *)RTMemTmpAlloc(pszQ - pszStr + 1); 1011 1011 if (!pszUnquoted) … … 1183 1183 if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDesc, pszKey, 1184 1184 &pszValue)) 1185 return VERR_VD I_VALUE_NOT_FOUND;1185 return VERR_VD_VMDK_VALUE_NOT_FOUND; 1186 1186 return RTStrToUInt32Ex(pszValue, NULL, 10, puValue); 1187 1187 } … … 1195 1195 if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDesc, pszKey, 1196 1196 &pszValue)) 1197 return VERR_VD I_VALUE_NOT_FOUND;1197 return VERR_VD_VMDK_VALUE_NOT_FOUND; 1198 1198 int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL); 1199 1199 if (RT_FAILURE(rc)) … … 1324 1324 if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey, 1325 1325 &pszValue)) 1326 return VERR_VD I_VALUE_NOT_FOUND;1326 return VERR_VD_VMDK_VALUE_NOT_FOUND; 1327 1327 int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL); 1328 1328 if (RT_FAILURE(rc)) … … 1340 1340 if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey, 1341 1341 &pszValue)) 1342 return VERR_VD I_VALUE_NOT_FOUND;1342 return VERR_VD_VMDK_VALUE_NOT_FOUND; 1343 1343 int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL); 1344 1344 if (RT_FAILURE(rc)) … … 1357 1357 if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey, 1358 1358 &pszValue)) 1359 return VERR_VD I_VALUE_NOT_FOUND;1359 return VERR_VD_VMDK_VALUE_NOT_FOUND; 1360 1360 int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL); 1361 1361 if (RT_FAILURE(rc)) … … 1429 1429 if (cLine >= VMDK_DESCRIPTOR_LINES_MAX) 1430 1430 { 1431 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: descriptor too big in '%s'"), pImage->pszFilename);1431 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: descriptor too big in '%s'"), pImage->pszFilename); 1432 1432 goto out; 1433 1433 } … … 1439 1439 if (*(pTmp + 1) != '\n') 1440 1440 { 1441 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: unsupported end of line in descriptor in '%s'"), pImage->pszFilename);1441 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: unsupported end of line in descriptor in '%s'"), pImage->pszFilename); 1442 1442 goto out; 1443 1443 } … … 1464 1464 && strcmp(pDescriptor->aLines[0], "# Disk Descriptor File")) 1465 1465 { 1466 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: descriptor does not start as expected in '%s'"), pImage->pszFilename);1466 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: descriptor does not start as expected in '%s'"), pImage->pszFilename); 1467 1467 goto out; 1468 1468 } … … 1484 1484 { 1485 1485 /* Incorrect ordering of entries. */ 1486 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect ordering of entries in descriptor in '%s'"), pImage->pszFilename);1486 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect ordering of entries in descriptor in '%s'"), pImage->pszFilename); 1487 1487 goto out; 1488 1488 } … … 1499 1499 { 1500 1500 /* Incorrect ordering of entries. */ 1501 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect ordering of entries in descriptor in '%s'"), pImage->pszFilename);1501 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect ordering of entries in descriptor in '%s'"), pImage->pszFilename); 1502 1502 goto out; 1503 1503 } … … 1514 1514 { 1515 1515 /* Incorrect ordering of entries. */ 1516 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect ordering of entries in descriptor in '%s'"), pImage->pszFilename);1516 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect ordering of entries in descriptor in '%s'"), pImage->pszFilename); 1517 1517 goto out; 1518 1518 } … … 1659 1659 return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error finding key 'version' in descriptor in '%s'"), pImage->pszFilename); 1660 1660 if (uVersion != 1) 1661 return vmdkError(pImage, VERR_VD I_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VMDK: unsupported format version in descriptor in '%s'"), pImage->pszFilename);1661 return vmdkError(pImage, VERR_VD_VMDK_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VMDK: unsupported format version in descriptor in '%s'"), pImage->pszFilename); 1662 1662 1663 1663 /* Get image creation type and determine image flags. */ … … 1686 1686 { 1687 1687 /* Monolithic image, must have only one extent (already opened). */ 1688 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: monolithic image may only have one extent in '%s'"), pImage->pszFilename);1688 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: monolithic image may only have one extent in '%s'"), pImage->pszFilename); 1689 1689 } 1690 1690 … … 1719 1719 } 1720 1720 else 1721 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1721 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1722 1722 if (*pszLine++ != ' ') 1723 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1723 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1724 1724 1725 1725 /* Nominal size of the extent. */ … … 1727 1727 &pImage->pExtents[i].cNominalSectors); 1728 1728 if (RT_FAILURE(rc)) 1729 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1729 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1730 1730 if (*pszLine++ != ' ') 1731 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1731 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1732 1732 1733 1733 /* Type of the extent. */ … … 1753 1753 } 1754 1754 else 1755 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1755 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1756 1756 if (pImage->pExtents[i].enmType == VMDKETYPE_ZERO) 1757 1757 { … … 1760 1760 pszLine++; 1761 1761 if (*pszLine != '\0') 1762 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1762 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1763 1763 pImage->pExtents[i].pszBasename = NULL; 1764 1764 } … … 1767 1767 /* All other extent types have basename and optional offset. */ 1768 1768 if (*pszLine++ != ' ') 1769 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1769 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1770 1770 1771 1771 /* Basename of the image. Surrounded by quotes. */ … … 1784 1784 &pImage->pExtents[i].uSectorOffset); 1785 1785 if (RT_FAILURE(rc)) 1786 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1786 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1787 1787 } 1788 1788 } 1789 1789 1790 1790 if (*pszLine != '\0') 1791 return vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);1791 return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename); 1792 1792 } 1793 1793 } … … 1797 1797 VMDK_DDB_GEO_PCHS_CYLINDERS, 1798 1798 &pImage->PCHSGeometry.cCylinders); 1799 if (rc == VERR_VD I_VALUE_NOT_FOUND)1799 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1800 1800 pImage->PCHSGeometry.cCylinders = 0; 1801 1801 else if (RT_FAILURE(rc)) … … 1804 1804 VMDK_DDB_GEO_PCHS_HEADS, 1805 1805 &pImage->PCHSGeometry.cHeads); 1806 if (rc == VERR_VD I_VALUE_NOT_FOUND)1806 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1807 1807 pImage->PCHSGeometry.cHeads = 0; 1808 1808 else if (RT_FAILURE(rc)) … … 1811 1811 VMDK_DDB_GEO_PCHS_SECTORS, 1812 1812 &pImage->PCHSGeometry.cSectors); 1813 if (rc == VERR_VD I_VALUE_NOT_FOUND)1813 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1814 1814 pImage->PCHSGeometry.cSectors = 0; 1815 1815 else if (RT_FAILURE(rc)) … … 1832 1832 VMDK_DDB_GEO_LCHS_CYLINDERS, 1833 1833 &pImage->LCHSGeometry.cCylinders); 1834 if (rc == VERR_VD I_VALUE_NOT_FOUND)1834 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1835 1835 pImage->LCHSGeometry.cCylinders = 0; 1836 1836 else if (RT_FAILURE(rc)) … … 1839 1839 VMDK_DDB_GEO_LCHS_HEADS, 1840 1840 &pImage->LCHSGeometry.cHeads); 1841 if (rc == VERR_VD I_VALUE_NOT_FOUND)1841 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1842 1842 pImage->LCHSGeometry.cHeads = 0; 1843 1843 else if (RT_FAILURE(rc)) … … 1846 1846 VMDK_DDB_GEO_LCHS_SECTORS, 1847 1847 &pImage->LCHSGeometry.cSectors); 1848 if (rc == VERR_VD I_VALUE_NOT_FOUND)1848 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1849 1849 pImage->LCHSGeometry.cSectors = 0; 1850 1850 else if (RT_FAILURE(rc)) … … 1862 1862 rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor, VMDK_DDB_IMAGE_UUID, 1863 1863 &pImage->ImageUuid); 1864 if (rc == VERR_VD I_VALUE_NOT_FOUND)1864 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1865 1865 { 1866 1866 /* Image without UUID. Probably created by VMware and not yet used … … 1887 1887 VMDK_DDB_MODIFICATION_UUID, 1888 1888 &pImage->ModificationUuid); 1889 if (rc == VERR_VD I_VALUE_NOT_FOUND)1889 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1890 1890 { 1891 1891 /* Image without UUID. Probably created by VMware and not yet used … … 1912 1912 rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor, VMDK_DDB_PARENT_UUID, 1913 1913 &pImage->ParentUuid); 1914 if (rc == VERR_VD I_VALUE_NOT_FOUND)1914 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1915 1915 { 1916 1916 /* Image without UUID. Probably created by VMware and not yet used … … 1937 1937 VMDK_DDB_PARENT_MODIFICATION_UUID, 1938 1938 &pImage->ParentModificationUuid); 1939 if (rc == VERR_VD I_VALUE_NOT_FOUND)1939 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 1940 1940 { 1941 1941 /* Image without UUID. Probably created by VMware and not yet used … … 2040 2040 goto out; 2041 2041 } 2042 if ( RT_LE2H_U32(Header.magicNumber) != VMDK_SPARSE_MAGICNUMBER 2043 || RT_LE2H_U32(Header.version) != 1) 2044 { 2045 rc = vmdkError(pExtent->pImage, VERR_VDI_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect magic/version in extent header in '%s'"), pExtent->pszFullname); 2042 if (RT_LE2H_U32(Header.magicNumber) != VMDK_SPARSE_MAGICNUMBER) 2043 { 2044 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect magic in sparse extent header in '%s'"), pExtent->pszFullname); 2045 goto out; 2046 } 2047 if (RT_LE2H_U32(Header.version) != 1) 2048 { 2049 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VMDK: incorrect version in sparse extent header in '%s', not a VMDK 1.0 conforming file"), pExtent->pszFullname); 2046 2050 goto out; 2047 2051 } … … 2052 2056 || Header.doubleEndLineChar2 != '\n') ) 2053 2057 { 2054 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: corrupted by CR/LF translation in '%s'"), pExtent->pszFullname);2058 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: corrupted by CR/LF translation in '%s'"), pExtent->pszFullname); 2055 2059 goto out; 2056 2060 } … … 2062 2066 if (pExtent->uDescriptorSector && !pExtent->cDescriptorSectors) 2063 2067 { 2064 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: inconsistent embedded descriptor config in '%s'"), pExtent->pszFullname);2068 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: inconsistent embedded descriptor config in '%s'"), pExtent->pszFullname); 2065 2069 goto out; 2066 2070 } … … 2083 2087 if (!cSectorsPerGDE || cSectorsPerGDE > UINT32_MAX) 2084 2088 { 2085 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect grain directory size in '%s'"), pExtent->pszFullname);2089 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrect grain directory size in '%s'"), pExtent->pszFullname); 2086 2090 goto out; 2087 2091 } … … 2131 2135 && (pExtent->enmType != VMDKETYPE_FLAT || pExtent->cNominalSectors + pExtent->uSectorOffset > VMDK_BYTE2SECTOR(cbExtentSize))) 2132 2136 { 2133 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: file size is not a multiple of 512 in '%s', file is truncated or otherwise garbled"), pExtent->pszFullname);2137 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: file size is not a multiple of 512 in '%s', file is truncated or otherwise garbled"), pExtent->pszFullname); 2134 2138 goto out; 2135 2139 } … … 2143 2147 || pExtent->cSectorsPerGrain < 8) 2144 2148 { 2145 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: invalid extent grain size %u in '%s'"), pExtent->cSectorsPerGrain, pExtent->pszFullname);2149 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: invalid extent grain size %u in '%s'"), pExtent->cSectorsPerGrain, pExtent->pszFullname); 2146 2150 goto out; 2147 2151 } … … 2152 2156 || pExtent->cGTEntries < VMDK_GT_CACHELINE_SIZE) 2153 2157 { 2154 rc = vmdkError(pExtent->pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: grain table cache size problem in '%s'"), pExtent->pszFullname);2158 rc = vmdkError(pExtent->pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: grain table cache size problem in '%s'"), pExtent->pszFullname); 2155 2159 goto out; 2156 2160 } … … 2226 2230 || RT_LE2H_U32(Header.flags) != 3) 2227 2231 { 2228 rc = VERR_VD I_INVALID_HEADER;2232 rc = VERR_VD_VMDK_INVALID_HEADER; 2229 2233 goto out; 2230 2234 } … … 2238 2242 || pExtent->cSectorsPerGrain > 2048) 2239 2243 { 2240 rc = VERR_VD I_INVALID_HEADER;2244 rc = VERR_VD_VMDK_INVALID_HEADER; 2241 2245 goto out; 2242 2246 } … … 2250 2254 if (!cSectorsPerGDE || cSectorsPerGDE > UINT32_MAX) 2251 2255 { 2252 rc = VERR_VD I_INVALID_HEADER;2256 rc = VERR_VD_VMDK_INVALID_HEADER; 2253 2257 goto out; 2254 2258 } … … 2259 2263 /* Inconsistency detected. Computed number of GD entries doesn't match 2260 2264 * stored value. Better be safe than sorry. */ 2261 rc = VERR_VD I_INVALID_HEADER;2265 rc = VERR_VD_VMDK_INVALID_HEADER; 2262 2266 goto out; 2263 2267 } … … 2444 2448 if (!pExtent->uDescriptorSector || !pExtent->cDescriptorSectors) 2445 2449 { 2446 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: monolithic image without descriptor in '%s'"), pImage->pszFilename);2450 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: monolithic image without descriptor in '%s'"), pImage->pszFilename); 2447 2451 goto out; 2448 2452 } … … 2503 2507 /* Likely the read is truncated. Better fail a bit too early 2504 2508 * (normally the descriptor is much smaller than our buffer). */ 2505 rc = vmdkError(pImage, VERR_VD I_INVALID_HEADER, RT_SRC_POS, N_("VMDK: cannot read descriptor in '%s'"), pImage->pszFilename);2509 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: cannot read descriptor in '%s'"), pImage->pszFilename); 2506 2510 goto out; 2507 2511 } … … 3612 3616 * ever happen on a valid extent. */ 3613 3617 if (uGTSector > UINT32_MAX) 3614 return VERR_VD I_INVALID_HEADER;3618 return VERR_VD_VMDK_INVALID_HEADER; 3615 3619 /* Write grain table by writing the required number of grain table 3616 3620 * cache chunks. Avoids dynamic memory allocation, but is a bit … … 3630 3634 if (pExtent->pRGD) 3631 3635 { 3632 AssertReturn(!uRGTSector, VERR_VD I_INVALID_HEADER);3636 AssertReturn(!uRGTSector, VERR_VD_VMDK_INVALID_HEADER); 3633 3637 rc = vmdkFileGetSize(pExtent->pFile, &cbExtentSize); 3634 3638 if (RT_FAILURE(rc)) … … 3640 3644 * this shouldn't ever happen on a valid extent. */ 3641 3645 if (uRGTSector > UINT32_MAX) 3642 return VERR_VD I_INVALID_HEADER;3646 return VERR_VD_VMDK_INVALID_HEADER; 3643 3647 /* Write backup grain table by writing the required number of grain 3644 3648 * table cache chunks. Avoids dynamic memory allocation, but is a … … 4259 4263 if (pExtent->enmAccess == VMDKACCESS_NOACCESS) 4260 4264 { 4261 rc = VERR_VD I_INVALID_STATE;4265 rc = VERR_VD_VMDK_INVALID_STATE; 4262 4266 goto out; 4263 4267 } … … 4281 4285 Assert(!(cbToRead % 512)); 4282 4286 if (uSectorExtentAbs == 0) 4283 rc = VERR_VD I_BLOCK_FREE;4287 rc = VERR_VD_BLOCK_FREE; 4284 4288 else 4285 4289 rc = vmdkFileReadAt(pExtent->pFile, … … 4322 4326 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 4323 4327 { 4324 rc = VERR_VD I_IMAGE_READ_ONLY;4328 rc = VERR_VD_IMAGE_READ_ONLY; 4325 4329 goto out; 4326 4330 } … … 4347 4351 if (pExtent->enmAccess != VMDKACCESS_READWRITE) 4348 4352 { 4349 rc = VERR_VD I_INVALID_STATE;4353 rc = VERR_VD_VMDK_INVALID_STATE; 4350 4354 goto out; 4351 4355 } … … 4377 4381 } 4378 4382 else 4379 rc = VERR_VD I_BLOCK_FREE;4383 rc = VERR_VD_BLOCK_FREE; 4380 4384 *pcbPreRead = 0; 4381 4385 *pcbPostRead = 0; … … 4387 4391 *pcbPreRead = VMDK_SECTOR2BYTE(uSectorExtentRel % pExtent->cSectorsPerGrain); 4388 4392 *pcbPostRead = VMDK_SECTOR2BYTE(pExtent->cSectorsPerGrain) - cbToWrite - *pcbPreRead; 4389 rc = VERR_VD I_BLOCK_FREE;4393 rc = VERR_VD_BLOCK_FREE; 4390 4394 } 4391 4395 } … … 4456 4460 *penmImageType = pImage->enmImageType; 4457 4461 else 4458 rc = VERR_VD I_NOT_OPENED;4462 rc = VERR_VD_NOT_OPENED; 4459 4463 4460 4464 LogFlowFunc(("returns %Rrc enmImageType=%u\n", rc, *penmImageType)); … … 4527 4531 } 4528 4532 else 4529 rc = VERR_VD I_GEOMETRY_NOT_SET;4533 rc = VERR_VD_GEOMETRY_NOT_SET; 4530 4534 } 4531 4535 else 4532 rc = VERR_VD I_NOT_OPENED;4536 rc = VERR_VD_NOT_OPENED; 4533 4537 4534 4538 LogFlowFunc(("returns %Rrc (PCHS=%u/%u/%u)\n", rc, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors)); … … 4550 4554 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 4551 4555 { 4552 rc = VERR_VD I_IMAGE_READ_ONLY;4556 rc = VERR_VD_IMAGE_READ_ONLY; 4553 4557 goto out; 4554 4558 } … … 4561 4565 } 4562 4566 else 4563 rc = VERR_VD I_NOT_OPENED;4567 rc = VERR_VD_NOT_OPENED; 4564 4568 4565 4569 out: … … 4586 4590 } 4587 4591 else 4588 rc = VERR_VD I_GEOMETRY_NOT_SET;4592 rc = VERR_VD_GEOMETRY_NOT_SET; 4589 4593 } 4590 4594 else 4591 rc = VERR_VD I_NOT_OPENED;4595 rc = VERR_VD_NOT_OPENED; 4592 4596 4593 4597 LogFlowFunc(("returns %Rrc (LCHS=%u/%u/%u)\n", rc, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors)); … … 4609 4613 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 4610 4614 { 4611 rc = VERR_VD I_IMAGE_READ_ONLY;4615 rc = VERR_VD_IMAGE_READ_ONLY; 4612 4616 goto out; 4613 4617 } … … 4620 4624 } 4621 4625 else 4622 rc = VERR_VD I_NOT_OPENED;4626 rc = VERR_VD_NOT_OPENED; 4623 4627 4624 4628 out: … … 4702 4706 rc = vmdkDescDDBGetStr(pImage, &pImage->Descriptor, 4703 4707 "ddb.comment", &pszCommentEncoded); 4704 if (rc == VERR_VD I_VALUE_NOT_FOUND)4708 if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND) 4705 4709 pszCommentEncoded = NULL; 4706 4710 else if (RT_FAILURE(rc)) … … 4715 4719 } 4716 4720 else 4717 rc = VERR_VD I_NOT_OPENED;4721 rc = VERR_VD_NOT_OPENED; 4718 4722 4719 4723 out: … … 4733 4737 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 4734 4738 { 4735 rc = VERR_VD I_IMAGE_READ_ONLY;4739 rc = VERR_VD_IMAGE_READ_ONLY; 4736 4740 goto out; 4737 4741 } … … 4740 4744 rc = vmdkSetImageComment(pImage, pszComment); 4741 4745 else 4742 rc = VERR_VD I_NOT_OPENED;4746 rc = VERR_VD_NOT_OPENED; 4743 4747 4744 4748 out: … … 4762 4766 } 4763 4767 else 4764 rc = VERR_VD I_NOT_OPENED;4768 rc = VERR_VD_NOT_OPENED; 4765 4769 4766 4770 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 4790 4794 } 4791 4795 else 4792 rc = VERR_VD I_IMAGE_READ_ONLY;4796 rc = VERR_VD_IMAGE_READ_ONLY; 4793 4797 } 4794 4798 else 4795 rc = VERR_VD I_NOT_OPENED;4799 rc = VERR_VD_NOT_OPENED; 4796 4800 4797 4801 LogFlowFunc(("returns %Rrc\n", rc)); … … 4814 4818 } 4815 4819 else 4816 rc = VERR_VD I_NOT_OPENED;4820 rc = VERR_VD_NOT_OPENED; 4817 4821 4818 4822 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 4841 4845 } 4842 4846 else 4843 rc = VERR_VD I_IMAGE_READ_ONLY;4847 rc = VERR_VD_IMAGE_READ_ONLY; 4844 4848 } 4845 4849 else 4846 rc = VERR_VD I_NOT_OPENED;4850 rc = VERR_VD_NOT_OPENED; 4847 4851 4848 4852 LogFlowFunc(("returns %Rrc\n", rc)); … … 4865 4869 } 4866 4870 else 4867 rc = VERR_VD I_NOT_OPENED;4871 rc = VERR_VD_NOT_OPENED; 4868 4872 4869 4873 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 4892 4896 } 4893 4897 else 4894 rc = VERR_VD I_IMAGE_READ_ONLY;4898 rc = VERR_VD_IMAGE_READ_ONLY; 4895 4899 } 4896 4900 else 4897 rc = VERR_VD I_NOT_OPENED;4901 rc = VERR_VD_NOT_OPENED; 4898 4902 4899 4903 LogFlowFunc(("returns %Rrc\n", rc)); … … 4916 4920 } 4917 4921 else 4918 rc = VERR_VD I_NOT_OPENED;4922 rc = VERR_VD_NOT_OPENED; 4919 4923 4920 4924 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 4943 4947 } 4944 4948 else 4945 rc = VERR_VD I_IMAGE_READ_ONLY;4949 rc = VERR_VD_IMAGE_READ_ONLY; 4946 4950 } 4947 4951 else 4948 rc = VERR_VD I_NOT_OPENED;4952 rc = VERR_VD_NOT_OPENED; 4949 4953 4950 4954 LogFlowFunc(("returns %Rrc\n", rc)); … … 5065 5069 if (pExtent->enmAccess == VMDKACCESS_NOACCESS) 5066 5070 { 5067 rc = VERR_VD I_INVALID_STATE;5071 rc = VERR_VD_VMDK_INVALID_STATE; 5068 5072 goto out; 5069 5073 } … … 5149 5153 { 5150 5154 /* The request was completely in a ZERO extent nothing to do. */ 5151 rc = VINF_VD I_ASYNC_IO_FINISHED;5155 rc = VINF_VD_ASYNC_IO_FINISHED; 5152 5156 } 5153 5157 else … … 5201 5205 if (pExtent->enmAccess == VMDKACCESS_NOACCESS) 5202 5206 { 5203 rc = VERR_VD I_INVALID_STATE;5207 rc = VERR_VD_VMDK_INVALID_STATE; 5204 5208 goto out; 5205 5209 } … … 5285 5289 { 5286 5290 /* The request was completely in a ZERO extent nothing to do. */ 5287 rc = VINF_VD I_ASYNC_IO_FINISHED;5291 rc = VINF_VD_ASYNC_IO_FINISHED; 5288 5292 } 5289 5293 else
Note:
See TracChangeset
for help on using the changeset viewer.