VirtualBox

Changeset 54948 in vbox for trunk/src/VBox/Main/include


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

Location:
trunk/src/VBox/Main/include
Files:
3 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);
  • trunk/src/VBox/Main/include/SnapshotImpl.h

    r50504 r54948  
    11/* $Id$ */
    2 
    32/** @file
    4  *
    53 * VirtualBox COM class implementation
    64 */
    75
    86/*
    9  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    108 *
    119 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9290                                Snapshot *pSnapshotToIgnore);
    9391
    94     HRESULT i_saveSnapshot(settings::Snapshot &data, bool aAttrsOnly);
    95     HRESULT i_saveSnapshotImpl(settings::Snapshot &data, bool aAttrsOnly);
     92    HRESULT i_saveSnapshot(settings::Snapshot &data) const;
     93    HRESULT i_saveSnapshotImpl(settings::Snapshot &data) const;
     94    HRESULT i_saveSnapshotImplOne(settings::Snapshot &data) const;
    9695
     96    HRESULT i_uninitOne(AutoWriteLock &writeLock,
     97                        CleanupMode_T cleanupMode,
     98                        MediaList &llMedia,
     99                        std::list<Utf8Str> &llFilenames);
    97100    HRESULT i_uninitRecursively(AutoWriteLock &writeLock,
    98101                                CleanupMode_T cleanupMode,
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r54438 r54948  
    9393    HRESULT initMachines();
    9494    HRESULT initMedia(const Guid &uuidMachineRegistry,
    95                       const settings::MediaRegistry mediaRegistry,
     95                      const settings::MediaRegistry &mediaRegistry,
    9696                      const Utf8Str &strMachineFolder);
    9797    void uninit();
     
    230230    HRESULT i_saveSettings();
    231231    void i_markRegistryModified(const Guid &uuid);
     232    void i_unmarkRegistryModified(const Guid &uuid);
    232233    void i_saveModifiedRegistries();
    233234    static const com::Utf8Str &i_getVersionNormalized();
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