- Timestamp:
- Feb 24, 2009 4:58:15 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r17075 r17077 6086 6086 } 6087 6087 6088 /** 6089 * Convert config value to DEVPCBIOSBOOT. 6090 * 6091 * @returns VBox status code. 6092 * @param pDevIns The device instance data. 6093 * @param pCfgHandle Configuration handle. 6094 * @param penmChipset Where to store the chipset type. 6095 */ 6096 static int ataControllerFromCfg(PPDMDEVINS pDevIns, PCFGMNODE pCfgHandle, CHIPSET *penmChipset) 6097 { 6098 char szType[20]; 6099 6100 int rc = CFGMR3QueryString(pCfgHandle, "Type", &szType[0], sizeof(szType)); 6101 if (RT_FAILURE(rc)) 6102 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 6103 N_("Configuration error: Querying \"Type\" as a string failed")); 6104 if (!strcmp(szType, "PIIX3")) 6105 *penmChipset = CHIPSET_PIIX3; 6106 else if (!strcmp(szType, "PIIX4")) 6107 *penmChipset = CHIPSET_PIIX4; 6108 else if (!strcmp(szType, "ICH6")) 6109 *penmChipset = CHIPSET_ICH6; 6110 else 6111 { 6112 PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 6113 N_("Configuration error: The \"Type\" value \"%s\" is unknown"), 6114 szType); 6115 rc = VERR_INTERNAL_ERROR; 6116 } 6117 return rc; 6118 } 6119 6088 6120 6089 6121 /** … … 6147 6179 Assert(DelayIRQMillies < 50); 6148 6180 6149 pThis->u8Type = CHIPSET_PIIX3; 6150 uint32_t type; 6151 rc = CFGMR3QueryU32Def(pCfgHandle, "Type", &type, 0); 6181 CHIPSET enmChipset = CHIPSET_PIIX3; 6182 rc = ataControllerFromCfg(pDevIns, pCfgHandle, &enmChipset); 6152 6183 if (RT_FAILURE(rc)) 6153 return PDMDEV_SET_ERROR(pDevIns, rc, 6154 N_("PIIX3 configuration error: failed to read Type as integer")); 6155 Log(("%s: type=%d\n", __FUNCTION__, type)); 6156 /** See IDEControllerType in VirtualBox.xidl */ 6157 switch (type) 6158 { 6159 case 0: 6160 /** @todo: what is right here? */ 6161 AssertMsgFailed(("What do we do here: type Null\n")); 6162 break; 6163 case 1: 6164 pThis->u8Type = CHIPSET_PIIX3; 6165 break; 6166 case 2: 6167 pThis->u8Type = CHIPSET_PIIX4; 6168 break; 6169 case 3: 6170 pThis->u8Type = CHIPSET_ICH6; 6171 break; 6172 default: 6173 AssertMsgFailed(("Unknown IDE type: %d\n", type)); 6174 } 6175 6184 return rc; 6185 pThis->u8Type = (uint8_t)enmChipset; 6186 6176 6187 /* 6177 6188 * Initialize data (most of it anyway). -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r17075 r17077 80 80 #endif 81 81 82 82 /** 83 * Translate IDEControllerType_T to string representation. 84 */ 85 const char* controllerString(IDEControllerType_T enmType) 86 { 87 switch (enmType) 88 { 89 case IDEControllerType_PIIX3: 90 return "PIIX3"; 91 case IDEControllerType_PIIX4: 92 return "PIIX4"; 93 case IDEControllerType_ICH6: 94 return "ICH6"; 95 default: 96 return "Unknown"; 97 } 98 } 83 99 /* 84 100 * VC++ 8 / amd64 has some serious trouble with this function. … … 780 796 rc = CFGMR3InsertInteger(pIdeInst, "PCIFunctionNo", 1); RC_CHECK(); 781 797 rc = CFGMR3InsertNode(pIdeInst, "Config", &pCfg); RC_CHECK(); 782 rc = CFGMR3Insert Integer(pCfg, "Type", (uint32_t)controllerType);RC_CHECK();798 rc = CFGMR3InsertString(pCfg, "Type", controllerString(controllerType)); RC_CHECK(); 783 799 784 800 /* Attach the status driver */
Note:
See TracChangeset
for help on using the changeset viewer.