Changeset 16309 in vbox
- Timestamp:
- Jan 28, 2009 1:42:36 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
-
ApplianceImpl.cpp (modified) (14 diffs)
-
idl/VirtualBox.xidl (modified) (1 diff)
-
include/ApplianceImpl.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r16307 r16309 1375 1375 1376 1376 /* Guest OS type */ 1377 list<VirtualSystemDescriptionEntry> vsdeOS = vsd->findByType(VirtualSystemDescriptionType_OS);1377 std::list<VirtualSystemDescriptionEntry*> vsdeOS = vsd->findByType(VirtualSystemDescriptionType_OS); 1378 1378 Assert(vsdeOS.size() == 1); 1379 string osTypeVBox = vsdeOS.front() .strFinalValue;1379 string osTypeVBox = vsdeOS.front()->strFinalValue; 1380 1380 1381 1381 /* Now that we know the base system get our internal defaults based on that. */ … … 1386 1386 /* Create the machine */ 1387 1387 /* First get the name */ 1388 list<VirtualSystemDescriptionEntry> vsdeName = vsd->findByType(VirtualSystemDescriptionType_Name);1388 std::list<VirtualSystemDescriptionEntry*> vsdeName = vsd->findByType(VirtualSystemDescriptionType_Name); 1389 1389 Assert(vsdeName.size() == 1); 1390 string nameVBox = vsdeName.front() .strFinalValue;1390 string nameVBox = vsdeName.front()->strFinalValue; 1391 1391 ComPtr<IMachine> newMachine; 1392 1392 rc = mVirtualBox->CreateMachine(Bstr(nameVBox.c_str()), Bstr(osTypeVBox.c_str()), … … 1397 1397 /* CPU count (ignored for now) */ 1398 1398 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxCPUCount) */ 1399 // list<VirtualSystemDescriptionEntry>vsdeCPU = vsd->findByType (VirtualSystemDescriptionType_CPU);1399 // EntriesList vsdeCPU = vsd->findByType (VirtualSystemDescriptionType_CPU); 1400 1400 1401 1401 /* RAM */ 1402 1402 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */ 1403 list<VirtualSystemDescriptionEntry> vsdeRAM = vsd->findByType(VirtualSystemDescriptionType_Memory);1403 std::list<VirtualSystemDescriptionEntry*> vsdeRAM = vsd->findByType(VirtualSystemDescriptionType_Memory); 1404 1404 Assert(vsdeRAM.size() == 1); 1405 string memoryVBox = vsdeRAM.front() .strFinalValue;1405 string memoryVBox = vsdeRAM.front()->strFinalValue; 1406 1406 uint64_t tt = RTStrToUInt64(memoryVBox.c_str()) / _1M; 1407 1407 … … 1420 1420 1421 1421 /* Change the network adapters */ 1422 list<VirtualSystemDescriptionEntry> vsdeNW = vsd->findByType(VirtualSystemDescriptionType_NetworkAdapter);1422 std::list<VirtualSystemDescriptionEntry*> vsdeNW = vsd->findByType(VirtualSystemDescriptionType_NetworkAdapter); 1423 1423 if (vsdeNW.size() == 0) 1424 1424 { … … 1432 1432 else 1433 1433 { 1434 list<VirtualSystemDescriptionEntry >::const_iterator nwIt;1434 list<VirtualSystemDescriptionEntry*>::const_iterator nwIt; 1435 1435 /* Iterate through all network cards. We support 8 network adapters 1436 1436 * at the maximum. (@todo: warn if it are more!) */ … … 1440 1440 ++nwIt, ++a) 1441 1441 { 1442 string nwTypeVBox = nwIt->strFinalValue;1442 string nwTypeVBox = (*nwIt)->strFinalValue; 1443 1443 uint32_t tt1 = RTStrToUInt32(nwTypeVBox.c_str()); 1444 1444 ComPtr<INetworkAdapter> nwVBox; … … 1455 1455 1456 1456 /* Hard disk controller IDE */ 1457 list<VirtualSystemDescriptionEntry> vsdeHDCIDE = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerIDE);1457 std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerIDE); 1458 1458 /* @todo: we support one IDE controller only */ 1459 1459 if (vsdeHDCIDE.size() > 0) 1460 1460 { 1461 IDEControllerType_T hdcVBox = static_cast<IDEControllerType_T>(RTStrToUInt32(vsdeHDCIDE.front() .strFinalValue.c_str()));1461 IDEControllerType_T hdcVBox = static_cast<IDEControllerType_T>(RTStrToUInt32(vsdeHDCIDE.front()->strFinalValue.c_str())); 1462 1462 /* Set the appropriate IDE controller in the virtual BIOS of the 1463 1463 * VM. */ … … 1470 1470 #ifdef VBOX_WITH_AHCI 1471 1471 /* Hard disk controller SATA */ 1472 list<VirtualSystemDescriptionEntry> vsdeHDCSATA = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA);1472 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA); 1473 1473 /* @todo: we support one SATA controller only */ 1474 1474 if (vsdeHDCSATA.size() > 0) 1475 1475 { 1476 string hdcVBox = vsdeHDCIDE.front() .strFinalValue;1476 string hdcVBox = vsdeHDCIDE.front()->strFinalValue; 1477 1477 if (!RTStrCmp(hdcVBox.c_str(), "AHCI")) 1478 1478 { … … 1492 1492 #ifdef VBOX_WITH_SCSI 1493 1493 /* Hard disk controller SCSI */ 1494 list<VirtualSystemDescriptionEntry>vsdeHDCSCSI = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI);1494 EntriesList vsdeHDCSCSI = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI); 1495 1495 /* @todo: do we support more than one SCSI controller? */ 1496 1496 if (vsdeHDCSCSI.size() > 0) … … 1506 1506 1507 1507 /* Create the hard disks & connect them to the appropriate controllers. */ 1508 list<VirtualSystemDescriptionEntry> vsdeHD = vsd->findByType(VirtualSystemDescriptionType_HardDiskImage);1508 std::list<VirtualSystemDescriptionEntry*> vsdeHD = vsd->findByType(VirtualSystemDescriptionType_HardDiskImage); 1509 1509 if (vsdeHD.size() > 0) 1510 1510 { … … 1526 1526 RTPathStripFilename(srcDir); 1527 1527 /* Iterate over all given disk images */ 1528 list<VirtualSystemDescriptionEntry >::const_iterator hdIt;1528 list<VirtualSystemDescriptionEntry*>::const_iterator hdIt; 1529 1529 for (hdIt = vsdeHD.begin(); 1530 1530 hdIt != vsdeHD.end(); 1531 1531 ++hdIt) 1532 1532 { 1533 char *dstFilePath = RTStrDup( hdIt->strFinalValue.c_str());1533 char *dstFilePath = RTStrDup((*hdIt)->strFinalValue.c_str()); 1534 1534 /* Check if the destination file exists already or the 1535 1535 * destination path is empty. */ … … 1541 1541 // continue; 1542 1542 } 1543 const string &strRef = (*hdIt)->strRef; 1543 1544 /* Get the associated disk image */ 1544 if (m->mapDisks.find( hdIt->strRef) == m->mapDisks.end())1545 if (m->mapDisks.find(strRef) == m->mapDisks.end()) 1545 1546 { 1546 1547 /* @todo: error: entry doesn't exists */ 1547 1548 } 1548 DiskImage di = m->mapDisks [ hdIt->strRef];1549 DiskImage di = m->mapDisks [strRef]; 1549 1550 /* Construct the source file path */ 1550 1551 char *srcFilePath; … … 1768 1769 } 1769 1770 1770 void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType, std::string aRef, std::string aOrigValue, std::string aAutoValue, std::string aConfig /* = "" */) 1771 void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType, 1772 const std::string &aRef, 1773 const std::string &aOrigValue, 1774 const std::string &aAutoValue, 1775 const std::string &aConfig /* = "" */) 1771 1776 { 1772 1777 VirtualSystemDescriptionEntry vsde; … … 1782 1787 } 1783 1788 1784 list<VirtualSystemDescriptionEntry> VirtualSystemDescription::findByType(VirtualSystemDescriptionType_T aType) 1785 { 1786 list<VirtualSystemDescriptionEntry> vsd; 1787 1788 list<VirtualSystemDescriptionEntry>::const_iterator it; 1789 std::list<VirtualSystemDescriptionEntry*> VirtualSystemDescription::findByType(VirtualSystemDescriptionType_T aType) 1790 { 1791 std::list<VirtualSystemDescriptionEntry*> vsd; 1792 list<VirtualSystemDescriptionEntry>::iterator it; 1789 1793 for (it = m->descriptions.begin(); 1790 1794 it != m->descriptions.end(); 1791 1795 ++it) 1792 1796 if (it->type == aType) 1793 vsd.push_back( *it);1797 vsd.push_back(&(*it)); 1794 1798 1795 1799 return vsd; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16306 r16309 3002 3002 <const name="NetworkAdapter" value="11" /> 3003 3003 <const name="USBController" value="12" /> 3004 <const name="SoundCard" value="13" /> 3004 3005 3005 3006 </enum> -
trunk/src/VBox/Main/include/ApplianceImpl.h
r16298 r16309 150 150 /* private instance data */ 151 151 private: 152 void addEntry(VirtualSystemDescriptionType_T aType, std::string aRef, std::string aOrigValue, std::string aAutoValue, std::string aConfig = ""); 153 std::list<VirtualSystemDescriptionEntry> findByType(VirtualSystemDescriptionType_T aType); 152 void addEntry(VirtualSystemDescriptionType_T aType, 153 const std::string &aRef, 154 const std::string &aOrigValue, 155 const std::string &aAutoValue, 156 const std::string &aConfig = ""); 157 158 std::list<VirtualSystemDescriptionEntry*> findByType(VirtualSystemDescriptionType_T aType); 154 159 155 160 struct Data;
Note:
See TracChangeset
for help on using the changeset viewer.

