VirtualBox

Changeset 64517 in vbox


Ignore:
Timestamp:
Nov 2, 2016 11:07:14 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111666
Message:

Main/Settings: Network name settings have to be optional, otherwise there is trouble with inaccessible VMs when the settings are saved before the network name is updated. Happens easily with VBoxManage.

Location:
trunk/src/VBox/Main/xml
Files:
2 edited

Legend:

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

    r64273 r64517  
    34403440        enmAttachmentType = NetworkAttachmentType_Bridged;
    34413441
    3442         elmMode.getAttributeValue("name", nic.strBridgedName);  // optional bridged interface name
     3442        // optional network name, cannot be required or we have trouble with
     3443        // settings which are saved before configuring the network name
     3444        elmMode.getAttributeValue("name", nic.strBridgedName);
    34433445    }
    34443446    else if (elmMode.nameEquals("InternalNetwork"))
     
    34463448        enmAttachmentType = NetworkAttachmentType_Internal;
    34473449
    3448         if (!elmMode.getAttributeValue("name", nic.strInternalNetworkName))    // required network name
    3449             throw ConfigFileError(this, &elmMode, N_("Required InternalNetwork/@name element is missing"));
     3450        // optional network name, cannot be required or we have trouble with
     3451        // settings which are saved before configuring the network name
     3452        elmMode.getAttributeValue("name", nic.strInternalNetworkName);
    34503453    }
    34513454    else if (elmMode.nameEquals("HostOnlyInterface"))
     
    34533456        enmAttachmentType = NetworkAttachmentType_HostOnly;
    34543457
    3455         if (!elmMode.getAttributeValue("name", nic.strHostOnlyName))    // required network name
    3456             throw ConfigFileError(this, &elmMode, N_("Required HostOnlyInterface/@name element is missing"));
     3458        // optional network name, cannot be required or we have trouble with
     3459        // settings which are saved before configuring the network name
     3460        elmMode.getAttributeValue("name", nic.strHostOnlyName);
    34573461    }
    34583462    else if (elmMode.nameEquals("GenericInterface"))
     
    34823486        enmAttachmentType = NetworkAttachmentType_NATNetwork;
    34833487
    3484         if (!elmMode.getAttributeValue("name", nic.strNATNetworkName))    // required network name
    3485             throw ConfigFileError(this, &elmMode, N_("Required NATNetwork/@name element is missing"));
     3488        // optional network name, cannot be required or we have trouble with
     3489        // settings which are saved before configuring the network name
     3490        elmMode.getAttributeValue("name", nic.strNATNetworkName);
    34863491    }
    34873492    else if (elmMode.nameEquals("VDE"))
    34883493    {
     3494        // inofficial hack (VDE networking was never part of the official
     3495        // settings, so it's not mentioned in VirtualBox-settings.xsd)
    34893496        enmAttachmentType = NetworkAttachmentType_Generic;
    34903497
  • trunk/src/VBox/Main/xml/VirtualBox-settings.xsd

    r63774 r64517  
    937937
    938938<xsd:complexType name="TNetNATNetwork">
    939   <xsd:attribute name="name" type="xsd:string" use="required"/>
     939  <xsd:attribute name="name" type="xsd:string"/>
    940940</xsd:complexType>
    941941
    942942<xsd:complexType name="TNetBridged">
    943   <xsd:attribute name="name" type="xsd:string" use="required"/>
     943  <xsd:attribute name="name" type="xsd:string"/>
    944944</xsd:complexType>
    945945
    946946<xsd:complexType name="TNetInternal">
    947   <xsd:attribute name="name" type="xsd:string" use="required"/>
     947  <xsd:attribute name="name" type="xsd:string"/>
    948948</xsd:complexType>
    949949
    950950<xsd:complexType name="TNetHostOnly">
    951   <xsd:attribute name="name" type="xsd:string" use="required"/>
     951  <xsd:attribute name="name" type="xsd:string"/>
    952952</xsd:complexType>
    953953
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