VirtualBox

vbox的更動 9734 路徑 trunk/src/VBox/Devices/Storage


忽略:
時間撮記:
2008-6-16 下午05:20:49 (16 年 以前)
作者:
vboxsync
訊息:

Extended the interface with backends to support time stamps and parent's filename.

位置:
trunk/src/VBox/Devices/Storage
檔案:
修改 5 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp

    r9599 r9734  
    15291529        {
    15301530            RTUUID Uuid;
     1531            RTTIMESPEC ts;
    15311532            int rc2;
    15321533
     
    15401541                pImage->Backend->pfnSetParentModificationUuid(pImage->pvBackendData,
    15411542                                                              &Uuid);
     1543            rc2 = pDisk->pLast->Backend->pfnGetTimeStamp(pDisk->pLast->pvBackendData,
     1544                                                             &ts);
     1545            if (VBOX_SUCCESS(rc2))
     1546                pImage->Backend->pfnSetParentTimeStamp(pImage->pvBackendData, &ts);
     1547
     1548            rc2 = pImage->Backend->pfnSetParentFilename(pImage->pvBackendData, pDisk->pLast->pszFilename);
    15421549        }
    15431550
  • trunk/src/VBox/Devices/Storage/VBoxHDD-newInternal.h

    r8155 r9734  
    376376    DECLR3CALLBACKMEMBER(void, pfnDump, (void *pvBackendData));
    377377
     378    /**
     379     * Get a time stamp of a disk image.
     380     *
     381     * @returns VBox status code.
     382     * @param   pvBackendData   Opaque state data for this image.
     383     * @param   pTimeStamp      Where to store the time stamp.
     384     */
     385    DECLR3CALLBACKMEMBER(int, pfnGetTimeStamp, (void *pvBackendData, PRTTIMESPEC pTimeStamp));
     386
     387    /**
     388     * Get the parent time stamp of a disk image.
     389     *
     390     * @returns VBox status code.
     391     * @param   pvBackendData   Opaque state data for this image.
     392     * @param   pTimeStamp      Where to store the time stamp.
     393     */
     394    DECLR3CALLBACKMEMBER(int, pfnGetParentTimeStamp, (void *pvBackendData, PRTTIMESPEC pTimeStamp));
     395
     396    /**
     397     * Set the parent time stamp of a disk image.
     398     *
     399     * @returns VBox status code.
     400     * @param   pvBackendData   Opaque state data for this image.
     401     * @param   pTimeStamp      Where to get the time stamp from.
     402     */
     403    DECLR3CALLBACKMEMBER(int, pfnSetParentTimeStamp, (void *pvBackendData, PCRTTIMESPEC pTimeStamp));
     404
     405    /**
     406     * Get the relative path to parent image.
     407     *
     408     * @returns VBox status code.
     409     * @param   pvBackendData     Opaque state data for this image.
     410     * @param   pszParentFilename Where to store the path.
     411     */
     412    DECLR3CALLBACKMEMBER(int, pfnGetParentFilename, (void *pvBackendData, char **ppszParentFilename));
     413
     414    /**
     415     * Set the relative path to parent image.
     416     *
     417     * @returns VBox status code.
     418     * @param   pvBackendData     Opaque state data for this image.
     419     * @param   pszParentFilename Where to get the path from.
     420     */
     421    DECLR3CALLBACKMEMBER(int, pfnSetParentFilename, (void *pvBackendData, const char *pszParentFilename));
     422
    378423} VBOXHDDBACKEND;
    379424
  • trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp

    r9528 r9734  
    17151715                cBadBlocks);
    17161716    }
     1717}
     1718
     1719static int vdiGetTimeStamp(void *pvBackendData, PRTTIMESPEC pTimeStamp)
     1720{
     1721    int rc = VERR_NOT_IMPLEMENTED;
     1722    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     1723    return rc;
     1724}
     1725
     1726static int vdiGetParentTimeStamp(void *pvBackendData, PRTTIMESPEC pTimeStamp)
     1727{
     1728    int rc = VERR_NOT_IMPLEMENTED;
     1729    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     1730    return rc;
     1731}
     1732
     1733static int vdiSetParentTimeStamp(void *pvBackendData, PCRTTIMESPEC pTimeStamp)
     1734{
     1735    int rc = VERR_NOT_IMPLEMENTED;
     1736    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     1737    return rc;
     1738}
     1739
     1740static int vdiGetParentFilename(void *pvBackendData, char **ppszParentFilename)
     1741{
     1742    int rc = VERR_NOT_IMPLEMENTED;
     1743    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     1744    return rc;
     1745}
     1746
     1747static int vdiSetParentFilename(void *pvBackendData, const char *pszParentFilename)
     1748{
     1749    int rc = VERR_NOT_IMPLEMENTED;
     1750    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     1751    return rc;
    17171752}
    17181753
     
    17851820    vdiSetParentModificationUuid,
    17861821    /* pfnDump */
    1787     vdiDump
     1822    vdiDump,
     1823    /* pfnGetTimeStamp */
     1824    vdiGetTimeStamp,
     1825    /* pfnGetParentTimeStamp */
     1826    vdiGetParentTimeStamp,
     1827    /* pfnSetParentTimeStamp */
     1828    vdiSetParentTimeStamp,
     1829    /* pfnGetParentFilename */
     1830    vdiGetParentFilename,
     1831    /* pfnSetParentFilename */
     1832    vdiSetParentFilename
    17881833};
    17891834
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r9528 r9734  
    46344634}
    46354635
     4636
     4637static int vmdkGetTimeStamp(void *pvBackendData, PRTTIMESPEC pTimeStamp)
     4638{
     4639    int rc = VERR_NOT_IMPLEMENTED;
     4640    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     4641    return rc;
     4642}
     4643
     4644static int vmdkGetParentTimeStamp(void *pvBackendData, PRTTIMESPEC pTimeStamp)
     4645{
     4646    int rc = VERR_NOT_IMPLEMENTED;
     4647    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     4648    return rc;
     4649}
     4650
     4651static int vmdkSetParentTimeStamp(void *pvBackendData, PCRTTIMESPEC pTimeStamp)
     4652{
     4653    int rc = VERR_NOT_IMPLEMENTED;
     4654    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     4655    return rc;
     4656}
     4657
     4658static int vmdkGetParentFilename(void *pvBackendData, char **ppszParentFilename)
     4659{
     4660    int rc = VERR_NOT_IMPLEMENTED;
     4661    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     4662    return rc;
     4663}
     4664
     4665static int vmdkSetParentFilename(void *pvBackendData, const char *pszParentFilename)
     4666{
     4667    int rc = VERR_NOT_IMPLEMENTED;
     4668    LogFlow(("%s: returned %Vrc\n", __FUNCTION__, rc));
     4669    return rc;
     4670}
    46364671
    46374672VBOXHDDBACKEND g_VmdkBackend =
     
    47034738    vmdkSetParentModificationUuid,
    47044739    /* pfnDump */
    4705     vmdkDump
     4740    vmdkDump,
     4741    /* pfnGetTimeStamp */
     4742    vmdkGetTimeStamp,
     4743    /* pfnGetParentTimeStamp */
     4744    vmdkGetParentTimeStamp,
     4745    /* pfnSetParentTimeStamp */
     4746    vmdkSetParentTimeStamp,
     4747    /* pfnGetParentFilename */
     4748    vmdkGetParentFilename,
     4749    /* pfnSetParentFilename */
     4750    vmdkSetParentFilename
    47064751};
  • trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp

    r9528 r9734  
    4242{
    4343    g_cErrors++;
    44     RTPrintf("tstVD: Error %Vrc at %s:%u (%s): ");
     44    RTPrintf("tstVD: Error %Vrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
    4545    RTPrintfV(pszFormat, va);
    4646    RTPrintf("\n");
     
    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++)
    481481        RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/
     
    583583    return 0;
    584584}
     585
    585586
    586587int main(int argc, char *argv[])
     
    703704        g_cErrors++;
    704705    }
     706#endif
    705707
    706708    rc = tstVDCreateWriteOpenRead("VHD", "tmpVDCreate.vhd", u32Seed);
     
    710712        g_cErrors++;
    711713    }
    712 #endif
    713714
    714715    rc = tstVDOpenCreateWriteMerge("VHD", "tmpVDBase.vhd", "tmpVDDiff.vhd", u32Seed);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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