VirtualBox

Changeset 16949 in vbox for trunk


Ignore:
Timestamp:
Feb 19, 2009 1:56:08 PM (16 years ago)
Author:
vboxsync
Message:

OVF: implement multiple channels per HD controller

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r16945 r16949  
    149149    uint32_t            idController;           // SCSI (or IDE) controller this disk is connected to;
    150150                                                // 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)
    151153    Utf8Str             strDiskId;              // if the hard disk has an ovf:/disk/<id> reference,
    152154                                                // this receives the <id> component; points to one of the
     
    752754                        VirtualDisk vd;
    753755                        vd.idController = i.ulParent;
     756                        i.strAddressOnParent.toInt(vd.ulAddressOnParent);
    754757                        bool fFound = false;
    755758                        // ovf://disk/lamp
     
    15131516                                           tr("Internal inconsistency looking up hard disk controller."));
    15141517
    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);
    15181522                        pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage,
    15191523                                           hd.strDiskId,
     
    21032107                        mhda.pMachine = pNewMachine;
    21042108                        mhda.busType = StorageBus_IDE;
    2105                         mhda.lChannel = (long)hdc.ulBusNumber; // ?!? @todo this is still wrong
    2106                         mhda.lDevice = (long)0;         // ?!? @todo this is still wrong
    21072109
    21082110                        switch (hdc.system)
    21092111                        {
    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
    21132155                            default: break;
    21142156                        }
     2157
     2158                        Log(("Attaching disk %s to channel %d on device %d\n", pcszDstFilePath, mhda.lChannel, mhda.lDevice));
    21152159
    21162160                        rc = sMachine->AttachHardDisk(hdId,
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r16927 r16949  
    30823082        "HarddiskControllerIDE": an IDE hard disk controller. There can be at most one such item. This
    30833083        has no value in aOrigValues[] or aConfigValues[].
    3084         The matching item in the aRefs[] array will contain an integer that other items of the "Harddisk"
     3084        The matching item in the aRefs[] array will contain an integer that items of the "Harddisk"
    30853085        type can use to specify which hard disk controller a virtual disk should be connected to.
    30863086      </li>
     
    30983098        "Harddisk": a virtual hard disk, most probably as a reference to an image file. There can be an
    30993099        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=&lt;ctrl&gt;"
    3104         format, where &lt;ctrl&gt; 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=&lt;index&gt;;channel=&lt;c&gt;"
     3105        In this string, &lt;index&gt; 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, &lt;c&gt; 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.
    31073112      </li>
    31083113      <li>
     
    65556560      <desc>List of host tap interfaces currently defined on the host.</desc>
    65566561    </attribute>
    6557    
     6562
    65586563    <attribute name="processorCount" type="unsigned long" readonly="yes">
    65596564      <desc>Number of (logical) CPUs installed in the host system.</desc>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette