VirtualBox

Changeset 40418 in vbox for trunk/src/VBox/Main/xml


Ignore:
Timestamp:
Mar 9, 2012 10:00:56 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76749
Message:

Main: Extended IMachine and the settings XML with three tracing related properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r40066 r40418  
    834834            break;
    835835
     836        case SettingsVersion_v1_13:
     837            pcszVersion = "1.13";
     838            break;
     839
    836840        case SettingsVersion_Future:
    837841            // can be set if this code runs on XML files that were created by a future version of VBox;
    838842            // in that case, downgrade to current version when writing since we can't write future versions...
    839             pcszVersion = "1.12";
    840             m->sv = SettingsVersion_v1_12;
     843            pcszVersion = "1.13";
     844            m->sv = SettingsVersion_v1_13;
    841845            break;
    842846
     
    17551759                  && (storage               == s.storage)                   // deep compare
    17561760                  && (llChildSnapshots      == s.llChildSnapshots)          // deep compare
     1761                  && debugging              == s.debugging
    17571762                )
    17581763           );
     
    31603165
    31613166/**
     3167 * Called for reading the <Debugging> element under <Machine> or <Snapshot>.
     3168 */
     3169void 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/**
    31623184 * Called initially for the <Snapshot> element under <Machine>, if present,
    31633185 * to store the snapshot's data into the given Snapshot structure (which is
     
    32313253        // with data from old DVDDrive and FloppyDrive elements
    32323254        readDVDAndFloppies_pre1_9(*pelmHardware, snap.storage);
     3255
     3256    readDebugging(elmSnapshot.findChildElement("Debugging"), &snap.debugging);
    32333257}
    32343258
     
    33793403            else if (pelmMachineChild->nameEquals("MediaRegistry"))
    33803404                readMediaRegistry(*pelmMachineChild, mediaRegistry);
     3405            else if (pelmMachineChild->nameEquals("Debugging"))
     3406                readDebugging(pelmMachineChild, &debugging);
    33813407        }
    33823408
     
    43014327
    43024328/**
     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 */
     4335void 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/**
    43034348 * Writes a single snapshot into the DOM tree. Initially this gets called from MachineConfigFile::write()
    43044349 * for the root snapshot of a machine, if present; elmParent then points to the <Snapshots> node under the
     
    43294374                                    // we only skip removable media for OVF, but we never get here for OVF
    43304375                                    // since snapshots never get written then
     4376    buildDebuggingXML(pelmSnapshot, &snap.debugging);
    43314377
    43324378    if (snap.llChildSnapshots.size())
     
    44764522                               !!(fl & BuildMachineXML_SkipRemovableMedia),
    44774523                               pllElementsWithUuidAttributes);
     4524    buildDebuggingXML(&elmMachine, &debugging);
    44784525}
    44794526
     
    45914638void MachineConfigFile::bumpSettingsVersionIfNeeded()
    45924639{
     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
    45934647    if (m->sv < SettingsVersion_v1_12)
    45944648    {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette