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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-07-04 13:02:31 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110704130231-l843es6wqhx614n7
Tags: 4.0.10-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Add the Modaliases control field manually for maximum backportability.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 */
4
4
 
5
5
/*
6
 
 * Copyright (C) 2006-2010 Oracle Corporation
 
6
 * Copyright (C) 2006-2011 Oracle Corporation
7
7
 *
8
8
 * This file is part of VirtualBox Open Source Edition (OSE), as
9
9
 * available from http://www.virtualbox.org. This file is free software;
771
771
    rc = vdiFileReadSync(pImage, 0, &pImage->PreHeader, sizeof(pImage->PreHeader), NULL);
772
772
    if (RT_FAILURE(rc))
773
773
    {
774
 
        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: error reading pre-header in '%s'"), pImage->pszFilename);
 
774
        vdiError(pImage, rc, RT_SRC_POS, N_("VDI: error reading pre-header in '%s'"), pImage->pszFilename);
 
775
        rc = VERR_VD_VDI_INVALID_HEADER;
775
776
        goto out;
776
777
    }
777
778
    rc = vdiValidatePreHeader(&pImage->PreHeader);
1105
1106
            pfnProgress = pCbProgress->pfnProgress;
1106
1107
        pvUser = pIfProgress->pvUser;
1107
1108
    }
 
1109
    
 
1110
    /* Check the image flags. */
 
1111
    if ((uImageFlags & ~VD_VDI_IMAGE_FLAGS_MASK) != 0)
 
1112
    {
 
1113
        rc = VERR_VD_INVALID_TYPE;
 
1114
        goto out;
 
1115
    }
1108
1116
 
1109
1117
    /* Check open flags. All valid flags are supported. */
1110
1118
    if (uOpenFlags & ~VD_OPEN_FLAGS_MASK)