VirtualBox

Changeset 23560 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Oct 5, 2009 12:45:09 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53208
Message:

API/SystemProperties: new method to query the maximum instance count for each storage bus

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

Legend:

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

    r23257 r23560  
    469469}
    470470
     471STDMETHODIMP SystemProperties::GetMaxInstancesOfStorageBus(StorageBus_T aBus, ULONG *aMaxInstances)
     472{
     473    CheckComArgOutPointerValid(aMaxInstances);
     474
     475    AutoCaller autoCaller(this);
     476    CheckComRCReturnRC(autoCaller.rc());
     477
     478    /* no need to lock, this is const */
     479    switch (aBus)
     480    {
     481        case StorageBus_SATA:
     482        case StorageBus_SCSI:
     483        case StorageBus_IDE:
     484        case StorageBus_Floppy:
     485        {
     486            /** @todo raise the limits ASAP, per bus type */
     487            *aMaxInstances = 1;
     488            break;
     489        }
     490        default:
     491            AssertMsgFailed(("Invalid bus type %d\n", aBus));
     492    }
     493
     494    return S_OK;
     495}
     496
    471497STDMETHODIMP SystemProperties::COMGETTER(DefaultMachineFolder) (BSTR *aDefaultMachineFolder)
    472498{
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r23288 r23560  
    72387238     name="ISystemProperties"
    72397239     extends="$unknown"
    7240      uuid="79a8bc4d-24a5-4258-a0a6-8c36f8a68a4b"
     7240     uuid="4b78105a-d066-4eab-ae48-ccb2c0ba5057"
    72417241     wsmap="managed"
    72427242     >
     
    75397539      <param name="maxPortCount" type="unsigned long" dir="return">
    75407540        <desc>The maximum number of ports for the given storage bus.</desc>
     7541      </param>
     7542    </method>
     7543
     7544    <method name="getMaxInstancesOfStorageBus">
     7545      <desc>Returns the maximum number of storage bus instances which
     7546        can be configured for each VM. This corresponds to the number of
     7547        storage controllers one can have.</desc>
     7548
     7549      <param name="bus" type="StorageBus" dir="in">
     7550        <desc>The storage bus type to get the value for.</desc>
     7551      </param>
     7552
     7553      <param name="maxInstances" type="unsigned long" dir="return">
     7554        <desc>The maximum number of instances for the given storage bus.</desc>
    75417555      </param>
    75427556    </method>
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r23223 r23560  
    9898    STDMETHOD(GetMinPortCountForStorageBus) (StorageBus_T aBus, ULONG *aMinPortCount);
    9999    STDMETHOD(GetMaxPortCountForStorageBus) (StorageBus_T aBus, ULONG *aMaxPortCount);
     100    STDMETHOD(GetMaxInstancesOfStorageBus)(StorageBus_T aBus, ULONG *aMaxInstances);
    100101
    101102    // public methods only for internal purposes
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