- Timestamp:
- Oct 26, 2009 3:16:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
r24081 r24084 38 38 39 39 /** 40 * Helper function used with "VBoxManage snapshot ... dump". 40 * Helper function used with "VBoxManage snapshot ... dump". Gets called to find the 41 * snapshot in the machine's snapshot tree that uses a particular diff image child of 42 * a medium. 43 * Horribly inefficient since we keep re-querying the snapshots tree for each image, 44 * but this is for quick debugging only. 41 45 * @param pMedium 42 46 * @param pThisSnapshot … … 64 68 CHECK_ERROR_BREAK(pSnapshotMachine, COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(aAttachments))); 65 69 66 bool fFound = false;67 68 70 for (uint32_t i = 0; 69 71 i < aAttachments.size(); … … 84 86 CHECK_ERROR_BREAK(pThisSnapshot, COMGETTER(Name)(bstrSnapshotName.asOutParam())); 85 87 86 RTPrintf("%*s \"%ls\" \n",88 RTPrintf("%*s \"%ls\"%s\n", 87 89 50 + uSnapshotLevel * 2, "", // indent 88 bstrSnapshotName.raw()); 90 bstrSnapshotName.raw(), 91 (pThisSnapshot == pCurrentSnapshot) ? " (CURSNAP)" : ""); 89 92 return true; // found 90 93 } … … 92 95 } 93 96 94 if (!fFound) 95 { 96 SafeIfaceArray<ISnapshot> aSnapshots; 97 CHECK_ERROR_BREAK(pThisSnapshot, COMGETTER(Children)(ComSafeArrayAsOutParam(aSnapshots))); 98 99 for (uint32_t i = 0; 100 i < aSnapshots.size(); 101 ++i) 102 { 103 ComPtr<ISnapshot> pChild(aSnapshots[i]); 104 if (FindAndPrintSnapshotUsingMedium(pMedium, 105 pChild, 106 pCurrentSnapshot, 107 uMediumLevel, 108 uSnapshotLevel + 1)) 109 // found: 110 break; 111 } 97 // not found: then recurse into child snapshots 98 SafeIfaceArray<ISnapshot> aSnapshots; 99 CHECK_ERROR_BREAK(pThisSnapshot, COMGETTER(Children)(ComSafeArrayAsOutParam(aSnapshots))); 100 101 for (uint32_t i = 0; 102 i < aSnapshots.size(); 103 ++i) 104 { 105 ComPtr<ISnapshot> pChild(aSnapshots[i]); 106 if (FindAndPrintSnapshotUsingMedium(pMedium, 107 pChild, 108 pCurrentSnapshot, 109 uMediumLevel, 110 uSnapshotLevel + 1)) 111 // found: 112 break; 112 113 } 113 114 } while (0); … … 142 143 uLevel * 2, "", // indent 143 144 bstrMediumName.raw(), 144 (pCurrentStateMedium == pMedium) ? " (CUR RENTSTATE)" : "");145 (pCurrentStateMedium == pMedium) ? " (CURSTATE)" : ""); 145 146 146 147 // find and print the snapshot that uses this particular medium (diff image)
Note:
See TracChangeset
for help on using the changeset viewer.