VirtualBox

Changeset 50436 in vbox


Ignore:
Timestamp:
Feb 12, 2014 6:53:15 PM (11 years ago)
Author:
vboxsync
Message:

Main/BandwidthControl+BandwidthGroup: fix an init bug which led to crashes when restoring snapshots (just one line, using the wrong "copy constructor"), and quite some comment fixes to talk about the right thing (and not show where the code was copied from)

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/BandwidthControlImpl.cpp

    r50427 r50436  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5656 * @returns COM result indicator.
    5757 * @param aParent       Pointer to our parent object.
    58  * @param aName         Name of the storage controller.
    59  * @param aInstance     Instance number of the storage controller.
    6058 */
    6159HRESULT BandwidthControl::init(Machine *aParent)
     
    132130
    133131/**
    134  *  Initializes the storage controller object given another guest object
     132 *  Initializes the bandwidth control object given another guest object
    135133 *  (a kind of copy constructor). This object makes a private copy of data
    136134 *  of the original object passed as an argument.
     
    163161        ComObjPtr<BandwidthGroup> group;
    164162        group.createObject();
    165         group->init(this, *it);
     163        group->initCopy(this, *it);
    166164        m->llBandwidthGroups->push_back(group);
    167165    }
     
    201199    AutoWriteLock wl(this COMMA_LOCKVAL_SRC_POS);
    202200
    203     /* create private copies of all filters */
     201    /* create private copies of all bandwidth groups */
    204202    m->llBandwidthGroups.backup();
    205203    m->llBandwidthGroups->clear();
     
    269267            AutoWriteLock peerlock(m->pPeer COMMA_LOCKVAL_SRC_POS);
    270268
    271             /* Commit all changes to new controllers (this will reshare data with
     269            /* Commit all changes to new groups (this will reshare data with
    272270             * peers for those who have peers) */
    273271            BandwidthGroupList *newList = new BandwidthGroupList();
     
    296294            }
    297295
    298 #if 0
    299             /* uninit old peer's controllers that are left */
     296            /* uninit old peer's groups that are left */
    300297            for (it = m->pPeer->m->llBandwidthGroups->begin();
    301298                 it != m->pPeer->m->llBandwidthGroups->end();
    302299                 ++it)
    303300                (*it)->uninit();
    304 #endif
    305 
    306             /* attach new list of controllers to our peer */
     301
     302            /* attach new list of groups to our peer */
    307303            m->pPeer->m->llBandwidthGroups.attach(newList);
    308304        }
     
    317313    {
    318314        /* the list of groups itself is not changed,
    319          * just commit changes to controllers themselves */
     315         * just commit changes to groups themselves */
    320316        commitBandwidthGroups = true;
    321317    }
     
    361357
    362358/**
    363  * Returns a storage controller object with the given name.
     359 * Returns a bandwidth group object with the given name.
    364360 *
    365  *  @param aName                 storage controller name to find
    366  *  @param aBandwidthGroup where to return the found storage controller
     361 *  @param aName                 bandwidth group name to find
     362 *  @param aBandwidthGroup where to return the found bandwidth group
    367363 *  @param aSetError             true to set extended error info on failure
    368364 */
  • trunk/src/VBox/Main/src-server/BandwidthGroupImpl.cpp

    r49738 r50436  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4949 * @returns COM result indicator.
    5050 * @param aParent       Pointer to our parent object.
    51  * @param aName         Name of the storage controller.
    52  * @param aInstance     Instance number of the storage controller.
     51 * @param aName         Name of the bandwidth group.
     52 * @param aType         Type of the bandwidth group (net, disk).
     53 * @param aMaxBytesPerSec Maximum bandwidth for the bandwidth group.
    5354 */
    5455HRESULT BandwidthGroup::init(BandwidthControl *aParent,
     
    144145
    145146/**
    146  *  Initializes the storage controller object given another guest object
     147 *  Initializes the bandwidth group object given another guest object
    147148 *  (a kind of copy constructor). This object makes a private copy of data
    148149 *  of the original object passed as an argument.
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