VirtualBox

Changeset 79965 in vbox for trunk/src/VBox/Storage/testcase


Ignore:
Timestamp:
Jul 24, 2019 8:32:32 PM (5 years ago)
Author:
vboxsync
Message:

Storage: Added a desired format parameter to VDGetFormat() so Main can pass along the device type. Bumped the RAW backend down after the CUE and VISO to prevent (impossible) mixups of tiny files. Extended rawProbe() to look for a valid ISO-9660/UDF descriptor sequence on the image if the caller doesn't say it should be a floppy or hdd, only if that fail go by the extension. Note! the pfnProbe callback should probably get a score return parameter to indicate how confient the backend is about the probe result, as this would prevent the RAW backend from accidentally grabbing images which belongs to a plug-in. bugref:9151

Location:
trunk/src/VBox/Storage/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/tstVD.cpp

    r76553 r79965  
    544544        RTFileClose(File);
    545545        rc = VDGetFormat(NULL /* pVDIfsDisk */, NULL /* pVDIfsImage */,
    546                          pszBaseFilename, &pszFormat, &enmType);
     546                         pszBaseFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    547547        RTPrintf("VDGetFormat() pszFormat=%s rc=%Rrc\n", pszFormat, rc);
    548548        if (RT_SUCCESS(rc) && strcmp(pszFormat, pszBackend))
  • trunk/src/VBox/Storage/testcase/vbox-img.cpp

    r76553 r79965  
    283283        /* Don't pass error interface, as that would triggers error messages
    284284         * because some backends fail to open the image. */
    285         rc = VDGetFormat(NULL, NULL, pszFilename, &pszFormat, &enmType);
     285        rc = VDGetFormat(NULL, NULL, pszFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    286286        if (RT_FAILURE(rc))
    287287            return errorRuntime("Format autodetect failed: %Rrc\n", rc);
     
    419419        /* Don't pass error interface, as that would triggers error messages
    420420         * because some backends fail to open the image. */
    421         rc = VDGetFormat(NULL, NULL, pszFilename, &pszFormat, &enmType);
     421        rc = VDGetFormat(NULL, NULL, pszFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    422422        if (RT_FAILURE(rc))
    423423            return errorRuntime("Format autodetect failed: %Rrc\n", rc);
     
    12151215            char *pszFormat = NULL;
    12161216            VDTYPE enmType = VDTYPE_INVALID;
    1217             rc = VDGetFormat(NULL, NULL, pszSrcFilename, &pszFormat, &enmType);
     1217            rc = VDGetFormat(NULL, NULL, pszSrcFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    12181218            if (RT_FAILURE(rc))
    12191219            {
     
    13111311    char *pszFormat = NULL;
    13121312    VDTYPE enmType = VDTYPE_INVALID;
    1313     rc = VDGetFormat(NULL, NULL, pszFilename, &pszFormat, &enmType);
     1313    rc = VDGetFormat(NULL, NULL, pszFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    13141314    if (RT_FAILURE(rc))
    13151315        return errorSyntax("Format autodetect failed: %Rrc\n", rc);
     
    14071407    char *pszFormat = NULL;
    14081408    VDTYPE enmType = VDTYPE_INVALID;
    1409     int rc = VDGetFormat(NULL, NULL, pszFilename, &pszFormat, &enmType);
     1409    int rc = VDGetFormat(NULL, NULL, pszFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    14101410    if (RT_FAILURE(rc))
    14111411        return errorSyntax("Format autodetect failed: %Rrc\n", rc);
     
    18121812    if (!pszFormat)
    18131813    {
    1814         rc = VDGetFormat(NULL, NULL, pszFilename, &pszBackend, &enmType);
     1814        rc = VDGetFormat(NULL, NULL, pszFilename, VDTYPE_INVALID, &pszBackend, &enmType);
    18151815        if (RT_FAILURE(rc))
    18161816            return errorSyntax("Format autodetect failed: %Rrc\n", rc);
     
    18651865    char *pszFormat = NULL;
    18661866    VDTYPE enmType = VDTYPE_INVALID;
    1867     rc = VDGetFormat(NULL, NULL, pszFilename, &pszFormat, &enmType);
     1867    rc = VDGetFormat(NULL, NULL, pszFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    18681868    if (RT_FAILURE(rc))
    18691869        return errorSyntax("Format autodetect failed: %Rrc\n", rc);
     
    20222022    char *pszFormat = NULL;
    20232023    VDTYPE enmType = VDTYPE_INVALID;
    2024     rc = VDGetFormat(NULL, NULL, pszFilename, &pszFormat, &enmType);
     2024    rc = VDGetFormat(NULL, NULL, pszFilename, VDTYPE_INVALID, &pszFormat, &enmType);
    20252025    if (RT_FAILURE(rc))
    20262026        return errorSyntax("Format autodetect failed: %Rrc\n", rc);
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