Changeset 17755 in vbox
- Timestamp:
- Mar 12, 2009 3:03:46 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r17669 r17755 1771 1771 if (fSataEnabled) 1772 1772 { 1773 CHECK_ERROR(machine, AddStorageController(Bstr("SATA"), StorageBus_SATA));1774 1773 ComPtr<IStorageController> ctl; 1775 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), ctl.asOutParam()));1774 CHECK_ERROR(machine, AddStorageController(Bstr("SATA"), StorageBus_SATA, ctl.asOutParam())); 1776 1775 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_IntelAhci)); 1777 1776 } … … 1847 1846 if (fLsiLogicEnabled) 1848 1847 { 1849 CHECK_ERROR(machine, AddStorageController(Bstr("LsiLogic"), StorageBus_SCSI));1850 1848 ComPtr<IStorageController> ctl; 1851 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("LsiLogic"), ctl.asOutParam()));1849 CHECK_ERROR(machine, AddStorageController(Bstr("LsiLogic"), StorageBus_SCSI, ctl.asOutParam())); 1852 1850 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic)); 1853 1851 } -
trunk/src/VBox/Main/ApplianceImpl.cpp
r17747 r17755 753 753 else if (!strcmp(pcszItemChildName, "ResourceType")) 754 754 { 755 int32_t iType; /** @todo how to fix correctly? (enum fun.) */756 pelmItemChild->copyValue( iType);757 i.resourceType = (OVFResourceType_T) iType;755 uint32_t ulType; 756 pelmItemChild->copyValue(ulType); 757 i.resourceType = (OVFResourceType_T)ulType; 758 758 } 759 759 else if (!strcmp(pcszItemChildName, "OtherResourceType")) … … 1218 1218 1219 1219 /* Clear any previous virtual system descriptions */ 1220 // @todo: have the entries deleted also?1221 1220 m->virtualSystemDescriptions.clear(); 1222 1221 … … 1335 1334 /* Check for the constrains */ 1336 1335 if (vsysThis.llNetworkNames.size() > SchemaDefs::NetworkAdapterCount) 1337 {1338 1336 pNewDesc->addWarning(tr("The virtual system claims support for %u network adapters, but VirtualBox has support for max %u network adapter only."), 1339 1337 vsysThis.llNetworkNames.size(), SchemaDefs::NetworkAdapterCount); 1340 1338 1341 }1342 1339 /* Get the default network adapter type for the selected guest OS */ 1343 1340 NetworkAdapterType_T nwAdapterVBox = NetworkAdapterType_Am79C970A; … … 1452 1449 if (cSCSIused < 1) 1453 1450 { 1454 // @todo: figure out the SCSI types1455 1451 Utf8Str hdcController = "LsiLogic"; 1456 /* if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic"))1457 hdcController = "LsiLogic";1458 else*/1459 1452 if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic")) 1460 1453 hdcController = "BusLogic"; … … 1473 1466 ++cSCSIused; 1474 1467 break; 1475 }1476 default:1477 {1478 /* @todo: should we stop? */1479 1468 } 1480 1469 } … … 1531 1520 } 1532 1521 else 1533 { 1534 /* @todo: should we stop here? */ 1535 pNewDesc->addWarning(tr("The virtual system claims support for the following virtual disk image format which VirtualBox not support: %s"), 1536 di.strFormat.c_str()); 1537 } 1522 throw setError(VBOX_E_FILE_ERROR, 1523 tr("Unsupported format for virtual disk image in OVF: \"%s\"", di.strFormat.c_str())); 1538 1524 } 1539 1525 } … … 1948 1934 /* Hard disk controller IDE */ 1949 1935 std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerIDE); 1950 /* @todo: we support one IDE controller only */ 1951 if (vsdeHDCIDE.size() > 0) 1936 if (vsdeHDCIDE.size() > 1) 1937 throw setError(VBOX_E_FILE_ERROR, 1938 tr("Too many IDE controllers in OVF; VirtualBox only supports one")); 1939 if (vsdeHDCIDE.size() == 1) 1952 1940 { 1953 /* Set the appropriate IDE controller in the virtual BIOS of the VM */ 1954 ComPtr<IStorageController> ctl; 1955 rc = pNewMachine->GetStorageControllerByName(Bstr("IDE"), ctl.asOutParam()); 1941 ComPtr<IStorageController> pController; 1942 rc = pNewMachine->GetStorageControllerByName(Bstr("IDE"), pController.asOutParam()); 1956 1943 if (FAILED(rc)) throw rc; 1957 1944 1958 1945 const char *pcszIDEType = vsdeHDCIDE.front()->strVbox.c_str(); 1959 1946 if (!strcmp(pcszIDEType, "PIIX3")) 1960 rc = ctl->COMSETTER(ControllerType)(StorageControllerType_PIIX3);1947 rc = pController->COMSETTER(ControllerType)(StorageControllerType_PIIX3); 1961 1948 else if (!strcmp(pcszIDEType, "PIIX4")) 1962 rc = ctl->COMSETTER(ControllerType)(StorageControllerType_PIIX4);1949 rc = pController->COMSETTER(ControllerType)(StorageControllerType_PIIX4); 1963 1950 else if (!strcmp(pcszIDEType, "ICH6")) 1964 rc = ctl->COMSETTER(ControllerType)(StorageControllerType_ICH6);1951 rc = pController->COMSETTER(ControllerType)(StorageControllerType_ICH6); 1965 1952 else 1966 1953 throw setError(VBOX_E_FILE_ERROR, … … 1972 1959 /* Hard disk controller SATA */ 1973 1960 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA); 1974 /* @todo: we support one SATA controller only */ 1961 if (vsdeHDCSATA.size() > 1) 1962 throw setError(VBOX_E_FILE_ERROR, 1963 tr("Too many SATA controllers in OVF; VirtualBox only supports one")); 1975 1964 if (vsdeHDCSATA.size() > 0) 1976 1965 { 1966 ComPtr<IStorageController> pController; 1977 1967 const Utf8Str &hdcVBox = vsdeHDCIDE.front()->strVbox; 1978 1968 if (hdcVBox == "AHCI") 1979 1969 { 1980 /* For now we have just to enable the AHCI controller. */ 1981 rc = pNewMachine->AddStorageController(Bstr("SATA"), StorageBus_SATA); 1970 rc = pNewMachine->AddStorageController(Bstr("SATA"), StorageBus_SATA, pController.asOutParam()); 1982 1971 if (FAILED(rc)) throw rc; 1983 1972 } 1984 1973 else 1985 {1986 1974 throw setError(VBOX_E_FILE_ERROR, 1987 1975 tr("Invalid SATA controller type \"%s\""), 1988 1976 hdcVBox.c_str()); 1989 }1990 1977 } 1991 1978 #endif /* VBOX_WITH_AHCI */ … … 1993 1980 /* Hard disk controller SCSI */ 1994 1981 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSCSI = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI); 1995 /* @todo: do we support more than one SCSI controller? */ 1982 if (vsdeHDCSATA.size() > 1) 1983 throw setError(VBOX_E_FILE_ERROR, 1984 tr("Too many SCSI controllers in OVF; VirtualBox only supports one")); // @todo is that true? 1996 1985 if (vsdeHDCSCSI.size() > 0) 1997 1986 { 1998 /* @todo: revisit when Main support for SCSI is ready */ 1987 ComPtr<IStorageController> pController; 1988 StorageControllerType_T controllerType; 1989 const Utf8Str &hdcVBox = vsdeHDCIDE.front()->strVbox; 1990 if (hdcVBox == "LsiLogic") 1991 controllerType = StorageControllerType_LsiLogic; 1992 else if (hdcVBox == "BusLogic") 1993 controllerType = StorageControllerType_BusLogic; 1994 else 1995 throw setError(VBOX_E_FILE_ERROR, 1996 tr("Invalid SCSI controller type \"%s\""), 1997 hdcVBox.c_str()); 1998 1999 rc = pNewMachine->AddStorageController(Bstr("SCSI"), StorageBus_SCSI, pController.asOutParam()); 2000 if (FAILED(rc)) throw rc; 2001 rc = pController->COMSETTER(ControllerType)(controllerType); 2002 if (FAILED(rc)) throw rc; 1999 2003 } 2000 2004 … … 2230 2234 2231 2235 case HardDiskController::SCSI: 2232 // mhda.busType = StorageBus_SCSI; 2233 throw setError(VBOX_E_NOT_SUPPORTED, 2234 tr("SCSI controller support is not available yet in VirtualBox")); 2235 // @todo 2236 mhda.controllerType = Bstr("SCSI"); 2237 mhda.lChannel = (long)vd.ulAddressOnParent; 2238 mhda.lDevice = (long)0; 2236 2239 break; 2237 2240 … … 2398 2401 xml::ElementNode *pelmDiskSectionInfo = pelmDiskSection->createChild("Info"); 2399 2402 pelmDiskSectionInfo->addContent("List of the virtual disks used in the package"); 2400 // @todo for each disk:2401 // xml::ElementNode *pelmDisk = pelmDiskSection->createChild("Disk");2402 2403 // for now, set up a map so we have a list of unique disk names (to make 2403 2404 // sure the same disk name is only added once) … … 2450 2451 xml::ElementNode *pelmOperatingSystemSection = pelmVirtualSystem->createChild("OperatingSystemSection"); 2451 2452 pelmOperatingSystemSection->setAttribute("ovf:id", llOS.front()->strOvf); 2452 // @todo convert vbox OS type into OVF ID2453 2453 pelmOperatingSystemSection->createChild("Info")->addContent("blah"); // @ŧodo 2454 2454 pelmOperatingSystemSection->createChild("Description")->addContent("blah"); // @ŧodo … … 3358 3358 int32_t lIDEControllerIndex = 0; 3359 3359 int32_t lSATAControllerIndex = 0; 3360 int32_t lSCSIControllerIndex = 0; 3360 3361 3361 3362 // <const name="HardDiskControllerIDE" value="6" /> 3362 ComPtr<IStorageController> ctl;3363 rc = GetStorageControllerByName(Bstr("IDE"), ctl.asOutParam());3363 ComPtr<IStorageController> pController; 3364 rc = GetStorageControllerByName(Bstr("IDE"), pController.asOutParam()); 3364 3365 if (FAILED(rc)) throw rc; 3365 3366 Utf8Str strVbox; 3366 3367 StorageControllerType_T ctlr; 3367 rc = ctl->COMGETTER(ControllerType)(&ctlr);3368 rc = pController->COMGETTER(ControllerType)(&ctlr); 3368 3369 if (FAILED(rc)) throw rc; 3369 3370 switch(ctlr) … … 3377 3378 { 3378 3379 lIDEControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size(); 3379 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, Utf8StrFmt("%d", lIDEControllerIndex), strVbox, ""); 3380 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 3381 Utf8StrFmt("%d", lIDEControllerIndex), 3382 strVbox, 3383 ""); 3380 3384 } 3381 3385 3382 3386 #ifdef VBOX_WITH_AHCI 3383 3387 // <const name="HardDiskControllerSATA" value="7" /> 3384 rc = GetStorageControllerByName(Bstr("IDE"), ctl.asOutParam());3388 rc = GetStorageControllerByName(Bstr("IDE"), pController.asOutParam()); 3385 3389 if (SUCCEEDED(rc)) 3386 3390 { 3387 3391 lSATAControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size(); 3388 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, Utf8StrFmt("%d", lSATAControllerIndex), strVbox, ""); 3392 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, 3393 Utf8StrFmt("%d", lSATAControllerIndex), 3394 strVbox, 3395 ""); 3389 3396 } 3390 3397 #endif // VBOX_WITH_AHCI 3391 3398 3392 3399 // <const name="HardDiskControllerSCSI" value="8" /> 3393 // @todo 3400 rc = GetStorageControllerByName(Bstr("SCSI"), pController.asOutParam()); 3401 if (SUCCEEDED(rc)) 3402 { 3403 lSCSIControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size(); 3404 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, 3405 Utf8StrFmt("%d", lSCSIControllerIndex), 3406 strVbox, 3407 ""); 3408 } 3394 3409 3395 3410 // <const name="HardDiskImage" value="9" /> -
trunk/src/VBox/Main/MachineImpl.cpp
r17736 r17755 515 515 * not in the StorageDevice implementation at the moment) 516 516 */ 517 rc = AddStorageController(Bstr("IDE"), StorageBus_IDE); 517 ComPtr<IStorageController> pController; 518 rc = AddStorageController(Bstr("IDE"), StorageBus_IDE, pController.asOutParam()); 518 519 CheckComRCReturnRC(rc); 519 520 ComObjPtr<StorageController> ctl; … … 3268 3269 3269 3270 STDMETHODIMP Machine:: 3270 AddStorageController(IN_BSTR aName, StorageBus_T aConnectionType) 3271 AddStorageController(IN_BSTR aName, 3272 StorageBus_T aConnectionType, 3273 IStorageController **controller) 3271 3274 { 3272 3275 CheckComArgStrNotEmptyOrNull(aName); … … 3300 3303 mStorageControllers.backup(); 3301 3304 mStorageControllers->push_back (ctrl); 3305 3306 ctrl.queryInterfaceTo(controller); 3302 3307 3303 3308 /* inform the direct session if any */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r17752 r17755 3658 3658 <interface 3659 3659 name="IMachine" extends="$unknown" 3660 uuid=" ea6fb7ea-1993-4642-b113-f29eb39e0df0"3660 uuid="dcf6a64c-1466-4b5a-b822-9db04133dc74" 3661 3661 wsmap="managed" 3662 3662 > … … 4444 4444 <method name="addStorageController"> 4445 4445 <desc> 4446 Adds a new storage controller (SCSI or SATA controller) to the machine. 4446 Adds a new storage controller (SCSI or SATA controller) to the 4447 machine and returns it as an instance of 4448 <link to="IStorageController" />. 4449 4447 4450 @a name identifies the controller with subsequent calls such as 4448 4451 <link to="#getStorageControllerByName" /> or … … 4450 4453 <link to="#attachHardDisk" />. 4451 4454 4455 After the controller has been added, you can set its exact 4456 type by setting the <link to="IStorageController::controllerType" />. 4457 4452 4458 <result name="VBOX_E_OBJECT_IN_USE"> 4453 4459 A storage controller with given name exists already. … … 4459 4465 <param name="name" type="wstring" dir="in"/> 4460 4466 <param name="connectionType" type="StorageBus" dir="in"/> 4467 <param name="controller" type="IStorageController" dir="return"/> 4461 4468 </method> 4462 4469 -
trunk/src/VBox/Main/include/MachineImpl.h
r17685 r17755 569 569 STDMETHOD(EnumerateGuestProperties) (IN_BSTR aPattern, ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(ULONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags)); 570 570 STDMETHOD(GetHardDiskAttachmentsOfController)(IN_BSTR aName, ComSafeArrayOut (IHardDiskAttachment *, aAttachments)); 571 STDMETHOD(AddStorageController) (IN_BSTR aName, StorageBus_T aConnectionType );571 STDMETHOD(AddStorageController) (IN_BSTR aName, StorageBus_T aConnectionType, IStorageController **controller); 572 572 STDMETHOD(RemoveStorageController (IN_BSTR aName)); 573 573 STDMETHOD(GetStorageControllerByName (IN_BSTR aName, IStorageController **storageController));
Note:
See TracChangeset
for help on using the changeset viewer.