VirtualBox

Ignore:
Timestamp:
Dec 12, 2008 1:50:32 PM (16 years ago)
Author:
vboxsync
Message:

Storage: Eradicated the last bits using the old VDI only backend, keeping only the testcases for now (no longer built).

Completely removed old iSCSI driver.

Added intnet option to addiscsidisk and adjusted documentation.

Made backend name comparisons case-insensitive.

Detect VMDK files not according to VMDK 1.0 and reject with clear error message.

Changed format probing logic to not fall through to the "unsupported" case if it's a known format, i.e. has valid header.

VBoxManage converthd generic format converter made official.

Added format flag to VBoxManage createhd, allows creating VMDK files.

VBoxManage convertdd reimplemented based on new framework, supporting any image format.

VBoxManage internalcommands sethduuid reimplemented based on new framework, supporting any image format.

Cleaned up error codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r14967 r15366  
    758758            else if (CpQ == '\0')
    759759            {
    760                 rc = VERR_VDI_INVALID_HEADER;
     760                rc = VERR_VD_VMDK_INVALID_HEADER;
    761761                break;
    762762            }
     
    859859                RTMemTmpFree(pTmpGT1);
    860860                RTMemTmpFree(pTmpGT2);
    861                 rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    862862                goto out;
    863863            }
     
    884884                RTMemTmpFree(pTmpGT1);
    885885                RTMemTmpFree(pTmpGT2);
    886                 rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    887887                goto out;
    888888            }
     
    10031003        pszStr++;
    10041004    if (*pszStr++ != '"')
    1005         return vmdkError(pImage, VERR_VDI_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);
    10061006
    10071007    pszQ = (char *)strchr(pszStr, '"');
    10081008    if (pszQ == NULL)
    1009         return vmdkError(pImage, VERR_VDI_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);
    10101010    pszUnquoted = (char *)RTMemTmpAlloc(pszQ - pszStr + 1);
    10111011    if (!pszUnquoted)
     
    11831183    if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDesc, pszKey,
    11841184                        &pszValue))
    1185         return VERR_VDI_VALUE_NOT_FOUND;
     1185        return VERR_VD_VMDK_VALUE_NOT_FOUND;
    11861186    return RTStrToUInt32Ex(pszValue, NULL, 10, puValue);
    11871187}
     
    11951195    if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDesc, pszKey,
    11961196                        &pszValue))
    1197         return VERR_VDI_VALUE_NOT_FOUND;
     1197        return VERR_VD_VMDK_VALUE_NOT_FOUND;
    11981198    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    11991199    if (RT_FAILURE(rc))
     
    13241324    if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey,
    13251325                        &pszValue))
    1326         return VERR_VDI_VALUE_NOT_FOUND;
     1326        return VERR_VD_VMDK_VALUE_NOT_FOUND;
    13271327    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    13281328    if (RT_FAILURE(rc))
     
    13401340    if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey,
    13411341                        &pszValue))
    1342         return VERR_VDI_VALUE_NOT_FOUND;
     1342        return VERR_VD_VMDK_VALUE_NOT_FOUND;
    13431343    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    13441344    if (RT_FAILURE(rc))
     
    13571357    if (!vmdkDescGetStr(pDescriptor, pDescriptor->uFirstDDB, pszKey,
    13581358                        &pszValue))
    1359         return VERR_VDI_VALUE_NOT_FOUND;
     1359        return VERR_VD_VMDK_VALUE_NOT_FOUND;
    13601360    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    13611361    if (RT_FAILURE(rc))
     
    14291429        if (cLine >= VMDK_DESCRIPTOR_LINES_MAX)
    14301430        {
    1431             rc = vmdkError(pImage, VERR_VDI_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);
    14321432            goto out;
    14331433        }
     
    14391439                if (*(pTmp + 1) != '\n')
    14401440                {
    1441                     rc = vmdkError(pImage, VERR_VDI_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);
    14421442                    goto out;
    14431443                }
     
    14641464        &&  strcmp(pDescriptor->aLines[0], "# Disk Descriptor File"))
    14651465    {
    1466         rc = vmdkError(pImage, VERR_VDI_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);
    14671467        goto out;
    14681468    }
     
    14841484                {
    14851485                    /* Incorrect ordering of entries. */
    1486                     rc = vmdkError(pImage, VERR_VDI_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);
    14871487                    goto out;
    14881488                }
     
    14991499                {
    15001500                    /* Incorrect ordering of entries. */
    1501                     rc = vmdkError(pImage, VERR_VDI_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);
    15021502                    goto out;
    15031503                }
     
    15141514                {
    15151515                    /* Incorrect ordering of entries. */
    1516                     rc = vmdkError(pImage, VERR_VDI_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);
    15171517                    goto out;
    15181518                }
     
    16591659        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error finding key 'version' in descriptor in '%s'"), pImage->pszFilename);
    16601660    if (uVersion != 1)
    1661         return vmdkError(pImage, VERR_VDI_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);
    16621662
    16631663    /* Get image creation type and determine image flags. */
     
    16861686    {
    16871687        /* Monolithic image, must have only one extent (already opened). */
    1688         return vmdkError(pImage, VERR_VDI_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);
    16891689    }
    16901690
     
    17191719        }
    17201720        else
    1721             return vmdkError(pImage, VERR_VDI_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);
    17221722        if (*pszLine++ != ' ')
    1723             return vmdkError(pImage, VERR_VDI_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);
    17241724
    17251725        /* Nominal size of the extent. */
     
    17271727                             &pImage->pExtents[i].cNominalSectors);
    17281728        if (RT_FAILURE(rc))
    1729             return vmdkError(pImage, VERR_VDI_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);
    17301730        if (*pszLine++ != ' ')
    1731             return vmdkError(pImage, VERR_VDI_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);
    17321732
    17331733        /* Type of the extent. */
     
    17531753        }
    17541754        else
    1755             return vmdkError(pImage, VERR_VDI_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);
    17561756        if (pImage->pExtents[i].enmType == VMDKETYPE_ZERO)
    17571757        {
     
    17601760                pszLine++;
    17611761            if (*pszLine != '\0')
    1762                 return vmdkError(pImage, VERR_VDI_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);
    17631763            pImage->pExtents[i].pszBasename = NULL;
    17641764        }
     
    17671767            /* All other extent types have basename and optional offset. */
    17681768            if (*pszLine++ != ' ')
    1769                 return vmdkError(pImage, VERR_VDI_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);
    17701770
    17711771            /* Basename of the image. Surrounded by quotes. */
     
    17841784                                         &pImage->pExtents[i].uSectorOffset);
    17851785                    if (RT_FAILURE(rc))
    1786                         return vmdkError(pImage, VERR_VDI_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);
    17871787                }
    17881788            }
    17891789
    17901790            if (*pszLine != '\0')
    1791                 return vmdkError(pImage, VERR_VDI_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);
    17921792        }
    17931793    }
     
    17971797                           VMDK_DDB_GEO_PCHS_CYLINDERS,
    17981798                           &pImage->PCHSGeometry.cCylinders);
    1799     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1799    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18001800        pImage->PCHSGeometry.cCylinders = 0;
    18011801    else if (RT_FAILURE(rc))
     
    18041804                           VMDK_DDB_GEO_PCHS_HEADS,
    18051805                           &pImage->PCHSGeometry.cHeads);
    1806     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1806    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18071807        pImage->PCHSGeometry.cHeads = 0;
    18081808    else if (RT_FAILURE(rc))
     
    18111811                           VMDK_DDB_GEO_PCHS_SECTORS,
    18121812                           &pImage->PCHSGeometry.cSectors);
    1813     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1813    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18141814        pImage->PCHSGeometry.cSectors = 0;
    18151815    else if (RT_FAILURE(rc))
     
    18321832                           VMDK_DDB_GEO_LCHS_CYLINDERS,
    18331833                           &pImage->LCHSGeometry.cCylinders);
    1834     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1834    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18351835        pImage->LCHSGeometry.cCylinders = 0;
    18361836    else if (RT_FAILURE(rc))
     
    18391839                           VMDK_DDB_GEO_LCHS_HEADS,
    18401840                           &pImage->LCHSGeometry.cHeads);
    1841     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1841    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18421842        pImage->LCHSGeometry.cHeads = 0;
    18431843    else if (RT_FAILURE(rc))
     
    18461846                           VMDK_DDB_GEO_LCHS_SECTORS,
    18471847                           &pImage->LCHSGeometry.cSectors);
    1848     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1848    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18491849        pImage->LCHSGeometry.cSectors = 0;
    18501850    else if (RT_FAILURE(rc))
     
    18621862    rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor, VMDK_DDB_IMAGE_UUID,
    18631863                            &pImage->ImageUuid);
    1864     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1864    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18651865    {
    18661866        /* Image without UUID. Probably created by VMware and not yet used
     
    18871887                            VMDK_DDB_MODIFICATION_UUID,
    18881888                            &pImage->ModificationUuid);
    1889     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1889    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    18901890    {
    18911891        /* Image without UUID. Probably created by VMware and not yet used
     
    19121912    rc = vmdkDescDDBGetUuid(pImage, &pImage->Descriptor, VMDK_DDB_PARENT_UUID,
    19131913                            &pImage->ParentUuid);
    1914     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1914    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    19151915    {
    19161916        /* Image without UUID. Probably created by VMware and not yet used
     
    19371937                            VMDK_DDB_PARENT_MODIFICATION_UUID,
    19381938                            &pImage->ParentModificationUuid);
    1939     if (rc == VERR_VDI_VALUE_NOT_FOUND)
     1939    if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    19401940    {
    19411941        /* Image without UUID. Probably created by VMware and not yet used
     
    20402040        goto out;
    20412041    }
    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);
    20462050        goto out;
    20472051    }
     
    20522056             || Header.doubleEndLineChar2 != '\n') )
    20532057    {
    2054         rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    20552059        goto out;
    20562060    }
     
    20622066    if (pExtent->uDescriptorSector && !pExtent->cDescriptorSectors)
    20632067    {
    2064         rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    20652069        goto out;
    20662070    }
     
    20832087    if (!cSectorsPerGDE || cSectorsPerGDE > UINT32_MAX)
    20842088    {
    2085         rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    20862090        goto out;
    20872091    }
     
    21312135        &&  (pExtent->enmType != VMDKETYPE_FLAT || pExtent->cNominalSectors + pExtent->uSectorOffset > VMDK_BYTE2SECTOR(cbExtentSize)))
    21322136    {
    2133         rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    21342138        goto out;
    21352139    }
     
    21432147        ||  pExtent->cSectorsPerGrain < 8)
    21442148    {
    2145         rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    21462150        goto out;
    21472151    }
     
    21522156        ||  pExtent->cGTEntries < VMDK_GT_CACHELINE_SIZE)
    21532157    {
    2154         rc = vmdkError(pExtent->pImage, VERR_VDI_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);
    21552159        goto out;
    21562160    }
     
    22262230        ||  RT_LE2H_U32(Header.flags) != 3)
    22272231    {
    2228         rc = VERR_VDI_INVALID_HEADER;
     2232        rc = VERR_VD_VMDK_INVALID_HEADER;
    22292233        goto out;
    22302234    }
     
    22382242        ||  pExtent->cSectorsPerGrain > 2048)
    22392243    {
    2240         rc = VERR_VDI_INVALID_HEADER;
     2244        rc = VERR_VD_VMDK_INVALID_HEADER;
    22412245        goto out;
    22422246    }
     
    22502254    if (!cSectorsPerGDE || cSectorsPerGDE > UINT32_MAX)
    22512255    {
    2252         rc = VERR_VDI_INVALID_HEADER;
     2256        rc = VERR_VD_VMDK_INVALID_HEADER;
    22532257        goto out;
    22542258    }
     
    22592263        /* Inconsistency detected. Computed number of GD entries doesn't match
    22602264         * stored value. Better be safe than sorry. */
    2261         rc = VERR_VDI_INVALID_HEADER;
     2265        rc = VERR_VD_VMDK_INVALID_HEADER;
    22622266        goto out;
    22632267    }
     
    24442448        if (!pExtent->uDescriptorSector || !pExtent->cDescriptorSectors)
    24452449        {
    2446             rc = vmdkError(pImage, VERR_VDI_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);
    24472451            goto out;
    24482452        }
     
    25032507            /* Likely the read is truncated. Better fail a bit too early
    25042508             * (normally the descriptor is much smaller than our buffer). */
    2505             rc = vmdkError(pImage, VERR_VDI_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);
    25062510            goto out;
    25072511        }
     
    36123616         * ever happen on a valid extent. */
    36133617        if (uGTSector > UINT32_MAX)
    3614             return VERR_VDI_INVALID_HEADER;
     3618            return VERR_VD_VMDK_INVALID_HEADER;
    36153619        /* Write grain table by writing the required number of grain table
    36163620         * cache chunks. Avoids dynamic memory allocation, but is a bit
     
    36303634        if (pExtent->pRGD)
    36313635        {
    3632             AssertReturn(!uRGTSector, VERR_VDI_INVALID_HEADER);
     3636            AssertReturn(!uRGTSector, VERR_VD_VMDK_INVALID_HEADER);
    36333637            rc = vmdkFileGetSize(pExtent->pFile, &cbExtentSize);
    36343638            if (RT_FAILURE(rc))
     
    36403644             * this shouldn't ever happen on a valid extent. */
    36413645            if (uRGTSector > UINT32_MAX)
    3642                 return VERR_VDI_INVALID_HEADER;
     3646                return VERR_VD_VMDK_INVALID_HEADER;
    36433647            /* Write backup grain table by writing the required number of grain
    36443648             * table cache chunks. Avoids dynamic memory allocation, but is a
     
    42594263    if (pExtent->enmAccess == VMDKACCESS_NOACCESS)
    42604264    {
    4261         rc = VERR_VDI_INVALID_STATE;
     4265        rc = VERR_VD_VMDK_INVALID_STATE;
    42624266        goto out;
    42634267    }
     
    42814285            Assert(!(cbToRead % 512));
    42824286            if (uSectorExtentAbs == 0)
    4283                 rc = VERR_VDI_BLOCK_FREE;
     4287                rc = VERR_VD_BLOCK_FREE;
    42844288            else
    42854289                rc = vmdkFileReadAt(pExtent->pFile,
     
    43224326    if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    43234327    {
    4324         rc = VERR_VDI_IMAGE_READ_ONLY;
     4328        rc = VERR_VD_IMAGE_READ_ONLY;
    43254329        goto out;
    43264330    }
     
    43474351    if (pExtent->enmAccess != VMDKACCESS_READWRITE)
    43484352    {
    4349         rc = VERR_VDI_INVALID_STATE;
     4353        rc = VERR_VD_VMDK_INVALID_STATE;
    43504354        goto out;
    43514355    }
     
    43774381                    }
    43784382                    else
    4379                         rc = VERR_VDI_BLOCK_FREE;
     4383                        rc = VERR_VD_BLOCK_FREE;
    43804384                    *pcbPreRead = 0;
    43814385                    *pcbPostRead = 0;
     
    43874391                    *pcbPreRead = VMDK_SECTOR2BYTE(uSectorExtentRel % pExtent->cSectorsPerGrain);
    43884392                    *pcbPostRead = VMDK_SECTOR2BYTE(pExtent->cSectorsPerGrain) - cbToWrite - *pcbPreRead;
    4389                     rc = VERR_VDI_BLOCK_FREE;
     4393                    rc = VERR_VD_BLOCK_FREE;
    43904394                }
    43914395            }
     
    44564460        *penmImageType = pImage->enmImageType;
    44574461    else
    4458         rc = VERR_VDI_NOT_OPENED;
     4462        rc = VERR_VD_NOT_OPENED;
    44594463
    44604464    LogFlowFunc(("returns %Rrc enmImageType=%u\n", rc, *penmImageType));
     
    45274531        }
    45284532        else
    4529             rc = VERR_VDI_GEOMETRY_NOT_SET;
     4533            rc = VERR_VD_GEOMETRY_NOT_SET;
    45304534    }
    45314535    else
    4532         rc = VERR_VDI_NOT_OPENED;
     4536        rc = VERR_VD_NOT_OPENED;
    45334537
    45344538    LogFlowFunc(("returns %Rrc (PCHS=%u/%u/%u)\n", rc, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
     
    45504554        if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    45514555        {
    4552             rc = VERR_VDI_IMAGE_READ_ONLY;
     4556            rc = VERR_VD_IMAGE_READ_ONLY;
    45534557            goto out;
    45544558        }
     
    45614565    }
    45624566    else
    4563         rc = VERR_VDI_NOT_OPENED;
     4567        rc = VERR_VD_NOT_OPENED;
    45644568
    45654569out:
     
    45864590        }
    45874591        else
    4588             rc = VERR_VDI_GEOMETRY_NOT_SET;
     4592            rc = VERR_VD_GEOMETRY_NOT_SET;
    45894593    }
    45904594    else
    4591         rc = VERR_VDI_NOT_OPENED;
     4595        rc = VERR_VD_NOT_OPENED;
    45924596
    45934597    LogFlowFunc(("returns %Rrc (LCHS=%u/%u/%u)\n", rc, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
     
    46094613        if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    46104614        {
    4611             rc = VERR_VDI_IMAGE_READ_ONLY;
     4615            rc = VERR_VD_IMAGE_READ_ONLY;
    46124616            goto out;
    46134617        }
     
    46204624    }
    46214625    else
    4622         rc = VERR_VDI_NOT_OPENED;
     4626        rc = VERR_VD_NOT_OPENED;
    46234627
    46244628out:
     
    47024706        rc = vmdkDescDDBGetStr(pImage, &pImage->Descriptor,
    47034707                              "ddb.comment", &pszCommentEncoded);
    4704         if (rc == VERR_VDI_VALUE_NOT_FOUND)
     4708        if (rc == VERR_VD_VMDK_VALUE_NOT_FOUND)
    47054709            pszCommentEncoded = NULL;
    47064710        else if (RT_FAILURE(rc))
     
    47154719    }
    47164720    else
    4717         rc = VERR_VDI_NOT_OPENED;
     4721        rc = VERR_VD_NOT_OPENED;
    47184722
    47194723out:
     
    47334737    if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    47344738    {
    4735         rc = VERR_VDI_IMAGE_READ_ONLY;
     4739        rc = VERR_VD_IMAGE_READ_ONLY;
    47364740        goto out;
    47374741    }
     
    47404744        rc = vmdkSetImageComment(pImage, pszComment);
    47414745    else
    4742         rc = VERR_VDI_NOT_OPENED;
     4746        rc = VERR_VD_NOT_OPENED;
    47434747
    47444748out:
     
    47624766    }
    47634767    else
    4764         rc = VERR_VDI_NOT_OPENED;
     4768        rc = VERR_VD_NOT_OPENED;
    47654769
    47664770    LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
     
    47904794        }
    47914795        else
    4792             rc = VERR_VDI_IMAGE_READ_ONLY;
     4796            rc = VERR_VD_IMAGE_READ_ONLY;
    47934797    }
    47944798    else
    4795         rc = VERR_VDI_NOT_OPENED;
     4799        rc = VERR_VD_NOT_OPENED;
    47964800
    47974801    LogFlowFunc(("returns %Rrc\n", rc));
     
    48144818    }
    48154819    else
    4816         rc = VERR_VDI_NOT_OPENED;
     4820        rc = VERR_VD_NOT_OPENED;
    48174821
    48184822    LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
     
    48414845        }
    48424846        else
    4843             rc = VERR_VDI_IMAGE_READ_ONLY;
     4847            rc = VERR_VD_IMAGE_READ_ONLY;
    48444848    }
    48454849    else
    4846         rc = VERR_VDI_NOT_OPENED;
     4850        rc = VERR_VD_NOT_OPENED;
    48474851
    48484852    LogFlowFunc(("returns %Rrc\n", rc));
     
    48654869    }
    48664870    else
    4867         rc = VERR_VDI_NOT_OPENED;
     4871        rc = VERR_VD_NOT_OPENED;
    48684872
    48694873    LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
     
    48924896        }
    48934897        else
    4894             rc = VERR_VDI_IMAGE_READ_ONLY;
     4898            rc = VERR_VD_IMAGE_READ_ONLY;
    48954899    }
    48964900    else
    4897         rc = VERR_VDI_NOT_OPENED;
     4901        rc = VERR_VD_NOT_OPENED;
    48984902
    48994903    LogFlowFunc(("returns %Rrc\n", rc));
     
    49164920    }
    49174921    else
    4918         rc = VERR_VDI_NOT_OPENED;
     4922        rc = VERR_VD_NOT_OPENED;
    49194923
    49204924    LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid));
     
    49434947        }
    49444948        else
    4945             rc = VERR_VDI_IMAGE_READ_ONLY;
     4949            rc = VERR_VD_IMAGE_READ_ONLY;
    49464950    }
    49474951    else
    4948         rc = VERR_VDI_NOT_OPENED;
     4952        rc = VERR_VD_NOT_OPENED;
    49494953
    49504954    LogFlowFunc(("returns %Rrc\n", rc));
     
    50655069        if (pExtent->enmAccess == VMDKACCESS_NOACCESS)
    50665070        {
    5067             rc = VERR_VDI_INVALID_STATE;
     5071            rc = VERR_VD_VMDK_INVALID_STATE;
    50685072            goto out;
    50695073        }
     
    51495153    {
    51505154        /* The request was completely in a ZERO extent nothing to do. */
    5151         rc = VINF_VDI_ASYNC_IO_FINISHED;
     5155        rc = VINF_VD_ASYNC_IO_FINISHED;
    51525156    }
    51535157    else
     
    52015205        if (pExtent->enmAccess == VMDKACCESS_NOACCESS)
    52025206        {
    5203             rc = VERR_VDI_INVALID_STATE;
     5207            rc = VERR_VD_VMDK_INVALID_STATE;
    52045208            goto out;
    52055209        }
     
    52855289    {
    52865290        /* The request was completely in a ZERO extent nothing to do. */
    5287         rc = VINF_VDI_ASYNC_IO_FINISHED;
     5291        rc = VINF_VD_ASYNC_IO_FINISHED;
    52885292    }
    52895293    else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette