VirtualBox

Changeset 150 in vbox for trunk


Ignore:
Timestamp:
Jan 18, 2007 4:56:28 PM (18 years ago)
Author:
vboxsync
Message:

r=bird: Use @remark instead of @note and don't but it before the autoamtic brief. Don't split string litterals. Keep logstatements from taking too many lines.

File:
1 edited

Legend:

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

    r139 r150  
    3535#include <iprt/uuid.h>
    3636#include <iprt/file.h>
    37 
    38 #include <string.h>
     37#include <iprt/string.h>
    3938
    4039#include "Builtins.h"
     
    743742    /* Check common header parameters. */
    744743
    745     bool failure = false;
     744    bool fFailed = false;
    746745
    747746    if (    getImageType(pHeader) < VDI_IMAGE_TYPE_FIRST
     
    749748    {
    750749        LogRel(("VDI: bad image type %d\n", getImageType(pHeader)));
    751         failure = true;
     750        fFailed = true;
    752751    }
    753752
     
    755754    {
    756755        LogRel(("VDI: bad image flags %08x\n", getImageFlags(pHeader)));
    757         failure = true;
     756        fFailed = true;
    758757    }
    759758
     
    762761        LogRel(("VDI: wrong sector size (%d != %d)\n",
    763762               (getImageGeometry(pHeader))->cbSector, VDI_GEOMETRY_SECTOR_SIZE));
    764         failure = true;
     763        fFailed = true;
    765764    }
    766765
     
    773772              getImageDiskSize(pHeader), getImageBlockSize(pHeader),
    774773              getImageBlocks(pHeader), getPowerOfTwo(getImageBlockSize(pHeader))));
    775         failure = true;
     774        fFailed = true;
    776775    }
    777776
     
    782781              getImageBlocksAllocated(pHeader), getImageBlocks(pHeader),
    783782              getImageBlockSize(pHeader), getImageDiskSize(pHeader)));
    784         failure = true;
     783        fFailed = true;
    785784    }
    786785
     
    790789        LogRel(("VDI: wrong extra size (%d, %d)\n",
    791790               getImageExtraBlockSize(pHeader), getPowerOfTwo(getImageExtraBlockSize(pHeader))));
    792         failure = true;
     791        fFailed = true;
    793792    }
    794793
     
    797796        LogRel(("VDI: wrong disk size (%d, %d, %lld)\n",
    798797               getImageBlockSize(pHeader), getImageBlocks(pHeader), getImageDiskSize(pHeader)));
    799         failure = true;
     798        fFailed = true;
    800799    }
    801800
     
    803802    {
    804803        LogRel(("VDI: uuid of creator is 0\n"));
    805         failure = true;
     804        fFailed = true;
    806805    }
    807806
     
    809808    {
    810809        LogRel(("VDI: uuid of modificator is 0\n"));
    811         failure = true;
    812     }
    813 
    814     return failure ? VERR_VDI_INVALID_HEADER : VINF_SUCCESS;
     810        fFailed = true;
     811    }
     812
     813    return fFailed ? VERR_VDI_INVALID_HEADER : VINF_SUCCESS;
    815814}
    816815
     
    19281927
    19291928/**
    1930  * @note    Only used by tstVDI.
    1931  *
    19321929 * internal: commit last image(s) to selected previous image.
    19331930 * note: all images accessed across this call must be opened in R/W mode.
     1931 * @remark    Only used by tstVDI.
    19341932 */
    19351933static int vdiCommitToImage(PVDIDISK pDisk, PVDIIMAGEDESC pDstImage,
     
    24802478/**
    24812479 * Shrinks growing image file by removing zeroed data blocks.
    2482  * @note    Only used by vditool
    24832480 *
    24842481 * @returns VBox status code.
     
    24862483 * @param   pfnProgress     Progress callback. Optional.
    24872484 * @param   pvUser          User argument for the progress callback.
     2485 * @remark  Only used by vditool
    24882486 */
    24892487IDER3DECL(int) VDIShrinkImage(const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser)
     
    25332531    unsigned cBlocksAllocated2 = (unsigned)(cbData >> pImage->uShiftIndex2Offset);
    25342532    if (cbData != (uint64_t)cBlocksAllocated << pImage->uShiftIndex2Offset)
    2535         Log(("VDIShrinkImage: invalid image file length, cbBlock=%u cBlocks=%u "
    2536              "cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     2533        Log(("VDIShrinkImage: invalid image file length, cbBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
    25372534             cbBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
    25382535
     
    25422539    if (!paBlocks2)
    25432540    {
    2544         Log(("VDIShrinkImage: failed to allocate paBlocks2 buffer (%u bytes)\n",
    2545              sizeof(VDIIMAGEBLOCKPOINTER) * cBlocks));
     2541        Log(("VDIShrinkImage: failed to allocate paBlocks2 buffer (%u bytes)\n", sizeof(VDIIMAGEBLOCKPOINTER) * cBlocks));
    25462542        vdiCloseImage(pImage);
    25472543        return VERR_NO_MEMORY;
     
    25712567            else
    25722568            {
    2573                 Log(("VDIShrinkImage: block n=%u -> uBlock=%u is out of blocks range! (cbBlock=%u "
    2574                      "cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu)\n",
     2569                Log(("VDIShrinkImage: block n=%u -> uBlock=%u is out of blocks range! (cbBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu)\n",
    25752570                     n, uBlock, cbBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
    25762571                /* free link to invalid block. */
     
    25962591                if (VBOX_FAILURE(rc))
    25972592                {
    2598                     Log(("VDIShrinkImage: seek rc=%Vrc filename=\"%s\" uBlock=%u cBlocks=%u "
    2599                          "cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
    2600                          rc, pImage->szFilename, uBlock, cBlocks, cBlocksAllocated,
    2601                          cBlocksAllocated2, cbData));
     2593                    Log(("VDIShrinkImage: seek rc=%Vrc filename=\"%s\" uBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     2594                         rc, pImage->szFilename, uBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
    26022595                    break;
    26032596                }
     
    26052598                if (VBOX_FAILURE(rc))
    26062599                {
    2607                     Log(("VDIShrinkImage: read rc=%Vrc filename=\"%s\" cbBlock=%u uBlock=%u "
    2608                          "cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
    2609                          rc, pImage->szFilename, cbBlock, uBlock, cBlocks, cBlocksAllocated,
    2610                          cBlocksAllocated2, cbData));
     2600                    Log(("VDIShrinkImage: read rc=%Vrc filename=\"%s\" cbBlock=%u uBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     2601                         rc, pImage->szFilename, cbBlock, uBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
    26112602                    break;
    26122603                }
     
    26332624                        if (VBOX_FAILURE(rc))
    26342625                        {
    2635                             Log(("VDIShrinkImage: seek(2) rc=%Vrc filename=\"%s\" uBlockWrite=%u "
    2636                                  "cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
    2637                                  rc, pImage->szFilename, uBlockWrite, cBlocks, cBlocksAllocated,
    2638                                  cBlocksAllocated2, cbData));
     2626                            Log(("VDIShrinkImage: seek(2) rc=%Vrc filename=\"%s\" uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     2627                                 rc, pImage->szFilename, uBlockWrite, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
    26392628                            break;
    26402629                        }
     
    26422631                        if (VBOX_FAILURE(rc))
    26432632                        {
    2644                             Log(("VDIShrinkImage: write rc=%Vrc filename=\"%s\" cbBlock=%u "
    2645                                  "uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u "
    2646                                  "cBlocksAllocated2=%u cbData=%llu\n",
    2647                                  rc, pImage->szFilename, cbBlock, uBlockWrite, cBlocks,
    2648                                  cBlocksAllocated, cBlocksAllocated2, cbData));
     2633                            Log(("VDIShrinkImage: write rc=%Vrc filename=\"%s\" cbBlock=%u uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     2634                                 rc, pImage->szFilename, cbBlock, uBlockWrite, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
    26492635                            break;
    26502636                        }
     
    27182704/**
    27192705 * Converts image file from older VDI formats to current one.
    2720  * @note    Only used by vditool
    27212706 *
    27222707 * @returns VBox status code.
     
    27242709 * @param   pfnProgress     Progress callback. Optional.
    27252710 * @param   pvUser          User argument for the progress callback.
     2711 * @remark  Only used by vditool
    27262712 */
    27272713IDER3DECL(int) VDIConvertImage(const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser)
     
    40033989 * Note that in case of unrecoverable error all images of HDD container will be closed.
    40043990 *
    4005  * @note    Only used by tstVDI.
    4006  *
    40073991 * @returns VBox status code.
    40083992 * @param   pDisk           Pointer to VDI HDD container.
    40093993 * @param   pfnProgress     Progress callback. Optional.
    40103994 * @param   pvUser          User argument for the progress callback.
     3995 * @remark  Only used by tstVDI.
    40113996 */
    40123997IDER3DECL(int) VDIDiskCommitLastDiff(PVDIDISK pDisk, PFNVMPROGRESS pfnProgress, void *pvUser)
     
    40674052
    40684053/**
    4069  * @note    Only used by tstVDI.
    4070  *
    40714054 * Creates and opens a new differencing image file in HDD container.
    40724055 * See comments for VDIDiskOpenImage function about differencing images.
     
    40784061 * @param   pfnProgress     Progress callback. Optional.
    40794062 * @param   pvUser          User argument for the progress callback.
     4063 * @remark  Only used by tstVDI.
    40804064 */
    40814065IDER3DECL(int) VDIDiskCreateOpenDifferenceImage(PVDIDISK pDisk, const char *pszFilename,
     
    41164100
    41174101/**
    4118  * @note    Only used by tstVDI.
    4119  *
    41204102 * internal: debug image dump.
     4103 *
     4104 * @remark  Only used by tstVDI.
    41214105 */
    41224106static void vdiDumpImage(PVDIIMAGEDESC pImage)
     
    41814165/**
    41824166 * Debug helper - dumps all opened images of HDD container into the log file.
    4183  * @note    Only used by tstVDI and vditool
    41844167 *
    41854168 * @param   pDisk           Pointer to VDI HDD container.
     4169 * @remark  Only used by tstVDI and vditool
    41864170 */
    41874171IDER3DECL(void) VDIDiskDumpImages(PVDIDISK pDisk)
     
    42694253        if (VBOX_FAILURE(rc))
    42704254            return PDMDRV_SET_ERROR(pDrvIns, rc,
    4271                                     N_("VHDD: Configuration error: Querying \"Path\" as "
    4272                                        "string failed"));
     4255                                    N_("VHDD: Configuration error: Querying \"Path\" as string failed"));
    42734256
    42744257        bool fReadOnly;
     
    42804263            MMR3HeapFree(pszName);
    42814264            return PDMDRV_SET_ERROR(pDrvIns, rc,
    4282                                     N_("VHDD: Configuration error: Querying \"ReadOnly\" as "
    4283                                        "boolean failed"));
     4265                                    N_("VHDD: Configuration error: Querying \"ReadOnly\" as boolean failed"));
    42844266        }
    42854267
     
    43114293    if (VBOX_FAILURE(rc))
    43124294        return PDMDRV_SET_ERROR(pDrvIns, rc,
    4313                                 N_("VHDD: Configuration error: Querying \"Path\" as "
    4314                                    "string failed"));
     4295                                N_("VHDD: Configuration error: Querying \"Path\" as string failed"));
    43154296
    43164297    /** True if the media is readonly. */
     
    43234304        MMR3HeapFree(pszName);
    43244305        return PDMDRV_SET_ERROR(pDrvIns, rc,
    4325                                 N_("VHDD: Configuration error: Querying \"ReadOnly\" as "
    4326                                    "boolean failed"));
    4327         return rc;
     4306                                N_("VHDD: Configuration error: Querying \"ReadOnly\" as boolean failed"));
    43284307    }
    43294308
     
    43344313                                                    : VDI_OPEN_FLAGS_NORMAL);
    43354314    if (VBOX_SUCCESS(rc))
    4336         Log(("vdiConstruct: Opened '%s' in %s mode\n",
    4337               pszName, VDIDiskIsReadOnly(pData) ? "read-only" : "read-write"));
     4315        Log(("vdiConstruct: Opened '%s' in %s mode\n", pszName, VDIDiskIsReadOnly(pData) ? "read-only" : "read-write"));
    43384316    else
    43394317        AssertMsgFailed(("Failed to open image '%s' rc=%Vrc\n", pszName, 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