VirtualBox

Changeset 749 in vbox


Ignore:
Timestamp:
Feb 7, 2007 2:49:33 PM (18 years ago)
Author:
vboxsync
Message:

Main: Fixed: Don't try to delete the image file of a differencing VDI on unregistration if the last accessibility check for this VDI failed.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r606 r749  
    38333833    AutoLock alock (this);
    38343834
    3835     /*
    3836      *  Lock the hard disk to ensure nobody registers it again before we delete
    3837      *  the differencing image (sanity check actually -- should never happen).
    3838      */
     3835    /* Lock the hard disk to ensure nobody registers it again before we delete
     3836     * the differencing image (sanity check actually -- should never happen). */
    38393837    AutoLock hdLock (aHardDisk);
    38403838
     
    38483846    if (!aHardDisk->parent())
    38493847    {
    3850         /*
    3851          *  non-differencing hard disk:
    3852          *  remove from the collection of top-level hard disks
    3853          */
     3848        /* non-differencing hard disk:
     3849         * remove from the collection of top-level hard disks */
    38543850        mData.mHardDisks.remove (aHardDisk);
    38553851    }
     
    38583854        Assert (aHardDisk->isDifferencing());
    38593855
    3860         /* differencing hard disk: uninitialize */
    3861         rc = aHardDisk->asVDI()->DeleteImage();
     3856        /* differencing hard disk: delete (only if the last access check
     3857         * succeeded) and uninitialize */
     3858        if (aHardDisk->asVDI()->lastAccessError().isNull())
     3859            rc = aHardDisk->asVDI()->DeleteImage();
    38623860        aHardDisk->uninit();
    38633861    }
  • trunk/src/VBox/Main/include/HardDiskImpl.h

    r351 r749  
    167167    void updatePaths (const char *aOldPath, const char *aNewPath);
    168168
    169     /* these must be are called from under the lock */
     169    /* the following must be called from under the lock */
    170170    bool isBusy() { isLockedOnCurrentThread(); return mBusy; }
    171171    unsigned readers() { isLockedOnCurrentThread(); return mReaders; }
     172    const Bstr &lastAccessError() const { return mLastAccessError; }
    172173
    173174    // for VirtualBoxSupportErrorInfoImpl
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