VirtualBox

Changeset 17836 in vbox


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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxHDD.h

    r16962 r17836  
    12621262 * @param   fMoveByRename   If true, attempt to perform a move by renaming (if successful the new size is ignored).
    12631263 * @param   cbSize          New image size (0 means leave unchanged).
     1264 * @param   uImageFlags     Flags specifying special destination image features.
    12641265 * @param   pDstUuid        New UUID of the destination image. If NULL, a new UUID is created.
    12651266 *                          This parameter is used if and only if a true copy is created.
     
    12731274VBOXDDU_DECL(int) VDCopy(PVBOXHDD pDiskFrom, unsigned nImage, PVBOXHDD pDiskTo,
    12741275                         const char *pszBackend, const char *pszFilename,
    1275                          bool fMoveByRename, uint64_t cbSize, PCRTUUID pDstUuid,
     1276                         bool fMoveByRename, uint64_t cbSize,
     1277                         unsigned uImageFlags, PCRTUUID pDstUuid,
    12761278                         PVDINTERFACE pVDIfsOperation,
    12771279                         PVDINTERFACE pDstVDIfsImage,
  • 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
  • trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp

    r16873 r17836  
    13231323        else
    13241324        {
    1325             vrc = VDCopy(pDisk, 0, pDisk, "VMDK", Utf8Str(dst).raw(), true, 0, NULL, NULL, NULL, NULL);
     1325            vrc = VDCopy(pDisk, 0, pDisk, "VMDK", Utf8Str(dst).raw(), true, 0, VD_IMAGE_FLAGS_NONE, NULL, NULL, NULL, NULL);
    13261326            if (RT_FAILURE(vrc))
    13271327            {
     
    16001600        /* Create the output image */
    16011601        vrc = VDCopy(pSrcDisk, VD_LAST_IMAGE, pDstDisk, Utf8Str(dstformat).raw(),
    1602                      Utf8Str(dst).raw(), false, 0, NULL, NULL, NULL, NULL);
     1602                     Utf8Str(dst).raw(), false, 0, VD_IMAGE_FLAGS_NONE, NULL, NULL, NULL, NULL);
    16031603        if (RT_FAILURE(vrc))
    16041604        {
  • trunk/src/VBox/Main/HardDiskImpl.cpp

    r17825 r17836  
    22392239 *
    22402240 * @param aTarget       Target hard disk.
     2241 * @param aVariant      Precise image variant to create.
    22412242 * @param aProgress     Where to find/store a Progress object to track operation
    22422243 *                      completion.
     
    34003401
    34013402            /* The object may request a specific UUID (through a special form of
    3402              * the setLocation() argumet). Otherwise we have to generate it */
     3403             * the setLocation() argument). Otherwise we have to generate it */
    34033404            Guid id = that->m.id;
    34043405            bool generateUuid = id.isEmpty();
     
    34403441                                            VD_IMAGE_TYPE_FIXED,
    34413442                                        task->d.size * _1M,
    3442                                         VD_IMAGE_FLAGS_NONE,
     3443                                        task->d.variant,
    34433444                                        NULL, &geo, &geo, id.raw(),
    34443445                                        VD_OPEN_FLAGS_NORMAL,
     
    35603561
    35613562                    vrc = VDCreateDiff (hdd, targetFormat, targetLocation,
    3562                                         VD_IMAGE_FLAGS_NONE,
     3563                                        task->d.variant,
    35633564                                        NULL, targetId.raw(),
    35643565                                        id.raw(),
     
    39773978
    39783979            /* The object may request a specific UUID (through a special form of
    3979              * the setLocation() argumet). Otherwise we have to generate it */
     3980             * the setLocation() argument). Otherwise we have to generate it */
    39803981            Guid targetId = target->m.id;
    39813982            bool generateUuid = targetId.isEmpty();
     
    40314032
    40324033                    vrc = VDCopy (hdd, 0, targetHdd, targetFormat,
    4033                                   targetLocation, false, 0, targetId.raw(),
    4034                                   NULL, target->mm.vdDiskIfaces,
     4034                                  targetLocation, false, 0, task->d.variant,
     4035                                  targetId.raw(), NULL,
     4036                                  target->mm.vdDiskIfaces,
    40354037                                  that->mm.vdDiskIfaces);
    40364038
     
    42534255
    42544256                    vrc = VDCreateDiff (hdd, format, location,
     4257                                        /// @todo use the same image variant as before
    42554258                                        VD_IMAGE_FLAGS_NONE,
    42564259                                        NULL, id.raw(),
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r17835 r17836  
    84138413    <const name="VmdkStreamOptimized" value="0x04">
    84148414      <desc>
    8415         VMDK streamOptimized image. Epecial import/export format which is
     8415        VMDK streamOptimized image. Special import/export format which is
    84168416        read-only/append-only.
    84178417      </desc>
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