Changeset 25901 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Jan 18, 2010 4:52:21 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56716
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r25892 r25901 30 30 * 3) In the settings writer method, write the setting _only_ if the current settings 31 31 * version (stored in m->sv) is high enough. That is, for VirtualBox 3.2, write it 32 * only if (m->sv >= SettingsVersion_v1_1 0).32 * only if (m->sv >= SettingsVersion_v1_11). 33 33 * 34 34 * 4) In MachineConfigFile::bumpSettingsVersionIfNeeded(), check if the new setting has … … 82 82 83 83 /** VirtualBox XML settings version number substring ("x.y") */ 84 #define VBOX_XML_VERSION "1. 9"84 #define VBOX_XML_VERSION "1.11" 85 85 86 86 /** VirtualBox XML settings version platform substring */ … … 282 282 else if (ulMinor == 10) 283 283 m->sv = SettingsVersion_v1_10; 284 else if (ulMinor > 10) 284 else if (ulMinor == 11) 285 m->sv = SettingsVersion_v1_11; 286 else if (ulMinor > 11) 285 287 m->sv = SettingsVersion_Future; 286 288 } … … 302 304 // creating new settings file: 303 305 m->strSettingsVersionFull = VBOX_XML_VERSION_FULL; 304 m->sv = SettingsVersion_v1_1 0;306 m->sv = SettingsVersion_v1_11; 305 307 } 306 308 } … … 556 558 557 559 case SettingsVersion_v1_10: 560 pcszVersion = "1.10"; 561 m->sv = SettingsVersion_v1_10; 562 break; 563 564 case SettingsVersion_v1_11: 558 565 case SettingsVersion_Future: // can be set if this code runs on XML files that were created by a future version of VBox; 559 566 // in that case, downgrade to current version when writing since we can't write future versions... 560 pcszVersion = "1.1 0";561 m->sv = SettingsVersion_v1_1 0;567 pcszVersion = "1.11"; 568 m->sv = SettingsVersion_v1_11; 562 569 break; 563 570 … … 1263 1270 fPAE(false), 1264 1271 cCPUs(1), 1272 fCpuHotPlug(false), 1265 1273 ulMemorySizeMB((uint32_t)-1), 1266 1274 ulVRAMSizeMB(8), … … 1284 1292 fPAE = true; 1285 1293 #endif 1294 } 1295 1296 /** 1297 * Called from MachineConfigFile::readHardware() to read cpu information. 1298 * @param elmCpuid 1299 * @param ll 1300 */ 1301 void MachineConfigFile::readCpuTree(const xml::ElementNode &elmCpu, 1302 CpuList &ll) 1303 { 1304 xml::NodesLoop nl1(elmCpu, "Cpu"); 1305 const xml::ElementNode *pelmCpu; 1306 while ((pelmCpu = nl1.forAllNodes())) 1307 { 1308 Cpu cpu; 1309 1310 if (!pelmCpu->getAttributeValue("id", cpu.ulId)) 1311 throw ConfigFileError(this, pelmCpu, N_("Required Cpu/@id attribute is missing")); 1312 1313 ll.push_back(cpu); 1314 } 1286 1315 } 1287 1316 … … 1560 1589 } 1561 1590 1591 pelmHwChild->getAttributeValue("hotplug", hw.fCpuHotPlug); 1592 1562 1593 const xml::ElementNode *pelmCPUChild; 1594 if (hw.fCpuHotPlug) 1595 { 1596 if ((pelmCPUChild = pelmHwChild->findChildElement("CpuTree"))) 1597 readCpuTree(*pelmCPUChild, hw.llCpus); 1598 } 1599 1563 1600 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtEx"))) 1564 1601 { … … 2468 2505 pelmCPU->createChild("SyntheticCpu")->setAttribute("enabled", hw.fSyntheticCpu); 2469 2506 pelmCPU->setAttribute("count", hw.cCPUs); 2507 2508 if (m->sv >= SettingsVersion_v1_11) 2509 { 2510 pelmCPU->setAttribute("hotplug", hw.fCpuHotPlug); 2511 2512 xml::ElementNode *pelmCpuTree = NULL; 2513 for (CpuList::const_iterator it = hw.llCpus.begin(); 2514 it != hw.llCpus.end(); 2515 ++it) 2516 { 2517 const Cpu &cpu = *it; 2518 2519 if (pelmCpuTree == NULL) 2520 pelmCpuTree = pelmCPU->createChild("CpuTree"); 2521 2522 xml::ElementNode *pelmCpu = pelmCpuTree->createChild("Cpu"); 2523 pelmCpu->setAttribute("id", cpu.ulId); 2524 } 2525 } 2526 2470 2527 xml::ElementNode *pelmCpuIdTree = NULL; 2471 2528 for (CpuIdLeafsList::const_iterator it = hw.llCpuIdLeafs.begin(); … … 3081 3138 ) 3082 3139 m->sv = SettingsVersion_v1_10; 3140 3141 // Version 1.11 is required for CPU hotplugging 3142 if ( (m->sv < SettingsVersion_v1_11) 3143 && (hardwareMachine.fCpuHotPlug) 3144 ) 3145 m->sv = SettingsVersion_v1_11; 3083 3146 } 3084 3147
Note:
See TracChangeset
for help on using the changeset viewer.