- Timestamp:
- Feb 19, 2009 1:56:08 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r16945 r16949 149 149 uint32_t idController; // SCSI (or IDE) controller this disk is connected to; 150 150 // points into VirtualSystem.mapControllers 151 uint32_t ulAddressOnParent; // parsed strAddressOnParent of hardware item; will be 0 or 1 for IDE 152 // and possibly higher for disks attached to SCSI controllers (untested) 151 153 Utf8Str strDiskId; // if the hard disk has an ovf:/disk/<id> reference, 152 154 // this receives the <id> component; points to one of the … … 752 754 VirtualDisk vd; 753 755 vd.idController = i.ulParent; 756 i.strAddressOnParent.toInt(vd.ulAddressOnParent); 754 757 bool fFound = false; 755 758 // ovf://disk/lamp … … 1513 1516 tr("Internal inconsistency looking up hard disk controller.")); 1514 1517 1515 /* controller to attach to @todo bus? */ 1516 Utf8StrFmt strExtraConfig("controller=%RI16", 1517 pController->ulIndex); 1518 /* controller to attach to, and the bus within that controller */ 1519 Utf8StrFmt strExtraConfig("controller=%RI16;channel=%RI16", 1520 pController->ulIndex, 1521 hd.ulAddressOnParent); 1518 1522 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage, 1519 1523 hd.strDiskId, … … 2103 2107 mhda.pMachine = pNewMachine; 2104 2108 mhda.busType = StorageBus_IDE; 2105 mhda.lChannel = (long)hdc.ulBusNumber; // ?!? @todo this is still wrong2106 mhda.lDevice = (long)0; // ?!? @todo this is still wrong2107 2109 2108 2110 switch (hdc.system) 2109 2111 { 2110 case HardDiskController::IDE: mhda.busType = StorageBus_IDE; break; 2111 case HardDiskController::SATA: mhda.busType = StorageBus_SATA; break; 2112 //case HardDiskController::SCSI: sbt = StorageBus_SCSI; break; // @todo: not available yet 2112 case HardDiskController::IDE: 2113 // For the IDE bus, the channel parameter can be either 0 or 1, to specify the primary 2114 // or secondary IDE controller, respectively. For the primary controller of the IDE bus, 2115 // the device number can be either 0 or 1, to specify the master or the slave device, 2116 // respectively. For the secondary IDE controller, the device number is always 1 because 2117 // the master device is reserved for the CD-ROM drive. 2118 switch (vd.ulAddressOnParent) 2119 { 2120 case 0: // interpret this as primary master 2121 mhda.lChannel = (long)0; 2122 mhda.lDevice = (long)0; 2123 break; 2124 2125 case 1: // interpret this as primary slave 2126 mhda.lChannel = (long)0; 2127 mhda.lDevice = (long)1; 2128 break; 2129 2130 case 2: // interpret this as secondary slave 2131 mhda.lChannel = (long)1; 2132 mhda.lDevice = (long)1; 2133 break; 2134 2135 default: 2136 throw setError(VERR_NOT_IMPLEMENTED, 2137 tr("Invalid channel %RI16 specified; IDE conrollers support only 0, 1 or 2"), vd.ulAddressOnParent); 2138 break; 2139 } 2140 break; 2141 2142 case HardDiskController::SATA: 2143 mhda.busType = StorageBus_SATA; 2144 mhda.lChannel = (long)vd.ulAddressOnParent; 2145 mhda.lDevice = (long)0; 2146 break; 2147 2148 case HardDiskController::SCSI: 2149 // mhda.busType = StorageBus_SCSI; 2150 throw setError(VERR_NOT_IMPLEMENTED, 2151 tr("SCSI controller support is not available yet in VirtualBox")); 2152 // @ŧodo 2153 break; 2154 2113 2155 default: break; 2114 2156 } 2157 2158 Log(("Attaching disk %s to channel %d on device %d\n", pcszDstFilePath, mhda.lChannel, mhda.lDevice)); 2115 2159 2116 2160 rc = sMachine->AttachHardDisk(hdId, -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16927 r16949 3082 3082 "HarddiskControllerIDE": an IDE hard disk controller. There can be at most one such item. This 3083 3083 has no value in aOrigValues[] or aConfigValues[]. 3084 The matching item in the aRefs[] array will contain an integer that otheritems of the "Harddisk"3084 The matching item in the aRefs[] array will contain an integer that items of the "Harddisk" 3085 3085 type can use to specify which hard disk controller a virtual disk should be connected to. 3086 3086 </li> … … 3098 3098 "Harddisk": a virtual hard disk, most probably as a reference to an image file. There can be an 3099 3099 arbitrary number of these items, one for each virtual disk image that accompanies the OVF. The 3100 array item in aOrigValues[] will contain the file specification from the OVF file, whereas the item 3101 in aConfigValues[] will contain a qualified path specification where the hard disk image should 3102 be copied to; this target image will then be registered with VirtualBox. 3103 The matching item in the aExtraConfigValues[] array must contain a string of the "controller=<ctrl>" 3104 format, where <ctrl> must be an integer specifying the hard disk controller to connect the image to. 3105 That number must be the index of an array item with one of the hard disk controller types 3106 (HarddiskControllerSCSI, HarddiskControllerSATA, HarddiskControllerIDE). 3100 array item in aOrigValues[] will contain the file specification from the OVF file, whereas the 3101 item in aConfigValues[] will contain a qualified path specification to where the hard disk image 3102 should be copied; this target image will then be registered with VirtualBox. 3103 The matching item in the aExtraConfigValues[] array must contain a string of the following 3104 format: "controller=<index>;channel=<c>" 3105 In this string, <index> must be an integer specifying the hard disk controller to connect 3106 the image to. That number must be the index of an array item with one of the hard disk controller 3107 types (HarddiskControllerSCSI, HarddiskControllerSATA, HarddiskControllerIDE). 3108 In addition, <c> must specify the channel to use on that controller. For IDE controllers, 3109 this can range from 0-2 (which VirtualBox will interpret as primary master, primary slave, 3110 secondary slave; VirtualBox reserves the secondary master for the CD-ROM drive). For SATA and 3111 SCSI conrollers, the channel can range from 0-29. 3107 3112 </li> 3108 3113 <li> … … 6555 6560 <desc>List of host tap interfaces currently defined on the host.</desc> 6556 6561 </attribute> 6557 6562 6558 6563 <attribute name="processorCount" type="unsigned long" readonly="yes"> 6559 6564 <desc>Number of (logical) CPUs installed in the host system.</desc>
Note:
See TracChangeset
for help on using the changeset viewer.