VirtualBox

Changeset 12635 in vbox for trunk/src


Ignore:
Timestamp:
Sep 22, 2008 12:49:48 PM (16 years ago)
Author:
vboxsync
Message:

#1865: CFGM.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/CFGM.cpp

    r10702 r12635  
    2222/** @page pg_cfgm       CFGM - The Configuration Manager
    2323 *
    24  * The configuration manager is responsible for storing the configuration
    25  * of the VM at run time. It is organized a bit like file hierarchy,
    26  * except that the values live in a separate name space, i.e. value names
    27  * can include path separators.
    28  *
    29  * The VMM user creates the configuration tree as part of the VMR3Create()
    30  * call via the pfnCFGMConstructor callback argument. If this isn't specified
    31  * a simple default tree is created by cfgmR3CreateDefaultTree(). When used
    32  * in the normal setup, this function is found in Main/ConsoleImpl2.cpp.
    33  * For the VBoxBFE case, see the VBoxBFE.cpp.
     24 * The configuration manager is a directory containing the VM configuration at
     25 * run time. It works in a manner similar to the windows registry - it's like a
     26 * file system hierarchy, but the files (values) live in a separate name space
     27 * and can include the path separators.
     28 *
     29 * The configuration is normally created via a callback passed to VMR3Create()
     30 * via the pfnCFGMConstructor parameter. To make testcase writing a bit simpler,
     31 * we allow the callback to be NULL, in which case a simple default
     32 * configuration will be created by cfgmR3CreateDefaultTree(). The
     33 * Console::configConstructor() method in Main/ConsoleImpl2.cpp creates the
     34 * configuration from the XML.
    3435 *
    3536 * Devices, drivers, services and other PDM stuff are given their own subtree
     
    3738 * is implemented via the CFGMR3SetRestrictedRoot() API.
    3839 *
    39  * Validating of the data obtained, except for validation of the primitive
    40  * type, is left the caller. The caller is in a better position to know the
    41  * proper validation rules of the individual properties.
     40 * Data validation out over the basic primitives is left to the caller. The
     41 * caller is in a better position to know the proper validation rules of the
     42 * individual properties.
    4243 *
    4344 *
     
    4950 *      - Zero terminated character strings. These are of course UTF-8.
    5051 *      - Variable length byte strings. This can be used to get/put binary
    51  *        objects.
     52 *        objects like for instance RTMAC.
    5253 *
    5354 */
     
    9394 *                              This is called in the EM.
    9495 * @param   pvUser              The user argument passed to pfnCFGMConstructor.
     96 * @thread  EMT.
    9597 */
    9698CFGMR3DECL(int) CFGMR3Init(PVM pVM, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUser)
     
    101103     * Init data members.
    102104     */
    103     pVM->cfgm.s.offVM = RT_OFFSETOF(VM, cfgm);
    104105    pVM->cfgm.s.pRoot = NULL;
    105106
     
    136137        Log(("CFGMR3Init: Successfully constructed the configuration\n"));
    137138        CFGMR3Dump(CFGMR3GetRoot(pVM));
    138 
    139139    }
    140140    else
     
    154154{
    155155    CFGMR3RemoveNode(pVM->cfgm.s.pRoot);
     156    pVM->cfgm.s.pRoot = NULL;
    156157    return 0;
    157158}
  • trunk/src/VBox/VMM/CFGMInternal.h

    r8155 r12635  
    121121
    122122
    123 
    124 /**
    125  * Converts a CFGM pointer into a VM pointer.
    126  * @returns Pointer to the VM structure the CFGM is part of.
    127  * @param   pCFGM   Pointer to CFGM instance data.
    128  */
    129 #define CFGM2VM(pCFGM)  ( (PVM)((char*)pCFGM - pCFGM->offVM) )
    130 
    131123/**
    132124 * CFGM VM Instance data.
     
    135127typedef struct CFGM
    136128{
    137     /** Offset to the VM structure.
    138      * See CFGM2VM(). */
    139     RTUINT                  offVM;
    140     /** Alignment padding. */
    141     RTUINT                  uPadding0;
    142 
    143129    /** Pointer to root node. */
    144130    R3PTRTYPE(PCFGMNODE)    pRoot;
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