VirtualBox

Ignore:
Timestamp:
Jan 5, 2009 12:34:36 AM (16 years ago)
Author:
vboxsync
Message:

VDI: Update number of bytes actually written even if the block was completely zero. Fixes cloning of VDI's (public bug #2813)

File:
1 edited

Legend:

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

    r15673 r15785  
    10701070    {
    10711071        rc = VERR_VD_IMAGE_READ_ONLY;
    1072         goto out;
     1072        goto outfail;
    10731073    }
    10741074
     
    10761076    {
    10771077        rc = VERR_INVALID_PARAMETER;
    1078         goto out;
     1078        goto outfail;
    10791079    }
    10801080
     
    11211121            rc = RTFileWriteAt(pImage->File, u64Offset, pvBuf, cbToWrite, NULL);
    11221122            if (RT_FAILURE(rc))
    1123                 goto out;
     1123                goto outfail;
    11241124            pImage->paBlocks[uBlock] = cBlocksAllocated;
    11251125            setImageBlocksAllocated(&pImage->Header, cBlocksAllocated + 1);
     
    11271127            rc = vdiUpdateBlockInfo(pImage, uBlock);
    11281128            if (RT_FAILURE(rc))
    1129                 goto out;
     1129                goto outfail;
    11301130
    11311131            *pcbPreRead = 0;
     
    11481148        rc = RTFileWriteAt(pImage->File, u64Offset, pvBuf, cbToWrite, NULL);
    11491149    }
     1150
     1151out:
    11501152    if (pcbWriteProcess)
    11511153        *pcbWriteProcess = cbToWrite;
    11521154
    1153 out:
     1155outfail:
    11541156    LogFlowFunc(("returns %Rrc\n", rc));
    11551157    return 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