VirtualBox

Changeset 18621 in vbox for trunk/src


Ignore:
Timestamp:
Apr 2, 2009 7:26:15 AM (16 years ago)
Author:
vboxsync
Message:

fix for xTracker #3762

File:
1 edited

Legend:

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

    r18572 r18621  
    74457445                    rc = hd->LockWrite (NULL);
    74467446                    AssertComRC (rc);
     7447                   
     7448                    mData->mSession.mLockedMedia.push_back (
     7449                        Data::Session::LockedMedia::value_type (
     7450                            ComPtr <IHardDisk> (hd), true));
    74477451
    74487452                    /* also, relock the old hard disk which is a base for the
     
    74567460                    rc = parent->LockRead (NULL);
    74577461                    AssertComRC (rc);
     7462
     7463                    /* XXX actually we should replace the old entry in that
     7464                     * vector (write lock => read lock) but this would take
     7465                     * some effort. So lets just ignore the error code in
     7466                     * SessionMachine::unlockMedia(). */
     7467                    mData->mSession.mLockedMedia.push_back (
     7468                        Data::Session::LockedMedia::value_type (
     7469                            ComPtr <IHardDisk> (parent), false));
    74587470                }
    74597471
     
    1107611088         it != mData->mSession.mLockedMedia.end(); ++ it)
    1107711089    {
     11090        MediaState_T state;
    1107811091        if (it->second)
    11079             rc = it->first->UnlockWrite (NULL);
     11092            rc = it->first->UnlockWrite (&state);
    1108011093        else
    11081             rc = it->first->UnlockRead (NULL);
    11082 
    11083         AssertComRC (rc);
     11094            rc = it->first->UnlockRead (&state);
     11095
     11096        /* the latter can happen if an object was re-locked in
     11097         * Machine::fixupHardDisks() */
     11098        Assert (SUCCEEDED (rc) || state == MediaState_LockedRead);
    1108411099    }
    1108511100
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