StorageControllerImpl.cpp revision e64031e20c39650a7bc902a3e1aba613b9415dee
2N/A * Implementation of IStorageController. 2N/A * Copyright (C) 2008-2009 Oracle Corporation 2N/A * This file is part of VirtualBox Open Source Edition (OSE), as 2N/A * you can redistribute it and/or modify it under the terms of the GNU 2N/A * General Public License (GPL) as published by the Free Software 2N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 2N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 2N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 2N/A///////////////////////////////////////////////////////////////////////////// 2N/A /** Unique name of the storage controller. */ 2N/A /** The connection type of thestorage controller. */ 2N/A /** Type of the Storage controller. */ 2N/A /** Instance number of the storage controller. */ 2N/A /** Number of usable ports. */ 2N/A /** I/O backend type */ 2N/A /** The following is only for the SATA controller atm. */ 2N/A /** Port which acts as primary master for ide emulation. */ 2N/A /** Port which acts as primary slave for ide emulation. */ 2N/A /** Port which acts as secondary master for ide emulation. */ 2N/A /** Port which acts as secondary slave for ide emulation. */ 2N/A// constructor / destructor 2N/A///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// * Initializes the storage controller object. * @returns COM result indicator. * @param aParent Pointer to our parent object. * @param aName Name of the storage controller. * @param aInstance Instance number of the storage controller. tr(
"Invalid storage connection type"));
/* Enclose the state transition NotReady->InInit->Ready */ /* m->pPeer is left null */ /* register with parent early, since uninit() will unconditionally * unregister on failure */ /** @todo allow 2 floppies later */ /* Confirm a successful initialization */ * Initializes the object given another object * (a kind of copy constructor). This object shares data with * the object passed as an argument. * When false, the original object will remain a data owner. * Otherwise, data ownership will be transferred from the original * @note This object must be destroyed before the original object * it shares data with is destroyed. * @note Locks @a aThat object for writing if @a aReshare is @c true, or for * reading if @a aReshare is false. /* Enclose the state transition NotReady->InInit->Ready */ /* register with parent early, since uninit() will unconditionally * unregister on failure */ /* Confirm successful initialization */ * Initializes the storage controller object given another guest object * (a kind of copy constructor). This object makes a private copy of data * of the original object passed as an argument. /* Enclose the state transition NotReady->InInit->Ready */ /* m->pPeer is left null */ /* Confirm a successful initialization */ * Uninitializes the instance and sets the ready flag to FALSE. * Called either from FinalRelease() or by the parent when it gets destroyed. /* Enclose the state transition Ready->InUninit->NotReady */ // IStorageController properties ///////////////////////////////////////////////////////////////////////////// /* mName is constant during life time, no need to lock */ tr (
"Invalid controller type %d"),
/* AHCI SATA supports a maximum of 30 ports. */ tr(
"Invalid port count: %lu (must be in range [%lu, %lu])"),
* SCSI does not support setting different ports. * (doesn't make sense here either). * The maximum and minimum is 16 and unless the callee * tries to set a different value we return an error. tr(
"Invalid port count: %lu (must be in range [%lu, %lu])"),
* The port count is fixed to 2. tr(
"Invalid port count: %lu (must be in range [%lu, %lu])"),
/** @todo allow 2 floppies later */ * The port count is fixed to 1. tr(
"Invalid port count: %lu (must be in range [%lu, %lu])"),
* The port count is fixed to 8. tr(
"Invalid port count: %lu (must be in range [%lu, %lu])"),
/* the machine needs to be mutable */ /* The machine doesn't need to be mutable. */ /* The machine doesn't need to be mutable. */ /* The machine doesn't need to be mutable. */ /* the machine needs to be mutable */ // IStorageController methods ///////////////////////////////////////////////////////////////////////////// tr(
"Invalid controller type"));
/* the machine needs to be mutable */ tr(
"Invalid controller type"));
tr(
"Invalid port number: %l (must be in range [%lu, %lu])"),
// public methods only for internal purposes ///////////////////////////////////////////////////////////////////////////// /** @note Locks objects for writing! */ * @note Locks this object for writing, together with the peer object (also * for writing) if there is one. /* lock both for writing since we modify both (m->pPeer is "master" so locked // attach new data to the peer and reshare it * Cancels sharing (if any) by making an independent copy of data. * This operation also resets this object's peer to NULL. * @note Locks this object for writing, together with the peer object * represented by @a aThat (locked for reading). /* peer is not modified, lock it for reading (m->pPeer is "master" so locked ///////////////////////////////////////////////////////////////////////////// /* vi: set tabstop=4 shiftwidth=4 expandtab: */