VirtualBox

Changeset 63774 in vbox for trunk


Ignore:
Timestamp:
Sep 9, 2016 9:28:19 AM (8 years ago)
Author:
vboxsync
Message:

Main/xml/Settings.cpp: relax the version attribute requirement of the VirtualBox settings embedded in the OVF file, because there are some files floating around (not created by VirtualBox) which don't have it

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

Legend:

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

    r63172 r63774  
    31993199void MachineConfigFile::importMachineXML(const xml::ElementNode &elmMachine)
    32003200{
     3201    // Ideally the version should be mandatory, but since VirtualBox didn't
     3202    // care about it until 5.1 came with different defaults, there are OVF
     3203    // files created by magicians (not using VirtualBox, which always wrote it)
     3204    // which lack this information. Let's hope that they learn to add the
     3205    // version when they switch to the newer settings style/defaults of 5.1.
    32013206    if (!(elmMachine.getAttributeValue("version", m->strSettingsVersionFull)))
    3202         throw ConfigFileError(this, &elmMachine, N_("Required Machine/@version attribute is missing"));
     3207        m->strSettingsVersionFull = "1.15";
    32033208
    32043209    LogRel(("Import settings with version \"%s\"\n", m->strSettingsVersionFull.c_str()));
  • trunk/src/VBox/Main/xml/VirtualBox-settings.xsd

    r61009 r63774  
    14281428  <xsd:attribute name="aborted" type="xsd:boolean" default="false"/>
    14291429  <xsd:attribute name="currentStateModified" type="xsd:boolean" default="true"/>
     1430  <xsd:attribute name="version" type="xsd:string" default="1.15"/> <!-- Used for OVF files only, must not be present in normal settings files. The default corresponds to settings created by 5.0, which covers many older versions but not newer ones. -->
    14301431</xsd:complexType>
    14311432
     
    14641465    </xsd:element>
    14651466  </xsd:choice>
    1466   <xsd:attribute name="version" type="xsd:string"/>
     1467  <xsd:attribute name="version" type="xsd:string" use="required"/>
    14671468</xsd:complexType>
    14681469
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