Changeset 50196 in vbox for trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
- Timestamp:
- Jan 23, 2014 6:15:23 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r49951 r50196 1 1 /* $Id$ */ 2 2 /** @file 3 *4 3 * IAppliance and IVirtualSystem COM class implementations. 5 4 */ … … 212 211 if (!pIDEController.isNull()) 213 212 { 214 Utf8Str strV box;213 Utf8Str strVBox; 215 214 StorageControllerType_T ctlr; 216 215 rc = pIDEController->COMGETTER(ControllerType)(&ctlr); … … 218 217 switch(ctlr) 219 218 { 220 case StorageControllerType_PIIX3: strV box = "PIIX3"; break;221 case StorageControllerType_PIIX4: strV box = "PIIX4"; break;222 case StorageControllerType_ICH6: strV box = "ICH6"; break;219 case StorageControllerType_PIIX3: strVBox = "PIIX3"; break; 220 case StorageControllerType_PIIX4: strVBox = "PIIX4"; break; 221 case StorageControllerType_ICH6: strVBox = "ICH6"; break; 223 222 } 224 223 225 if (strV box.length())224 if (strVBox.length()) 226 225 { 227 226 lIDEControllerPrimaryIndex = (int32_t)pNewDesc->m->maDescriptions.size(); 228 227 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 229 228 Utf8StrFmt("%d", lIDEControllerPrimaryIndex), // strRef 230 strV box, // aOvfValue231 strV box); // aVboxValue229 strVBox, // aOvfValue 230 strVBox); // aVBoxValue 232 231 lIDEControllerSecondaryIndex = lIDEControllerPrimaryIndex + 1; 233 232 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 234 233 Utf8StrFmt("%d", lIDEControllerSecondaryIndex), 235 strV box,236 strV box);234 strVBox, 235 strVBox); 237 236 } 238 237 } … … 241 240 if (!pSATAController.isNull()) 242 241 { 243 Utf8Str strV box = "AHCI";242 Utf8Str strVBox = "AHCI"; 244 243 lSATAControllerIndex = (int32_t)pNewDesc->m->maDescriptions.size(); 245 244 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, 246 245 Utf8StrFmt("%d", lSATAControllerIndex), 247 strV box,248 strV box);246 strVBox, 247 strVBox); 249 248 } 250 249 … … 256 255 if (SUCCEEDED(rc)) 257 256 { 258 Utf8Str strV box = "LsiLogic"; // the default in VBox257 Utf8Str strVBox = "LsiLogic"; // the default in VBox 259 258 switch(ctlr) 260 259 { 261 case StorageControllerType_LsiLogic: strV box = "LsiLogic"; break;262 case StorageControllerType_BusLogic: strV box = "BusLogic"; break;260 case StorageControllerType_LsiLogic: strVBox = "LsiLogic"; break; 261 case StorageControllerType_BusLogic: strVBox = "BusLogic"; break; 263 262 } 264 263 lSCSIControllerIndex = (int32_t)pNewDesc->m->maDescriptions.size(); 265 264 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, 266 265 Utf8StrFmt("%d", lSCSIControllerIndex), 267 strV box,268 strV box);266 strVBox, 267 strVBox); 269 268 } 270 269 else … … 276 275 // VirtualBox considers the SAS controller a class of its own but in OVF 277 276 // it should be a SCSI controller 278 Utf8Str strV box = "LsiLogicSas";277 Utf8Str strVBox = "LsiLogicSas"; 279 278 lSCSIControllerIndex = (int32_t)pNewDesc->m->maDescriptions.size(); 280 279 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerSAS, 281 280 Utf8StrFmt("%d", lSCSIControllerIndex), 282 strV box,283 strV box);281 strVBox, 282 strVBox); 284 283 } 285 284 … … 885 884 886 885 // source path: where the VBox image is 887 const Utf8Str &strSrcFilePath = pDiskEntry->strV boxCurrent;886 const Utf8Str &strSrcFilePath = pDiskEntry->strVBoxCurrent; 888 887 Bstr bstrSrcFilePath(strSrcFilePath); 889 888 … … 1049 1048 if (!llName.size()) 1050 1049 throw setError(VBOX_E_NOT_SUPPORTED, tr("Missing VM name")); 1051 Utf8Str &strVMName = llName.back()->strV boxCurrent;1050 Utf8Str &strVMName = llName.back()->strVBoxCurrent; 1052 1051 pelmVirtualSystem->setAttribute("ovf:id", strVMName); 1053 1052 … … 1058 1057 std::list<VirtualSystemDescriptionEntry*> llVendorUrl = vsdescThis->i_findByType(VirtualSystemDescriptionType_VendorUrl); 1059 1058 std::list<VirtualSystemDescriptionEntry*> llVersion = vsdescThis->i_findByType(VirtualSystemDescriptionType_Version); 1060 bool fProduct = llProduct.size() && !llProduct.back()->strV boxCurrent.isEmpty();1061 bool fProductUrl = llProductUrl.size() && !llProductUrl.back()->strV boxCurrent.isEmpty();1062 bool fVendor = llVendor.size() && !llVendor.back()->strV boxCurrent.isEmpty();1063 bool fVendorUrl = llVendorUrl.size() && !llVendorUrl.back()->strV boxCurrent.isEmpty();1064 bool fVersion = llVersion.size() && !llVersion.back()->strV boxCurrent.isEmpty();1059 bool fProduct = llProduct.size() && !llProduct.back()->strVBoxCurrent.isEmpty(); 1060 bool fProductUrl = llProductUrl.size() && !llProductUrl.back()->strVBoxCurrent.isEmpty(); 1061 bool fVendor = llVendor.size() && !llVendor.back()->strVBoxCurrent.isEmpty(); 1062 bool fVendorUrl = llVendorUrl.size() && !llVendorUrl.back()->strVBoxCurrent.isEmpty(); 1063 bool fVersion = llVersion.size() && !llVersion.back()->strVBoxCurrent.isEmpty(); 1065 1064 if (fProduct || 1066 1065 fProductUrl || … … 1089 1088 pelmAnnotationSection->createChild("Info")->addContent("Meta-information about the installed software"); 1090 1089 if (fProduct) 1091 pelmAnnotationSection->createChild("Product")->addContent(llProduct.back()->strV boxCurrent);1090 pelmAnnotationSection->createChild("Product")->addContent(llProduct.back()->strVBoxCurrent); 1092 1091 if (fVendor) 1093 pelmAnnotationSection->createChild("Vendor")->addContent(llVendor.back()->strV boxCurrent);1092 pelmAnnotationSection->createChild("Vendor")->addContent(llVendor.back()->strVBoxCurrent); 1094 1093 if (fVersion) 1095 pelmAnnotationSection->createChild("Version")->addContent(llVersion.back()->strV boxCurrent);1094 pelmAnnotationSection->createChild("Version")->addContent(llVersion.back()->strVBoxCurrent); 1096 1095 if (fProductUrl) 1097 pelmAnnotationSection->createChild("ProductUrl")->addContent(llProductUrl.back()->strV boxCurrent);1096 pelmAnnotationSection->createChild("ProductUrl")->addContent(llProductUrl.back()->strVBoxCurrent); 1098 1097 if (fVendorUrl) 1099 pelmAnnotationSection->createChild("VendorUrl")->addContent(llVendorUrl.back()->strV boxCurrent);1098 pelmAnnotationSection->createChild("VendorUrl")->addContent(llVendorUrl.back()->strVBoxCurrent); 1100 1099 } 1101 1100 … … 1103 1102 std::list<VirtualSystemDescriptionEntry*> llDescription = vsdescThis->i_findByType(VirtualSystemDescriptionType_Description); 1104 1103 if (llDescription.size() && 1105 !llDescription.back()->strV boxCurrent.isEmpty())1104 !llDescription.back()->strVBoxCurrent.isEmpty()) 1106 1105 { 1107 1106 /* <Section ovf:required="false" xsi:type="ovf:AnnotationSection_Type"> … … 1120 1119 1121 1120 pelmAnnotationSection->createChild("Info")->addContent("A human-readable annotation"); 1122 pelmAnnotationSection->createChild("Annotation")->addContent(llDescription.back()->strV boxCurrent);1121 pelmAnnotationSection->createChild("Annotation")->addContent(llDescription.back()->strVBoxCurrent); 1123 1122 } 1124 1123 … … 1126 1125 std::list<VirtualSystemDescriptionEntry*> llLicense = vsdescThis->i_findByType(VirtualSystemDescriptionType_License); 1127 1126 if (llLicense.size() && 1128 !llLicense.back()->strV boxCurrent.isEmpty())1127 !llLicense.back()->strVBoxCurrent.isEmpty()) 1129 1128 { 1130 1129 /* <EulaSection> … … 1142 1141 1143 1142 pelmEulaSection->createChild("Info")->addContent("License agreement for the virtual system"); 1144 pelmEulaSection->createChild("License")->addContent(llLicense.back()->strV boxCurrent);1143 pelmEulaSection->createChild("License")->addContent(llLicense.back()->strVBoxCurrent); 1145 1144 } 1146 1145 … … 1171 1170 xml::ElementNode *pelmVBoxOSType = pelmOperatingSystemSection->createChild("vbox:OSType"); 1172 1171 pelmVBoxOSType->setAttribute("ovf:required", "false"); 1173 pelmVBoxOSType->addContent(pvsdeOS->strV boxCurrent);1172 pelmVBoxOSType->addContent(pvsdeOS->strVBoxCurrent); 1174 1173 1175 1174 // <VirtualHardwareSection ovf:id="hw1" ovf:transport="iso"> … … 1241 1240 const VirtualSystemDescriptionEntry &desc = *itD; 1242 1241 1243 LogFlowFunc(("Loop %u: handling description entry ulIndex=%u, type=%s, strRef=%s, strOvf=%s, strV box=%s, strExtraConfig=%s\n",1242 LogFlowFunc(("Loop %u: handling description entry ulIndex=%u, type=%s, strRef=%s, strOvf=%s, strVBox=%s, strExtraConfig=%s\n", 1244 1243 uLoop, 1245 1244 desc.ulIndex, … … 1252 1251 desc.strRef.c_str(), 1253 1252 desc.strOvf.c_str(), 1254 desc.strV boxCurrent.c_str(),1253 desc.strVBoxCurrent.c_str(), 1255 1254 desc.strExtraConfigCurrent.c_str())); 1256 1255 … … 1295 1294 strDescription = "Number of virtual CPUs"; 1296 1295 type = ovf::ResourceType_Processor; // 3 1297 desc.strV boxCurrent.toInt(uTemp);1296 desc.strVBoxCurrent.toInt(uTemp); 1298 1297 lVirtualQuantity = (int32_t)uTemp; 1299 1298 strCaption = Utf8StrFmt("%d virtual CPU", lVirtualQuantity); // without this ovftool won't eat the item … … 1315 1314 strDescription = "Memory Size"; 1316 1315 type = ovf::ResourceType_Memory; // 4 1317 desc.strV boxCurrent.toInt(uTemp);1316 desc.strVBoxCurrent.toInt(uTemp); 1318 1317 lVirtualQuantity = (int32_t)(uTemp / _1M); 1319 1318 strAllocationUnits = "MegaBytes"; … … 1335 1334 strDescription = "IDE Controller"; 1336 1335 type = ovf::ResourceType_IDEController; // 5 1337 strResourceSubType = desc.strV boxCurrent;1336 strResourceSubType = desc.strVBoxCurrent; 1338 1337 1339 1338 if (!lIDEPrimaryControllerIndex) … … 1381 1380 lBusNumber = 0; 1382 1381 1383 if ( desc.strV boxCurrent.isEmpty() // AHCI is the default in VirtualBox1384 || (!desc.strV boxCurrent.compare("ahci", Utf8Str::CaseInsensitive))1382 if ( desc.strVBoxCurrent.isEmpty() // AHCI is the default in VirtualBox 1383 || (!desc.strVBoxCurrent.compare("ahci", Utf8Str::CaseInsensitive)) 1385 1384 ) 1386 1385 strResourceSubType = "AHCI"; 1387 1386 else 1388 1387 throw setError(VBOX_E_NOT_SUPPORTED, 1389 tr("Invalid config string \"%s\" in SATA controller"), desc.strV boxCurrent.c_str());1388 tr("Invalid config string \"%s\" in SATA controller"), desc.strVBoxCurrent.c_str()); 1390 1389 1391 1390 // remember this ID … … 1417 1416 lBusNumber = 0; 1418 1417 1419 if ( desc.strV boxCurrent.isEmpty() // LsiLogic is the default in VirtualBox1420 || (!desc.strV boxCurrent.compare("lsilogic", Utf8Str::CaseInsensitive))1418 if ( desc.strVBoxCurrent.isEmpty() // LsiLogic is the default in VirtualBox 1419 || (!desc.strVBoxCurrent.compare("lsilogic", Utf8Str::CaseInsensitive)) 1421 1420 ) 1422 1421 strResourceSubType = "lsilogic"; 1423 else if (!desc.strV boxCurrent.compare("buslogic", Utf8Str::CaseInsensitive))1422 else if (!desc.strVBoxCurrent.compare("buslogic", Utf8Str::CaseInsensitive)) 1424 1423 strResourceSubType = "buslogic"; 1425 else if (!desc.strV boxCurrent.compare("lsilogicsas", Utf8Str::CaseInsensitive))1424 else if (!desc.strVBoxCurrent.compare("lsilogicsas", Utf8Str::CaseInsensitive)) 1426 1425 strResourceSubType = "lsilogicsas"; 1427 1426 else 1428 1427 throw setError(VBOX_E_NOT_SUPPORTED, 1429 tr("Invalid config string \"%s\" in SCSI/SAS controller"), desc.strV boxCurrent.c_str());1428 tr("Invalid config string \"%s\" in SCSI/SAS controller"), desc.strVBoxCurrent.c_str()); 1430 1429 1431 1430 // remember this ID … … 1519 1518 1520 1519 //skip empty Medium. There are no information to add into section <References> or <DiskSection> 1521 if (desc.strV boxCurrent.isNotEmpty())1520 if (desc.strVBoxCurrent.isNotEmpty()) 1522 1521 { 1523 1522 // the following references the "<Disks>" XML block … … 1577 1576 * PCNet32 for our PCNet types & E1000 for the 1578 1577 * E1000 cards. */ 1579 switch (desc.strV boxCurrent.toInt32())1578 switch (desc.strVBoxCurrent.toInt32()) 1580 1579 { 1581 1580 case NetworkAdapterType_Am79C970A: … … 1831 1830 // write the machine config to the vbox:Machine element 1832 1831 pConfig->buildMachineXML(*pelmVBoxMachine, 1833 settings::MachineConfigFile::BuildMachineXML_WriteV boxVersionAttribute1832 settings::MachineConfigFile::BuildMachineXML_WriteVBoxVersionAttribute 1834 1833 /*| settings::MachineConfigFile::BuildMachineXML_SkipRemovableMedia*/ 1835 1834 | settings::MachineConfigFile::BuildMachineXML_SuppressSavedState, … … 2076 2075 2077 2076 // source path: where the VBox image is 2078 const Utf8Str &strSrcFilePath = pDiskEntry->strV boxCurrent;2077 const Utf8Str &strSrcFilePath = pDiskEntry->strVBoxCurrent; 2079 2078 2080 2079 //skip empty Medium. In common, It's may be empty CD/DVD
Note:
See TracChangeset
for help on using the changeset viewer.