VirtualBox

Ignore:
Timestamp:
Oct 15, 2009 3:37:20 PM (15 years ago)
Author:
vboxsync
Message:

Main/xml: Put the target teleporter settings in a separate node (Machine got too crowded with attributes). Enabled the code.

File:
1 edited

Legend:

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

    r23801 r23803  
    22032203            // constructor has called RTTimeNow(&timeLastStateChange) before
    22042204
    2205         if (!elmMachine.getAttributeValue("teleporterEnabled", fTeleporterEnabled) /** @todo Teleportation: remove liveMigration* in a couple of days. */
     2205#if 1 /** @todo Teleportation: Obsolete. Remove in a couple of days. */
     2206        if (!elmMachine.getAttributeValue("teleporterEnabled", fTeleporterEnabled)
    22062207         && !elmMachine.getAttributeValue("liveMigrationTarget", fTeleporterEnabled))
    22072208            fTeleporterEnabled = false;
     
    22142215         && !elmMachine.getAttributeValue("liveMigrationPassword", strTeleporterPassword))
    22152216            strTeleporterPassword = "";
     2217#endif
    22162218
    22172219        // parse Hardware before the other elements because other things depend on it
     
    22452247            else if (pelmMachineChild->nameEquals("Description"))
    22462248                strDescription = pelmMachineChild->getValue();
     2249            else if (pelmMachineChild->nameEquals("Teleporter"))
     2250            {
     2251                if (!pelmMachineChild->getAttributeValue("enabled", fTeleporterEnabled))
     2252                    fTeleporterEnabled = false;
     2253                if (!pelmMachineChild->getAttributeValue("port", uTeleporterPort))
     2254                    uTeleporterPort = 0;
     2255                if (!pelmMachineChild->getAttributeValue("address", strTeleporterAddress))
     2256                    strTeleporterAddress = "";
     2257                if (!pelmMachineChild->getAttributeValue("password", strTeleporterPassword))
     2258                    strTeleporterPassword = "";
     2259            }
    22472260        }
    22482261
     
    29252938        if (fAborted)
    29262939            pelmMachine->setAttribute("aborted", fAborted);
    2927 #ifdef VBOX_WITH_LIVE_MIGRATION /** @todo Teleportation: Enable in a bit. */
    2928         if (m->sv >= SettingsVersion_v1_9)
    2929         {
    2930             if (fTeleporterEnabled)
    2931                 pelmMachine->setAttribute("teleporterEnabled", true);
    2932             if (uTeleporterPort)
    2933                 pelmMachine->setAttribute("teleporterPort", uTeleporterPort);
    2934             if (!strTeleporterAddress.isEmpty())
    2935                 pelmMachine->setAttribute("teleporterAddress", strTeleporterAddress);
    2936             if (!strTeleporterPassword.isEmpty())
    2937                 pelmMachine->setAttribute("teleporterPassword", strTeleporterPassword);
    2938         }
    2939 #endif
     2940        if (    m->sv >= SettingsVersion_v1_9
     2941            &&  (   fTeleporterEnabled
     2942                 || uTeleporterPort
     2943                 || !strTeleporterAddress.isEmpty()
     2944                 || !strTeleporterPassword.isEmpty()
     2945                )
     2946           )
     2947        {
     2948           xml::ElementNode *pelmTeleporter = pelmMachine->createChild("Teleporter");
     2949           pelmTeleporter->setAttribute("enabled", fTeleporterEnabled);
     2950           pelmTeleporter->setAttribute("port", uTeleporterPort);
     2951           pelmTeleporter->setAttribute("address", strTeleporterAddress);
     2952           pelmTeleporter->setAttribute("password", strTeleporterPassword);
     2953        }
    29402954
    29412955        writeExtraData(*pelmMachine, mapExtraDataItems);
Note: See TracChangeset for help on using the changeset viewer.

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