VirtualBox

Changeset 40712 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Mar 29, 2012 3:33:43 PM (13 years ago)
Author:
vboxsync
Message:

NetShaper: Online bandwidth limit setting (#5582)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r40633 r40712  
    9696# include <VBox/vmm/pdmusb.h>
    9797#endif
     98#ifdef VBOX_WITH_NETSHAPER
     99# include <VBox/vmm/pdmnetshaper.h>
     100#endif /* VBOX_WITH_NETSHAPER */
    98101#include <VBox/vmm/mm.h>
    99102#include <VBox/vmm/ftm.h>
     
    51525155            ULONG cMax;
    51535156            Bstr strName;
     5157            BandwidthGroupType_T enmType;
    51545158            rc = aBandwidthGroup->COMGETTER(Name)(strName.asOutParam());
    51555159            if (SUCCEEDED(rc))
    51565160                rc = aBandwidthGroup->COMGETTER(MaxMbPerSec)(&cMax);
     5161            if (SUCCEEDED(rc))
     5162                rc = aBandwidthGroup->COMGETTER(Type)(&enmType);
    51575163
    51585164            if (SUCCEEDED(rc))
    51595165            {
    5160                 int vrc;
    5161                 vrc = PDMR3AsyncCompletionBwMgrSetMaxForFile(ptrVM, Utf8Str(strName).c_str(),
    5162                                                              cMax * _1M);
     5166                int vrc = VINF_SUCCESS;
     5167                if (enmType == BandwidthGroupType_Disk)
     5168                    vrc = PDMR3AsyncCompletionBwMgrSetMaxForFile(ptrVM, Utf8Str(strName).c_str(),
     5169                                                                 cMax * _1M);
     5170                else if (enmType == BandwidthGroupType_Network)
     5171                    vrc = PDMR3NsBwGroupSetLimit(ptrVM, Utf8Str(strName).c_str(),
     5172                                                                 cMax * 1000);
     5173                else
     5174                    rc = E_NOTIMPL;
    51635175                AssertRC(vrc);
    51645176            }
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