VirtualBox

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


Ignore:
Timestamp:
Sep 19, 2013 3:17:43 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89083
Message:

Main/NetworkAdapter+Machine+Appliance+SystemProperties+Medium+Console+Settings+IDL: make NAT networking a separate network attachment type which improves the user experience, store the necessary settings, plus changing the design of the methods which will move images and entire VMs, they lacked a progress object
Frontends/VirtualBox: adapted fully, can configure NAT networks with proper drop down list support
Frontends/VBoxManage: also supports NAT networks completely, and adds the long missing code to list intnets

File:
1 edited

Legend:

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

    r48408 r48538  
    24222422        }
    24232423    }
     2424    else if (elmMode.nameEquals("NATNetwork"))
     2425    {
     2426        enmAttachmentType = NetworkAttachmentType_NATNetwork;
     2427
     2428        if (!elmMode.getAttributeValue("name", nic.strNATNetworkName))    // required network name
     2429            throw ConfigFileError(this, &elmMode, N_("Required NATNetwork/@name element is missing"));
     2430    }
    24242431    else if (elmMode.nameEquals("VDE"))
    24252432    {
     
    44604467            if (nic.mode != NetworkAttachmentType_Generic)
    44614468                buildNetworkXML(NetworkAttachmentType_Generic, *pelmDisabledNode, false, nic);
     4469            if (nic.mode != NetworkAttachmentType_NATNetwork)
     4470                buildNetworkXML(NetworkAttachmentType_NATNetwork, *pelmDisabledNode, false, nic);
    44624471            buildNetworkXML(nic.mode, *pelmAdapter, true, nic);
    44634472        }
     
    47724781                }
    47734782            }
     4783            break;
     4784
     4785        case NetworkAttachmentType_NATNetwork:
     4786            if (fEnabled || !nic.strNATNetworkName.isEmpty())
     4787                elmParent.createChild("NATNetwork")->setAttribute("name", nic.strNATNetworkName);
    47744788            break;
    47754789
     
    53195333    {
    53205334        // VirtualBox 4.3 adds default frontend setting, graphics controller
    5321         // setting, explicit long mode setting and video capturing.
     5335        // setting, explicit long mode setting, video capturing and NAT networking.
    53225336        if (   !hardwareMachine.strDefaultFrontend.isEmpty()
    53235337            || hardwareMachine.graphicsControllerType != GraphicsControllerType_VBoxVGA
     
    53255339            || machineUserData.ovIcon.length() > 0
    53265340            || hardwareMachine.fVideoCaptureEnabled)
     5341        {
    53275342            m->sv = SettingsVersion_v1_14;
     5343            return;
     5344        }
     5345        NetworkAdaptersList::const_iterator netit;
     5346        for (netit = hardwareMachine.llNetworkAdapters.begin();
     5347             netit != hardwareMachine.llNetworkAdapters.end();
     5348             ++netit)
     5349        {
     5350            if (netit->mode == NetworkAttachmentType_NATNetwork)
     5351            {
     5352                m->sv = SettingsVersion_v1_14;
     5353                break;
     5354            }
     5355        }
    53285356    }
    53295357
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