- Timestamp:
- May 5, 2010 2:20:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61143
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImplExport.cpp
r28958 r29087 174 174 175 175 ComPtr<IStorageController> pIDEController; 176 #ifdef VBOX_WITH_AHCI177 176 ComPtr<IStorageController> pSATAController; 178 #endif /* VBOX_WITH_AHCI */179 #ifdef VBOX_WITH_LSILOGIC180 177 ComPtr<IStorageController> pSCSIController; 181 #endif /* VBOX_WITH_LSILOGIC */ 178 ComPtr<IStorageController> pSASController; 182 179 for (size_t j = 0; j < nwControllers.size(); ++j) 183 180 { … … 188 185 && pIDEController.isNull()) 189 186 pIDEController = nwControllers[j]; 190 #ifdef VBOX_WITH_AHCI191 187 else if ( eType == StorageBus_SATA 192 188 && pSATAController.isNull()) 193 189 pSATAController = nwControllers[j]; 194 #endif /* VBOX_WITH_AHCI */195 #ifdef VBOX_WITH_LSILOGIC196 190 else if ( eType == StorageBus_SCSI 197 191 && pSATAController.isNull()) 198 192 pSCSIController = nwControllers[j]; 199 #endif /* VBOX_WITH_LSILOGIC */ 193 else if ( eType == StorageBus_SAS 194 && pSASController.isNull()) 195 pSASController = nwControllers[j]; 200 196 } 201 197 … … 229 225 } 230 226 231 #ifdef VBOX_WITH_AHCI232 227 // <const name="HardDiskControllerSATA" value="7" /> 233 228 if (!pSATAController.isNull()) … … 240 235 strVbox); 241 236 } 242 #endif // VBOX_WITH_AHCI 243 244 #ifdef VBOX_WITH_LSILOGIC 237 245 238 // <const name="HardDiskControllerSCSI" value="8" /> 246 239 if (!pSCSIController.isNull()) … … 265 258 throw rc; 266 259 } 267 #endif // VBOX_WITH_LSILOGIC 260 261 if (!pSASController.isNull()) 262 { 263 // VirtualBox considers the SAS controller a class of its own but in OVF 264 // it should be a SCSI controller 265 Utf8Str strVbox = "LsiLogicSas"; 266 lSCSIControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size(); 267 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, 268 Utf8StrFmt("%d", lSCSIControllerIndex), 269 strVbox, 270 strVbox); 271 } 268 272 269 273 // <const name="HardDiskImage" value="9" /> -
trunk/src/VBox/Main/ApplianceImplImport.cpp
r28957 r29087 416 416 417 417 case ovf::HardDiskController::SATA: 418 /* Check for the constrains */ 419 if (cSATAused < 1) 418 420 { 419 #ifdef VBOX_WITH_AHCI 420 /* Check for the constrains */ 421 if (cSATAused < 1) 422 { 423 // @todo: figure out the SATA types 424 /* We only support a plain AHCI controller, so use them always */ 425 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, 426 strControllerID, 427 hdc.strControllerType, 428 "AHCI"); 429 } 430 else 431 { 432 /* Warn only once */ 433 if (cSATAused == 1) 434 addWarning(tr("The virtual system \"%s\" requests support for more than one SATA controller, but VirtualBox has support for only one"), 435 vsysThis.strName.c_str()); 436 437 } 438 ++cSATAused; 439 break; 440 #else /* !VBOX_WITH_AHCI */ 441 addWarning(tr("The virtual system \"%s\" requests at least one SATA controller but this version of VirtualBox does not provide a SATA controller emulation"), 442 vsysThis.strName.c_str()); 443 #endif /* !VBOX_WITH_AHCI */ 421 // @todo: figure out the SATA types 422 /* We only support a plain AHCI controller, so use them always */ 423 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, 424 strControllerID, 425 hdc.strControllerType, 426 "AHCI"); 444 427 } 428 else 429 { 430 /* Warn only once */ 431 if (cSATAused == 1) 432 addWarning(tr("The virtual system \"%s\" requests support for more than one SATA controller, but VirtualBox has support for only one"), 433 vsysThis.strName.c_str()); 434 435 } 436 ++cSATAused; 437 break; 445 438 446 439 case ovf::HardDiskController::SCSI: 440 /* Check for the constrains */ 441 if (cSCSIused < 1) 447 442 { 448 #ifdef VBOX_WITH_LSILOGIC 449 /* Check for the constrains */ 450 if (cSCSIused < 1) 451 { 452 Utf8Str hdcController = "LsiLogic"; 453 if (!hdc.strControllerType.compare("BusLogic", Utf8Str::CaseInsensitive)) 454 hdcController = "BusLogic"; 455 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, 456 strControllerID, 457 hdc.strControllerType, 458 hdcController); 459 } 460 else 461 addWarning(tr("The virtual system \"%s\" requests support for an additional SCSI controller of type \"%s\" with ID %s, but VirtualBox presently supports only one SCSI controller."), 462 vsysThis.strName.c_str(), 463 hdc.strControllerType.c_str(), 464 strControllerID.c_str()); 465 ++cSCSIused; 466 break; 467 #else /* !VBOX_WITH_LSILOGIC */ 468 addWarning(tr("The virtual system \"%s\" requests at least one SATA controller but this version of VirtualBox does not provide a SCSI controller emulation"), 469 vsysThis.strName.c_str()); 470 #endif /* !VBOX_WITH_LSILOGIC */ 443 Utf8Str hdcController = "LsiLogic"; 444 if (!hdc.strControllerType.compare("lsilogicsas", Utf8Str::CaseInsensitive)) 445 hdcController = "LsiLogicSas"; 446 else if (!hdc.strControllerType.compare("BusLogic", Utf8Str::CaseInsensitive)) 447 hdcController = "BusLogic"; 448 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, 449 strControllerID, 450 hdc.strControllerType, 451 hdcController); 471 452 } 453 else 454 addWarning(tr("The virtual system \"%s\" requests support for an additional SCSI controller of type \"%s\" with ID %s, but VirtualBox presently supports only one SCSI controller."), 455 vsysThis.strName.c_str(), 456 hdc.strControllerType.c_str(), 457 strControllerID.c_str()); 458 ++cSCSIused; 459 break; 472 460 } 473 461 } … … 1647 1635 if (FAILED(rc)) throw rc; 1648 1636 } 1649 #ifdef VBOX_WITH_AHCI 1637 1650 1638 /* Hard disk controller SATA */ 1651 1639 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA); … … 1667 1655 hdcVBox.c_str()); 1668 1656 } 1669 #endif /* VBOX_WITH_AHCI */ 1670 1671 #ifdef VBOX_WITH_LSILOGIC 1657 1672 1658 /* Hard disk controller SCSI */ 1673 1659 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSCSI = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI); … … 1678 1664 { 1679 1665 ComPtr<IStorageController> pController; 1666 Bstr bstrName(L"SCSI Controller"); 1667 StorageBus_T busType = StorageBus_SCSI; 1680 1668 StorageControllerType_T controllerType; 1681 1669 const Utf8Str &hdcVBox = vsdeHDCSCSI.front()->strVbox; 1682 1670 if (hdcVBox == "LsiLogic") 1683 1671 controllerType = StorageControllerType_LsiLogic; 1672 else if (hdcVBox == "LsiLogicSas") 1673 { 1674 // OVF treats LsiLogicSas as a SCSI controller but VBox considers it a class of its own 1675 bstrName = L"SAS Controller"; 1676 busType = StorageBus_SAS; 1677 controllerType = StorageControllerType_LsiLogic; 1678 } 1684 1679 else if (hdcVBox == "BusLogic") 1685 1680 controllerType = StorageControllerType_BusLogic; … … 1689 1684 hdcVBox.c_str()); 1690 1685 1691 rc = pNewMachine->AddStorageController( Bstr("SCSI Controller"), StorageBus_SCSI, pController.asOutParam());1686 rc = pNewMachine->AddStorageController(bstrName, busType, pController.asOutParam()); 1692 1687 if (FAILED(rc)) throw rc; 1693 1688 rc = pController->COMSETTER(ControllerType)(controllerType); 1694 1689 if (FAILED(rc)) throw rc; 1695 1690 } 1696 #endif /* VBOX_WITH_LSILOGIC */1697 1691 1698 1692 /* Now its time to register the machine before we add any hard disks */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r29028 r29087 3599 3599 <li> 3600 3600 "HardDiskControllerSCSI": a SCSI hard disk controller. There can be at most one such item. 3601 The items in @a aOvfValues[] and @a aVBoxValues[] will either be "LsiLogic" or "BusLogic". 3601 The items in @a aOvfValues[] and @a aVBoxValues[] will either be "LsiLogic", "BusLogic" or 3602 "LsiLogicSas". (Note that in OVF, the LsiLogicSas controller is treated as a SCSI controller 3603 whereas VirtualBox considers it a class of storage controllers of its own; see 3604 <link to="StorageControllerType" />). 3602 3605 The matching item in the @a aRefs[] array will be used as with IDE controllers (see above). 3603 3606 </li> -
trunk/src/VBox/Main/include/ovfreader.h
r28957 r29087 257 257 ControllerSystemType system; // one of IDE, SATA, SCSI 258 258 259 iprt::MiniString strControllerType; // controller subtype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE) 259 iprt::MiniString strControllerType; 260 // controller subtype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE) 261 // note that we treat LsiLogicSAS as a SCSI controller (system == SCSI) even though VirtualBox 262 // treats it as a fourth class besides IDE, SATA, SCSI 260 263 261 264 uint32_t ulAddress; // controller index; this is determined heuristically by the OVF reader and will
Note:
See TracChangeset
for help on using the changeset viewer.