# IStorageController Interface Reference

Represents a storage controller that is attached to a virtual machine (IMachine). More...

List of all members.

## Public Member Functions
void | GetIDEEmulationPort (in long devicePosition,[retval] out long portNumber)
| Gets the corresponding port number which is emulated as an IDE device.
void | SetIDEEmulationPort (in long devicePosition, in long portNumber)
| Sets the port number which is emulated as an IDE device.
## Public Attributes
readonly attribute wstring | name
| Name of the storage controller, as originally specified with IMachine::addStorageController.
readonly attribute unsigned long | maxDevicesPerPortCount
| Maximum number of devices which can be attached to one port.
readonly attribute unsigned long | minPortCount
| Minimum number of ports that IStorageController::portCount can be set to.
readonly attribute unsigned long | maxPortCount
| Maximum number of ports that IStorageController::portCount can be set to.
attribute unsigned long | instance
| The instance number of the device in the running VM.
attribute unsigned long | portCount
| The number of currently usable ports on the controller.
readonly attribute StorageBus | bus
| The bus type of the storage controller (IDE, SATA, SCSI or Floppy).
attribute StorageControllerType | controllerType
| The exact variant of storage controller hardware presented to the guest.

## Detailed Description

Represents a storage controller that is attached to a virtual machine (IMachine).

Just as drives (hard disks, DVDs, FDs) are attached to storage controllers in a real computer, virtual drives (represented by IMediumAttachment) are attached to virtual storage controllers, represented by this interface.

As opposed to physical hardware, VirtualBox has a very generic concept of a storage controller, and for purposes of the Main API, all virtual storage is attached to virtual machines via instances of this interface. There are four types of such virtual storage controllers: IDE, SCSI, SATA and Floppy (see bus). Depending on which of these four is used, certain sub-types may be available and can be selected in controllerType.

Depending on these settings, the guest operating system might see significantly different virtual hardware.

Interface ID:
  `{6BF8335B-D14A-44A5-9B45-DDC49CE7D5B2}`

## Member Function Documentation

void IStorageController::GetIDEEmulationPort | ( | in long | devicePosition,
|  | [retval] out long | portNumber |
| ) |  |  |

Gets the corresponding port number which is emulated as an IDE device.

Works only with SATA controllers.

Expected result codes:

  E_INVALIDARG | The devicePosition is not in the range 0 to 3.
  E_NOTIMPL | The storage controller type is not SATAIntelAhci.

void IStorageController::SetIDEEmulationPort | ( | in long | devicePosition,
|  | in long | portNumber |
| ) |  |  |

Sets the port number which is emulated as an IDE device.

Works only with SATA controllers.

Expected result codes:

  E_INVALIDARG | The devicePosition is not in the range 0 to 3 or the portNumber is not in the range 0 to 29.
  E_NOTIMPL | The storage controller type is not SATAIntelAhci.

## Member Data Documentation

readonly attribute wstring IStorageController::name

Name of the storage controller, as originally specified with IMachine::addStorageController.

This then uniquely identifies this controller with other method calls such as IMachine::attachDevice and IMachine::mountMedium.

readonly attribute unsigned long IStorageController::maxDevicesPerPortCount

Maximum number of devices which can be attached to one port.

readonly attribute unsigned long IStorageController::minPortCount

Minimum number of ports that IStorageController::portCount can be set to.

readonly attribute unsigned long IStorageController::maxPortCount

Maximum number of ports that IStorageController::portCount can be set to.

attribute unsigned long IStorageController::instance

The instance number of the device in the running VM.

attribute unsigned long IStorageController::portCount

The number of currently usable ports on the controller.

The minimum and maximum number of ports for one controller are stored in IStorageController::minPortCount and IStorageController::maxPortCount.

readonly attribute StorageBus IStorageController::bus

The bus type of the storage controller (IDE, SATA, SCSI or Floppy).

attribute StorageControllerType IStorageController::controllerType

The exact variant of storage controller hardware presented to the guest.

Depending on this value, VirtualBox will provide a different virtual storage controller hardware to the guest. For SATA and floppy controllers, only one variant is available, but for IDE and SCSI, there are several.

For SCSI controllers, the default type is LsiLogic.