VirtualBox

Changeset 57214 in vbox for trunk/src


Ignore:
Timestamp:
Aug 6, 2015 10:19:55 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101966
Message:

vbox-img: for most errors print both, the cleartext error message as well as the error code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/vbox-img.cpp

    r55974 r57214  
    272272    rc = VDCreate(pVDIfs, enmType, &pVD);
    273273    if (RT_FAILURE(rc))
    274         return errorRuntime("Cannot create the virtual disk container: %Rrc\n", rc);
     274        return errorRuntime("Cannot create the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    275275
    276276    /* Open in info mode to be able to open diff images without their parent. */
    277277    rc = VDOpen(pVD, pszFormat, pszFilename, VD_OPEN_FLAGS_INFO, NULL);
    278278    if (RT_FAILURE(rc))
    279         return errorRuntime("Cannot open the virtual disk image \"%s\": %Rrc\n",
    280                             pszFilename, rc);
     279        return errorRuntime("Cannot open the virtual disk image \"%s\": %Rrf (%Rrc)\n",
     280                            pszFilename, rc, rc);
    281281
    282282    RTUUID oldImageUuid;
     
    301301        rc = VDSetUuid(pVD, VD_LAST_IMAGE, &imageUuid);
    302302        if (RT_FAILURE(rc))
    303             return errorRuntime("Cannot set UUID of virtual disk image \"%s\": %Rrc\n",
    304                                 pszFilename, rc);
     303            return errorRuntime("Cannot set UUID of virtual disk image \"%s\": %Rrf (%Rrc)\n",
     304                                pszFilename, rc, rc);
    305305    }
    306306
     
    310310        rc = VDSetParentUuid(pVD, VD_LAST_IMAGE, &parentUuid);
    311311        if (RT_FAILURE(rc))
    312             return errorRuntime("Cannot set parent UUID of virtual disk image \"%s\": %Rrc\n",
    313                                 pszFilename, rc);
     312            return errorRuntime("Cannot set parent UUID of virtual disk image \"%s\": %Rrf (%Rrc)\n",
     313                                pszFilename, rc, rc);
    314314    }
    315315
     
    408408    rc = VDCreate(pVDIfs, enmType, &pVD);
    409409    if (RT_FAILURE(rc))
    410         return errorRuntime("Cannot create the virtual disk container: %Rrc\n", rc);
     410        return errorRuntime("Cannot create the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    411411
    412412    /* Open in info mode to be able to open diff images without their parent. */
    413413    rc = VDOpen(pVD, pszFormat, pszFilename, VD_OPEN_FLAGS_INFO, NULL);
    414414    if (RT_FAILURE(rc))
    415         return errorRuntime("Cannot open the virtual disk image \"%s\": %Rrc\n",
    416                             pszFilename, rc);
     415        return errorRuntime("Cannot open the virtual disk image \"%s\": %Rrf (%Rrc)\n",
     416                            pszFilename, rc, rc);
    417417
    418418    VDGEOMETRY oldLCHSGeometry;
     
    442442        rc = VDSetLCHSGeometry(pVD, VD_LAST_IMAGE, &newLCHSGeometry);
    443443        if (RT_FAILURE(rc))
    444             return errorRuntime("Cannot set LCHS geometry of virtual disk image \"%s\": %Rrc\n",
    445                                 pszFilename, rc);
     444            return errorRuntime("Cannot set LCHS geometry of virtual disk image \"%s\": %Rrf (%Rrc)\n",
     445                                pszFilename, rc, rc);
    446446    }
    447447    else
     
    10131013        if (RT_FAILURE(rc))
    10141014        {
    1015             errorRuntime("Error while creating source disk container: %Rrc\n", rc);
     1015            errorRuntime("Error while creating source disk container: %Rrf (%Rrc)\n", rc, rc);
    10161016            break;
    10171017        }
     
    10221022        if (RT_FAILURE(rc))
    10231023        {
    1024             errorRuntime("Error while opening source image: %Rrc\n", rc);
     1024            errorRuntime("Error while opening source image: %Rrf (%Rrc)\n", rc, rc);
    10251025            break;
    10261026        }
     
    10291029        if (RT_FAILURE(rc))
    10301030        {
    1031             errorRuntime("Error while creating the destination disk container: %Rrc\n", rc);
     1031            errorRuntime("Error while creating the destination disk container: %Rrf (%Rrc)\n", rc, rc);
    10321032            break;
    10331033        }
     
    10431043        if (RT_FAILURE(rc))
    10441044        {
    1045             errorRuntime("Error while copying the image: %Rrc\n", rc);
     1045            errorRuntime("Error while copying the image: %Rrf (%Rrc)\n", rc, rc);
    10461046            break;
    10471047        }
     
    11021102    rc = VDCreate(pVDIfs, enmType, &pDisk);
    11031103    if (RT_FAILURE(rc))
    1104         return errorRuntime("Error while creating the virtual disk container: %Rrc\n", rc);
     1104        return errorRuntime("Error while creating the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    11051105
    11061106    /* Open the image */
    11071107    rc = VDOpen(pDisk, pszFormat, pszFilename, VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_READONLY, NULL);
    11081108    if (RT_FAILURE(rc))
    1109         return errorRuntime("Error while opening the image: %Rrc\n", rc);
     1109        return errorRuntime("Error while opening the image: %Rrf (%Rrc)\n", rc, rc);
    11101110
    11111111    VDDumpImages(pDisk);
     
    12611261    rc = VDCreate(pVDIfs, enmType, &pDisk);
    12621262    if (RT_FAILURE(rc))
    1263         return errorRuntime("Error while creating the virtual disk container: %Rrc\n", rc);
     1263        return errorRuntime("Error while creating the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    12641264
    12651265    /* Open the image */
    12661266    rc = VDOpen(pDisk, pszFormat, pszFilename, VD_OPEN_FLAGS_NORMAL, NULL);
    12671267    if (RT_FAILURE(rc))
    1268         return errorRuntime("Error while opening the image: %Rrc\n", rc);
     1268        return errorRuntime("Error while opening the image: %Rrf (%Rrc)\n", rc, rc);
    12691269
    12701270    if (   RT_SUCCESS(rc)
     
    13521352                }
    13531353                else
    1354                     errorRuntime("Error while opening the volume manager: %Rrc\n", rc);
     1354                    errorRuntime("Error while opening the volume manager: %Rrf (%Rrc)\n", rc, rc);
    13551355            }
    13561356            else
    1357                 errorRuntime("Error creating the volume manager: %Rrc\n", rc);
     1357                errorRuntime("Error creating the volume manager: %Rrf (%Rrc)\n", rc, rc);
    13581358        }
    13591359        else
     
    13681368        rc = VDCompact(pDisk, 0, pIfsCompact);
    13691369        if (RT_FAILURE(rc))
    1370             errorRuntime("Error while compacting image: %Rrc\n", rc);
     1370            errorRuntime("Error while compacting image: %Rrf (%Rrc)\n", rc, rc);
    13711371    }
    13721372
     
    14351435    rc = VDCreate(pVDIfs, VDTYPE_HDD, &pDisk);
    14361436    if (RT_FAILURE(rc))
    1437         return errorRuntime("Error while creating the virtual disk container: %Rrc\n", rc);
     1437        return errorRuntime("Error while creating the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    14381438
    14391439    rc = VDCreateCache(pDisk, "VCI", pszFilename, cbSize, VD_IMAGE_FLAGS_DEFAULT,
    14401440                       NULL, NULL, VD_OPEN_FLAGS_NORMAL, NULL, NULL);
    14411441    if (RT_FAILURE(rc))
    1442         return errorRuntime("Error while creating the virtual disk cache: %Rrc\n", rc);
     1442        return errorRuntime("Error while creating the virtual disk cache: %Rrf (%Rrc)\n", rc, rc);
    14431443
    14441444    VDDestroy(pDisk);
     
    15721572    rc = VDCreate(pVDIfs, VDTYPE_HDD, &pDisk);
    15731573    if (RT_FAILURE(rc))
    1574         return errorRuntime("Error while creating the virtual disk container: %Rrc\n", rc);
     1574        return errorRuntime("Error while creating the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    15751575
    15761576    rc = VDCreateBase(pDisk, pszBackend, pszFilename, cbSize, uImageFlags,
     
    15781578                      NULL, pVDIfsOperation);
    15791579    if (RT_FAILURE(rc))
    1580         return errorRuntime("Error while creating the virtual disk: %Rrc\n", rc);
     1580        return errorRuntime("Error while creating the virtual disk: %Rrf (%Rrc)\n", rc, rc);
    15811581
    15821582    VDDestroy(pDisk);
     
    16451645    rc = VDRepair(pVDIfs, NULL, pszFilename, pszFormat, fDryRun ? VD_REPAIR_DRY_RUN : 0);
    16461646    if (RT_FAILURE(rc))
    1647         rc = errorRuntime("Error while repairing the virtual disk: %Rrc\n", rc);
     1647        rc = errorRuntime("Error while repairing the virtual disk: %Rrf (%Rrc)\n", rc, rc);
    16481648
    16491649    if (pszBackend)
     
    16971697    rc = VDCreate(pVDIfs, enmType, &pDisk);
    16981698    if (RT_FAILURE(rc))
    1699         return errorRuntime("Error while creating the virtual disk container: %Rrc\n", rc);
     1699        return errorRuntime("Error while creating the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    17001700
    17011701    /* Open the image */
    17021702    rc = VDOpen(pDisk, pszFormat, pszFilename, VD_OPEN_FLAGS_INFO, NULL);
    17031703    if (RT_FAILURE(rc))
    1704         return errorRuntime("Error while opening the image: %Rrc\n", rc);
     1704        return errorRuntime("Error while opening the image: %Rrf (%Rrc)\n", rc, rc);
    17051705
    17061706    VDSetComment(pDisk, 0, NULL);
     
    17681768    rc = VDCreate(pVDIfs, enmType, &pDisk);
    17691769    if (RT_FAILURE(rc))
    1770         return errorRuntime("Error while creating the virtual disk container: %Rrc\n", rc);
     1770        return errorRuntime("Error while creating the virtual disk container: %Rrf (%Rrc)\n", rc, rc);
    17711771
    17721772    /* Open the image */
    17731773    rc = VDOpen(pDisk, pszFormat, pszFilename, VD_OPEN_FLAGS_NORMAL, NULL);
    17741774    if (RT_FAILURE(rc))
    1775         return errorRuntime("Error while opening the image: %Rrc\n", rc);
     1775        return errorRuntime("Error while opening the image: %Rrf (%Rrc)\n", rc, rc);
    17761776
    17771777    rc = VDResize(pDisk, cbNew, &PCHSGeometry, &LCHSGeometry, NULL);
    17781778    if (RT_FAILURE(rc))
    1779         rc = errorRuntime("Error while resizing the virtual disk: %Rrc\n", rc);
     1779        rc = errorRuntime("Error while resizing the virtual disk: %Rrf (%Rrc)\n", rc, rc);
    17801780
    17811781    VDDestroy(pDisk);
Note: See TracChangeset for help on using the changeset viewer.

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