Changeset 40418 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Mar 9, 2012 10:00:56 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 76749
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r40066 r40418 834 834 break; 835 835 836 case SettingsVersion_v1_13: 837 pcszVersion = "1.13"; 838 break; 839 836 840 case SettingsVersion_Future: 837 841 // can be set if this code runs on XML files that were created by a future version of VBox; 838 842 // in that case, downgrade to current version when writing since we can't write future versions... 839 pcszVersion = "1.1 2";840 m->sv = SettingsVersion_v1_1 2;843 pcszVersion = "1.13"; 844 m->sv = SettingsVersion_v1_13; 841 845 break; 842 846 … … 1755 1759 && (storage == s.storage) // deep compare 1756 1760 && (llChildSnapshots == s.llChildSnapshots) // deep compare 1761 && debugging == s.debugging 1757 1762 ) 1758 1763 ); … … 3160 3165 3161 3166 /** 3167 * Called for reading the <Debugging> element under <Machine> or <Snapshot>. 3168 */ 3169 void MachineConfigFile::readDebugging(const xml::ElementNode *pElmDebugging, Debugging *pDbg) 3170 { 3171 if (!pElmDebugging || m->sv < SettingsVersion_v1_13) 3172 return; 3173 3174 const xml::ElementNode * const pelmTracing = pElmDebugging->findChildElement("Tracing"); 3175 if (pelmTracing) 3176 { 3177 pelmTracing->getAttributeValue("enabled", pDbg->fTracingEnabled); 3178 pelmTracing->getAttributeValue("allowTracingToAccessVM", pDbg->fAllowTracingToAccessVM); 3179 pelmTracing->getAttributeValue("config", pDbg->strTracingConfig); 3180 } 3181 } 3182 3183 /** 3162 3184 * Called initially for the <Snapshot> element under <Machine>, if present, 3163 3185 * to store the snapshot's data into the given Snapshot structure (which is … … 3231 3253 // with data from old DVDDrive and FloppyDrive elements 3232 3254 readDVDAndFloppies_pre1_9(*pelmHardware, snap.storage); 3255 3256 readDebugging(elmSnapshot.findChildElement("Debugging"), &snap.debugging); 3233 3257 } 3234 3258 … … 3379 3403 else if (pelmMachineChild->nameEquals("MediaRegistry")) 3380 3404 readMediaRegistry(*pelmMachineChild, mediaRegistry); 3405 else if (pelmMachineChild->nameEquals("Debugging")) 3406 readDebugging(pelmMachineChild, &debugging); 3381 3407 } 3382 3408 … … 4301 4327 4302 4328 /** 4329 * Creates a <Debugging> node under elmParent and then writes out the XML 4330 * keys under that. Called for both the <Machine> node and for snapshots. 4331 * 4332 * @param pElmParent Pointer to the parent element. 4333 * @param pDbg Pointer to the debugging settings. 4334 */ 4335 void MachineConfigFile::buildDebuggingXML(xml::ElementNode *pElmParent, const Debugging *pDbg) 4336 { 4337 if (m->sv < SettingsVersion_v1_13 || pDbg->areDefaultSettings()) 4338 return; 4339 4340 xml::ElementNode *pElmDebugging = pElmParent->createChild("Debugging"); 4341 xml::ElementNode *pElmTracing = pElmDebugging->createChild("Tracing"); 4342 pElmTracing->setAttribute("enabled", pDbg->fTracingEnabled); 4343 pElmTracing->setAttribute("allowTracingToAccessVM", pDbg->fAllowTracingToAccessVM); 4344 pElmTracing->setAttribute("config", pDbg->strTracingConfig); 4345 } 4346 4347 /** 4303 4348 * Writes a single snapshot into the DOM tree. Initially this gets called from MachineConfigFile::write() 4304 4349 * for the root snapshot of a machine, if present; elmParent then points to the <Snapshots> node under the … … 4329 4374 // we only skip removable media for OVF, but we never get here for OVF 4330 4375 // since snapshots never get written then 4376 buildDebuggingXML(pelmSnapshot, &snap.debugging); 4331 4377 4332 4378 if (snap.llChildSnapshots.size()) … … 4476 4522 !!(fl & BuildMachineXML_SkipRemovableMedia), 4477 4523 pllElementsWithUuidAttributes); 4524 buildDebuggingXML(&elmMachine, &debugging); 4478 4525 } 4479 4526 … … 4591 4638 void MachineConfigFile::bumpSettingsVersionIfNeeded() 4592 4639 { 4640 if (m->sv < SettingsVersion_v1_13) 4641 { 4642 // VirtualBox 4.2 adds tracing. 4643 if (!debugging.areDefaultSettings()) 4644 m->sv = SettingsVersion_v1_13; 4645 } 4646 4593 4647 if (m->sv < SettingsVersion_v1_12) 4594 4648 {
Note:
See TracChangeset
for help on using the changeset viewer.