Changeset 25146 in vbox for trunk/src/VBox/Main/ApplianceImpl.cpp
- Timestamp:
- Dec 2, 2009 12:50:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r25142 r25146 4491 4491 int32_t lSCSIControllerIndex = 0; 4492 4492 4493 /* Fetch all available storage controllers */ 4494 com::SafeIfaceArray<IStorageController> nwControllers; 4495 rc = COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(nwControllers)); 4496 if (FAILED(rc)) throw rc; 4497 4498 ComPtr<IStorageController> pIDEController; 4499 #ifdef VBOX_WITH_AHCI 4500 ComPtr<IStorageController> pSATAController; 4501 #endif /* VBOX_WITH_AHCI */ 4502 #ifdef VBOX_WITH_LSILOGIC 4503 ComPtr<IStorageController> pSCSIController; 4504 #endif /* VBOX_WITH_LSILOGIC */ 4505 for (size_t j = 0; j < nwControllers.size(); ++j) 4506 { 4507 StorageBus_T eType; 4508 rc = nwControllers[j]->COMGETTER(Bus)(&eType); 4509 if (FAILED(rc)) throw rc; 4510 if ( eType == StorageBus_IDE 4511 && pIDEController.isNull()) 4512 pIDEController = nwControllers[j]; 4513 #ifdef VBOX_WITH_AHCI 4514 else if ( eType == StorageBus_SATA 4515 && pSATAController.isNull()) 4516 pSATAController = nwControllers[j]; 4517 #endif /* VBOX_WITH_AHCI */ 4518 #ifdef VBOX_WITH_LSILOGIC 4519 else if ( eType == StorageBus_SCSI 4520 && pSATAController.isNull()) 4521 pSCSIController = nwControllers[j]; 4522 #endif /* VBOX_WITH_LSILOGIC */ 4523 } 4524 4493 4525 // <const name="HardDiskControllerIDE" value="6" /> 4494 ComPtr<IStorageController> pController; 4495 rc = GetStorageControllerByName(Bstr("IDE Controller"), pController.asOutParam()); 4496 if (FAILED(rc)) throw rc; 4497 Utf8Str strVbox; 4498 StorageControllerType_T ctlr; 4499 rc = pController->COMGETTER(ControllerType)(&ctlr); 4500 if (FAILED(rc)) throw rc; 4501 switch(ctlr) 4526 if (!pIDEController.isNull()) 4502 4527 { 4503 case StorageControllerType_PIIX3: strVbox = "PIIX3"; break; 4504 case StorageControllerType_PIIX4: strVbox = "PIIX4"; break; 4505 case StorageControllerType_ICH6: strVbox = "ICH6"; break; 4506 } 4507 4508 if (strVbox.length()) 4509 { 4510 lIDEControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size(); 4511 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 4512 Utf8StrFmt("%d", lIDEControllerIndex), 4513 strVbox, 4514 strVbox); 4528 Utf8Str strVbox; 4529 StorageControllerType_T ctlr; 4530 rc = pIDEController->COMGETTER(ControllerType)(&ctlr); 4531 if (FAILED(rc)) throw rc; 4532 switch(ctlr) 4533 { 4534 case StorageControllerType_PIIX3: strVbox = "PIIX3"; break; 4535 case StorageControllerType_PIIX4: strVbox = "PIIX4"; break; 4536 case StorageControllerType_ICH6: strVbox = "ICH6"; break; 4537 } 4538 4539 if (strVbox.length()) 4540 { 4541 lIDEControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size(); 4542 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 4543 Utf8StrFmt("%d", lIDEControllerIndex), 4544 strVbox, 4545 strVbox); 4546 } 4515 4547 } 4516 4548 4517 4549 #ifdef VBOX_WITH_AHCI 4518 4550 // <const name="HardDiskControllerSATA" value="7" /> 4519 rc = GetStorageControllerByName(Bstr("SATA Controller"), pController.asOutParam()); 4520 if (SUCCEEDED(rc)) 4551 if (!pSATAController.isNull()) 4521 4552 { 4522 strVbox = "AHCI";4553 Utf8Str strVbox = "AHCI"; 4523 4554 lSATAControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size(); 4524 4555 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, … … 4531 4562 #ifdef VBOX_WITH_LSILOGIC 4532 4563 // <const name="HardDiskControllerSCSI" value="8" /> 4533 rc = GetStorageControllerByName(Bstr("SCSI Controller"), pController.asOutParam()); 4534 if (SUCCEEDED(rc)) 4564 if (!pSCSIController.isNull()) 4535 4565 { 4536 rc = pController->COMGETTER(ControllerType)(&ctlr); 4566 StorageControllerType_T ctlr; 4567 rc = pSCSIController->COMGETTER(ControllerType)(&ctlr); 4537 4568 if (SUCCEEDED(rc)) 4538 4569 { 4539 strVbox = "LsiLogic"; // the default in VBox4570 Utf8Str strVbox = "LsiLogic"; // the default in VBox 4540 4571 switch(ctlr) 4541 4572 {
Note:
See TracChangeset
for help on using the changeset viewer.