Changeset 24509 in vbox
- Timestamp:
- Nov 9, 2009 2:59:05 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r24462 r24509 71 71 const Guid &aSnapshotId = Guid::Empty) 72 72 : machineId(aMachineId), 73 inCurState(aSnapshotId.isEmpty())73 fInCurState(aSnapshotId.isEmpty()) 74 74 { 75 75 if (!aSnapshotId.isEmpty()) … … 78 78 79 79 Guid machineId; 80 bool inCurState : 1;80 bool fInCurState : 1; 81 81 GuidList llSnapshotIds; 82 82 }; … … 1793 1793 /* if the medium is attached to the machine in the current state, we 1794 1794 * return its ID as the first element of the array */ 1795 if (it-> inCurState)1796 ++ 1795 if (it->fInCurState) 1796 ++size; 1797 1797 1798 1798 if (size > 0) … … 1801 1801 1802 1802 size_t j = 0; 1803 if (it-> inCurState)1804 it->machineId.toUtf16().detachTo(&snapshotIds [j++]);1803 if (it->fInCurState) 1804 it->machineId.toUtf16().detachTo(&snapshotIds[j++]); 1805 1805 1806 1806 for (BackRef::GuidList::const_iterator jt = it->llSnapshotIds.begin(); … … 1808 1808 ++jt, ++j) 1809 1809 { 1810 (*jt).toUtf16().detachTo(&snapshotIds 1810 (*jt).toUtf16().detachTo(&snapshotIds[j]); 1811 1811 } 1812 1812 } … … 2689 2689 } 2690 2690 2691 // if the caller has not supplied a snapshot ID, then we're attaching 2692 // to a machine a medium which represents the machine's current state, 2693 // so set the flag 2691 2694 if (aSnapshotId.isEmpty()) 2692 2695 { 2693 2696 /* sanity: no duplicate attachments */ 2694 AssertReturn(!it-> inCurState, E_FAIL);2695 it-> inCurState = true;2697 AssertReturn(!it->fInCurState, E_FAIL); 2698 it->fInCurState = true; 2696 2699 2697 2700 return S_OK; 2698 2701 } 2702 2703 // otherwise: a snapshot medium is being attached 2699 2704 2700 2705 /* sanity: no duplicate attachments */ … … 2715 2720 2716 2721 it->llSnapshotIds.push_back(aSnapshotId); 2722 it->fInCurState = false; 2717 2723 2718 2724 LogFlowThisFuncLeave(); … … 2747 2753 { 2748 2754 /* remove the current state attachment */ 2749 it-> inCurState = false;2755 it->fInCurState = false; 2750 2756 } 2751 2757 else … … 2760 2766 2761 2767 /* if the backref becomes empty, remove it */ 2762 if (it-> inCurState == false && it->llSnapshotIds.size() == 0)2768 if (it->fInCurState == false && it->llSnapshotIds.size() == 0) 2763 2769 m->backRefs.erase(it); 2764 2770 … … 2783 2789 { 2784 2790 const BackRef &ref = *it2; 2785 LogFlowThisFunc((" Backref from machine {%RTuuid} \n", ref.machineId.raw()));2791 LogFlowThisFunc((" Backref from machine {%RTuuid} (fInCurState: %d)\n", ref.machineId.raw(), ref.fInCurState)); 2786 2792 2787 2793 for (BackRef::GuidList::const_iterator jt2 = it2->llSnapshotIds.begin(); … … 2874 2880 std::find_if(m->backRefs.begin(), m->backRefs.end(), 2875 2881 BackRef::EqualsTo(aMachineId)); 2876 return it != m->backRefs.end() && it-> inCurState;2882 return it != m->backRefs.end() && it->fInCurState; 2877 2883 } 2878 2884 … … 3190 3196 * (the code calling prepareDiscard() should detach). */ 3191 3197 AssertReturn(m->backRefs.size() == 1, E_FAIL); 3192 AssertReturn(!m->backRefs.front(). inCurState, E_FAIL);3198 AssertReturn(!m->backRefs.front().fInCurState, E_FAIL); 3193 3199 AssertReturn(m->backRefs.front().llSnapshotIds.size() == 1, E_FAIL); 3194 3200 … … 4234 4240 it != m->backRefs.end(); ++ it) 4235 4241 { 4236 if (it-> inCurState)4242 if (it->fInCurState) 4237 4243 { 4238 4244 /* Note: when a VM snapshot is being taken, all normal hard disks -
trunk/src/VBox/Main/SnapshotImpl.cpp
r24458 r24509 2128 2128 // do not lock, prepareDiscared() has a write lock which will hang otherwise 2129 2129 2130 #ifdef DEBUG 2131 pHD->dumpBackRefs(); 2132 #endif 2133 2130 2134 Medium::MergeChain *chain = NULL; 2131 2135
Note:
See TracChangeset
for help on using the changeset viewer.