VirtualBox

Ignore:
Timestamp:
Nov 5, 2009 1:29:47 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
54412
Message:

VBoxManageStorageController: sata controller port count check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp

    r24347 r24381  
    200200        errorSyntax(USAGE_STORAGEATTACH, "Couldn't find the controller with the name: '%s'\n", pszCtl);
    201201        goto leave;
     202    }
     203
     204    /* for sata controller check if the port count is big enough
     205     * to accomodate the current port which is being assigned
     206     * else just increase the port count
     207     */
     208    {
     209        ULONG ulPortCount = 0;
     210        ULONG ulMaxPortCount = 0;
     211
     212        CHECK_ERROR(storageCtl, COMGETTER(MaxPortCount)(&ulMaxPortCount));
     213        CHECK_ERROR(storageCtl, COMGETTER(PortCount)(&ulPortCount));
     214
     215        if (   (ulPortCount != ulMaxPortCount)
     216            && (port >= ulPortCount)
     217            && (port < ulMaxPortCount))
     218            CHECK_ERROR(storageCtl, COMSETTER(PortCount)(port + 1));
    202219    }
    203220
Note: See TracChangeset for help on using the changeset viewer.

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