Changeset 16298 in vbox
- Timestamp:
- Jan 28, 2009 11:35:52 AM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
-
ApplianceImpl.cpp (modified) (28 diffs)
-
idl/VirtualBox.xidl (modified) (2 diffs)
-
include/ApplianceImpl.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r16248 r16298 23 23 #include <iprt/stream.h> 24 24 #include <iprt/path.h> 25 #include <iprt/dir.h> 26 #include <iprt/file.h> 25 27 26 28 #include "ApplianceImpl.h" … … 132 134 uint32_t idController; // instance ID (Item/InstanceId); this gets referenced from HardDisk 133 135 ControllerSystemType controllerSystem; // one of IDE, SATA, SCSI 134 string strControllerType; // controller type (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE)136 string strControllerType; // controllertype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE) 135 137 string strAddress; // for IDE 136 138 uint32_t ulBusNumber; // for IDE … … 154 156 }; 155 157 158 typedef map<string, VirtualDisk> VirtualDisksMap; 159 156 160 struct VirtualSystem 157 161 { … … 174 178 // (one for each VirtualSystem/Item[@ResourceType=6] element with accumulated data from children) 175 179 176 list<VirtualDisk> llVirtualDisks;180 VirtualDisksMap mapVirtualDisks; 177 181 // (one for each VirtualSystem/Item[@ResourceType=17] element with accumulated data from children) 178 182 … … 713 717 i.ulLineNumber); 714 718 715 d. llVirtualDisks.push_back(vd);719 d.mapVirtualDisks[vd.strDiskId] = vd; 716 720 } 717 721 break; … … 913 917 // - don't use COM methods but the methods directly (faster, but needs appropriate locking of that objects itself (s. HardDisk2)) 914 918 // - Appropriate handle errors like not supported file formats 919 AutoCaller autoCaller(this); 920 CheckComRCReturnRC(autoCaller.rc()); 915 921 916 922 HRESULT rc = S_OK; … … 921 927 922 928 /* We need the default path for storing disk images */ 923 ISystemProperties *systemProps = NULL;924 rc = mVirtualBox->COMGETTER(SystemProperties)( &systemProps);929 ComPtr<ISystemProperties> systemProps; 930 rc = mVirtualBox->COMGETTER(SystemProperties)(systemProps.asOutParam()); 925 931 ComAssertComRCThrowRC(rc); 926 932 BSTR defaultHardDiskLocation; … … 1124 1130 } 1125 1131 } 1126 vsd->addEntry(VirtualSystemDescriptionType_OS, 0, toString<ULONG>(vs.cimos), osTypeVBox);1132 vsd->addEntry(VirtualSystemDescriptionType_OS, "", toString<ULONG>(vs.cimos), osTypeVBox); 1127 1133 1128 1134 /* VM name */ … … 1133 1139 nameVBox = osTypeVBox; 1134 1140 searchUniqueVMName(nameVBox); 1135 vsd->addEntry(VirtualSystemDescriptionType_Name, 0, vs.strName, nameVBox);1141 vsd->addEntry(VirtualSystemDescriptionType_Name, "", vs.strName, nameVBox); 1136 1142 1137 1143 /* Now that we know the base system get our internal defaults based on that. */ 1138 IGuestOSType *osType = NULL;1139 rc = mVirtualBox-> GetGuestOSType(Bstr(Utf8Str(osTypeVBox.c_str())), &osType);1144 ComPtr<IGuestOSType> osType; 1145 rc = mVirtualBox->COMGETTER(GuestOSType)(Bstr(Utf8Str(osTypeVBox.c_str())), osType.asOutParam()); 1140 1146 ComAssertComRCThrowRC(rc); 1141 1147 … … 1145 1151 if (vs.cCPUs == 0) 1146 1152 cpuCountVBox = 1; 1147 vsd->addEntry(VirtualSystemDescriptionType_CPU, 0, toString<ULONG>(vs.cCPUs), toString<ULONG>(cpuCountVBox));1153 vsd->addEntry(VirtualSystemDescriptionType_CPU, "", toString<ULONG>(vs.cCPUs), toString<ULONG>(cpuCountVBox)); 1148 1154 1149 1155 /* RAM */ … … 1159 1165 ullMemSizeVBox = memSizeVBox2 * _1M; 1160 1166 } 1161 vsd->addEntry(VirtualSystemDescriptionType_Memory, 0, toString<uint64_t>(vs.ullMemorySize), toString<uint64_t>(ullMemSizeVBox));1167 vsd->addEntry(VirtualSystemDescriptionType_Memory, "", toString<uint64_t>(vs.ullMemorySize), toString<uint64_t>(ullMemSizeVBox)); 1162 1168 1163 1169 /* Hard disk Controller */ … … 1180 1186 else if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4")) 1181 1187 hdcController = IDEControllerType_PIIX4; 1182 vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerIDE, hdc.idController, hdc.strControllerType, toString<ULONG>(hdcController));1188 vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerIDE, toString<uint32_t>(hdc.idController), hdc.strControllerType, toString<ULONG>(hdcController)); 1183 1189 break; 1184 1190 } 1191 #ifdef VBOX_WITH_AHCI 1185 1192 case SATA: 1186 1193 { 1187 1194 // @todo: figure out the SATA types 1188 1195 /* We only support a plain AHCI controller, so use them always */ 1189 vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerSATA, hdc.idController, hdc.strControllerType, "AHCI");1196 vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerSATA, toString<uint32_t>(hdc.idController), hdc.strControllerType, "AHCI"); 1190 1197 break; 1191 1198 } 1199 #endif /* VBOX_WITH_AHCI */ 1200 #ifdef VBOX_WITH_SCSI 1192 1201 case SCSI: 1193 1202 { 1203 // @todo: figure out the SCSI types 1204 # ifdef VBOX_WITH_LSILOGIC 1194 1205 string hdcController = "LsiLogic"; 1195 // @todo: figure out the SCSI types 1206 # elif VBOX_WITH_BUSLOGIC 1207 string hdcController = "BusLogic"; 1208 # else /* !VBOX_WITH_BUSLOGIC */ 1209 string hdcController; 1210 # endif 1211 # ifdef VBOX_WITH_LSILOGIC 1196 1212 if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic")) 1197 1213 hdcController = "LsiLogic"; 1198 else if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic")) 1214 # endif /* VBOX_WITH_LSILOGIC */ 1215 # ifdef VBOX_WITH_BUSLOGIC 1216 if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic")) 1199 1217 hdcController = "BusLogic"; 1200 vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerSCSI, hdc.idController, hdc.strControllerType, hdcController); 1218 # endif /* VBOX_WITH_BUSLOGIC */ 1219 vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerSCSI, toString<uint32_t>(hdc.idController), hdc.strControllerType, hdcController); 1201 1220 break; 1202 1221 } 1222 #endif /* VBOX_WITH_SCSI */ 1223 default: 1224 { 1225 /* @todo: hmm, ok, this needs some explanation to the user, 1226 * so set an error! The other possibility is to set IDE 1227 * PIIX4 as default & redirect all hard disks to this 1228 * controller. */ 1229 break; 1230 } 1203 1231 } 1204 1232 } 1205 1233 1206 1234 /* Hard disks */ 1207 if (vs. llVirtualDisks.size() > 0)1235 if (vs.mapVirtualDisks.size() > 0) 1208 1236 { 1209 1237 // @todo: 1210 1238 // - strHref could be empty (construct a new default file name) 1211 1239 // - check that the filename is unique to vbox in any case 1212 list<VirtualDisk>::const_iterator hdIt;1240 VirtualDisksMap::const_iterator hdIt; 1213 1241 /* Iterate through all hard disks ()*/ 1214 for (hdIt = vs. llVirtualDisks.begin();1215 hdIt != vs. llVirtualDisks.end();1242 for (hdIt = vs.mapVirtualDisks.begin(); 1243 hdIt != vs.mapVirtualDisks.end(); 1216 1244 ++hdIt) 1217 1245 { 1218 VirtualDisk hd = *hdIt;1246 VirtualDisk hd = hdIt->second; 1219 1247 /* Get the associated disk image */ 1220 1248 DiskImage di = m->mapDisks [hd.strDiskId]; … … 1234 1262 /* Construct the path */ 1235 1263 string path = Utf8StrFmt("%ls%c%s", defaultHardDiskLocation, RTPATH_DELIMITER, di.strHref.c_str()).raw(); 1236 vsd->addEntry(VirtualSystemDescriptionType_Harddisk, hd.idController, di.strHref, path); 1264 /* Make the path unique to the VBox installation */ 1265 searchUniqueDiskImageFilePath(path); 1266 vsd->addEntry(VirtualSystemDescriptionType_Harddisk, hd.strDiskId, di.strHref, path); 1237 1267 } 1238 1268 } … … 1256 1286 { 1257 1287 // string nwController = *nwIt; // @todo: not used yet 1258 vsd->addEntry(VirtualSystemDescriptionType_NetworkAdapter, 0, "", toString<ULONG>(nwAdapterVBox));1288 vsd->addEntry(VirtualSystemDescriptionType_NetworkAdapter, "", "", toString<ULONG>(nwAdapterVBox)); 1259 1289 } 1260 1290 } … … 1267 1297 STDMETHODIMP Appliance::ImportAppliance() 1268 1298 { 1299 // @todo: we need definitely a IProgress object here (disk image copying, ...) 1300 AutoCaller autoCaller(this); 1301 CheckComRCReturnRC(autoCaller.rc()); 1302 1269 1303 HRESULT rc = S_OK; 1270 1304 1271 1305 list<VirtualSystem>::const_iterator it; 1272 1306 list< ComObjPtr<VirtualSystemDescription> >::const_iterator it1; 1273 /* Iterate through all appliances*/1307 /* Iterate through all virtual systems of that appliance */ 1274 1308 size_t i = 0; 1275 1309 for (it = m->llVirtualSystems.begin(), … … 1287 1321 1288 1322 /* Now that we know the base system get our internal defaults based on that. */ 1289 IGuestOSType *osType = NULL;1290 rc = mVirtualBox-> GetGuestOSType(Bstr(Utf8Str(osTypeVBox.c_str())), &osType);1323 ComPtr<IGuestOSType> osType; 1324 rc = mVirtualBox->COMGETTER(GuestOSType)(Bstr(Utf8Str(osTypeVBox.c_str())), osType.asOutParam()); 1291 1325 ComAssertComRCThrowRC(rc); 1292 1326 … … 1296 1330 Assert(vsdeName.size() == 1); 1297 1331 string nameVBox = vsdeName.front().strFinalValue; 1298 IMachine *newMachine = NULL;1332 ComPtr<IMachine> newMachine; 1299 1333 rc = mVirtualBox->CreateMachine(Bstr(nameVBox.c_str()), Bstr(osTypeVBox.c_str()), 1300 1334 Bstr(), Guid(), 1301 &newMachine);1335 newMachine.asOutParam()); 1302 1336 ComAssertComRCThrowRC(rc); 1303 1337 … … 1331 1365 { 1332 1366 /* No network adapters, so we have to disable our default one */ 1333 INetworkAdapter *nwVBox = NULL;1334 rc = newMachine->GetNetworkAdapter(0, &nwVBox);1367 ComPtr<INetworkAdapter> nwVBox; 1368 rc = newMachine->GetNetworkAdapter(0, nwVBox.asOutParam()); 1335 1369 ComAssertComRCThrowRC(rc); 1336 1370 rc = nwVBox->COMSETTER(Enabled)(false); … … 1349 1383 string nwTypeVBox = nwIt->strFinalValue; 1350 1384 uint32_t tt1 = RTStrToUInt32(nwTypeVBox.c_str()); 1351 INetworkAdapter *nwVBox = NULL;1352 rc = newMachine->GetNetworkAdapter((ULONG)a, &nwVBox);1385 ComPtr<INetworkAdapter> nwVBox; 1386 rc = newMachine->GetNetworkAdapter((ULONG)a, nwVBox.asOutParam()); 1353 1387 ComAssertComRCThrowRC(rc); 1354 1388 /* Enable the network card & set the adapter type */ … … 1360 1394 } 1361 1395 } 1396 1397 /* Hard disk controller IDE */ 1398 list<VirtualSystemDescriptionEntry> vsdeHDCIDE = vsd->findByType(VirtualSystemDescriptionType_HarddiskControllerIDE); 1399 /* @todo: we support one IDE controller only */ 1400 if (vsdeHDCIDE.size() > 0) 1401 { 1402 IDEControllerType_T hdcVBox = static_cast<IDEControllerType_T>(RTStrToUInt32(vsdeHDCIDE.front().strFinalValue.c_str())); 1403 /* Set the appropriate IDE controller in the virtual BIOS of the 1404 * VM. */ 1405 ComPtr<IBIOSSettings> biosSettings; 1406 rc = newMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); 1407 CheckComRCReturnRC(rc); 1408 rc = biosSettings->COMSETTER(IDEControllerType)(hdcVBox); 1409 CheckComRCReturnRC(rc); 1410 } 1411 #ifdef VBOX_WITH_AHCI 1412 /* Hard disk controller SATA */ 1413 list<VirtualSystemDescriptionEntry> vsdeHDCSATA = vsd->findByType(VirtualSystemDescriptionType_HarddiskControllerSATA); 1414 /* @todo: we support one SATA controller only */ 1415 if (vsdeHDCSATA.size() > 0) 1416 { 1417 string hdcVBox = vsdeHDCIDE.front().strFinalValue; 1418 if (!RTStrCmp(hdcVBox.c_str(), "AHCI")) 1419 { 1420 /* For now we have just to enable the AHCI controller. */ 1421 ComPtr<ISATAController> hdcSATAVBox; 1422 rc = newMachine->COMGETTER(SATAController)(hdcSATAVBox.asOutParam()); 1423 CheckComRCReturnRC(rc); 1424 rc = hdcSATAVBox->COMSETTER(Enabled)(true); 1425 CheckComRCReturnRC(rc); 1426 } 1427 else 1428 { 1429 /* @todo: set an error if this is other than AHCI */ 1430 } 1431 } 1432 #endif /* VBOX_WITH_AHCI */ 1433 #ifdef VBOX_WITH_SCSI 1434 /* Hard disk controller SCSI */ 1435 list<VirtualSystemDescriptionEntry> vsdeHDCSCSI = vsd->findByType(VirtualSystemDescriptionType_HarddiskControllerSCSI); 1436 /* @todo: do we support more than one SCSI controller? */ 1437 if (vsdeHDCSCSI.size() > 0) 1438 { 1439 /* @todo: Currently I have no idea how to enable this. Someone has 1440 * to write main support for SCSI at all. */ 1441 } 1442 #endif /* VBOX_WITH_SCSI */ 1443 1362 1444 /* Now its time to register the machine before we add any hard disks */ 1363 1445 rc = mVirtualBox->RegisterMachine(newMachine); 1364 1446 ComAssertComRCThrowRC(rc); 1365 1447 1448 /* Create the hard disks & connect them to the appropriate controllers. */ 1449 list<VirtualSystemDescriptionEntry> vsdeHD = vsd->findByType(VirtualSystemDescriptionType_Harddisk); 1450 if (vsdeHD.size() > 0) 1451 { 1452 /* That we can attach hard disks we need to open a session for the 1453 * new machine */ 1454 Guid newMachineId; 1455 rc = newMachine->COMGETTER(Id)(newMachineId.asOutParam()); 1456 CheckComRCReturnRC(rc); 1457 ComPtr<ISession> session; 1458 rc = session.createInprocObject(CLSID_Session); 1459 CheckComRCReturnRC(rc); 1460 rc = mVirtualBox->OpenSession(session, newMachineId); 1461 CheckComRCReturnRC(rc); 1462 1463 int result; 1464 /* The disk image has to be on the same place as the OVF file. So 1465 * strip the filename out of the full file path. */ 1466 char *srcDir = RTStrDup(Utf8Str(m->bstrPath).raw()); 1467 RTPathStripFilename(srcDir); 1468 /* Iterate over all given disk images */ 1469 list<VirtualSystemDescriptionEntry>::const_iterator hdIt; 1470 for (hdIt = vsdeHD.begin(); 1471 hdIt != vsdeHD.end(); 1472 ++hdIt) 1473 { 1474 char *dstFilePath = RTStrDup(hdIt->strFinalValue.c_str()); 1475 /* Check if the destination file exists already or the 1476 * destination path is empty. */ 1477 if (RTPathExists(dstFilePath) || 1478 !RTStrCmp(dstFilePath, "")) 1479 { 1480 /* @todo: what now? For now we override in no 1481 * circumstances. */ 1482 // continue; 1483 } 1484 /* Get the associated disk image */ 1485 if (m->mapDisks.find(hdIt->strRef) == m->mapDisks.end()) 1486 { 1487 /* @todo: error: entry doesn't exists */ 1488 } 1489 DiskImage di = m->mapDisks [hdIt->strRef]; 1490 /* Construct the source file path */ 1491 char *srcFilePath; 1492 RTStrAPrintf(&srcFilePath, "%s/%s", srcDir, di.strHref.c_str()); 1493 /* Check if the source file exists */ 1494 if (!RTPathExists(srcFilePath)) 1495 { 1496 /* @todo: we have to create a new one */ 1497 } 1498 else 1499 { 1500 /* Make sure all target directories exists */ 1501 rc = VirtualBox::ensureFilePathExists(dstFilePath); 1502 CheckComRCThrowRC(rc); 1503 /* Clone the disk image (this is necessary cause the id has 1504 * to be recreated for the case the same hard disk is 1505 * attached already from a previous import) */ 1506 /* First open the existing disk image */ 1507 ComPtr<IHardDisk2> srcHdVBox; 1508 rc = mVirtualBox->OpenHardDisk2(Bstr(srcFilePath), srcHdVBox.asOutParam()); 1509 CheckComRCReturnRC(rc); 1510 /* We need the format description of the source disk image */ 1511 Bstr srcFormat; 1512 rc = srcHdVBox->COMGETTER(Format)(srcFormat.asOutParam()); 1513 CheckComRCReturnRC(rc); 1514 /* Create a new hard disk interface for the destination disk image */ 1515 ComPtr<IHardDisk2> dstHdVBox; 1516 rc = mVirtualBox->CreateHardDisk2(srcFormat, Bstr(dstFilePath), dstHdVBox.asOutParam()); 1517 CheckComRCReturnRC(rc); 1518 /* Clone the source disk image */ 1519 ComPtr<IProgress> progress; 1520 rc = srcHdVBox->CloneTo(dstHdVBox, progress.asOutParam()); 1521 CheckComRCReturnRC(rc); 1522 rc = progress->WaitForCompletion(-1); 1523 CheckComRCReturnRC(rc); 1524 /* We *must* close the source disk image in order to deregister it */ 1525 rc = srcHdVBox->Close(); 1526 CheckComRCReturnRC(rc); 1527 /* Now use the new uuid to attach the disk image to our new machine */ 1528 ComPtr<IMachine> sMachine; 1529 rc = session->COMGETTER(Machine)(sMachine.asOutParam()); 1530 Guid hdId; 1531 rc = dstHdVBox->COMGETTER(Id)(hdId.asOutParam());; 1532 CheckComRCReturnRC(rc); 1533 rc = sMachine->AttachHardDisk2(hdId, StorageBus_IDE, 0, 0); // 1534 CheckComRCReturnRC(rc); 1535 rc = sMachine->SaveSettings(); 1536 CheckComRCReturnRC(rc); 1537 rc = session->Close(); 1538 CheckComRCReturnRC(rc); 1539 } 1540 RTStrFree(srcFilePath); 1541 RTStrFree(dstFilePath); 1542 } 1543 RTStrFree(srcDir); 1544 } 1366 1545 /* @todo: Unregister on failure */ 1367 1546 #if 0 … … 1376 1555 } 1377 1556 1378 HRESULT Appliance::searchUniqueVMName(std::string& aName) 1557 HRESULT Appliance::searchUniqueVMName(std::string& aName) const 1379 1558 { 1380 1559 IMachine *machine = NULL; … … 1394 1573 } 1395 1574 1575 HRESULT Appliance::searchUniqueDiskImageFilePath(std::string& aName) const 1576 { 1577 IHardDisk2 *harddisk = NULL; 1578 char *tmpName = RTStrDup(aName.c_str()); 1579 int i = 1; 1580 /* Check if the file exists or if a file with this path is registered 1581 * already */ 1582 /* @todo: Maybe to cost intensive; try to find a lighter way */ 1583 while (RTPathExists(tmpName) || 1584 mVirtualBox->FindHardDisk2(Bstr(tmpName), &harddisk) != VBOX_E_OBJECT_NOT_FOUND) 1585 { 1586 RTStrFree(tmpName); 1587 char *tmpDir = RTStrDup(aName.c_str()); 1588 RTPathStripFilename(tmpDir);; 1589 char *tmpFile = RTStrDup(RTPathFilename(aName.c_str())); 1590 RTPathStripExt(tmpFile); 1591 char *tmpExt = RTPathExt(aName.c_str()); 1592 RTStrAPrintf(&tmpName, "%s/%s_%d%s", tmpDir, tmpFile, i, tmpExt); 1593 RTStrFree(tmpFile); 1594 RTStrFree(tmpDir); 1595 ++i; 1596 } 1597 aName = tmpName; 1598 RTStrFree(tmpName); 1599 1600 return S_OK; 1601 } 1602 1396 1603 // IVirtualSystemDescription constructor / destructor 1397 1604 //////////////////////////////////////////////////////////////////////////////// … … 1427 1634 1428 1635 STDMETHODIMP VirtualSystemDescription::GetDescription(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes), 1429 ComSafeArrayOut(ULONG, aRefs),1430 1636 ComSafeArrayOut(BSTR, aOrigValues), 1431 1637 ComSafeArrayOut(BSTR, aAutoValues), … … 1433 1639 { 1434 1640 if (ComSafeArrayOutIsNull(aTypes) || 1435 ComSafeArrayOutIsNull(aRefs) ||1436 1641 ComSafeArrayOutIsNull(aOrigValues) || 1437 1642 ComSafeArrayOutIsNull(aAutoValues) || … … 1446 1651 ULONG c = (ULONG)m->descriptions.size(); 1447 1652 com::SafeArray<VirtualSystemDescriptionType_T> sfaTypes(c); 1448 com::SafeArray<ULONG> sfaRefs(c);1449 1653 com::SafeArray<BSTR> sfaOrigValues(c); 1450 1654 com::SafeArray<BSTR> sfaAutoValues(c); … … 1460 1664 /* Types */ 1461 1665 sfaTypes [i] = vsde.type; 1462 /* Refs */1463 sfaRefs [i] = vsde.ref;1464 1666 /* Original value */ 1465 1667 Bstr bstr = Utf8Str(vsde.strOriginalValue.c_str()); … … 1474 1676 1475 1677 sfaTypes.detachTo(ComSafeArrayOutArg(aTypes)); 1476 sfaRefs.detachTo(ComSafeArrayOutArg(aRefs));1477 1678 sfaOrigValues.detachTo(ComSafeArrayOutArg(aOrigValues)); 1478 1679 sfaAutoValues.detachTo(ComSafeArrayOutArg(aAutoValues)); … … 1508 1709 } 1509 1710 1510 void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType, ULONG aRef, std::string aOrigValue, std::string aAutoValue)1711 void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType, std::string aRef, std::string aOrigValue, std::string aAutoValue, std::string aConfig /* = "" */) 1511 1712 { 1512 1713 VirtualSystemDescriptionEntry vsde; 1513 1714 vsde.type = aType; 1514 vsde. ref = aRef;1715 vsde.strRef = aRef; 1515 1716 vsde.strOriginalValue = aOrigValue; 1516 1717 vsde.strAutoValue = aAutoValue; 1718 vsde.strConfiguration = aConfig; 1517 1719 /* For now we add the auto value as final value also */ 1518 1720 vsde.strFinalValue = aAutoValue; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16248 r16298 2983 2983 <enum 2984 2984 name="VirtualSystemDescriptionType" 2985 uuid=" 36209b5a-8f96-44de-a0af-1bb037cef324"2985 uuid="8ac36d00-bb7c-4a35-a835-3f004b27427b" 2986 2986 > 2987 2987 <desc>Used with <link to="IVirtualSystemDescription" /> to describe the type of … … 3068 3068 3069 3069 <param name="aTypes" type="VirtualSystemDescriptionType" dir="out" safearray="yes"> 3070 <desc></desc>3071 </param>3072 3073 <param name="aRefs" type="unsigned long" dir="out" safearray="yes">3074 3070 <desc></desc> 3075 3071 </param> -
trunk/src/VBox/Main/include/ApplianceImpl.h
r16248 r16298 26 26 27 27 #include "VirtualBoxBase.h" 28 29 #include <string> 28 30 29 31 class VirtualBox; … … 88 90 HRESULT HandleVirtualSystemContent(const char *pcszPath, const xml::Node *pContentElem); 89 91 90 HRESULT searchUniqueVMName (std::string& aName); 92 HRESULT searchUniqueVMName (std::string& aName) const; 93 HRESULT searchUniqueDiskImageFilePath(std::string& aName) const; 91 94 }; 92 95 93 94 #include <string>95 96 struct VirtualSystemDescriptionEntry 96 97 { 97 98 VirtualSystemDescriptionType_T type; /* Of which type is this value */ 98 uint64_t ref; /* Reference value to the internal implementation */99 std::string strOriginalValue; /* The original ovfvalue */100 std::string strAutoValue; /* The value which vbox suggest */99 std::string strRef; /* Reference value to the internal implementation */ 100 std::string strOriginalValue; /* The original OVF value */ 101 std::string strAutoValue; /* The value which VBox suggest */ 101 102 std::string strFinalValue; /* The value the user select */ 102 103 std::string strConfiguration; /* Additional configuration data for this type */ … … 140 141 /* IVirtualSystemDescription methods */ 141 142 STDMETHOD(GetDescription)(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes), 142 ComSafeArrayOut(ULONG, aRefs),143 143 ComSafeArrayOut(BSTR, aOrigValues), 144 144 ComSafeArrayOut(BSTR, aAutoValues), … … 150 150 /* private instance data */ 151 151 private: 152 void addEntry(VirtualSystemDescriptionType_T aType, ULONG aRef, std::string aOrigValue, std::string aAutoValue);152 void addEntry(VirtualSystemDescriptionType_T aType, std::string aRef, std::string aOrigValue, std::string aAutoValue, std::string aConfig = ""); 153 153 std::list<VirtualSystemDescriptionEntry> findByType(VirtualSystemDescriptionType_T aType); 154 154
Note:
See TracChangeset
for help on using the changeset viewer.

