Changeset 49687 in vbox
- Timestamp:
- Nov 27, 2013 6:00:49 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
doc/manual/user_ChangeLogImpl.xml (modified) (1 diff)
-
include/VBox/settings.h (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp (modified) (1 diff)
-
src/VBox/Main/src-server/SnapshotImpl.cpp (modified) (1 diff)
-
src/VBox/Main/xml/Settings.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/user_ChangeLogImpl.xml
r49682 r49687 18 18 19 19 <itemizedlist> 20 21 <listitem> 22 <para>API: block the removal of the current snapshot if it has child 23 snapshots (only relevant for VMs without snapshottable hard disks, 24 their presence always prevented removal), which resulted in VM 25 config corruption</para> 26 </listitem> 27 28 <listitem> 29 <para>API: mark VM configs with snapshots but without current snapshot 30 as inaccessible, as this combination is nonsense</para> 31 </listitem> 20 32 21 33 <listitem> -
trunk/include/VBox/settings.h
r49587 r49687 1276 1276 void readAutostart(const xml::ElementNode *pElmAutostart, Autostart *pAutostart); 1277 1277 void readGroups(const xml::ElementNode *elmGroups, StringsList *pllGroups); 1278 void readSnapshot(uint32_t depth, const xml::ElementNode &elmSnapshot, Snapshot &snap);1278 bool readSnapshot(const com::Guid &curSnapshotUuid, uint32_t depth, const xml::ElementNode &elmSnapshot, Snapshot &snap); 1279 1279 void convertOldOSType_pre1_5(com::Utf8Str &str); 1280 1280 void readMachine(const xml::ElementNode &elmMachine); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r48534 r49687 1018 1018 item->recache(); 1019 1019 1020 if (mMachine.GetCurrentSnapshot().GetId() == aSnapshot.GetId()) 1020 CSnapshot curSnapshot = mMachine.GetCurrentSnapshot(); 1021 if (!curSnapshot.isNull() && curSnapshot.GetId() == aSnapshot.GetId()) 1021 1022 { 1022 1023 item->setBold (true); -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r48311 r49687 2169 2169 mUserData->s.strName.c_str(), 2170 2170 childrenCount); 2171 if (pSnapshot == mData->mCurrentSnapshot && childrenCount >= 1) 2172 return setError(VBOX_E_INVALID_OBJECT_STATE, 2173 tr("Snapshot '%s' of the machine '%s' cannot be deleted, because it is the current snapshot and has one child snapshot"), 2174 pSnapshot->getName().c_str(), 2175 mUserData->s.strName.c_str()); 2171 2176 2172 2177 /* If the snapshot being deleted is the current one, ensure current -
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.

