Changeset 22296 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 17, 2009 1:13:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r22287 r22296 26 26 27 27 #include "VirtualBoxXMLUtil.h" 28 29 // generated header 30 #include "SchemaDefs.h" 28 31 29 32 using namespace com; … … 927 930 928 931 /** 932 * Hardware struct constructor. 933 */ 934 Hardware::Hardware() 935 : strVersion("2"), 936 fHardwareVirt(true), 937 fNestedPaging(false), 938 fVPID(false), 939 fPAE(false), 940 cCPUs(1), 941 ulMemorySizeMB((uint32_t)-1), 942 ulVRAMSizeMB(8), 943 cMonitors(1), 944 fAccelerate3D(false), 945 fAccelerate2DVideo(false), 946 clipboardMode(ClipboardMode_Bidirectional), 947 ulMemoryBalloonSize(0), 948 ulStatisticsUpdateInterval(0) 949 { 950 mapBootOrder[0] = DeviceType_Floppy; 951 mapBootOrder[1] = DeviceType_DVD; 952 mapBootOrder[2] = DeviceType_HardDisk; 953 } 954 955 956 /** 929 957 * Called from MachineConfigFile::readHardware() to network information. 930 958 * @param elmNetwork … … 1165 1193 else if (pelmHwChild->nameEquals("Boot")) 1166 1194 { 1195 hw.mapBootOrder.clear(); 1196 1167 1197 xml::NodesLoop nl2(*pelmHwChild, "Order"); 1168 1198 const xml::ElementNode *pelmOrder; … … 1172 1202 Utf8Str strDevice; 1173 1203 if (!pelmOrder->getAttributeValue("position", ulPos)) 1174 throw ConfigFileError(this, N_("Required Order/@position attribute is missing")); 1204 throw ConfigFileError(this, N_("Required Boot/Order/@position attribute is missing")); 1205 1206 if ( ulPos < 1 1207 || ulPos >= SchemaDefs::MaxBootPosition 1208 ) 1209 throw ConfigFileError(this, 1210 N_("Invalid value '%RU32' in Boot/Order/@position: must be between 0 and %RU32"), 1211 ulPos, 1212 SchemaDefs::MaxBootPosition + 1); 1213 // XML is 1-based but internal data is 0-based 1214 --ulPos; 1215 1216 if (hw.mapBootOrder.find(ulPos) != hw.mapBootOrder.end()) 1217 throw ConfigFileError(this, N_("Invalid value '%RU32' in Boot/Order/@position: value is not unique"), ulPos); 1218 1175 1219 if (!pelmOrder->getAttributeValue("device", strDevice)) 1176 throw ConfigFileError(this, N_("Required Order/@device attribute is missing")); 1177 if (hw.mapBootOrder.find(ulPos) != hw.mapBootOrder.end()) 1178 throw ConfigFileError(this, N_("Order/@attribute value %d is not unique"), ulPos); 1220 throw ConfigFileError(this, N_("Required Boot/Order/@device attribute is missing")); 1179 1221 1180 1222 DeviceType_T type; … … 1798 1840 1799 1841 xml::ElementNode *pelmOrder = pelmBoot->createChild("Order"); 1800 pelmOrder->setAttribute("position", i); 1842 pelmOrder->setAttribute("position", 1843 i + 1); // XML is 1-based but internal data is 0-based 1801 1844 pelmOrder->setAttribute("device", pcszDevice); 1802 1845 }
Note:
See TracChangeset
for help on using the changeset viewer.