Changeset 49687 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Nov 27, 2013 6:00:49 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90957
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r49296 r49687 3698 3698 * Snapshot structure. 3699 3699 * 3700 * @param curSnapshotUuid 3700 3701 * @param depth 3701 3702 * @param elmSnapshot 3702 3703 * @param snap 3703 */ 3704 void MachineConfigFile::readSnapshot(uint32_t depth, 3704 * @returns true if curSnapshotUuid is in this snapshot subtree, otherwise false 3705 */ 3706 bool MachineConfigFile::readSnapshot(const Guid &curSnapshotUuid, 3707 uint32_t depth, 3705 3708 const xml::ElementNode &elmSnapshot, 3706 3709 Snapshot &snap) … … 3714 3717 throw ConfigFileError(this, &elmSnapshot, N_("Required Snapshot/@uuid attribute is missing")); 3715 3718 parseUUID(snap.uuid, strTemp); 3719 bool foundCurrentSnapshot = (snap.uuid == curSnapshotUuid); 3716 3720 3717 3721 if (!elmSnapshot.getAttributeValue("name", snap.strName)) … … 3758 3762 // small, especially with XPCOM. 3759 3763 Snapshot *child = new Snapshot(); 3760 readSnapshot(depth + 1, *pelmChildSnapshot, *child); 3764 bool found = readSnapshot(curSnapshotUuid, depth + 1, *pelmChildSnapshot, *child); 3765 foundCurrentSnapshot = foundCurrentSnapshot || found; 3761 3766 snap.llChildSnapshots.push_back(*child); 3762 3767 delete child; … … 3774 3779 readAutostart(elmSnapshot.findChildElement("Autostart"), &snap.autostart); 3775 3780 // note: Groups exist only for Machine, not for Snapshot 3781 3782 return foundCurrentSnapshot; 3776 3783 } 3777 3784 … … 3894 3901 else if (pelmMachineChild->nameEquals("Snapshot")) 3895 3902 { 3903 if (uuidCurrentSnapshot.isZero()) 3904 throw ConfigFileError(this, &elmMachine, N_("Snapshots present but required Machine/@currentSnapshot attribute is missing")); 3905 bool foundCurrentSnapshot = false; 3896 3906 Snapshot snap; 3897 3907 // this will recurse into child snapshots, if necessary 3898 readSnapshot(1, *pelmMachineChild, snap); 3908 foundCurrentSnapshot = readSnapshot(uuidCurrentSnapshot, 1, *pelmMachineChild, snap); 3909 if (!foundCurrentSnapshot) 3910 throw ConfigFileError(this, &elmMachine, N_("Snapshots present but none matches the UUID in the Machine/@currentSnapshot attribute")); 3899 3911 llFirstSnapshot.push_back(snap); 3900 3912 }
Note:
See TracChangeset
for help on using the changeset viewer.