VirtualBox

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


Ignore:
Timestamp:
Mar 13, 2009 3:26:27 PM (16 years ago)
Author:
vboxsync
Message:

API/HardDisk, Storage/VBoxHDD: use image variant, and to implement cloning to different image variant add a parameter to VDCopy.

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

Legend:

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

    r16963 r17836  
    18791879 * @param   fMoveByRename   If true, attempt to perform a move by renaming (if successful the new size is ignored).
    18801880 * @param   cbSize          New image size (0 means leave unchanged).
     1881 * @param   uImageFlags     Flags specifying special destination image features.
    18811882 * @param   pDstUuid        New UUID of the destination image. If NULL, a new UUID is created.
    18821883 *                          This parameter is used if and only if a true copy is created.
     
    18901891VBOXDDU_DECL(int) VDCopy(PVBOXHDD pDiskFrom, unsigned nImage, PVBOXHDD pDiskTo,
    18911892                         const char *pszBackend, const char *pszFilename,
    1892                          bool fMoveByRename, uint64_t cbSize, PCRTUUID pDstUuid,
     1893                         bool fMoveByRename, uint64_t cbSize,
     1894                         unsigned uImageFlags, PCRTUUID pDstUuid,
    18931895                         PVDINTERFACE pVDIfsOperation,
    18941896                         PVDINTERFACE pDstVDIfsImage,
     
    19631965        if (cbSize == 0)
    19641966            cbSize = cbSizeFrom;
    1965 
    1966         unsigned uImageFlagsFrom;
    1967         uImageFlagsFrom = pImageFrom->Backend->pfnGetImageFlags(pImageFrom->pvBackendData);
    19681967
    19691968        PDMMEDIAGEOMETRY PCHSGeometryFrom = {0, 0, 0};
     
    20132012        if (enmTypeFrom == VD_IMAGE_TYPE_DIFF)
    20142013        {
    2015             rc = VDCreateDiff(pDiskTo, pszBackend, pszFilename, uImageFlagsFrom,
     2014            rc = VDCreateDiff(pDiskTo, pszBackend, pszFilename, uImageFlags,
    20162015                              szComment, &ImageUuid, &ParentUuid, uOpenFlagsFrom & ~VD_OPEN_FLAGS_READONLY, NULL, NULL);
    20172016        } else {
     
    20222021
    20232022            rc = VDCreateBase(pDiskTo, pszBackend, pszFilename, enmTypeTo,
    2024                               cbSize, uImageFlagsFrom, szComment,
     2023                              cbSize, uImageFlags, szComment,
    20252024                              &PCHSGeometryFrom, &LCHSGeometryFrom,
    20262025                              NULL, uOpenFlagsFrom & ~VD_OPEN_FLAGS_READONLY, NULL, NULL);
  • trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp

    r16873 r17836  
    735735    rc = VDOpen(pVD, "VMDK", src, VD_OPEN_FLAGS_NORMAL, NULL);
    736736    CHECK("VDOpen()");
    737     rc = VDCopy(pVD, 0, pVD, "VMDK", dst, true, 0, NULL, NULL, NULL, NULL);
     737    rc = VDCopy(pVD, 0, pVD, "VMDK", dst, true, 0, VD_IMAGE_FLAGS_NONE, NULL, NULL, NULL, NULL);
    738738    CHECK("VDCopy()");
    739739
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