VirtualBox

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


Ignore:
Timestamp:
Mar 9, 2012 10:00:56 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76749
Message:

Main: Extended IMachine and the settings XML with three tracing related properties.

Location:
trunk/src/VBox/Main/include
Files:
2 edited

Legend:

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

    r40084 r40418  
    11/* $Id$ */
    22/** @file
    3  * VirtualBox COM class implementation
     3 * Implementation of IMachine in VBoxSVC - Header.
    44 */
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    297297        typedef std::list<ComObjPtr<PciDeviceAttachment> > PciDeviceAssignmentList;
    298298        PciDeviceAssignmentList mPciDeviceAssignments;
     299
     300        settings::Debugging  mDebugging;
    299301    };
    300302
     
    468470    STDMETHOD(COMGETTER(PciDeviceAssignments))(ComSafeArrayOut(IPciDeviceAttachment *, aAssignments));
    469471    STDMETHOD(COMGETTER(BandwidthControl))(IBandwidthControl **aBandwidthControl);
     472    STDMETHOD(COMGETTER(TracingEnabled))(BOOL *pfEnabled);
     473    STDMETHOD(COMSETTER(TracingEnabled))(BOOL fEnabled);
     474    STDMETHOD(COMGETTER(TracingConfig))(BSTR *pbstrConfig);
     475    STDMETHOD(COMSETTER(TracingConfig))(IN_BSTR bstrConfig);
     476    STDMETHOD(COMGETTER(AllowTracingToAccessVM))(BOOL *pfAllow);
     477    STDMETHOD(COMSETTER(AllowTracingToAccessVM))(BOOL fAllow);
    470478
    471479    // IMachine methods
     
    786794                         const Guid &aCurSnapshotId,
    787795                         Snapshot *aParentSnapshot);
    788     HRESULT loadHardware(const settings::Hardware &data);
     796    HRESULT loadHardware(const settings::Hardware &data, const settings::Debugging *pDbg);
     797    HRESULT loadDebugging(const settings::Debugging *pDbg);
    789798    HRESULT loadStorageControllers(const settings::Storage &data,
    790799                                   const Guid *puuidRegistry,
     
    826835    void copyMachineDataToSettings(settings::MachineConfigFile &config);
    827836    HRESULT saveAllSnapshots(settings::MachineConfigFile &config);
    828     HRESULT saveHardware(settings::Hardware &data);
     837    HRESULT saveHardware(settings::Hardware &data, settings::Debugging *pDbg);
    829838    HRESULT saveStorageControllers(settings::Storage &data);
    830839    HRESULT saveStorageDevices(ComObjPtr<StorageController> aStorageController,
     
    11951204                 IN_GUID aSnapshotId,
    11961205                 const Utf8Str &aStateFilePath);
    1197     HRESULT init(Machine *aMachine,
    1198                  const settings::Hardware &hardware,
    1199                  const settings::Storage &storage,
    1200                  IN_GUID aSnapshotId,
    1201                  const Utf8Str &aStateFilePath);
     1206    HRESULT initFromSettings(Machine *aMachine,
     1207                             const settings::Hardware &hardware,
     1208                             const settings::Debugging *pDbg,
     1209                             const settings::Storage &storage,
     1210                             IN_GUID aSnapshotId,
     1211                             const Utf8Str &aStateFilePath);
    12021212    void uninit();
    12031213
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r38533 r40418  
    351351
    352352/**
    353  * Checks that the string argument is not a NULL or empty string and returns
    354  * E_INVALIDARG + extended error info on failure.
    355  * @param arg   Input string argument (BSTR etc.).
    356  */
    357 #define CheckComArgStrNotEmptyOrNull(arg) \
    358     do { \
    359         if (RT_UNLIKELY((arg) == NULL || *(arg) == '\0')) \
    360             return setError(E_INVALIDARG, \
    361                 tr("Argument %s is empty or NULL"), #arg); \
     353 * Checks that a string input argument is valid (not NULL or obviously invalid
     354 * pointer), returning E_INVALIDARG + extended error info if invalid.
     355 * @param a_bstrIn  Input string argument (IN_BSTR).
     356 */
     357#define CheckComArgStr(a_bstrIn) \
     358    do { \
     359        IN_BSTR const bstrInCheck = (a_bstrIn); /* type check */ \
     360        if (RT_UNLIKELY(!RT_VALID_PTR(bstrInCheck))) \
     361            return setError(E_INVALIDARG, tr("Argument %s is an invalid pointer"), #a_bstrIn); \
     362    } while (0)
     363/**
     364 * Checks that the string argument is not a NULL, a invalid pointer or an empty
     365 * string, returning E_INVALIDARG + extended error info on failure.
     366 * @param a_bstrIn  Input string argument (BSTR etc.).
     367 */
     368#define CheckComArgStrNotEmptyOrNull(a_bstrIn) \
     369    do { \
     370        IN_BSTR const bstrInCheck = (a_bstrIn); /* type check */ \
     371        if (RT_UNLIKELY(!RT_VALID_PTR(bstrInCheck) || *(bstrInCheck) == '\0')) \
     372            return setError(E_INVALIDARG, tr("Argument %s is empty or an invalid pointer"), #a_bstrIn); \
    362373    } while (0)
    363374
     
    959970     *  Stores the current data pointer in the backup area, allocates new data
    960971     *  using the copy constructor on current data and makes new data active.
     972     *
     973     *  @deprecated Use backupEx to avoid throwing wild out-of-memory exceptions.
    961974     */
    962975    void backup()
     
    969982            this->mData = pNewData;
    970983        }
     984    }
     985
     986    /**
     987     *  Stores the current data pointer in the backup area, allocates new data
     988     *  using the copy constructor on current data and makes new data active.
     989     *
     990     *  @returns S_OK, E_OUTOFMEMORY or E_FAIL (internal error).
     991     */
     992    HRESULT backupEx()
     993    {
     994        AssertMsgReturn(this->mData, ("data must not be NULL"), E_FAIL);
     995        if (this->mData && !mBackupData)
     996        {
     997            try
     998            {
     999                D *pNewData = new D(*this->mData);
     1000                mBackupData = this->mData;
     1001                this->mData = pNewData;
     1002            }
     1003            catch (std::bad_alloc &)
     1004            {
     1005                return E_OUTOFMEMORY;
     1006            }
     1007        }
     1008        return S_OK;
    9711009    }
    9721010
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