Changeset 11251 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Aug 8, 2008 2:08:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r11250 r11251 939 939 * Validate configuration. 940 940 */ 941 if (!CFGMR3AreValuesValid(pCfgHandle, "Irq\0 Base\0Speaker\0GCEnabled\0R0Enabled\0"))941 if (!CFGMR3AreValuesValid(pCfgHandle, "Irq\0" "Base\0" "Speaker\0" "GCEnabled\0" "R0Enabled\0")) 942 942 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 943 943 … … 945 945 * Init the data. 946 946 */ 947 rc = CFGMR3QueryU8(pCfgHandle, "Irq", &u8Irq); 948 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 949 u8Irq = 0; 950 else if (VBOX_FAILURE(rc)) 947 rc = CFGMR3QueryU8Def(pCfgHandle, "Irq", &u8Irq, 0); 948 if (VBOX_FAILURE(rc)) 951 949 return PDMDEV_SET_ERROR(pDevIns, rc, 952 950 N_("Configuration error: Querying \"Irq\" as a uint8_t failed")); 953 951 954 rc = CFGMR3QueryU16(pCfgHandle, "Base", &u16Base); 955 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 956 u16Base = 0x40; 957 else if (VBOX_FAILURE(rc)) 952 rc = CFGMR3QueryU16Def(pCfgHandle, "Base", &u16Base, 0x40); 953 if (VBOX_FAILURE(rc)) 958 954 return PDMDEV_SET_ERROR(pDevIns, rc, 959 955 N_("Configuration error: Querying \"Base\" as a uint16_t failed")); 960 956 961 rc = CFGMR3QueryBool(pCfgHandle, "SpeakerEnabled", &fSpeaker); 962 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 963 fSpeaker = true; 964 else if (VBOX_FAILURE(rc)) 957 rc = CFGMR3QueryBoolDef(pCfgHandle, "SpeakerEnabled", &fSpeaker, true); 958 if (VBOX_FAILURE(rc)) 965 959 return PDMDEV_SET_ERROR(pDevIns, rc, 966 960 N_("Configuration error: Querying \"SpeakerEnabled\" as a bool failed")); 967 961 968 rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &fGCEnabled); 969 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 970 fGCEnabled = true; 971 else if (VBOX_FAILURE(rc)) 962 rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &fGCEnabled, true); 963 if (VBOX_FAILURE(rc)) 972 964 return PDMDEV_SET_ERROR(pDevIns, rc, 973 965 N_("Configuration error: Querying \"GCEnabled\" as a bool failed")); 974 966 975 rc = CFGMR3QueryBool(pCfgHandle, "R0Enabled", &fR0Enabled); 976 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 977 fR0Enabled = true; 978 else if (VBOX_FAILURE(rc)) 967 rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &fR0Enabled, true); 968 if (VBOX_FAILURE(rc)) 979 969 return PDMDEV_SET_ERROR(pDevIns, rc, 980 970 N_("Configuration error: failed to read R0Enabled as boolean"));
Note:
See TracChangeset
for help on using the changeset viewer.