VirtualBox

Ignore:
Timestamp:
Mar 25, 2015 4:56:48 PM (10 years ago)
Author:
vboxsync
Message:

Main/Medium+Snapshot: make all code recursing over trees (objects containing lists of child objects) use as little stack as possible, and establish safe depth limits to avoid crashes, plus related cleanups in related code areas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MediumImpl.h

    r54885 r54948  
    11/* $Id$ */
    2 
    32/** @file
    4  *
    53 * VirtualBox COM class implementation
    64 */
     
    7270
    7371    // initializer used when loading settings
     72    HRESULT initOne(Medium *aParent,
     73                    DeviceType_T aDeviceType,
     74                    const Guid &uuidMachineRegistry,
     75                    const settings::Medium &data,
     76                    const Utf8Str &strMachineFolder);
    7477    HRESULT init(VirtualBox *aVirtualBox,
    7578                 Medium *aParent,
     
    7780                 const Guid &uuidMachineRegistry,
    7881                 const settings::Medium &data,
    79                  const Utf8Str &strMachineFolder);
     82                 const Utf8Str &strMachineFolder,
     83                 AutoWriteLock &mediaTreeLock);
    8084
    8185    // initializer for host floppy/DVD
     
    109113
    110114    /* handles caller/locking itself */
    111     bool i_addRegistry(const Guid& id, bool fRecurse);
     115    bool i_addRegistry(const Guid &id);
     116    /* handles caller/locking itself, caller is responsible for tree lock */
     117    bool i_addRegistryRecursive(const Guid &id);
    112118    /* handles caller/locking itself */
    113     bool i_removeRegistry(const Guid& id, bool fRecurse);
     119    bool i_removeRegistry(const Guid& id);
     120    /* handles caller/locking itself, caller is responsible for tree lock */
     121    bool i_removeRegistryRecursive(const Guid& id);
    114122    bool i_isInRegistry(const Guid& id);
    115123    bool i_getFirstRegistryMachineId(Guid &uuid) const;
     
    135143    HRESULT i_updatePath(const Utf8Str &strOldPath, const Utf8Str &strNewPath);
    136144
     145    /* handles caller/locking itself */
    137146    ComObjPtr<Medium> i_getBase(uint32_t *aLevel = NULL);
     147    /* handles caller/locking itself */
     148    uint32_t i_getDepth();
    138149
    139150    bool i_isReadOnly();
    140151    void i_updateId(const Guid &id);
    141152
     153    void i_saveSettingsOne(settings::Medium &data,
     154                           const Utf8Str &strHardDiskFolder);
    142155    HRESULT i_saveSettings(settings::Medium &data,
    143156                           const Utf8Str &strHardDiskFolder);
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