~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/Main/MediumImpl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-03-11 17:16:37 UTC
  • mfrom: (0.3.4 upstream) (0.4.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100311171637-43z64ia3ccpj8vqn
Tags: 3.1.4-dfsg-2ubuntu1
* Merge from Debian unstable (LP: #528561), remaining changes:
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
  - Replace *-source packages with transitional packages for *-dkms
* Fix crash in vboxvideo_drm with kernel 2.6.33 / backported drm code
  (LP: #535297)
* Add a list of linux-headers packages to the apport hook
* Update debian/patches/u02-lp-integration.dpatch with a
  DEP-3 compliant header
* Add ${misc:Depends} to virtualbox-ose-source and virtualbox-ose-guest-source
  Depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1257
1257
 * @note All children of this hard disk get uninitialized by calling their
1258
1258
 *       uninit() methods.
1259
1259
 *
1260
 
 * @note Locks getTreeLock() for writing, VirtualBox for writing.
 
1260
 * @note Caller must hold the tree lock of the medium tree this medium is on.
1261
1261
 */
1262
1262
void Medium::uninit()
1263
1263
{
1628
1628
        AutoCaller autoCaller(this);
1629
1629
        CheckComRCReturnRC(autoCaller.rc());
1630
1630
 
 
1631
        /* we access mParent */
 
1632
        AutoReadLock treeLock(this->getTreeLock());
 
1633
 
1631
1634
        AutoReadLock alock(this);
1632
1635
 
1633
 
        /* we access mParent */
1634
 
        AutoReadLock treeLock(this->getTreeLock());
1635
 
 
1636
1636
        if (mParent.isNull())
1637
1637
        {
1638
1638
            *aLogicalSize = m->logicalSize;
2963
2963
    AutoCaller autoCaller(this);
2964
2964
    AssertComRCReturn(autoCaller.rc(), false);
2965
2965
 
2966
 
    AutoReadLock alock(this);
2967
 
 
2968
2966
    /* we access children */
2969
2967
    AutoReadLock treeLock(this->getTreeLock());
2970
2968
 
 
2969
    AutoReadLock alock(this);
 
2970
 
2971
2971
    switch (m->type)
2972
2972
    {
2973
2973
        case MediumType_Normal:
3010
3010
    AutoCaller autoCaller(this);
3011
3011
    CheckComRCReturnRC(autoCaller.rc());
3012
3012
 
3013
 
    AutoReadLock alock(this);
3014
 
 
3015
3013
    /* we access mParent */
3016
3014
    AutoReadLock treeLock(this->getTreeLock());
3017
3015
 
 
3016
    AutoReadLock alock(this);
 
3017
 
3018
3018
    data.uuid = m->id;
3019
3019
    data.strLocation = m->strLocation;
3020
3020
    data.strFormat = m->strFormat;
3115
3115
 
3116
3116
/**
3117
3117
 * Checks that this hard disk may be discarded and performs necessary state
3118
 
 * changes.
 
3118
 * changes. Must not be called for writethrough disks because there is nothing
 
3119
 * to discard then.
3119
3120
 *
3120
3121
 * This method is to be called prior to calling the #discard() to perform
3121
3122
 * necessary consistency checks and place involved hard disks to appropriate
3142
3143
    /* we access mParent & children() */
3143
3144
    AutoReadLock treeLock(this->getTreeLock());
3144
3145
 
3145
 
    AssertReturn(m->type == MediumType_Normal, E_FAIL);
 
3146
    // Medium must not be writethrough at this point
 
3147
    AssertReturn(   m->type == MediumType_Normal
 
3148
                 || m->type == MediumType_Immutable, E_FAIL);
3146
3149
 
3147
3150
    if (getChildren().size() == 0)
3148
3151
    {