~ubuntu-branches/ubuntu/precise/virtualbox/precise-updates

« back to all changes in this revision

Viewing changes to src/VBox/Storage/VMDK.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-10-17 23:23:09 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20111017232309-kzm6841lzk61ranj
Tags: 4.1.4-dfsg-1
* New upstream release.
  - Fixes missing icons when using pt_BR locale. (Closes: #507188)
  - Fixes guest additions download url. (Closes: #637349; LP: #840668)
* Refresh patches.
* Drop the vboxmouse x11 driver. The mouse integration is now completely
  handled by the kernel module.
* Restrict dh_pycentral to the virtualbox binary package.
* Merge changes from the Ubuntu package but use them only when built
  on Ubuntu:
  - Add an Apport hook.
  - Add vboxguest modalias to the package control field.
* Pass KBUILD_VERBOSE=2 to kmk.
* Add 36-fix-text-mode.patch to fix text mode when using the vboxvideo driver.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: VMDK.cpp 38030 2011-07-18 15:42:12Z vboxsync $ */
 
1
/* $Id: VMDK.cpp $ */
2
2
/** @file
3
3
 * VMDK disk image, core code.
4
4
 */
92
92
/** Marker for footer in streamOptimized images. */
93
93
#define VMDK_MARKER_FOOTER 3
94
94
 
 
95
/** Marker for unknown purpose in streamOptimized images.
 
96
 * Shows up in very recent images created by vSphere, but only sporadically.
 
97
 * They "forgot" to document that one in the VMDK specification. */
 
98
#define VMDK_MARKER_UNSPECIFIED 4
 
99
 
95
100
/** Dummy marker for "don't check the marker value". */
96
101
#define VMDK_MARKER_IGNORE 0xffffffffU
97
102
 
3956
3961
                if (pfnProgress)
3957
3962
                {
3958
3963
                    rc = pfnProgress(pvUser,
3959
 
                                     uPercentStart + uOff * uPercentSpan / cbExtent);
 
3964
                                     uPercentStart + (cbOffset + uOff) * uPercentSpan / cbSize);
3960
3965
                    if (RT_FAILURE(rc))
3961
3966
                    {
3962
3967
                        RTMemFree(pvBuf);
4023
4028
                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new grain directory in '%s'"), pExtent->pszFullname);
4024
4029
        }
4025
4030
 
 
4031
        cbOffset += cbExtent;
 
4032
 
4026
4033
        if (RT_SUCCESS(rc) && pfnProgress)
4027
 
            pfnProgress(pvUser, uPercentStart + i * uPercentSpan / cExtents);
 
4034
            pfnProgress(pvUser, uPercentStart + cbOffset * uPercentSpan / cbSize);
4028
4035
 
4029
4036
        cbRemaining -= cbExtent;
4030
 
        cbOffset += cbExtent;
4031
4037
    }
4032
4038
 
4033
4039
    if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_ESX)
5560
5566
                    case VMDK_MARKER_FOOTER:
5561
5567
                        uGrainSectorAbs += 2;
5562
5568
                        break;
 
5569
                    case VMDK_MARKER_UNSPECIFIED:
 
5570
                        /* Skip over the contents of the unspecified marker
 
5571
                         * type 4 which exists in some vSphere created files. */
 
5572
                        /** @todo figure out what the payload means. */
 
5573
                        uGrainSectorAbs += 1;
 
5574
                        break;
5563
5575
                    default:
5564
5576
                        AssertMsgFailed(("VMDK: corrupted marker, type=%#x\n", Marker.uType));
5565
5577
                        pExtent->uGrainSectorAbs = 0;