Changeset 24295 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Nov 3, 2009 5:11:08 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 54290
- Location:
- trunk/src/VBox/Main/xml
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r24276 r24295 1266 1266 } 1267 1267 1268 /** 1269 * Called from MachineConfigFile::readHardware() to cpuid information. 1270 * @param elmCpuid 1271 * @param ll 1272 */ 1273 void MachineConfigFile::readCpuIdTree(const xml::ElementNode &elmCpuid, 1274 CpuIdLeafsList &ll) 1275 { 1276 xml::NodesLoop nl1(elmCpuid, "CpuId"); 1277 const xml::ElementNode *pelmCpuIdLeaf; 1278 while ((pelmCpuIdLeaf = nl1.forAllNodes())) 1279 { 1280 CpuIdLeaf leaf; 1281 1282 if (!pelmCpuIdLeaf->getAttributeValue("id", leaf.ulId)) 1283 throw ConfigFileError(this, pelmCpuIdLeaf, N_("Required CpuId/@id attribute is missing")); 1284 1285 pelmCpuIdLeaf->getAttributeValue("eax", leaf.ulEax); 1286 pelmCpuIdLeaf->getAttributeValue("ebx", leaf.ulEbx); 1287 pelmCpuIdLeaf->getAttributeValue("ecx", leaf.ulEcx); 1288 pelmCpuIdLeaf->getAttributeValue("edx", leaf.ulEdx); 1289 1290 ll.push_back(leaf); 1291 } 1292 } 1268 1293 1269 1294 /** … … 1518 1543 if ((pelmCPUChild = pelmHwChild->findChildElement("SyntheticCpu"))) 1519 1544 pelmCPUChild->getAttributeValue("enabled", hw.fSyntheticCpu); 1545 if ((pelmCPUChild = pelmHwChild->findChildElement("CpuIdTree"))) 1546 readCpuIdTree(*pelmHwChild, hw.llCpuIdLeafs); 1520 1547 } 1521 1548 else if (pelmHwChild->nameEquals("Memory")) … … 2399 2426 pelmCPU->setAttribute("count", hw.cCPUs); 2400 2427 2428 xml::ElementNode *pelmCpuIdTree = pelmHardware->createChild("CpuId"); 2429 for (CpuIdLeafsList::const_iterator it = hw.llCpuIdLeafs.begin(); 2430 it != hw.llCpuIdLeafs.end(); 2431 ++it) 2432 { 2433 const CpuIdLeaf &leaf = *it; 2434 2435 xml::ElementNode *pelmCpuIdLeaf = pelmCpuIdTree->createChild("CpuIdLeaf"); 2436 pelmCpuIdLeaf->setAttribute("id", leaf.ulId); 2437 pelmCpuIdLeaf->setAttribute("eax", leaf.ulEax); 2438 pelmCpuIdLeaf->setAttribute("ebx", leaf.ulEbx); 2439 pelmCpuIdLeaf->setAttribute("ecx", leaf.ulEcx); 2440 pelmCpuIdLeaf->setAttribute("edx", leaf.ulEdx); 2441 } 2442 2401 2443 xml::ElementNode *pelmMemory = pelmHardware->createChild("Memory"); 2402 2444 pelmMemory->setAttribute("RAMSize", hw.ulMemorySizeMB); -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r23750 r24295 80 80 </xsd:simpleType> 81 81 </xsd:union> 82 </xsd:simpleType> 83 84 <xsd:simpleType name="TUInt32Hex"> 85 <xsd:restriction base="xsd:string"> 86 <xsd:pattern value="0x[A-Fa-f0-9]{1,8}"/> 87 </xsd:restriction> 82 88 </xsd:simpleType> 83 89 … … 461 467 </xsd:simpleType> 462 468 469 <xsd:complexType name="TCpuIdLeaf"> 470 <xsd:attribute name="id" type="TUInt32Hex" use="required"/> 471 <xsd:attribute name="eax" type="TUInt32Hex" use="required"/> 472 <xsd:attribute name="ebx" type="TUInt32Hex" use="required"/> 473 <xsd:attribute name="ecx" type="TUInt32Hex" use="required"/> 474 <xsd:attribute name="edx" type="TUInt32Hex" use="required"/> 475 </xsd:complexType> 476 477 <xsd:complexType name="TCpuIdTree"> 478 <xsd:sequence> 479 <xsd:element name="CpuIdLeaf" type="TCpuIdLeaf" 480 minOccurs="0" maxOccurs="unbounded"/> 481 </xsd:sequence> 482 </xsd:complexType> 483 463 484 <xsd:complexType name="TCPU"> 464 485 <xsd:sequence> … … 468 489 <xsd:element name="PAE" type="TPAEType" minOccurs="0"/> 469 490 <xsd:element name="SyntheticCpu" type="TSyntheticCpuType" minOccurs="0"/> 491 <xsd:element name="CpuIdTree" type="TCpuIdTree" minOccurs="0"/> 470 492 </xsd:sequence> 471 493 <xsd:attribute name="count" type="TCPUCount" default="1"/>
Note:
See TracChangeset
for help on using the changeset viewer.