- Timestamp:
- Nov 28, 2008 2:36:22 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r14538 r14780 289 289 *******************************************************************************/ 290 290 291 static bool drvvdCfgAreValuesValid(PVDCFGNODE pNode, const char *pszzValid) 292 { 293 return CFGMR3AreValuesValid((PCFGMNODE)pNode, pszzValid); 294 } 295 296 static int drvvdCfgQueryType(PVDCFGNODE pNode, const char *pszName, PVDCFGVALUETYPE penmType) 297 { 298 Assert(VDCFGVALUETYPE_INTEGER == (VDCFGVALUETYPE)CFGMVALUETYPE_INTEGER); 299 Assert(VDCFGVALUETYPE_STRING == (VDCFGVALUETYPE)CFGMVALUETYPE_STRING); 300 Assert(VDCFGVALUETYPE_BYTES == (VDCFGVALUETYPE)CFGMVALUETYPE_BYTES); 301 return CFGMR3QueryType((PCFGMNODE)pNode, pszName, (PCFGMVALUETYPE)penmType); 302 } 303 304 static int drvvdCfgQuerySize(PVDCFGNODE pNode, const char *pszName, size_t *pcb) 305 { 306 return CFGMR3QuerySize((PCFGMNODE)pNode, pszName, pcb); 307 } 308 309 static int drvvdCfgQueryInteger(PVDCFGNODE pNode, const char *pszName, uint64_t *pu64) 310 { 311 return CFGMR3QueryInteger((PCFGMNODE)pNode, pszName, pu64); 312 } 313 314 static int drvvdCfgQueryIntegerDef(PVDCFGNODE pNode, const char *pszName, uint64_t *pu64, uint64_t u64Def) 315 { 316 return CFGMR3QueryInteger((PCFGMNODE)pNode, pszName, pu64); 317 } 318 319 static int drvvdCfgQueryString(PVDCFGNODE pNode, const char *pszName, char *pszString, size_t cchString) 320 { 321 return CFGMR3QueryString((PCFGMNODE)pNode, pszName, pszString, cchString); 322 } 323 324 static int drvvdCfgQueryStringDef(PVDCFGNODE pNode, const char *pszName, char *pszString, size_t cchString, const char *pszDef) 325 { 326 return CFGMR3QueryStringDef((PCFGMNODE)pNode, pszName, pszString, cchString, pszDef); 327 } 328 329 static int drvvdCfgQueryBytes(PVDCFGNODE pNode, const char *pszName, void *pvData, size_t cbData) 330 { 331 return CFGMR3QueryBytes((PCFGMNODE)pNode, pszName, pvData, cbData); 291 static bool drvvdCfgAreKeysValid(void *pvUser, const char *pszzValid) 292 { 293 return CFGMR3AreValuesValid((PCFGMNODE)pvUser, pszzValid); 294 } 295 296 static int drvvdCfgQuerySize(void *pvUser, const char *pszName, size_t *pcb) 297 { 298 return CFGMR3QuerySize((PCFGMNODE)pvUser, pszName, pcb); 299 } 300 301 static int drvvdCfgQuery(void *pvUser, const char *pszName, char *pszString, size_t cchString) 302 { 303 return CFGMR3QueryString((PCFGMNODE)pvUser, pszName, pszString, cchString); 332 304 } 333 305 … … 790 762 pThis->VDIConfigCallbacks.cbSize = sizeof(VDINTERFACECONFIG); 791 763 pThis->VDIConfigCallbacks.enmInterface = VDINTERFACETYPE_CONFIG; 792 pThis->VDIConfigCallbacks.pfnAreValuesValid = drvvdCfgAreValuesValid; 793 pThis->VDIConfigCallbacks.pfnQueryType = drvvdCfgQueryType; 764 pThis->VDIConfigCallbacks.pfnAreKeysValid = drvvdCfgAreKeysValid; 794 765 pThis->VDIConfigCallbacks.pfnQuerySize = drvvdCfgQuerySize; 795 pThis->VDIConfigCallbacks.pfnQueryInteger = drvvdCfgQueryInteger; 796 pThis->VDIConfigCallbacks.pfnQueryIntegerDef = drvvdCfgQueryIntegerDef; 797 pThis->VDIConfigCallbacks.pfnQueryString = drvvdCfgQueryString; 798 pThis->VDIConfigCallbacks.pfnQueryStringDef = drvvdCfgQueryStringDef; 799 pThis->VDIConfigCallbacks.pfnQueryBytes = drvvdCfgQueryBytes; 766 pThis->VDIConfigCallbacks.pfnQuery = drvvdCfgQuery; 800 767 801 768 /* List of images is empty now. */ -
trunk/src/VBox/Devices/Storage/testcase/tstVD-2.cpp
r13837 r14780 87 87 { 88 88 case VDCFGVALUETYPE_INTEGER: 89 RTPrintf("integer default="); 90 if (pa->pDefaultValue) 91 RTPrintf("%RU64", pa->pDefaultValue->Integer.u64); 92 else 93 RTPrintf("<NONE>"); 89 RTPrintf("integer"); 94 90 break; 95 91 case VDCFGVALUETYPE_STRING: 96 RTPrintf("string default="); 97 if (pa->pDefaultValue) 98 RTPrintf("%s", pa->pDefaultValue->String.psz); 99 else 100 RTPrintf("<NONE>"); 92 RTPrintf("string"); 101 93 break; 102 94 case VDCFGVALUETYPE_BYTES: 103 RTPrintf("bytes default="); 104 if (pa->pDefaultValue) 105 RTPrintf("length=%RTuint %.*Rhxs", 106 pa->pDefaultValue->Bytes.cb, 107 pa->pDefaultValue->Bytes.cb, 108 pa->pDefaultValue->Bytes.pv); 109 else 110 RTPrintf("<NONE>"); 95 RTPrintf("bytes"); 111 96 break; 112 97 default: 113 98 RTPrintf("INVALID!"); 114 99 } 100 if (pa->pszDefaultValue) 101 RTPrintf("%s", pa->pszDefaultValue); 102 else 103 RTPrintf("<NONE>"); 115 104 RTPrintf(" flags="); 116 105 if (!pa->uKeyFlags) -
trunk/src/VBox/Main/HardDiskFormatImpl.cpp
r14772 r14780 95 95 dt = DataType_Int32; 96 96 /* If there is a default value get them in the right format */ 97 if (pa->pDefaultValue) 98 defaultValue = 99 Utf8StrFmt ("%d", pa->pDefaultValue->Integer.u64); 97 if (pa->pszDefaultValue) 98 defaultValue = pa->pszDefaultValue; 100 99 break; 101 100 } … … 104 103 dt = DataType_Int8; 105 104 /* If there is a default value get them in the right format */ 106 if (pa->p DefaultValue)105 if (pa->pszDefaultValue) 107 106 { 108 /* Copy the bytes over */ 109 defaultValue.alloc (pa->pDefaultValue->Bytes.cb + 1); 110 memcpy (defaultValue.mutableRaw(), pa->pDefaultValue->Bytes.pv, 111 pa->pDefaultValue->Bytes.cb); 112 defaultValue.mutableRaw() [defaultValue.length()] = 0; 107 /* Copy the bytes over - treated simply as a string */ 108 defaultValue = pa->pszDefaultValue; 113 109 flags |= DataFlags_Array; 114 110 } … … 119 115 dt = DataType_String; 120 116 /* If there is a default value get them in the right format */ 121 if (pa->p DefaultValue)122 defaultValue = pa->p DefaultValue->String.psz;117 if (pa->pszDefaultValue) 118 defaultValue = pa->pszDefaultValue; 123 119 break; 124 120 }
Note:
See TracChangeset
for help on using the changeset viewer.