VirtualBox

Changeset 31301 in vbox


Ignore:
Timestamp:
Aug 2, 2010 1:33:24 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64328
Message:

More resource control changes

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

Legend:

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

    r31296 r31301  
    34773477    ComObjPtr<MediumAttachment> attachment;
    34783478    attachment.createObject();
    3479     rc = attachment->init(this, medium, aControllerName, aControllerPort, aDevice, aType, indirect);
     3479    rc = attachment->init(this, medium, aControllerName, aControllerPort, aDevice, aType, indirect, 0 /* No bandwidth limit */);
    34803480    if (FAILED(rc)) return rc;
    34813481
     
    71657165                               dev.lDevice,
    71667166                               dev.deviceType,
    7167                                dev.fPassThrough);
     7167                               dev.fPassThrough,
     7168                               dev.ulBandwidthLimit);
    71687169        if (FAILED(rc)) break;
    71697170
     
    83648365                                  pAtt->getDevice(),
    83658366                                  DeviceType_HardDisk,
    8366                                   true /* aImplicit */);
     8367                                  true /* aImplicit */,
     8368                                  0 /* No bandwidth limit */);
    83678369            if (FAILED(rc)) throw rc;
    83688370
  • trunk/src/VBox/Main/MediumAttachmentImpl.cpp

    r31287 r31301  
    3939          type(DeviceType_Null),
    4040          fPassthrough(false),
    41           fImplicit(false)
     41          fImplicit(false),
     42          mBandwidthLimit(0)
    4243    { }
    4344
     
    9293 * Initializes the medium attachment object.
    9394 *
    94  * @param aParent     Machine object.
    95  * @param aMedium     Medium object.
    96  * @param aController Controller the hard disk is attached to.
    97  * @param aPort       Port number.
    98  * @param aDevice     Device number on the port.
    99  * @param aPassthrough Wether accesses are directly passed to the host drive.
     95 * @param aParent           Machine object.
     96 * @param aMedium           Medium object.
     97 * @param aController       Controller the hard disk is attached to.
     98 * @param aPort             Port number.
     99 * @param aDevice           Device number on the port.
     100 * @param aPassthrough      Whether accesses are directly passed to the host drive.
     101 * @param aBandwidthLimit   Bandwidth limit in Mbps
    100102 */
    101103HRESULT MediumAttachment::init(Machine *aParent,
     
    105107                               LONG aDevice,
    106108                               DeviceType_T aType,
    107                                bool aPassthrough)
     109                               bool aPassthrough,
     110                               ULONG aBandwidthLimit)
    108111{
    109112    LogFlowThisFuncEnter();
     
    133136    m->bd->fImplicit = false;
    134137
    135     /* Default is no limit. */
    136     m->bd->mBandwidthLimit = 0;
     138    m->bd->mBandwidthLimit = aBandwidthLimit;
    137139
    138140    /* Confirm a successful initialization when it's the case */
  • trunk/src/VBox/Main/include/MediumAttachmentImpl.h

    r31287 r31301  
    4848                 LONG aDevice,
    4949                 DeviceType_T aType,
    50                  bool fPassthrough);
     50                 bool fPassthrough,
     51                 ULONG aBandwidthLimit);
    5152    void uninit();
    5253
  • trunk/src/VBox/Main/xml/Settings.cpp

    r31293 r31301  
    15781578                  && (uuid                      == a.uuid)
    15791579                  && (strHostDriveSrc           == a.strHostDriveSrc)
     1580                  && (ulBandwidthLimit          == a.ulBandwidthLimit)
    15801581                )
    15811582           );
     
    27542755                    throw ConfigFileError(this, pelmImage, N_("Required AttachedDevice/@device attribute is missing"));
    27552756
     2757                pelmAttached->getAttributeValue("bandwidthLimit", att.ulBandwidthLimit);
    27562758                sctl.llAttachedDevices.push_back(att);
    27572759            }
     
    38143816            pelmDevice->setAttribute("device", att.lDevice);
    38153817
     3818            if (att.ulBandwidthLimit)
     3819                pelmDevice->setAttribute("bandwidthLimit", att.ulBandwidthLimit);
     3820
    38163821            // attached image, if any
    38173822            if (    !att.uuid.isEmpty()
     
    41534158                    break; /* abort the loop -- we will not raise the version further */
    41544159                }
     4160
     4161                /* Bandwidth limitations are new in VirtualBox 3.3 (1.11) */
     4162                if (att.ulBandwidthLimit != 0)
     4163                {
     4164                    m->sv = SettingsVersion_v1_11;
     4165                    break; /* abort the loop -- we will not raise the version further */
     4166                }
    41554167            }
    41564168        }
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