Changeset 101168 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Sep 19, 2023 12:55:37 PM (17 months ago)
- svn:sync-xref-src-repo-rev:
- 159141
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r101154 r101168 5302 5302 * 5303 5303 * @param elmPlatformOrHardware Platform or Hardware node to read from. 5304 * @param hw Where to store the hardware settings. 5304 5305 * @param plat Where to store the platform settings. 5305 5306 */ 5306 5307 void MachineConfigFile::readPlatform(const xml::ElementNode &elmPlatformOrHardware, 5307 Platform &plat)5308 Hardware &hw, Platform &plat) 5308 5309 { 5309 5310 /* … … 5314 5315 while ((pelmChild = nl1.forAllNodes())) 5315 5316 { 5316 if (pelmChild->nameEquals("Chipset")) 5317 if (pelmChild->nameEquals("CPU")) 5318 { 5319 if (!pelmChild->getAttributeValue("count", hw.cCPUs)) 5320 { 5321 // pre-1.5 variant; not sure if this actually exists in the wild anywhere 5322 const xml::ElementNode *pelmCPUChild; 5323 if ((pelmCPUChild = pelmChild->findChildElement("CPUCount"))) 5324 pelmCPUChild->getAttributeValue("count", hw.cCPUs); 5325 } 5326 5327 pelmChild->getAttributeValue("hotplug", hw.fCpuHotPlug); 5328 pelmChild->getAttributeValue("executionCap", hw.ulCpuExecutionCap); 5329 5330 const xml::ElementNode *pelmCPUChild; 5331 if (hw.fCpuHotPlug) 5332 { 5333 if ((pelmCPUChild = pelmChild->findChildElement("CpuTree"))) 5334 readCpuTree(*pelmCPUChild, hw.llCpus); 5335 } 5336 5337 if ((pelmCPUChild = pelmChild->findChildElement("SyntheticCpu"))) 5338 { 5339 bool fSyntheticCpu = false; 5340 pelmCPUChild->getAttributeValue("enabled", fSyntheticCpu); 5341 hw.uCpuIdPortabilityLevel = fSyntheticCpu ? 1 : 0; 5342 } 5343 pelmChild->getAttributeValue("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel); 5344 pelmChild->getAttributeValue("CpuProfile", hw.strCpuProfile); 5345 } 5346 else if (pelmChild->nameEquals("Chipset")) 5317 5347 { 5318 5348 Utf8Str strChipsetType; … … 5467 5497 while ((pelmHwChild = nl1.forAllNodes())) 5468 5498 { 5469 if (pelmHwChild->nameEquals("CPU")) 5470 { 5471 if (!pelmHwChild->getAttributeValue("count", hw.cCPUs)) 5472 { 5473 // pre-1.5 variant; not sure if this actually exists in the wild anywhere 5474 const xml::ElementNode *pelmCPUChild; 5475 if ((pelmCPUChild = pelmHwChild->findChildElement("CPUCount"))) 5476 pelmCPUChild->getAttributeValue("count", hw.cCPUs); 5477 } 5478 5479 pelmHwChild->getAttributeValue("hotplug", hw.fCpuHotPlug); 5480 pelmHwChild->getAttributeValue("executionCap", hw.ulCpuExecutionCap); 5481 5482 const xml::ElementNode *pelmCPUChild; 5483 if (hw.fCpuHotPlug) 5484 { 5485 if ((pelmCPUChild = pelmHwChild->findChildElement("CpuTree"))) 5486 readCpuTree(*pelmCPUChild, hw.llCpus); 5487 } 5488 5489 if ((pelmCPUChild = pelmHwChild->findChildElement("SyntheticCpu"))) 5490 { 5491 bool fSyntheticCpu = false; 5492 pelmCPUChild->getAttributeValue("enabled", fSyntheticCpu); 5493 hw.uCpuIdPortabilityLevel = fSyntheticCpu ? 1 : 0; 5494 } 5495 pelmHwChild->getAttributeValue("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel); 5496 pelmHwChild->getAttributeValue("CpuProfile", hw.strCpuProfile); 5497 } 5498 else if (pelmHwChild->nameEquals("Memory")) 5499 if (pelmHwChild->nameEquals("Memory")) 5499 5500 { 5500 5501 pelmHwChild->getAttributeValue("RAMSize", hw.ulMemorySizeMB); … … 6114 6115 * For newer settings (>= v1.20) we read the platform settings outside readHardware(). */ 6115 6116 if (m->sv < SettingsVersion_v1_20) 6116 readPlatform(elmHardware, hw .platformSettings);6117 readPlatform(elmHardware, hw, hw.platformSettings); 6117 6118 6118 6119 if (hw.ulMemorySizeMB == (uint32_t)-1) … … 6741 6742 if (!(pelmPlatform = pElement->findChildElement("Platform"))) 6742 6743 throw ConfigFileError(this, pElement, N_("Required Snapshot/@Platform element is missing")); 6743 readPlatform(*pelmPlatform, pSnap->hardware .platformSettings);6744 readPlatform(*pelmPlatform, pSnap->hardware, pSnap->hardware.platformSettings); 6744 6745 } 6745 6746 … … 6944 6945 if (!(pelmPlatform = elmMachine.findChildElement("Platform"))) 6945 6946 throw ConfigFileError(this, &elmMachine, N_("Required Machine/@Platform element is missing")); 6946 readPlatform(*pelmPlatform, hardwareMachine .platformSettings);6947 readPlatform(*pelmPlatform, hardwareMachine, hardwareMachine.platformSettings); 6947 6948 } 6948 6949
Note:
See TracChangeset
for help on using the changeset viewer.