VirtualBox

Changeset 9528 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jun 9, 2008 10:12:30 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
31806
Message:

fixes in setparentuuid and read/write to support diff images.

Location:
trunk/src/VBox/Devices/Storage
Files:
4 edited

Legend:

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

    r9262 r9528  
    14841484        pImage->uOpenFlags = uOpenFlags & VD_OPEN_FLAGS_HONOR_SAME;
    14851485        rc = pImage->Backend->pfnCreate(pImage->pszFilename,
    1486                                         VD_IMAGE_TYPE_NORMAL, pDisk->cbSize,
     1486                                        VD_IMAGE_TYPE_DIFF, pDisk->cbSize,
    14871487                                        uImageFlags, pszComment,
    14881488                                        &pDisk->PCHSGeometry,
  • trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp

    r9263 r9528  
    812812    if (   !VALID_PTR(pszFilename)
    813813        || !*pszFilename
    814         || (enmType != VD_IMAGE_TYPE_NORMAL && enmType != VD_IMAGE_TYPE_FIXED)
     814        || (enmType != VD_IMAGE_TYPE_NORMAL && enmType != VD_IMAGE_TYPE_FIXED
     815            && enmType != VD_IMAGE_TYPE_DIFF)
    815816        || cbSize < VDI_IMAGE_DEFAULT_BLOCK_SIZE
    816817        || !VALID_PTR(pPCHSGeometry)
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r9084 r9528  
    35883588        goto out;
    35893589    }
     3590
     3591    /* @todo A quick hack to support differencing images in VMDK. */
     3592    if (enmType == VD_IMAGE_TYPE_DIFF)
     3593        enmType = VD_IMAGE_TYPE_NORMAL;
    35903594
    35913595    /* Check remaining arguments. */
  • trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp

    r9490 r9528  
    393393                if (((uint8_t*)pvBuf)[i] != pSegment->u8Value)
    394394                {
    395                     RTPrintf("ERROR: Segment at %Lx of %d bytes is corrupt at offset %x (found %x instead of %x)\n",
     395                    RTPrintf("ERROR: Segment at %Lx of %x bytes is corrupt at offset %x (found %x instead of %x)\n",
    396396                             pSegment->u64Offset, pSegment->u32Length, i, ((uint8_t*)pvBuf)[i],
    397397                             pSegment->u8Value);
    398                     RTLogPrintf("ERROR: Segment at %Lx of %d bytes is corrupt at offset %x (found %x instead of %x)\n",
     398                    RTLogPrintf("ERROR: Segment at %Lx of %x bytes is corrupt at offset %x (found %x instead of %x)\n",
    399399                             pSegment->u64Offset, pSegment->u32Length, i, ((uint8_t*)pvBuf)[i],
    400400                             pSegment->u8Value);
     
    476476    generateRandomSegments(&ctx, paDiffSegments, nSegments, _1M, u64DiskSize, u32SectorSize, 128u, 255u);
    477477
    478     /*PSEGMENT pSegment;
    479     RTPrintf("Base segments:\n");
     478    PSEGMENT pSegment;
     479    /*RTPrintf("Base segments:\n");
    480480    for (pSegment = paBaseSegments; pSegment->u32Length; pSegment++)
    481         RTPrintf("off: %08Lx len: %04x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
     481        RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
    482482    writeSegmentsToDisk(pVD, pvBuf, paBaseSegments);
    483483
     
    489489    /*RTPrintf("\nDiff segments:\n");
    490490    for (pSegment = paDiffSegments; pSegment->u32Length; pSegment++)
    491         RTPrintf("off: %08Lx len: %04x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
     491        RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
    492492    writeSegmentsToDisk(pVD, pvBuf, paDiffSegments);
    493493
     
    501501    /*RTPrintf("\nMerged segments:\n");
    502502    for (pSegment = paMergeSegments; pSegment->u32Length; pSegment++)
    503         RTPrintf("off: %08Lx len: %04x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
     503        RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
    504504    rc = readAndCompareSegments(pVD, pvBuf, paMergeSegments);
    505505    CHECK("readAndCompareSegments()");
     
    565565    initializeRandomGenerator(&ctx, u32Seed);
    566566    generateRandomSegments(&ctx, paSegments, nSegments, _1M, u64DiskSize, u32SectorSize, 0u, 127u);
     567    /*for (PSEGMENT pSegment = paSegments; pSegment->u32Length; pSegment++)
     568        RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
    567569
    568570    writeSegmentsToDisk(pVD, pvBuf, paSegments);
     
    611613    RTFileDelete("tmpVDBase.vhd");
    612614    RTFileDelete("tmpVDDiff.vhd");
    613 
     615#if 1
    614616    rc = tstVDCreateDelete("VDI", "tmpVDCreate.vdi", 2 * _4G,
    615617                           VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE,
     
    708710        g_cErrors++;
    709711    }
    710 #if 0
     712#endif
     713
    711714    rc = tstVDOpenCreateWriteMerge("VHD", "tmpVDBase.vhd", "tmpVDDiff.vhd", u32Seed);
    712715    if (VBOX_FAILURE(rc))
     
    715718        g_cErrors++;
    716719    }
    717 #endif
     720
    718721    /*
    719722     * Clean up any leftovers.
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