VirtualBox

Changeset 31073 in vbox


Ignore:
Timestamp:
Jul 23, 2010 7:04:04 PM (14 years ago)
Author:
vboxsync
Message:

Main: API docs

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r31072 r31073  
    472472    </const>
    473473    <const name="Future"     value="99999">
    474       <desc>Settings version greater than "1.10", written by a future VirtualBox version.</desc>
     474      <desc>Settings version greater than "1.11", written by a future VirtualBox version.</desc>
    475475    </const>
    476476  </enum>
     
    40094009      <desc>
    40104010        Type of the session.  If <link to="#sessionState"/> is
    4011         SessionSpawning or SessionOpen, this attribute contains the
     4011        Spawning or Locked, this attribute contains the
    40124012        same value as passed to the
    40134013        <link to="IMachine::launchVMProcess"/> method in the
     
    1283212832      <desc>
    1283312833        Type of this session. The value of this attribute is valid only
    12834         if the session is currently open (i.e. its <link to="#state" /> is
    12835         SessionState_SessionOpen), otherwise an error will be returned.
     12834        if the session currently has a machine locked (i.e. its
     12835        <link to="#state" /> is Locked), otherwise an error will be returned.
    1283612836      </desc>
    1283712837    </attribute>
  • trunk/src/VBox/Main/xml/Settings.cpp

    r31063 r31073  
    99 * The code can read all VirtualBox settings files version 1.3 and higher. That version was
    1010 * written by VirtualBox 2.0. It can write settings version 1.7 (used by VirtualBox 2.2 and
    11  * 3.0) and 1.9 (used by VirtualBox 3.1).
    12  *
    13  * Rules for introducing new settings: If an element or attribute is introduced that was not
    14  * present before VirtualBox 3.1, then settings version checks need to be introduced. The
    15  * settings version for VirtualBox 3.1 is 1.9; see the SettingsVersion enumeration in
    16  * src/VBox/Main/idl/VirtualBox.xidl for details about which version was used when.
    17  *
    18  * The settings versions checks are necessary because VirtualBox 3.1 no longer automatically
    19  * converts XML settings files but only if necessary, that is, if settings are present that
    20  * the old format does not support. If we write an element or attribute to a settings file
    21  * of an older version, then an old VirtualBox (before 3.1) will attempt to validate it
    22  * with XML schema, and that will certainly fail.
     11 * 3.0) and 1.9 (used by VirtualBox 3.1) and newer ones obviously.
     12 *
     13 * The settings versions enum is defined in src/VBox/Main/idl/VirtualBox.xidl. To introduce
     14 * a new settings version (should be necessary at most once per VirtualBox major release,
     15 * if at all), add a new SettingsVersion value to that enum and grep for the previously
     16 * highest value to see which code in here needs adjusting.
     17 *
     18 * Certainly ConfigFileBase::ConfigFileBase() will. Change VBOX_XML_VERSION below as well.
     19 *
     20 * Once a new settings version has been added, these are the rules for introducing a new
     21 * setting: If an XML element or attribute or value is introduced that was not present in
     22 * previous versions, then settings version checks need to be introduced. See the
     23 * SettingsVersion enumeration in src/VBox/Main/idl/VirtualBox.xidl for details about which
     24 * version was used when.
     25 *
     26 * The settings versions checks are necessary because since version 3.1, VirtualBox no longer
     27 * automatically converts XML settings files but only if necessary, that is, if settings are
     28 * present that the old format does not support. If we write an element or attribute to a
     29 * settings file of an older version, then an old VirtualBox (before 3.1) will attempt to
     30 * validate it with XML schema, and that will certainly fail.
    2331 *
    2432 * So, to introduce a new setting:
     
    2735 *
    2836 *   2) In the settings reader method, try to read the setting; if it's there, great, if not,
    29  *      the default value will have been set by the constructor.
    30  *
    31  *   3) In the settings writer method, write the setting _only_ if the current settings
     37 *      the default value will have been set by the constructor. The rule is to be tolerant
     38 *      here.
     39 *
     40 *   3) In MachineConfigFile::bumpSettingsVersionIfNeeded(), check if the new setting has
     41 *      a non-default value (i.e. that differs from the constructor). If so, bump the
     42 *      settings version to the current version so the settings writer (4) can write out
     43 *      the non-default value properly.
     44 *
     45 *      So far a corresponding method for MainConfigFile has not been necessary since there
     46 *      have been no incompatible changes yet.
     47 *
     48 *   4) In the settings writer method, write the setting _only_ if the current settings
    3249 *      version (stored in m->sv) is high enough. That is, for VirtualBox 3.3, write it
    3350 *      only if (m->sv >= SettingsVersion_v1_11).
    34  *
    35  *   4) In MachineConfigFile::bumpSettingsVersionIfNeeded(), check if the new setting has
    36  *      a non-default value (i.e. that differs from the constructor). If so, bump the
    37  *      settings version to the current version so the settings writer (3) can write out
    38  *      the non-default value properly.
    39  *
    40  *      So far a corresponding method for MainConfigFile has not been necessary since there
    41  *      have been no incompatible changes yet.
    4251 */
    4352
     
    204213
    205214/**
    206  * Constructor. Allocates the XML internals.
     215 * Constructor. Allocates the XML internals, parses the XML file if
     216 * pstrFilename is != NULL and reads the settings version from it.
    207217 * @param strFilename
    208218 */
     
    571581 * set the "sv" member to the required settings version that is to
    572582 * be written. For newly created files, the settings version will be
    573  * the latest (1.9); for files read in from disk earlier, it will be
     583 * the latest (1.11); for files read in from disk earlier, it will be
    574584 * the settings version indicated in the file. However, this method
    575585 * will silently make sure that the settings version is always
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