- Timestamp:
- Sep 22, 2008 12:49:48 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/CFGM.cpp
r10702 r12635 22 22 /** @page pg_cfgm CFGM - The Configuration Manager 23 23 * 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. 34 35 * 35 36 * Devices, drivers, services and other PDM stuff are given their own subtree … … 37 38 * is implemented via the CFGMR3SetRestrictedRoot() API. 38 39 * 39 * Validating of the data obtained, except for validation of the primitive40 * type, is left the caller. The caller is in a better position to knowthe41 * proper validation rules of theindividual 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. 42 43 * 43 44 * … … 49 50 * - Zero terminated character strings. These are of course UTF-8. 50 51 * - Variable length byte strings. This can be used to get/put binary 51 * objects .52 * objects like for instance RTMAC. 52 53 * 53 54 */ … … 93 94 * This is called in the EM. 94 95 * @param pvUser The user argument passed to pfnCFGMConstructor. 96 * @thread EMT. 95 97 */ 96 98 CFGMR3DECL(int) CFGMR3Init(PVM pVM, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUser) … … 101 103 * Init data members. 102 104 */ 103 pVM->cfgm.s.offVM = RT_OFFSETOF(VM, cfgm);104 105 pVM->cfgm.s.pRoot = NULL; 105 106 … … 136 137 Log(("CFGMR3Init: Successfully constructed the configuration\n")); 137 138 CFGMR3Dump(CFGMR3GetRoot(pVM)); 138 139 139 } 140 140 else … … 154 154 { 155 155 CFGMR3RemoveNode(pVM->cfgm.s.pRoot); 156 pVM->cfgm.s.pRoot = NULL; 156 157 return 0; 157 158 } -
trunk/src/VBox/VMM/CFGMInternal.h
r8155 r12635 121 121 122 122 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 131 123 /** 132 124 * CFGM VM Instance data. … … 135 127 typedef struct CFGM 136 128 { 137 /** Offset to the VM structure.138 * See CFGM2VM(). */139 RTUINT offVM;140 /** Alignment padding. */141 RTUINT uPadding0;142 143 129 /** Pointer to root node. */ 144 130 R3PTRTYPE(PCFGMNODE) pRoot;
Note:
See TracChangeset
for help on using the changeset viewer.