VirtualBox

Changeset 51498 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 2, 2014 6:53:08 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94109
Message:

6813 - MachineImpl use of server side wrappers + misc mods on other classes

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

Legend:

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

    r33540 r51498  
    1010
    1111/*
    12  * Copyright (C) 2006-2010 Oracle Corporation
     12 * Copyright (C) 2006-2014 Oracle Corporation
    1313 *
    1414 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5858        {
    5959            Assert(aThat);
    60             mRC = aThat->addStateDependency(taDepType, &mMachineState,
     60            mRC = aThat->i_addStateDependency(taDepType, &mMachineState,
    6161                                            &mRegistered);
    6262        }
     
    6464        {
    6565            if (SUCCEEDED(mRC))
    66                 mThat->releaseStateDependency();
     66                mThat->i_releaseStateDependency();
    6767        }
    6868
     
    7272        {
    7373            AssertReturnVoid(SUCCEEDED(mRC));
    74             mThat->releaseStateDependency();
     74            mThat->i_releaseStateDependency();
    7575            mRC = E_FAIL;
    7676        }
     
    8282        {
    8383            AssertReturnVoid(!SUCCEEDED(mRC));
    84             mRC = mThat->addStateDependency(taDepType, &mMachineState,
     84            mRC = mThat->i_addStateDependency(taDepType, &mMachineState,
    8585                                            &mRegistered);
    8686        }
  • trunk/src/VBox/Main/include/MachineImpl.h

    r51476 r51498  
    5353#include <vector>
    5454
     55#include "MachineWrap.h"
     56
    5557// defines
    5658////////////////////////////////////////////////////////////////////////////////
     
    8688// Machine class
    8789////////////////////////////////////////////////////////////////////////////////
    88 
     90//
    8991class ATL_NO_VTABLE Machine :
    90     public VirtualBoxBase,
    91     VBOX_SCRIPTABLE_IMPL(IMachine)
     92    public MachineWrap
    9293{
    93     Q_OBJECT
    9494
    9595public:
     
    340340    };
    341341
    342     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Machine, IMachine)
    343 
    344     DECLARE_NOT_AGGREGATABLE(Machine)
    345 
    346     DECLARE_PROTECT_FINAL_CONSTRUCT()
    347 
    348     BEGIN_COM_MAP(Machine)
    349         VBOX_DEFAULT_INTERFACE_ENTRIES(IMachine)
    350     END_COM_MAP()
    351 
    352342    DECLARE_EMPTY_CTOR_DTOR(Machine)
    353343
     
    381371#ifdef VBOX_WITH_RESOURCE_USAGE_API
    382372    // Needed from VirtualBox, for the delayed metrics cleanup.
    383     void unregisterMetrics(PerformanceCollector *aCollector, Machine *aMachine);
     373    void i_unregisterMetrics(PerformanceCollector *aCollector, Machine *aMachine);
    384374#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    385375
     
    388378                     const Utf8Str &strConfigFile);
    389379    HRESULT initDataAndChildObjects();
    390     HRESULT registeredInit();
    391     HRESULT tryCreateMachineConfigFile(bool fForceOverwrite);
     380    HRESULT i_registeredInit();
     381    HRESULT i_tryCreateMachineConfigFile(bool fForceOverwrite);
    392382    void uninitDataAndChildObjects();
    393383
    394384public:
    395     // IMachine properties
    396     STDMETHOD(COMGETTER(Parent))(IVirtualBox **aParent);
    397     STDMETHOD(COMGETTER(Accessible))(BOOL *aAccessible);
    398     STDMETHOD(COMGETTER(AccessError))(IVirtualBoxErrorInfo **aAccessError);
    399     STDMETHOD(COMGETTER(Name))(BSTR *aName);
    400     STDMETHOD(COMSETTER(Name))(IN_BSTR aName);
    401     STDMETHOD(COMGETTER(Description))(BSTR *aDescription);
    402     STDMETHOD(COMSETTER(Description))(IN_BSTR aDescription);
    403     STDMETHOD(COMGETTER(Id))(BSTR *aId);
    404     STDMETHOD(COMGETTER(Groups))(ComSafeArrayOut(BSTR, aGroups));
    405     STDMETHOD(COMSETTER(Groups))(ComSafeArrayIn(IN_BSTR, aGroups));
    406     STDMETHOD(COMGETTER(OSTypeId))(BSTR *aOSTypeId);
    407     STDMETHOD(COMSETTER(OSTypeId))(IN_BSTR aOSTypeId);
    408     STDMETHOD(COMGETTER(HardwareVersion))(BSTR *aVersion);
    409     STDMETHOD(COMSETTER(HardwareVersion))(IN_BSTR aVersion);
    410     STDMETHOD(COMGETTER(HardwareUUID))(BSTR *aUUID);
    411     STDMETHOD(COMSETTER(HardwareUUID))(IN_BSTR aUUID);
    412     STDMETHOD(COMGETTER(MemorySize))(ULONG *memorySize);
    413     STDMETHOD(COMSETTER(MemorySize))(ULONG memorySize);
    414     STDMETHOD(COMGETTER(CPUCount))(ULONG *cpuCount);
    415     STDMETHOD(COMSETTER(CPUCount))(ULONG cpuCount);
    416     STDMETHOD(COMGETTER(CPUHotPlugEnabled))(BOOL *enabled);
    417     STDMETHOD(COMSETTER(CPUHotPlugEnabled))(BOOL enabled);
    418     STDMETHOD(COMGETTER(CPUExecutionCap))(ULONG *aExecutionCap);
    419     STDMETHOD(COMSETTER(CPUExecutionCap))(ULONG aExecutionCap);
    420     STDMETHOD(COMGETTER(EmulatedUSBCardReaderEnabled))(BOOL *aEnabled);
    421     STDMETHOD(COMSETTER(EmulatedUSBCardReaderEnabled))(BOOL aEnabled);
    422     STDMETHOD(COMGETTER(HPETEnabled))(BOOL *enabled);
    423     STDMETHOD(COMSETTER(HPETEnabled))(BOOL enabled);
    424     STDMETHOD(COMGETTER(MemoryBalloonSize))(ULONG *memoryBalloonSize);
    425     STDMETHOD(COMSETTER(MemoryBalloonSize))(ULONG memoryBalloonSize);
    426     STDMETHOD(COMGETTER(PageFusionEnabled))(BOOL *enabled);
    427     STDMETHOD(COMSETTER(PageFusionEnabled))(BOOL enabled);
    428     STDMETHOD(COMGETTER(GraphicsControllerType))(GraphicsControllerType_T *aGraphicsController);
    429     STDMETHOD(COMSETTER(GraphicsControllerType))(GraphicsControllerType_T aGraphicsController);
    430     STDMETHOD(COMGETTER(VRAMSize))(ULONG *memorySize);
    431     STDMETHOD(COMSETTER(VRAMSize))(ULONG memorySize);
    432     STDMETHOD(COMGETTER(Accelerate3DEnabled))(BOOL *aEnabled);
    433     STDMETHOD(COMSETTER(Accelerate3DEnabled))(BOOL aEnabled);
    434     STDMETHOD(COMGETTER(Accelerate2DVideoEnabled))(BOOL *aEnabled);
    435     STDMETHOD(COMSETTER(Accelerate2DVideoEnabled))(BOOL aEnabled);
    436     STDMETHOD(COMGETTER(MonitorCount))(ULONG *monitorCount);
    437     STDMETHOD(COMSETTER(MonitorCount))(ULONG monitorCount);
    438     STDMETHOD(COMGETTER(VideoCaptureEnabled))(BOOL *u8VideoRecEnabled);
    439     STDMETHOD(COMSETTER(VideoCaptureEnabled))(BOOL  u8VideoRecEnabled);
    440     STDMETHOD(COMGETTER(VideoCaptureScreens))(ComSafeArrayOut(BOOL, aScreens));
    441     STDMETHOD(COMSETTER(VideoCaptureScreens))(ComSafeArrayIn(BOOL, aScreens));
    442     STDMETHOD(COMGETTER(VideoCaptureFile))(BSTR * ppChVideoRecFilename);
    443     STDMETHOD(COMSETTER(VideoCaptureFile))(IN_BSTR pChVideoRecFilename);
    444     STDMETHOD(COMGETTER(VideoCaptureWidth))(ULONG *aHorzRes);
    445     STDMETHOD(COMSETTER(VideoCaptureWidth))(ULONG aorzRes);
    446     STDMETHOD(COMGETTER(VideoCaptureHeight))(ULONG *aVertRes);
    447     STDMETHOD(COMSETTER(VideoCaptureHeight))(ULONG aVertRes);
    448     STDMETHOD(COMGETTER(VideoCaptureRate))(ULONG *aRate);
    449     STDMETHOD(COMSETTER(VideoCaptureRate))(ULONG aRate);
    450     STDMETHOD(COMGETTER(VideoCaptureFPS))(ULONG *aFPS);
    451     STDMETHOD(COMSETTER(VideoCaptureFPS))(ULONG aFPS);
    452     STDMETHOD(COMGETTER(BIOSSettings))(IBIOSSettings **biosSettings);
    453     STDMETHOD(COMGETTER(SnapshotFolder))(BSTR *aSavedStateFolder);
    454     STDMETHOD(COMSETTER(SnapshotFolder))(IN_BSTR aSavedStateFolder);
    455     STDMETHOD(COMGETTER(MediumAttachments))(ComSafeArrayOut(IMediumAttachment *, aAttachments));
    456     STDMETHOD(COMGETTER(VRDEServer))(IVRDEServer **vrdeServer);
    457     STDMETHOD(COMGETTER(AudioAdapter))(IAudioAdapter **audioAdapter);
    458     STDMETHOD(COMGETTER(USBControllers))(ComSafeArrayOut(IUSBController *, aUSBControllers));
    459     STDMETHOD(COMGETTER(USBDeviceFilters))(IUSBDeviceFilters * *aUSBDeviceFilters);
    460     STDMETHOD(COMGETTER(SettingsFilePath))(BSTR *aFilePath);
    461     STDMETHOD(COMGETTER(SettingsModified))(BOOL *aModified);
    462     STDMETHOD(COMGETTER(SessionState))(SessionState_T *aSessionState);
    463     STDMETHOD(COMGETTER(SessionType))(BSTR *aSessionType);
    464     STDMETHOD(COMGETTER(SessionPID))(ULONG *aSessionPID);
    465     STDMETHOD(COMGETTER(State))(MachineState_T *machineState);
    466     STDMETHOD(COMGETTER(LastStateChange))(LONG64 *aLastStateChange);
    467     STDMETHOD(COMGETTER(StateFilePath))(BSTR *aStateFilePath);
    468     STDMETHOD(COMGETTER(LogFolder))(BSTR *aLogFolder);
    469     STDMETHOD(COMGETTER(CurrentSnapshot))(ISnapshot **aCurrentSnapshot);
    470     STDMETHOD(COMGETTER(SnapshotCount))(ULONG *aSnapshotCount);
    471     STDMETHOD(COMGETTER(CurrentStateModified))(BOOL *aCurrentStateModified);
    472     STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders));
    473     STDMETHOD(COMGETTER(ClipboardMode))(ClipboardMode_T *aClipboardMode);
    474     STDMETHOD(COMSETTER(ClipboardMode))(ClipboardMode_T aClipboardMode);
    475     STDMETHOD(COMGETTER(DnDMode))(DnDMode_T *aDnDMode);
    476     STDMETHOD(COMSETTER(DnDMode))(DnDMode_T aDnDMode);
    477     STDMETHOD(COMGETTER(GuestPropertyNotificationPatterns))(BSTR *aPattern);
    478     STDMETHOD(COMSETTER(GuestPropertyNotificationPatterns))(IN_BSTR aPattern);
    479     STDMETHOD(COMGETTER(StorageControllers))(ComSafeArrayOut(IStorageController *, aStorageControllers));
    480     STDMETHOD(COMGETTER(TeleporterEnabled))(BOOL *aEnabled);
    481     STDMETHOD(COMSETTER(TeleporterEnabled))(BOOL aEnabled);
    482     STDMETHOD(COMGETTER(TeleporterPort))(ULONG *aPort);
    483     STDMETHOD(COMSETTER(TeleporterPort))(ULONG aPort);
    484     STDMETHOD(COMGETTER(TeleporterAddress))(BSTR *aAddress);
    485     STDMETHOD(COMSETTER(TeleporterAddress))(IN_BSTR aAddress);
    486     STDMETHOD(COMGETTER(TeleporterPassword))(BSTR *aPassword);
    487     STDMETHOD(COMSETTER(TeleporterPassword))(IN_BSTR aPassword);
    488     STDMETHOD(COMGETTER(FaultToleranceState))(FaultToleranceState_T *aEnabled);
    489     STDMETHOD(COMSETTER(FaultToleranceState))(FaultToleranceState_T aEnabled);
    490     STDMETHOD(COMGETTER(FaultToleranceAddress))(BSTR *aAddress);
    491     STDMETHOD(COMSETTER(FaultToleranceAddress))(IN_BSTR aAddress);
    492     STDMETHOD(COMGETTER(FaultTolerancePort))(ULONG *aPort);
    493     STDMETHOD(COMSETTER(FaultTolerancePort))(ULONG aPort);
    494     STDMETHOD(COMGETTER(FaultTolerancePassword))(BSTR *aPassword);
    495     STDMETHOD(COMSETTER(FaultTolerancePassword))(IN_BSTR aPassword);
    496     STDMETHOD(COMGETTER(FaultToleranceSyncInterval))(ULONG *aInterval);
    497     STDMETHOD(COMSETTER(FaultToleranceSyncInterval))(ULONG aInterval);
    498     STDMETHOD(COMGETTER(RTCUseUTC))(BOOL *aEnabled);
    499     STDMETHOD(COMSETTER(RTCUseUTC))(BOOL aEnabled);
    500     STDMETHOD(COMGETTER(FirmwareType))(FirmwareType_T *aFirmware);
    501     STDMETHOD(COMSETTER(FirmwareType))(FirmwareType_T  aFirmware);
    502     STDMETHOD(COMGETTER(KeyboardHIDType))(KeyboardHIDType_T *aKeyboardHIDType);
    503     STDMETHOD(COMSETTER(KeyboardHIDType))(KeyboardHIDType_T  aKeyboardHIDType);
    504     STDMETHOD(COMGETTER(PointingHIDType))(PointingHIDType_T *aPointingHIDType);
    505     STDMETHOD(COMSETTER(PointingHIDType))(PointingHIDType_T  aPointingHIDType);
    506     STDMETHOD(COMGETTER(ChipsetType))(ChipsetType_T *aChipsetType);
    507     STDMETHOD(COMSETTER(ChipsetType))(ChipsetType_T  aChipsetType);
    508     STDMETHOD(COMGETTER(ParavirtProvider))(ParavirtProvider_T *aParavirtProvider);
    509     STDMETHOD(COMSETTER(ParavirtProvider))(ParavirtProvider_T  aParavirtProvider);
    510     STDMETHOD(COMGETTER(IOCacheEnabled))(BOOL *aEnabled);
    511     STDMETHOD(COMSETTER(IOCacheEnabled))(BOOL  aEnabled);
    512     STDMETHOD(COMGETTER(IOCacheSize))(ULONG *aIOCacheSize);
    513     STDMETHOD(COMSETTER(IOCacheSize))(ULONG  aIOCacheSize);
    514     STDMETHOD(COMGETTER(PCIDeviceAssignments))(ComSafeArrayOut(IPCIDeviceAttachment *, aAssignments));
    515     STDMETHOD(COMGETTER(BandwidthControl))(IBandwidthControl **aBandwidthControl);
    516     STDMETHOD(COMGETTER(TracingEnabled))(BOOL *pfEnabled);
    517     STDMETHOD(COMSETTER(TracingEnabled))(BOOL fEnabled);
    518     STDMETHOD(COMGETTER(TracingConfig))(BSTR *pbstrConfig);
    519     STDMETHOD(COMSETTER(TracingConfig))(IN_BSTR bstrConfig);
    520     STDMETHOD(COMGETTER(AllowTracingToAccessVM))(BOOL *pfAllow);
    521     STDMETHOD(COMSETTER(AllowTracingToAccessVM))(BOOL fAllow);
    522     STDMETHOD(COMGETTER(AutostartEnabled))(BOOL *pfEnabled);
    523     STDMETHOD(COMSETTER(AutostartEnabled))(BOOL fEnabled);
    524     STDMETHOD(COMGETTER(AutostartDelay))(ULONG *puDelay);
    525     STDMETHOD(COMSETTER(AutostartDelay))(ULONG uDelay);
    526     STDMETHOD(COMGETTER(AutostopType))(AutostopType_T *penmAutostopType);
    527     STDMETHOD(COMSETTER(AutostopType))(AutostopType_T enmAutostopType);
    528     STDMETHOD(COMGETTER(DefaultFrontend))(BSTR *aDefaultFrontend);
    529     STDMETHOD(COMSETTER(DefaultFrontend))(IN_BSTR aDefaultFrontend);
    530     STDMETHOD(COMGETTER(Icon))(ComSafeArrayOut(BYTE, aIcon));
    531     STDMETHOD(COMSETTER(Icon))(ComSafeArrayIn(BYTE, aIcon));
    532     STDMETHOD(COMGETTER(USBProxyAvailable))(BOOL *aAvailable);
    533 
    534     // IMachine methods
    535     STDMETHOD(LockMachine)(ISession *aSession, LockType_T lockType);
    536     STDMETHOD(LaunchVMProcess)(ISession *aSession,  IN_BSTR aType, IN_BSTR aEnvironment, IProgress **aProgress);
    537 
    538     STDMETHOD(SetBootOrder)(ULONG aPosition, DeviceType_T aDevice);
    539     STDMETHOD(GetBootOrder)(ULONG aPosition, DeviceType_T *aDevice);
    540     STDMETHOD(AttachDeviceWithoutMedium)(IN_BSTR aControllerName, LONG aControllerPort,
    541                                         LONG aDevice, DeviceType_T aType);
    542     STDMETHOD(AttachDevice)(IN_BSTR aControllerName, LONG aControllerPort,
    543                             LONG aDevice, DeviceType_T aType, IMedium *aMedium);
    544     STDMETHOD(DetachDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice);
    545     STDMETHOD(PassthroughDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aPassthrough);
    546     STDMETHOD(TemporaryEjectDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aTempEject);
    547     STDMETHOD(NonRotationalDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aNonRotational);
    548     STDMETHOD(SetAutoDiscardForDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aDiscard);
    549     STDMETHOD(SetHotPluggableForDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aHotPluggable);
    550     STDMETHOD(SetNoBandwidthGroupForDevice)(IN_BSTR aControllerName, LONG aControllerPort,
    551                                             LONG aDevice);
    552     STDMETHOD(SetBandwidthGroupForDevice)(IN_BSTR aControllerName, LONG aControllerPort,
    553                                           LONG aDevice, IBandwidthGroup *aBandwidthGroup);
    554     STDMETHOD(MountMedium)(IN_BSTR aControllerName, LONG aControllerPort,
    555                            LONG aDevice, IMedium *aMedium, BOOL aForce);
    556     STDMETHOD(UnmountMedium)(IN_BSTR aControllerName, LONG aControllerPort,
    557                              LONG aDevice, BOOL aForce);
    558     STDMETHOD(GetMedium)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice,
    559                          IMedium **aMedium);
    560     STDMETHOD(GetSerialPort)(ULONG slot, ISerialPort **port);
    561     STDMETHOD(GetParallelPort)(ULONG slot, IParallelPort **port);
    562     STDMETHOD(GetNetworkAdapter)(ULONG slot, INetworkAdapter **adapter);
    563     STDMETHOD(GetExtraDataKeys)(ComSafeArrayOut(BSTR, aKeys));
    564     STDMETHOD(GetExtraData)(IN_BSTR aKey, BSTR *aValue);
    565     STDMETHOD(SetExtraData)(IN_BSTR aKey, IN_BSTR aValue);
    566     STDMETHOD(GetCPUProperty)(CPUPropertyType_T property, BOOL *aVal);
    567     STDMETHOD(SetCPUProperty)(CPUPropertyType_T property, BOOL aVal);
    568     STDMETHOD(GetCPUIDLeaf)(ULONG id, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx);
    569     STDMETHOD(SetCPUIDLeaf)(ULONG id, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx);
    570     STDMETHOD(RemoveCPUIDLeaf)(ULONG id);
    571     STDMETHOD(RemoveAllCPUIDLeaves)();
    572     STDMETHOD(GetHWVirtExProperty)(HWVirtExPropertyType_T property, BOOL *aVal);
    573     STDMETHOD(SetHWVirtExProperty)(HWVirtExPropertyType_T property, BOOL aVal);
    574     STDMETHOD(SetSettingsFilePath)(IN_BSTR aFilePath, IProgress **aProgress);
    575     STDMETHOD(SaveSettings)();
    576     STDMETHOD(DiscardSettings)();
    577     STDMETHOD(Unregister)(CleanupMode_T cleanupMode, ComSafeArrayOut(IMedium*, aMedia));
    578     STDMETHOD(DeleteConfig)(ComSafeArrayIn(IMedium*, aMedia), IProgress **aProgress);
    579     STDMETHOD(ExportTo)(IAppliance *aAppliance, IN_BSTR location, IVirtualSystemDescription **aDescription);
    580     STDMETHOD(FindSnapshot)(IN_BSTR aNameOrId, ISnapshot **aSnapshot);
    581     STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount);
    582     STDMETHOD(RemoveSharedFolder)(IN_BSTR aName);
    583     STDMETHOD(CanShowConsoleWindow)(BOOL *aCanShow);
    584     STDMETHOD(ShowConsoleWindow)(LONG64 *aWinId);
    585     STDMETHOD(GetGuestProperty)(IN_BSTR aName, BSTR *aValue, LONG64 *aTimestamp, BSTR *aFlags);
    586     STDMETHOD(GetGuestPropertyValue)(IN_BSTR aName, BSTR *aValue);
    587     STDMETHOD(GetGuestPropertyTimestamp)(IN_BSTR aName, LONG64 *aTimestamp);
    588     STDMETHOD(SetGuestProperty)(IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags);
    589     STDMETHOD(SetGuestPropertyValue)(IN_BSTR aName, IN_BSTR aValue);
    590     STDMETHOD(DeleteGuestProperty)(IN_BSTR aName);
    591     STDMETHOD(EnumerateGuestProperties)(IN_BSTR aPattern, ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(LONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags));
    592     STDMETHOD(GetMediumAttachmentsOfController)(IN_BSTR aName, ComSafeArrayOut(IMediumAttachment *, aAttachments));
    593     STDMETHOD(GetMediumAttachment)(IN_BSTR aConstrollerName, LONG aControllerPort, LONG aDevice, IMediumAttachment **aAttachment);
    594     STDMETHOD(AddStorageController)(IN_BSTR aName, StorageBus_T aConnectionType, IStorageController **controller);
    595     STDMETHOD(RemoveStorageController(IN_BSTR aName));
    596     STDMETHOD(GetStorageControllerByName(IN_BSTR aName, IStorageController **storageController));
    597     STDMETHOD(GetStorageControllerByInstance(ULONG aInstance, IStorageController **storageController));
    598     STDMETHOD(SetStorageControllerBootable)(IN_BSTR aName, BOOL fBootable);
    599     STDMETHOD(AddUSBController)(IN_BSTR aName, USBControllerType_T aConnectionType, IUSBController **controller);
    600     STDMETHOD(RemoveUSBController(IN_BSTR aName));
    601     STDMETHOD(GetUSBControllerByName(IN_BSTR aName, IUSBController **usbController));
    602     STDMETHOD(GetUSBControllerCountByType(USBControllerType_T aType, ULONG *aControllers));
    603     STDMETHOD(QuerySavedGuestScreenInfo)(ULONG uScreenId, ULONG *puOriginX, ULONG *puOriginY, ULONG *puWidth, ULONG *puHeight, BOOL *pfEnabled);
    604     STDMETHOD(QuerySavedThumbnailSize)(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight);
    605     STDMETHOD(ReadSavedThumbnailToArray)(ULONG aScreenId, BOOL aBGR, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
    606     STDMETHOD(ReadSavedThumbnailPNGToArray)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
    607     STDMETHOD(QuerySavedScreenshotPNGSize)(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight);
    608     STDMETHOD(ReadSavedScreenshotPNGToArray)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
    609     STDMETHOD(HotPlugCPU(ULONG aCpu));
    610     STDMETHOD(HotUnplugCPU(ULONG aCpu));
    611     STDMETHOD(GetCPUStatus(ULONG aCpu, BOOL *aCpuAttached));
    612     STDMETHOD(QueryLogFilename(ULONG aIdx, BSTR *aName));
    613     STDMETHOD(ReadLog(ULONG aIdx, LONG64 aOffset, LONG64 aSize, ComSafeArrayOut(BYTE, aData)));
    614     STDMETHOD(AttachHostPCIDevice(LONG hostAddress, LONG desiredGuestAddress, BOOL tryToUnbind));
    615     STDMETHOD(DetachHostPCIDevice(LONG hostAddress));
    616     STDMETHOD(CloneTo(IMachine *pTarget, CloneMode_T mode, ComSafeArrayIn(CloneOptions_T, options), IProgress **pProgress));
     385
     386
    617387    // public methods only for internal purposes
    618388
    619     virtual bool isSnapshotMachine() const
     389    virtual bool i_isSnapshotMachine() const
    620390    {
    621391        return false;
    622392    }
    623393
    624     virtual bool isSessionMachine() const
     394    virtual bool i_isSessionMachine() const
    625395    {
    626396        return false;
     
    639409    //  that use it. Note: they should enter Machine lock to keep the returned
    640410    //  information valid!
    641     bool isRegistered() { return !!mData->mRegistered; }
     411    bool i_isRegistered() { return !!mData->mRegistered; }
    642412
    643413    // unsafe inline public methods for internal purposes only (ensure there is
     
    651421     * one) or after doing addCaller() manually.
    652422     */
    653     VirtualBox* getVirtualBox() const { return mParent; }
     423    VirtualBox* i_getVirtualBox() const { return mParent; }
    654424
    655425    /**
     
    661431     * one) or after doing addCaller() manually.
    662432     */
    663     bool isAccessible() const { return !!mData->mAccessible; }
     433    bool i_isAccessible() const { return !!mData->mAccessible; }
    664434
    665435    /**
     
    670440     * one) or after adding a caller manually.
    671441     */
    672     const Guid& getId() const { return mData->mUuid; }
     442    const Guid& i_getId() const { return mData->mUuid; }
    673443
    674444    /**
     
    680450     * one) or after adding a caller manually.
    681451     */
    682     inline const Guid& getSnapshotId() const;
     452    inline const Guid& i_getSnapshotId() const;
    683453
    684454    /**
     
    689459     * for reading.
    690460     */
    691     const Utf8Str& getSettingsFileFull() const { return mData->m_strConfigFileFull; }
     461    const Utf8Str& i_getSettingsFileFull() const { return mData->m_strConfigFileFull; }
    692462
    693463    /**
     
    698468     * for reading.
    699469     */
    700     const Utf8Str& getName() const { return mUserData->s.strName; }
     470    const Utf8Str& i_getName() const { return mUserData->s.strName; }
    701471
    702472    enum
     
    723493     * for reading.
    724494     */
    725     ChipsetType_T getChipsetType() const { return mHWData->mChipsetType; }
    726     ParavirtProvider_T getParavirtProvider() const { return mHWData->mParavirtProvider; }
    727 
    728     void setModified(uint32_t fl, bool fAllowStateModification = true);
    729     void setModifiedLock(uint32_t fl, bool fAllowStateModification = true);
    730 
    731     bool isStateModificationAllowed() const { return mData->m_fAllowStateModification; }
    732     void allowStateModification()           { mData->m_fAllowStateModification = true; }
    733     void disallowStateModification()        { mData->m_fAllowStateModification = false; }
    734 
    735     const StringsList &getGroups() const { return mUserData->s.llGroups; }
     495    ChipsetType_T i_getChipsetType() const { return mHWData->mChipsetType; }
     496    ParavirtProvider_T i_getParavirtProvider() const { return mHWData->mParavirtProvider; }
     497
     498    void i_setModified(uint32_t fl, bool fAllowStateModification = true);
     499    void i_setModifiedLock(uint32_t fl, bool fAllowStateModification = true);
     500
     501    bool i_isStateModificationAllowed() const { return mData->m_fAllowStateModification; }
     502    void i_allowStateModification()           { mData->m_fAllowStateModification = true; }
     503    void i_disallowStateModification()        { mData->m_fAllowStateModification = false; }
     504
     505    const StringsList &i_getGroups() const { return mUserData->s.llGroups; }
    736506
    737507    // callback handlers
    738     virtual HRESULT onNetworkAdapterChange(INetworkAdapter * /* networkAdapter */, BOOL /* changeAdapter */) { return S_OK; }
    739     virtual HRESULT onNATRedirectRuleChange(ULONG /* slot */, BOOL /* fRemove */ , IN_BSTR /* name */,
    740                                  NATProtocol_T /* protocol */, IN_BSTR /* host ip */, LONG /* host port */, IN_BSTR /* guest port */, LONG /* guest port */ ) { return S_OK; }
    741     virtual HRESULT onSerialPortChange(ISerialPort * /* serialPort */) { return S_OK; }
    742     virtual HRESULT onParallelPortChange(IParallelPort * /* parallelPort */) { return S_OK; }
    743     virtual HRESULT onVRDEServerChange(BOOL /* aRestart */) { return S_OK; }
    744     virtual HRESULT onUSBControllerChange() { return S_OK; }
    745     virtual HRESULT onStorageControllerChange() { return S_OK; }
    746     virtual HRESULT onCPUChange(ULONG /* aCPU */, BOOL /* aRemove */) { return S_OK; }
    747     virtual HRESULT onCPUExecutionCapChange(ULONG /* aExecutionCap */) { return S_OK; }
    748     virtual HRESULT onMediumChange(IMediumAttachment * /* mediumAttachment */, BOOL /* force */) { return S_OK; }
    749     virtual HRESULT onSharedFolderChange() { return S_OK; }
    750     virtual HRESULT onClipboardModeChange(ClipboardMode_T /* aClipboardMode */) { return S_OK; }
    751     virtual HRESULT onDnDModeChange(DnDMode_T /* aDnDMode */) { return S_OK; }
    752     virtual HRESULT onBandwidthGroupChange(IBandwidthGroup * /* aBandwidthGroup */) { return S_OK; }
    753     virtual HRESULT onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */, BOOL /* silent */) { return S_OK; }
    754     virtual HRESULT onVideoCaptureChange() { return S_OK; }
    755 
    756     HRESULT saveRegistryEntry(settings::MachineRegistryEntry &data);
    757 
    758     int calculateFullPath(const Utf8Str &strPath, Utf8Str &aResult);
    759     void copyPathRelativeToMachine(const Utf8Str &strSource, Utf8Str &strTarget);
    760 
    761     void getLogFolder(Utf8Str &aLogFolder);
    762     Utf8Str queryLogFilename(ULONG idx);
    763 
    764     void composeSavedStateFilename(Utf8Str &strStateFilePath);
    765 
    766     void getDefaultVideoCaptureFile(Utf8Str &strFile);
    767 
    768     bool isUSBControllerPresent();
    769 
    770     HRESULT launchVMProcess(IInternalSessionControl *aControl,
    771                             const Utf8Str &strType,
    772                             const Utf8Str &strEnvironment,
    773                             ProgressProxy *aProgress);
    774 
    775     HRESULT getDirectControl(ComPtr<IInternalSessionControl> *directControl)
     508    virtual HRESULT i_onNetworkAdapterChange(INetworkAdapter * /* networkAdapter */, BOOL /* changeAdapter */) { return S_OK; }
     509    virtual HRESULT i_onNATRedirectRuleChange(ULONG /* slot */, BOOL /* fRemove */ , IN_BSTR /* name */,
     510                                              NATProtocol_T /* protocol */, IN_BSTR /* host ip */, LONG /* host port */,
     511                                              IN_BSTR /* guest port */, LONG /* guest port */ ) { return S_OK; }
     512    virtual HRESULT i_onSerialPortChange(ISerialPort * /* serialPort */) { return S_OK; }
     513    virtual HRESULT i_onParallelPortChange(IParallelPort * /* parallelPort */) { return S_OK; }
     514    virtual HRESULT i_onVRDEServerChange(BOOL /* aRestart */) { return S_OK; }
     515    virtual HRESULT i_onUSBControllerChange() { return S_OK; }
     516    virtual HRESULT i_onStorageControllerChange() { return S_OK; }
     517    virtual HRESULT i_onCPUChange(ULONG /* aCPU */, BOOL /* aRemove */) { return S_OK; }
     518    virtual HRESULT i_onCPUExecutionCapChange(ULONG /* aExecutionCap */) { return S_OK; }
     519    virtual HRESULT i_onMediumChange(IMediumAttachment * /* mediumAttachment */, BOOL /* force */) { return S_OK; }
     520    virtual HRESULT i_onSharedFolderChange() { return S_OK; }
     521    virtual HRESULT i_onClipboardModeChange(ClipboardMode_T /* aClipboardMode */) { return S_OK; }
     522    virtual HRESULT i_onDnDModeChange(DnDMode_T /* aDnDMode */) { return S_OK; }
     523    virtual HRESULT i_onBandwidthGroupChange(IBandwidthGroup * /* aBandwidthGroup */) { return S_OK; }
     524    virtual HRESULT i_onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */,
     525                                            BOOL /* silent */) { return S_OK; }
     526    virtual HRESULT i_onVideoCaptureChange() { return S_OK; }
     527
     528    HRESULT i_saveRegistryEntry(settings::MachineRegistryEntry &data);
     529
     530    int i_calculateFullPath(const Utf8Str &strPath, Utf8Str &aResult);
     531    void i_copyPathRelativeToMachine(const Utf8Str &strSource, Utf8Str &strTarget);
     532
     533    void i_getLogFolder(Utf8Str &aLogFolder);
     534    Utf8Str i_queryLogFilename(ULONG idx);
     535
     536    void i_composeSavedStateFilename(Utf8Str &strStateFilePath);
     537
     538    void i_getDefaultVideoCaptureFile(Utf8Str &strFile);
     539
     540    bool i_isUSBControllerPresent();
     541
     542    HRESULT i_launchVMProcess(IInternalSessionControl *aControl,
     543                              const Utf8Str &strType,
     544                              const Utf8Str &strEnvironment,
     545                              ProgressProxy *aProgress);
     546
     547    HRESULT i_getDirectControl(ComPtr<IInternalSessionControl> *directControl)
    776548    {
    777549        HRESULT rc;
     
    786558    }
    787559
    788     bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
    789                        ComPtr<IInternalSessionControl> *aControl = NULL,
    790                        bool aAllowClosing = false);
    791     bool isSessionSpawning();
    792 
    793     bool isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,
    794                                 ComPtr<IInternalSessionControl> *aControl = NULL)
    795     { return isSessionOpen(aMachine, aControl, true /* aAllowClosing */); }
    796 
    797     bool checkForSpawnFailure();
    798 
    799     HRESULT prepareRegister();
    800 
    801     HRESULT getSharedFolder(CBSTR aName,
    802                             ComObjPtr<SharedFolder> &aSharedFolder,
    803                             bool aSetError = false)
     560    bool i_isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
     561                         ComPtr<IInternalSessionControl> *aControl = NULL,
     562                         bool aAllowClosing = false);
     563    bool i_isSessionSpawning();
     564
     565    bool i_isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,
     566                                  ComPtr<IInternalSessionControl> *aControl = NULL)
     567    { return i_isSessionOpen(aMachine, aControl, true /* aAllowClosing */); }
     568
     569    bool i_checkForSpawnFailure();
     570
     571    HRESULT i_prepareRegister();
     572
     573    HRESULT i_getSharedFolder(CBSTR aName,
     574                              ComObjPtr<SharedFolder> &aSharedFolder,
     575                              bool aSetError = false)
    804576    {
    805577        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    806         return findSharedFolder(aName, aSharedFolder, aSetError);
     578        return i_findSharedFolder(aName, aSharedFolder, aSetError);
    807579    }
    808580
    809     HRESULT addStateDependency(StateDependency aDepType = AnyStateDep,
    810                                MachineState_T *aState = NULL,
    811                                BOOL *aRegistered = NULL);
    812     void releaseStateDependency();
    813 
    814     HRESULT getBandwidthGroup(const Utf8Str &strBandwidthGroup,
    815                               ComObjPtr<BandwidthGroup> &pBandwidthGroup,
    816                               bool fSetError = false)
     581    HRESULT i_addStateDependency(StateDependency aDepType = AnyStateDep,
     582                                 MachineState_T *aState = NULL,
     583                                 BOOL *aRegistered = NULL);
     584    void i_releaseStateDependency();
     585
     586    HRESULT i_getBandwidthGroup(const Utf8Str &strBandwidthGroup,
     587                                ComObjPtr<BandwidthGroup> &pBandwidthGroup,
     588                                bool fSetError = false)
    817589    {
    818590        return mBandwidthControl->i_getBandwidthGroupByName(strBandwidthGroup,
     
    821593    }
    822594
     595
     596
    823597protected:
    824598
    825599    class ClientToken;
    826600
    827     HRESULT checkStateDependency(StateDependency aDepType);
    828 
    829     Machine *getMachine();
    830 
    831     void ensureNoStateDependencies();
    832 
    833     virtual HRESULT setMachineState(MachineState_T aMachineState);
    834 
    835     HRESULT findSharedFolder(const Utf8Str &aName,
    836                              ComObjPtr<SharedFolder> &aSharedFolder,
    837                              bool aSetError = false);
    838 
    839     HRESULT loadSettings(bool aRegistered);
    840     HRESULT loadMachineDataFromSettings(const settings::MachineConfigFile &config,
    841                                         const Guid *puuidRegistry);
    842     HRESULT loadSnapshot(const settings::Snapshot &data,
    843                          const Guid &aCurSnapshotId,
    844                          Snapshot *aParentSnapshot);
    845     HRESULT loadHardware(const settings::Hardware &data, const settings::Debugging *pDbg,
    846                          const settings::Autostart *pAutostart);
    847     HRESULT loadDebugging(const settings::Debugging *pDbg);
    848     HRESULT loadAutostart(const settings::Autostart *pAutostart);
    849     HRESULT loadStorageControllers(const settings::Storage &data,
    850                                    const Guid *puuidRegistry,
    851                                    const Guid *puuidSnapshot);
    852     HRESULT loadStorageDevices(StorageController *aStorageController,
    853                                const settings::StorageController &data,
    854                                const Guid *puuidRegistry,
    855                                const Guid *puuidSnapshot);
    856 
    857     HRESULT findSnapshotById(const Guid &aId,
    858                              ComObjPtr<Snapshot> &aSnapshot,
    859                              bool aSetError = false);
    860     HRESULT findSnapshotByName(const Utf8Str &strName,
     601    HRESULT i_checkStateDependency(StateDependency aDepType);
     602
     603    Machine *i_getMachine();
     604
     605    void i_ensureNoStateDependencies();
     606
     607    virtual HRESULT i_setMachineState(MachineState_T aMachineState);
     608
     609    HRESULT i_findSharedFolder(const Utf8Str &aName,
     610                               ComObjPtr<SharedFolder> &aSharedFolder,
     611                               bool aSetError = false);
     612
     613    HRESULT i_loadSettings(bool aRegistered);
     614    HRESULT i_loadMachineDataFromSettings(const settings::MachineConfigFile &config,
     615                                          const Guid *puuidRegistry);
     616    HRESULT i_loadSnapshot(const settings::Snapshot &data,
     617                           const Guid &aCurSnapshotId,
     618                           Snapshot *aParentSnapshot);
     619    HRESULT i_loadHardware(const settings::Hardware &data, const settings::Debugging *pDbg,
     620                           const settings::Autostart *pAutostart);
     621    HRESULT i_loadDebugging(const settings::Debugging *pDbg);
     622    HRESULT i_loadAutostart(const settings::Autostart *pAutostart);
     623    HRESULT i_loadStorageControllers(const settings::Storage &data,
     624                                     const Guid *puuidRegistry,
     625                                     const Guid *puuidSnapshot);
     626    HRESULT i_loadStorageDevices(StorageController *aStorageController,
     627                                 const settings::StorageController &data,
     628                                 const Guid *puuidRegistry,
     629                                 const Guid *puuidSnapshot);
     630
     631    HRESULT i_findSnapshotById(const Guid &aId,
    861632                               ComObjPtr<Snapshot> &aSnapshot,
    862633                               bool aSetError = false);
    863 
    864     HRESULT getStorageControllerByName(const Utf8Str &aName,
    865                                        ComObjPtr<StorageController> &aStorageController,
    866                                        bool aSetError = false);
    867 
    868     HRESULT getMediumAttachmentsOfController(CBSTR aName,
    869                                              MediaData::AttachmentList &aAttachments);
    870 
    871     HRESULT getUSBControllerByName(const Utf8Str &aName,
    872                                    ComObjPtr<USBController> &aUSBController,
    873                                    bool aSetError = false);
    874 
    875     ULONG   getUSBControllerCountByType(USBControllerType_T enmType);
     634    HRESULT i_findSnapshotByName(const Utf8Str &strName,
     635                                 ComObjPtr<Snapshot> &aSnapshot,
     636                                 bool aSetError = false);
     637
     638    HRESULT i_getStorageControllerByName(const Utf8Str &aName,
     639                                         ComObjPtr<StorageController> &aStorageController,
     640                                         bool aSetError = false);
     641
     642    HRESULT i_getMediumAttachmentsOfController(const Utf8Str &aName,
     643                                               MediaData::AttachmentList &aAttachments);
     644
     645    HRESULT i_getUSBControllerByName(const Utf8Str &aName,
     646                                     ComObjPtr<USBController> &aUSBController,
     647                                     bool aSetError = false);
     648
     649    ULONG   i_getUSBControllerCountByType(USBControllerType_T enmType);
    876650
    877651    enum
     
    887661    };
    888662
    889     HRESULT prepareSaveSettings(bool *pfNeedsGlobalSaveSettings);
    890     HRESULT saveSettings(bool *pfNeedsGlobalSaveSettings, int aFlags = 0);
    891 
    892     void copyMachineDataToSettings(settings::MachineConfigFile &config);
    893     HRESULT saveAllSnapshots(settings::MachineConfigFile &config);
    894     HRESULT saveHardware(settings::Hardware &data, settings::Debugging *pDbg,
    895                          settings::Autostart *pAutostart);
    896     HRESULT saveStorageControllers(settings::Storage &data);
    897     HRESULT saveStorageDevices(ComObjPtr<StorageController> aStorageController,
    898                                settings::StorageController &data);
    899     HRESULT saveStateSettings(int aFlags);
    900 
    901     void addMediumToRegistry(ComObjPtr<Medium> &pMedium);
    902 
    903     HRESULT createImplicitDiffs(IProgress *aProgress,
    904                                 ULONG aWeight,
    905                                 bool aOnline);
    906     HRESULT deleteImplicitDiffs(bool aOnline);
    907 
    908     MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
    909                                      IN_BSTR aControllerName,
    910                                      LONG aControllerPort,
    911                                      LONG aDevice);
    912     MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
    913                                      ComObjPtr<Medium> pMedium);
    914     MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
    915                                      Guid &id);
    916 
    917     HRESULT detachDevice(MediumAttachment *pAttach,
    918                          AutoWriteLock &writeLock,
    919                          Snapshot *pSnapshot);
    920 
    921     HRESULT detachAllMedia(AutoWriteLock &writeLock,
    922                            Snapshot *pSnapshot,
    923                            CleanupMode_T cleanupMode,
    924                            MediaList &llMedia);
    925 
    926     void commitMedia(bool aOnline = false);
    927     void rollbackMedia();
    928 
    929     bool isInOwnDir(Utf8Str *aSettingsDir = NULL) const;
    930 
    931     void rollback(bool aNotify);
    932     void commit();
    933     void copyFrom(Machine *aThat);
    934     bool isControllerHotplugCapable(StorageControllerType_T enmCtrlType);
     663    HRESULT i_prepareSaveSettings(bool *pfNeedsGlobalSaveSettings);
     664    HRESULT i_saveSettings(bool *pfNeedsGlobalSaveSettings, int aFlags = 0);
     665
     666    void i_copyMachineDataToSettings(settings::MachineConfigFile &config);
     667    HRESULT i_saveAllSnapshots(settings::MachineConfigFile &config);
     668    HRESULT i_saveHardware(settings::Hardware &data, settings::Debugging *pDbg,
     669                           settings::Autostart *pAutostart);
     670    HRESULT i_saveStorageControllers(settings::Storage &data);
     671    HRESULT i_saveStorageDevices(ComObjPtr<StorageController> aStorageController,
     672                                 settings::StorageController &data);
     673    HRESULT i_saveStateSettings(int aFlags);
     674
     675    void i_addMediumToRegistry(ComObjPtr<Medium> &pMedium);
     676
     677    HRESULT i_createImplicitDiffs(IProgress *aProgress,
     678                                  ULONG aWeight,
     679                                  bool aOnline);
     680    HRESULT i_deleteImplicitDiffs(bool aOnline);
     681
     682    MediumAttachment* i_findAttachment(const MediaData::AttachmentList &ll,
     683                                       IN_BSTR aControllerName,
     684                                       LONG aControllerPort,
     685                                       LONG aDevice);
     686    MediumAttachment* i_findAttachment(const MediaData::AttachmentList &ll,
     687                                       ComObjPtr<Medium> pMedium);
     688    MediumAttachment* i_findAttachment(const MediaData::AttachmentList &ll,
     689                                       Guid &id);
     690
     691    HRESULT i_detachDevice(MediumAttachment *pAttach,
     692                           AutoWriteLock &writeLock,
     693                           Snapshot *pSnapshot);
     694
     695    HRESULT i_detachAllMedia(AutoWriteLock &writeLock,
     696                             Snapshot *pSnapshot,
     697                             CleanupMode_T cleanupMode,
     698                             MediaList &llMedia);
     699
     700    void i_commitMedia(bool aOnline = false);
     701    void i_rollbackMedia();
     702
     703    bool i_isInOwnDir(Utf8Str *aSettingsDir = NULL) const;
     704
     705    void i_rollback(bool aNotify);
     706    void i_commit();
     707    void i_copyFrom(Machine *aThat);
     708    bool i_isControllerHotplugCapable(StorageControllerType_T enmCtrlType);
    935709
    936710    struct DeleteTask;
    937711    static DECLCALLBACK(int) deleteThread(RTTHREAD Thread, void *pvUser);
    938     HRESULT deleteTaskWorker(DeleteTask &task);
    939 
    940     Utf8Str getExtraData(const Utf8Str &strKey);
     712    HRESULT i_deleteTaskWorker(DeleteTask &task);
     713    Utf8Str i_getExtraData(const Utf8Str &strKey);
    941714
    942715#ifdef VBOX_WITH_GUEST_PROPS
    943     HRESULT getGuestPropertyFromService(IN_BSTR aName, BSTR *aValue,
    944                                         LONG64 *aTimestamp, BSTR *aFlags) const;
    945     HRESULT getGuestPropertyFromVM(IN_BSTR aName, BSTR *aValue,
    946                                    LONG64 *aTimestamp, BSTR *aFlags) const;
    947     HRESULT setGuestPropertyToService(IN_BSTR aName, IN_BSTR aValue,
    948                                       IN_BSTR aFlags);
    949     HRESULT setGuestPropertyToVM(IN_BSTR aName, IN_BSTR aValue,
    950                                  IN_BSTR aFlags);
    951     HRESULT enumerateGuestPropertiesInService
    952                 (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames),
    953                  ComSafeArrayOut(BSTR, aValues),
    954                  ComSafeArrayOut(LONG64, aTimestamps),
    955                  ComSafeArrayOut(BSTR, aFlags));
    956     HRESULT enumerateGuestPropertiesOnVM
    957                 (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames),
    958                  ComSafeArrayOut(BSTR, aValues),
    959                  ComSafeArrayOut(LONG64, aTimestamps),
    960                  ComSafeArrayOut(BSTR, aFlags));
     716    HRESULT i_getGuestPropertyFromService(const com::Utf8Str &aName, com::Utf8Str &aValue,
     717                                          LONG64 *aTimestamp, com::Utf8Str &aFlags) const;
     718    HRESULT i_setGuestPropertyToService(const com::Utf8Str &aName, const com::Utf8Str &aValue,
     719                                        const com::Utf8Str &aFlags);
     720    HRESULT i_getGuestPropertyFromVM(const com::Utf8Str &aName, com::Utf8Str &aValue,
     721                                     LONG64 *aTimestamp, com::Utf8Str &aFlags) const;
     722    HRESULT i_setGuestPropertyToVM(const com::Utf8Str &aName, const com::Utf8Str &aValue,
     723                                   const com::Utf8Str &aFlags);
     724    HRESULT i_enumerateGuestPropertiesInService(const com::Utf8Str &aPatterns,
     725                                                std::vector<com::Utf8Str> &aNames,
     726                                                std::vector<com::Utf8Str> &aValues,
     727                                                std::vector<LONG64> &aTimestamps,
     728                                                std::vector<com::Utf8Str> &aFlags);
     729    HRESULT i_enumerateGuestPropertiesOnVM(const com::Utf8Str &aPatterns,
     730                                           std::vector<com::Utf8Str> &aNames,
     731                                           std::vector<com::Utf8Str> &aValues,
     732                                           std::vector<LONG64> &aTimestamps,
     733                                           std::vector<com::Utf8Str> &aFlags);
     734
    961735#endif /* VBOX_WITH_GUEST_PROPS */
    962736
    963737#ifdef VBOX_WITH_RESOURCE_USAGE_API
    964     void getDiskList(MediaList &list);
    965     void registerMetrics(PerformanceCollector *aCollector, Machine *aMachine, RTPROCESS pid);
     738    void i_getDiskList(MediaList &list);
     739    void i_registerMetrics(PerformanceCollector *aCollector, Machine *aMachine, RTPROCESS pid);
    966740
    967741    pm::CollectorGuest     *mCollectorGuest;
     
    1007781
    1008782    friend class MachineCloneVM;
     783
     784private:
     785    // wrapped IMachine properties
     786    HRESULT getParent(ComPtr<IVirtualBox> &aParent);
     787    HRESULT getIcon(std::vector<BYTE> &aIcon);
     788    HRESULT setIcon(const std::vector<BYTE> &aIcon);
     789    HRESULT getAccessible(BOOL *aAccessible);
     790    HRESULT getAccessError(ComPtr<IVirtualBoxErrorInfo> &aAccessError);
     791    HRESULT getName(com::Utf8Str &aName);
     792    HRESULT setName(const com::Utf8Str &aName);
     793    HRESULT getDescription(com::Utf8Str &aDescription);
     794    HRESULT setDescription(const com::Utf8Str &aDescription);
     795    HRESULT getId(com::Guid &aId);
     796    HRESULT getGroups(std::vector<com::Utf8Str> &aGroups);
     797    HRESULT setGroups(const std::vector<com::Utf8Str> &aGroups);
     798    HRESULT getOSTypeId(com::Utf8Str &aOSTypeId);
     799    HRESULT setOSTypeId(const com::Utf8Str &aOSTypeId);
     800    HRESULT getHardwareVersion(com::Utf8Str &aHardwareVersion);
     801    HRESULT setHardwareVersion(const com::Utf8Str &aHardwareVersion);
     802    HRESULT getHardwareUUID(com::Guid &aHardwareUUID);
     803    HRESULT setHardwareUUID(const com::Guid &aHardwareUUID);
     804    HRESULT getCPUCount(ULONG *aCPUCount);
     805    HRESULT setCPUCount(ULONG aCPUCount);
     806    HRESULT getCPUHotPlugEnabled(BOOL *aCPUHotPlugEnabled);
     807    HRESULT setCPUHotPlugEnabled(BOOL aCPUHotPlugEnabled);
     808    HRESULT getCPUExecutionCap(ULONG *aCPUExecutionCap);
     809    HRESULT setCPUExecutionCap(ULONG aCPUExecutionCap);
     810    HRESULT getMemorySize(ULONG *aMemorySize);
     811    HRESULT setMemorySize(ULONG aMemorySize);
     812    HRESULT getMemoryBalloonSize(ULONG *aMemoryBalloonSize);
     813    HRESULT setMemoryBalloonSize(ULONG aMemoryBalloonSize);
     814    HRESULT getPageFusionEnabled(BOOL *aPageFusionEnabled);
     815    HRESULT setPageFusionEnabled(BOOL aPageFusionEnabled);
     816    HRESULT getGraphicsControllerType(GraphicsControllerType_T *aGraphicsControllerType);
     817    HRESULT setGraphicsControllerType(GraphicsControllerType_T aGraphicsControllerType);
     818    HRESULT getVRAMSize(ULONG *aVRAMSize);
     819    HRESULT setVRAMSize(ULONG aVRAMSize);
     820    HRESULT getAccelerate3DEnabled(BOOL *aAccelerate3DEnabled);
     821    HRESULT setAccelerate3DEnabled(BOOL aAccelerate3DEnabled);
     822    HRESULT getAccelerate2DVideoEnabled(BOOL *aAccelerate2DVideoEnabled);
     823    HRESULT setAccelerate2DVideoEnabled(BOOL aAccelerate2DVideoEnabled);
     824    HRESULT getMonitorCount(ULONG *aMonitorCount);
     825    HRESULT setMonitorCount(ULONG aMonitorCount);
     826    HRESULT getVideoCaptureEnabled(BOOL *aVideoCaptureEnabled);
     827    HRESULT setVideoCaptureEnabled(BOOL aVideoCaptureEnabled);
     828    HRESULT getVideoCaptureScreens(std::vector<BOOL> &aVideoCaptureScreens);
     829    HRESULT setVideoCaptureScreens(const std::vector<BOOL> &aVideoCaptureScreens);
     830    HRESULT getVideoCaptureFile(com::Utf8Str &aVideoCaptureFile);
     831    HRESULT setVideoCaptureFile(const com::Utf8Str &aVideoCaptureFile);
     832    HRESULT getVideoCaptureWidth(ULONG *aVideoCaptureWidth);
     833    HRESULT setVideoCaptureWidth(ULONG aVideoCaptureWidth);
     834    HRESULT getVideoCaptureHeight(ULONG *aVideoCaptureHeight);
     835    HRESULT setVideoCaptureHeight(ULONG aVideoCaptureHeight);
     836    HRESULT getVideoCaptureRate(ULONG *aVideoCaptureRate);
     837    HRESULT setVideoCaptureRate(ULONG aVideoCaptureRate);
     838    HRESULT getVideoCaptureFPS(ULONG *aVideoCaptureFPS);
     839    HRESULT setVideoCaptureFPS(ULONG aVideoCaptureFPS);
     840    HRESULT getBIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings);
     841    HRESULT getFirmwareType(FirmwareType_T *aFirmwareType);
     842    HRESULT setFirmwareType(FirmwareType_T aFirmwareType);
     843    HRESULT getPointingHIDType(PointingHIDType_T *aPointingHIDType);
     844    HRESULT setPointingHIDType(PointingHIDType_T aPointingHIDType);
     845    HRESULT getKeyboardHIDType(KeyboardHIDType_T *aKeyboardHIDType);
     846    HRESULT setKeyboardHIDType(KeyboardHIDType_T aKeyboardHIDType);
     847    HRESULT getHPETEnabled(BOOL *aHPETEnabled);
     848    HRESULT setHPETEnabled(BOOL aHPETEnabled);
     849    HRESULT getChipsetType(ChipsetType_T *aChipsetType);
     850    HRESULT setChipsetType(ChipsetType_T aChipsetType);
     851    HRESULT getSnapshotFolder(com::Utf8Str &aSnapshotFolder);
     852    HRESULT setSnapshotFolder(const com::Utf8Str &aSnapshotFolder);
     853    HRESULT getVRDEServer(ComPtr<IVRDEServer> &aVRDEServer);
     854    HRESULT getEmulatedUSBCardReaderEnabled(BOOL *aEmulatedUSBCardReaderEnabled);
     855    HRESULT setEmulatedUSBCardReaderEnabled(BOOL aEmulatedUSBCardReaderEnabled);
     856    HRESULT getMediumAttachments(std::vector<ComPtr<IMediumAttachment> > &aMediumAttachments);
     857    HRESULT getUSBControllers(std::vector<ComPtr<IUSBController> > &aUSBControllers);
     858    HRESULT getUSBDeviceFilters(ComPtr<IUSBDeviceFilters> &aUSBDeviceFilters);
     859    HRESULT getAudioAdapter(ComPtr<IAudioAdapter> &aAudioAdapter);
     860    HRESULT getStorageControllers(std::vector<ComPtr<IStorageController> > &aStorageControllers);
     861    HRESULT getSettingsFilePath(com::Utf8Str &aSettingsFilePath);
     862    HRESULT getSettingsModified(BOOL *aSettingsModified);
     863    HRESULT getSessionState(SessionState_T *aSessionState);
     864    HRESULT getSessionType(com::Utf8Str &aSessionType);
     865    HRESULT getSessionPID(ULONG *aSessionPID);
     866    HRESULT getState(MachineState_T *aState);
     867    HRESULT getLastStateChange(LONG64 *aLastStateChange);
     868    HRESULT getStateFilePath(com::Utf8Str &aStateFilePath);
     869    HRESULT getLogFolder(com::Utf8Str &aLogFolder);
     870    HRESULT getCurrentSnapshot(ComPtr<ISnapshot> &aCurrentSnapshot);
     871    HRESULT getSnapshotCount(ULONG *aSnapshotCount);
     872    HRESULT getCurrentStateModified(BOOL *aCurrentStateModified);
     873    HRESULT getSharedFolders(std::vector<ComPtr<ISharedFolder> > &aSharedFolders);
     874    HRESULT getClipboardMode(ClipboardMode_T *aClipboardMode);
     875    HRESULT setClipboardMode(ClipboardMode_T aClipboardMode);
     876    HRESULT getDnDMode(DnDMode_T *aDnDMode);
     877    HRESULT setDnDMode(DnDMode_T aDnDMode);
     878    HRESULT getGuestPropertyNotificationPatterns(com::Utf8Str &aGuestPropertyNotificationPatterns);
     879    HRESULT setGuestPropertyNotificationPatterns(const com::Utf8Str &aGuestPropertyNotificationPatterns);
     880    HRESULT getTeleporterEnabled(BOOL *aTeleporterEnabled);
     881    HRESULT setTeleporterEnabled(BOOL aTeleporterEnabled);
     882    HRESULT getTeleporterPort(ULONG *aTeleporterPort);
     883    HRESULT setTeleporterPort(ULONG aTeleporterPort);
     884    HRESULT getTeleporterAddress(com::Utf8Str &aTeleporterAddress);
     885    HRESULT setTeleporterAddress(const com::Utf8Str &aTeleporterAddress);
     886    HRESULT getTeleporterPassword(com::Utf8Str &aTeleporterPassword);
     887    HRESULT setTeleporterPassword(const com::Utf8Str &aTeleporterPassword);
     888    HRESULT getParavirtProvider(ParavirtProvider_T *aParavirtProvider);
     889    HRESULT setParavirtProvider(ParavirtProvider_T aParavirtProvider);
     890    HRESULT getFaultToleranceState(FaultToleranceState_T *aFaultToleranceState);
     891    HRESULT setFaultToleranceState(FaultToleranceState_T aFaultToleranceState);
     892    HRESULT getFaultTolerancePort(ULONG *aFaultTolerancePort);
     893    HRESULT setFaultTolerancePort(ULONG aFaultTolerancePort);
     894    HRESULT getFaultToleranceAddress(com::Utf8Str &aFaultToleranceAddress);
     895    HRESULT setFaultToleranceAddress(const com::Utf8Str &aFaultToleranceAddress);
     896    HRESULT getFaultTolerancePassword(com::Utf8Str &aFaultTolerancePassword);
     897    HRESULT setFaultTolerancePassword(const com::Utf8Str &aFaultTolerancePassword);
     898    HRESULT getFaultToleranceSyncInterval(ULONG *aFaultToleranceSyncInterval);
     899    HRESULT setFaultToleranceSyncInterval(ULONG aFaultToleranceSyncInterval);
     900    HRESULT getRTCUseUTC(BOOL *aRTCUseUTC);
     901    HRESULT setRTCUseUTC(BOOL aRTCUseUTC);
     902    HRESULT getIOCacheEnabled(BOOL *aIOCacheEnabled);
     903    HRESULT setIOCacheEnabled(BOOL aIOCacheEnabled);
     904    HRESULT getIOCacheSize(ULONG *aIOCacheSize);
     905    HRESULT setIOCacheSize(ULONG aIOCacheSize);
     906    HRESULT getPCIDeviceAssignments(std::vector<ComPtr<IPCIDeviceAttachment> > &aPCIDeviceAssignments);
     907    HRESULT getBandwidthControl(ComPtr<IBandwidthControl> &aBandwidthControl);
     908    HRESULT getTracingEnabled(BOOL *aTracingEnabled);
     909    HRESULT setTracingEnabled(BOOL aTracingEnabled);
     910    HRESULT getTracingConfig(com::Utf8Str &aTracingConfig);
     911    HRESULT setTracingConfig(const com::Utf8Str &aTracingConfig);
     912    HRESULT getAllowTracingToAccessVM(BOOL *aAllowTracingToAccessVM);
     913    HRESULT setAllowTracingToAccessVM(BOOL aAllowTracingToAccessVM);
     914    HRESULT getAutostartEnabled(BOOL *aAutostartEnabled);
     915    HRESULT setAutostartEnabled(BOOL aAutostartEnabled);
     916    HRESULT getAutostartDelay(ULONG *aAutostartDelay);
     917    HRESULT setAutostartDelay(ULONG aAutostartDelay);
     918    HRESULT getAutostopType(AutostopType_T *aAutostopType);
     919    HRESULT setAutostopType(AutostopType_T aAutostopType);
     920    HRESULT getDefaultFrontend(com::Utf8Str &aDefaultFrontend);
     921    HRESULT setDefaultFrontend(const com::Utf8Str &aDefaultFrontend);
     922    HRESULT getUSBProxyAvailable(BOOL *aUSBProxyAvailable);
     923
     924    // wrapped IMachine methods
     925    HRESULT lockMachine(const ComPtr<ISession> &aSession,
     926                        LockType_T aLockType);
     927    HRESULT launchVMProcess(const ComPtr<ISession> &aSession,
     928                            const com::Utf8Str &aType,
     929                            const com::Utf8Str &aEnvironment,
     930                            ComPtr<IProgress> &aProgress);
     931    HRESULT setBootOrder(ULONG aPosition,
     932                         DeviceType_T aDevice);
     933    HRESULT getBootOrder(ULONG aPosition,
     934                         DeviceType_T *aDevice);
     935    HRESULT attachDevice(const com::Utf8Str &aName,
     936                         LONG aControllerPort,
     937                         LONG aDevice,
     938                         DeviceType_T aType,
     939                         const ComPtr<IMedium> &aMedium);
     940    HRESULT attachDeviceWithoutMedium(const com::Utf8Str &aName,
     941                                      LONG aControllerPort,
     942                                      LONG aDevice,
     943                                      DeviceType_T aType);
     944    HRESULT detachDevice(const com::Utf8Str &aName,
     945                         LONG aControllerPort,
     946                         LONG aDevice);
     947    HRESULT passthroughDevice(const com::Utf8Str &aName,
     948                              LONG aControllerPort,
     949                              LONG aDevice,
     950                              BOOL aPassthrough);
     951    HRESULT temporaryEjectDevice(const com::Utf8Str &aName,
     952                                 LONG aControllerPort,
     953                                 LONG aDevice,
     954                                 BOOL aTemporaryEject);
     955    HRESULT nonRotationalDevice(const com::Utf8Str &aName,
     956                                LONG aControllerPort,
     957                                LONG aDevice,
     958                                BOOL aNonRotational);
     959    HRESULT setAutoDiscardForDevice(const com::Utf8Str &aName,
     960                                    LONG aControllerPort,
     961                                    LONG aDevice,
     962                                    BOOL aDiscard);
     963    HRESULT setHotPluggableForDevice(const com::Utf8Str &aName,
     964                                     LONG aControllerPort,
     965                                     LONG aDevice,
     966                                     BOOL aHotPluggable);
     967    HRESULT setBandwidthGroupForDevice(const com::Utf8Str &aName,
     968                                       LONG aControllerPort,
     969                                       LONG aDevice,
     970                                       const ComPtr<IBandwidthGroup> &aBandwidthGroup);
     971    HRESULT setNoBandwidthGroupForDevice(const com::Utf8Str &aName,
     972                                         LONG aControllerPort,
     973                                         LONG aDevice);
     974    HRESULT unmountMedium(const com::Utf8Str &aName,
     975                          LONG aControllerPort,
     976                          LONG aDevice,
     977                          BOOL aForce);
     978    HRESULT mountMedium(const com::Utf8Str &aName,
     979                        LONG aControllerPort,
     980                        LONG aDevice,
     981                        const ComPtr<IMedium> &aMedium,
     982                        BOOL aForce);
     983    HRESULT getMedium(const com::Utf8Str &aName,
     984                      LONG aControllerPort,
     985                      LONG aDevice,
     986                      ComPtr<IMedium> &aMedium);
     987    HRESULT getMediumAttachmentsOfController(const com::Utf8Str &aName,
     988                                             std::vector<ComPtr<IMediumAttachment> > &aMediumAttachments);
     989    HRESULT getMediumAttachment(const com::Utf8Str &aName,
     990                                LONG aControllerPort,
     991                                LONG aDevice,
     992                                ComPtr<IMediumAttachment> &aAttachment);
     993    HRESULT attachHostPCIDevice(LONG aHostAddress,
     994                                LONG aDesiredGuestAddress,
     995                                BOOL aTryToUnbind);
     996    HRESULT detachHostPCIDevice(LONG aHostAddress);
     997    HRESULT getNetworkAdapter(ULONG aSlot,
     998                              ComPtr<INetworkAdapter> &aAdapter);
     999    HRESULT addStorageController(const com::Utf8Str &aName,
     1000                                 StorageBus_T aConnectionType,
     1001                                 ComPtr<IStorageController> &aController);
     1002    HRESULT getStorageControllerByName(const com::Utf8Str &aName,
     1003                                       ComPtr<IStorageController> &aStorageController);
     1004    HRESULT getStorageControllerByInstance(ULONG aInstance,
     1005                                           ComPtr<IStorageController> &aStorageController);
     1006    HRESULT removeStorageController(const com::Utf8Str &aName);
     1007    HRESULT setStorageControllerBootable(const com::Utf8Str &aName,
     1008                                         BOOL aBootable);
     1009    HRESULT addUSBController(const com::Utf8Str &aName,
     1010                             USBControllerType_T aType,
     1011                             ComPtr<IUSBController> &aController);
     1012    HRESULT removeUSBController(const com::Utf8Str &aName);
     1013    HRESULT getUSBControllerByName(const com::Utf8Str &aName,
     1014                                   ComPtr<IUSBController> &aController);
     1015    HRESULT getUSBControllerCountByType(USBControllerType_T aType,
     1016                                        ULONG *aControllers);
     1017    HRESULT getSerialPort(ULONG aSlot,
     1018                          ComPtr<ISerialPort> &aPort);
     1019    HRESULT getParallelPort(ULONG aSlot,
     1020                            ComPtr<IParallelPort> &aPort);
     1021    HRESULT getExtraDataKeys(std::vector<com::Utf8Str> &aKeys);
     1022    HRESULT getExtraData(const com::Utf8Str &aKey,
     1023                         com::Utf8Str &aValue);
     1024    HRESULT setExtraData(const com::Utf8Str &aKey,
     1025                         const com::Utf8Str &aValue);
     1026    HRESULT getCPUProperty(CPUPropertyType_T aProperty,
     1027                           BOOL *aValue);
     1028    HRESULT setCPUProperty(CPUPropertyType_T aProperty,
     1029                           BOOL aValue);
     1030    HRESULT getCPUIDLeaf(ULONG aId,
     1031                         ULONG *aValEax,
     1032                         ULONG *aValEbx,
     1033                         ULONG *aValEcx,
     1034                         ULONG *aValEdx);
     1035    HRESULT setCPUIDLeaf(ULONG aId,
     1036                         ULONG aValEax,
     1037                         ULONG aValEbx,
     1038                         ULONG aValEcx,
     1039                         ULONG aValEdx);
     1040    HRESULT removeCPUIDLeaf(ULONG aId);
     1041    HRESULT removeAllCPUIDLeaves();
     1042    HRESULT getHWVirtExProperty(HWVirtExPropertyType_T aProperty,
     1043                                BOOL *aValue);
     1044    HRESULT setHWVirtExProperty(HWVirtExPropertyType_T aProperty,
     1045                                BOOL aValue);
     1046    HRESULT setSettingsFilePath(const com::Utf8Str &aSettingsFilePath,
     1047                                ComPtr<IProgress> &aProgress);
     1048    HRESULT saveSettings();
     1049    HRESULT discardSettings();
     1050    HRESULT unregister(CleanupMode_T aCleanupMode,
     1051                       std::vector<ComPtr<IMedium> > &aMedia);
     1052    HRESULT deleteConfig(const std::vector<ComPtr<IMedium> > &aMedia,
     1053                         ComPtr<IProgress> &aProgress);
     1054    HRESULT exportTo(const ComPtr<IAppliance> &aAppliance,
     1055                     const com::Utf8Str &aLocation,
     1056                     ComPtr<IVirtualSystemDescription> &aDescription);
     1057    HRESULT findSnapshot(const com::Utf8Str &aNameOrId,
     1058                         ComPtr<ISnapshot> &aSnapshot);
     1059    HRESULT createSharedFolder(const com::Utf8Str &aName,
     1060                               const com::Utf8Str &aHostPath,
     1061                               BOOL aWritable,
     1062                               BOOL aAutomount);
     1063    HRESULT removeSharedFolder(const com::Utf8Str &aName);
     1064    HRESULT canShowConsoleWindow(BOOL *aCanShow);
     1065    HRESULT showConsoleWindow(LONG64 *aWinId);
     1066    HRESULT getGuestProperty(const com::Utf8Str &aName,
     1067                             com::Utf8Str &aValue,
     1068                             LONG64 *aTimestamp,
     1069                             com::Utf8Str &aFlags);
     1070    HRESULT getGuestPropertyValue(const com::Utf8Str &aProperty,
     1071                                  com::Utf8Str &aValue);
     1072    HRESULT getGuestPropertyTimestamp(const com::Utf8Str &aProperty,
     1073                                      LONG64 *aValue);
     1074    HRESULT setGuestProperty(const com::Utf8Str &aProperty,
     1075                             const com::Utf8Str &aValue,
     1076                             const com::Utf8Str &aFlags);
     1077    HRESULT setGuestPropertyValue(const com::Utf8Str &aProperty,
     1078                                  const com::Utf8Str &aValue);
     1079    HRESULT deleteGuestProperty(const com::Utf8Str &aName);
     1080    HRESULT enumerateGuestProperties(const com::Utf8Str &aPatterns,
     1081                                     std::vector<com::Utf8Str> &aNames,
     1082                                     std::vector<com::Utf8Str> &aValues,
     1083                                     std::vector<LONG64> &aTimestamps,
     1084                                     std::vector<com::Utf8Str> &aFlags);
     1085    HRESULT querySavedGuestScreenInfo(ULONG aScreenId,
     1086                                      ULONG *aOriginX,
     1087                                      ULONG *aOriginY,
     1088                                      ULONG *aWidth,
     1089                                      ULONG *aHeight,
     1090                                      BOOL *aEnabled);
     1091    HRESULT querySavedThumbnailSize(ULONG aScreenId,
     1092                                    ULONG *aSize,
     1093                                    ULONG *aWidth,
     1094                                    ULONG *aHeight);
     1095    HRESULT readSavedThumbnailToArray(ULONG aScreenId,
     1096                                      BOOL aBGR,
     1097                                      ULONG *aWidth,
     1098                                      ULONG *aHeight,
     1099                                      std::vector<BYTE> &aData);
     1100    HRESULT readSavedThumbnailPNGToArray(ULONG aScreenId,
     1101                                         ULONG *aWidth,
     1102                                         ULONG *aHeight,
     1103                                         std::vector<BYTE> &aData);
     1104    HRESULT querySavedScreenshotPNGSize(ULONG aScreenId,
     1105                                        ULONG *aSize,
     1106                                        ULONG *aWidth,
     1107                                        ULONG *aHeight);
     1108    HRESULT readSavedScreenshotPNGToArray(ULONG aScreenId,
     1109                                          ULONG *aWidth,
     1110                                          ULONG *aHeight,
     1111                                          std::vector<BYTE> &aData);
     1112    HRESULT hotPlugCPU(ULONG aCpu);
     1113    HRESULT hotUnplugCPU(ULONG aCpu);
     1114    HRESULT getCPUStatus(ULONG aCpu,
     1115                         BOOL *aAttached);
     1116    HRESULT queryLogFilename(ULONG aIdx,
     1117                             com::Utf8Str &aFilename);
     1118    HRESULT readLog(ULONG aIdx,
     1119                    LONG64 aOffset,
     1120                    LONG64 aSize,
     1121                    std::vector<BYTE> &aData);
     1122    HRESULT cloneTo(const ComPtr<IMachine> &aTarget,
     1123                    CloneMode_T aMode,
     1124                    const std::vector<CloneOptions_T> &aOptions,
     1125                    ComPtr<IProgress> &aProgress);
     1126
     1127    // wrapped IInternalMachineControl properties
     1128
     1129    // wrapped IInternalMachineControl methods
     1130    HRESULT setRemoveSavedStateFile(BOOL aRemove);
     1131    HRESULT updateState(MachineState_T aState);
     1132    HRESULT beginPowerUp(const ComPtr<IProgress> &aProgress);
     1133    HRESULT endPowerUp(LONG aResult);
     1134    HRESULT beginPoweringDown(ComPtr<IProgress> &aProgress);
     1135    HRESULT endPoweringDown(LONG aResult,
     1136                            const com::Utf8Str &aErrMsg);
     1137    HRESULT runUSBDeviceFilters(const ComPtr<IUSBDevice> &aDevice,
     1138                                BOOL *aMatched,
     1139                                ULONG *aMaskedInterfaces);
     1140    HRESULT captureUSBDevice(const com::Guid &aId);
     1141    HRESULT detachUSBDevice(const com::Guid &aId,
     1142                            BOOL aDone);
     1143    HRESULT autoCaptureUSBDevices();
     1144    HRESULT detachAllUSBDevices(BOOL aDone);
     1145    HRESULT onSessionEnd(const ComPtr<ISession> &aSession,
     1146                         ComPtr<IProgress> &aProgress);
     1147    HRESULT beginSavingState(ComPtr<IProgress> &aProgress,
     1148                             com::Utf8Str &aStateFilePath);
     1149    HRESULT endSavingState(LONG aResult,
     1150                           const com::Utf8Str &aErrMsg);
     1151    HRESULT adoptSavedState(const com::Utf8Str &aSavedStateFile);
     1152    HRESULT beginTakingSnapshot(const ComPtr<IConsole> &aInitiator,
     1153                                const com::Utf8Str &aName,
     1154                                const com::Utf8Str &aDescription,
     1155                                const ComPtr<IProgress> &aConsoleProgress,
     1156                                BOOL aFTakingSnapshotOnline,
     1157                                com::Utf8Str &aStateFilePath);
     1158    HRESULT endTakingSnapshot(BOOL aSuccess);
     1159    HRESULT deleteSnapshot(const ComPtr<IConsole> &aInitiator,
     1160                           const com::Guid &aStartId,
     1161                           const com::Guid &aEndId,
     1162                           BOOL aDeleteAllChildren,
     1163                           MachineState_T *aMachineState,
     1164                           ComPtr<IProgress> &aProgress);
     1165    HRESULT finishOnlineMergeMedium();
     1166    HRESULT restoreSnapshot(const ComPtr<IConsole> &aInitiator,
     1167                            const ComPtr<ISnapshot> &aSnapshot,
     1168                            MachineState_T *aMachineState,
     1169                            ComPtr<IProgress> &aProgress);
     1170    HRESULT pullGuestProperties(std::vector<com::Utf8Str> &aNames,
     1171                                std::vector<com::Utf8Str> &aValues,
     1172                                std::vector<LONG64> &aTimestamps,
     1173                                std::vector<com::Utf8Str> &aFlags);
     1174    HRESULT pushGuestProperty(const com::Utf8Str &aName,
     1175                              const com::Utf8Str &aValue,
     1176                              LONG64 aTimestamp,
     1177                              const com::Utf8Str &aFlags);
     1178    HRESULT lockMedia();
     1179    HRESULT unlockMedia();
     1180    HRESULT ejectMedium(const ComPtr<IMediumAttachment> &aAttachment,
     1181                        ComPtr<IMediumAttachment> &aNewAttachment);
     1182    HRESULT reportVmStatistics(ULONG aValidStats,
     1183                               ULONG aCpuUser,
     1184                               ULONG aCpuKernel,
     1185                               ULONG aCpuIdle,
     1186                               ULONG aMemTotal,
     1187                               ULONG aMemFree,
     1188                               ULONG aMemBalloon,
     1189                               ULONG aMemShared,
     1190                               ULONG aMemCache,
     1191                               ULONG aPagedTotal,
     1192                               ULONG aMemAllocTotal,
     1193                               ULONG aMemFreeTotal,
     1194                               ULONG aMemBalloonTotal,
     1195                               ULONG aMemSharedTotal,
     1196                               ULONG aVmNetRx,
     1197                               ULONG aVmNetTx);
     1198
     1199
     1200
     1201
    10091202};
    10101203
     
    10211214 */
    10221215class ATL_NO_VTABLE SessionMachine :
    1023     public Machine,
    1024     VBOX_SCRIPTABLE_IMPL(IInternalMachineControl)
     1216    public Machine
    10251217{
    10261218public:
     
    11051297    // public methods only for internal purposes
    11061298
    1107     virtual bool isSessionMachine() const
     1299    virtual bool i_isSessionMachine() const
    11081300    {
    11091301        return true;
     
    11111303
    11121304#ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
    1113     bool checkForDeath();
    1114 
    1115     void getTokenId(Utf8Str &strTokenId);
     1305    bool i_checkForDeath();
     1306
     1307    void i_getTokenId(Utf8Str &strTokenId);
    11161308#else /* VBOX_WITH_GENERIC_SESSION_WATCHER */
    1117     IToken *getToken();
     1309    IToken *i_getToken();
    11181310#endif /* VBOX_WITH_GENERIC_SESSION_WATCHER */
    11191311    // getClientToken must be only used by callers who can guarantee that
    11201312    // the object cannot be deleted in the mean time, i.e. have a caller/lock.
    1121     ClientToken *getClientToken();
    1122 
    1123     HRESULT onNetworkAdapterChange(INetworkAdapter *networkAdapter, BOOL changeAdapter);
    1124     HRESULT onNATRedirectRuleChange(ULONG ulSlot, BOOL aNatRuleRemove, IN_BSTR aRuleName,
    1125                                  NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort, IN_BSTR aGuestIp, LONG aGuestPort);
    1126     HRESULT onStorageControllerChange();
    1127     HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
    1128     HRESULT onSerialPortChange(ISerialPort *serialPort);
    1129     HRESULT onParallelPortChange(IParallelPort *parallelPort);
    1130     HRESULT onCPUChange(ULONG aCPU, BOOL aRemove);
    1131     HRESULT onVRDEServerChange(BOOL aRestart);
    1132     HRESULT onVideoCaptureChange();
    1133     HRESULT onUSBControllerChange();
    1134     HRESULT onUSBDeviceAttach(IUSBDevice *aDevice,
    1135                               IVirtualBoxErrorInfo *aError,
    1136                               ULONG aMaskedIfs);
    1137     HRESULT onUSBDeviceDetach(IN_BSTR aId,
    1138                               IVirtualBoxErrorInfo *aError);
    1139     HRESULT onSharedFolderChange();
    1140     HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
    1141     HRESULT onDnDModeChange(DnDMode_T aDnDMode);
    1142     HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup);
    1143     HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent);
    1144     HRESULT onCPUExecutionCapChange(ULONG aCpuExecutionCap);
    1145 
    1146     bool hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
     1313    ClientToken *i_getClientToken();
     1314
     1315    HRESULT i_onNetworkAdapterChange(INetworkAdapter *networkAdapter, BOOL changeAdapter);
     1316    HRESULT i_onNATRedirectRuleChange(ULONG ulSlot, BOOL aNatRuleRemove, IN_BSTR aRuleName,
     1317                                      NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort,
     1318                                      IN_BSTR aGuestIp, LONG aGuestPort);
     1319    HRESULT i_onStorageControllerChange();
     1320    HRESULT i_onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
     1321    HRESULT i_onSerialPortChange(ISerialPort *serialPort);
     1322    HRESULT i_onParallelPortChange(IParallelPort *parallelPort);
     1323    HRESULT i_onCPUChange(ULONG aCPU, BOOL aRemove);
     1324    HRESULT i_onVRDEServerChange(BOOL aRestart);
     1325    HRESULT i_onVideoCaptureChange();
     1326    HRESULT i_onUSBControllerChange();
     1327    HRESULT i_onUSBDeviceAttach(IUSBDevice *aDevice,
     1328                                IVirtualBoxErrorInfo *aError,
     1329                                ULONG aMaskedIfs);
     1330    HRESULT i_onUSBDeviceDetach(IN_BSTR aId,
     1331                                IVirtualBoxErrorInfo *aError);
     1332    HRESULT i_onSharedFolderChange();
     1333    HRESULT i_onClipboardModeChange(ClipboardMode_T aClipboardMode);
     1334    HRESULT i_onDnDModeChange(DnDMode_T aDnDMode);
     1335    HRESULT i_onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup);
     1336    HRESULT i_onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent);
     1337    HRESULT i_onCPUExecutionCapChange(ULONG aCpuExecutionCap);
     1338
     1339    bool i_hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
    11471340
    11481341    HRESULT lockMedia();
    1149     void unlockMedia();
     1342    HRESULT unlockMedia();
    11501343
    11511344private:
     
    11781371
    11791372    HRESULT endSavingState(HRESULT aRC, const Utf8Str &aErrMsg);
    1180     void releaseSavedStateFile(const Utf8Str &strSavedStateFile, Snapshot *pSnapshotToIgnore);
    1181 
    1182     void deleteSnapshotHandler(DeleteSnapshotTask &aTask);
    1183     void restoreSnapshotHandler(RestoreSnapshotTask &aTask);
    1184 
    1185     HRESULT prepareDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
    1186                                         const Guid &machineId,
    1187                                         const Guid &snapshotId,
    1188                                         bool fOnlineMergePossible,
    1189                                         MediumLockList *aVMMALockList,
    1190                                         ComObjPtr<Medium> &aSource,
    1191                                         ComObjPtr<Medium> &aTarget,
    1192                                         bool &fMergeForward,
    1193                                         ComObjPtr<Medium> &pParentForTarget,
    1194                                         MediumLockList * &aChildrenToReparent,
    1195                                         bool &fNeedOnlineMerge,
    1196                                         MediumLockList * &aMediumLockList,
    1197                                         ComPtr<IToken> &aHDLockToken);
    1198     void cancelDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
    1199                                     const ComObjPtr<Medium> &aSource,
    1200                                     MediumLockList *aChildrenToReparent,
    1201                                     bool fNeedsOnlineMerge,
    1202                                     MediumLockList *aMediumLockList,
    1203                                     const ComPtr<IToken> &aHDLockToken,
    1204                                     const Guid &aMediumId,
    1205                                     const Guid &aSnapshotId);
    1206     HRESULT onlineMergeMedium(const ComObjPtr<MediumAttachment> &aMediumAttachment,
    1207                               const ComObjPtr<Medium> &aSource,
    1208                               const ComObjPtr<Medium> &aTarget,
    1209                               bool fMergeForward,
    1210                               const ComObjPtr<Medium> &pParentForTarget,
    1211                               MediumLockList *aChildrenToReparent,
    1212                               MediumLockList *aMediumLockList,
    1213                               ComObjPtr<Progress> &aProgress,
    1214                               bool *pfNeedsMachineSaveSettings);
    1215 
    1216     HRESULT setMachineState(MachineState_T aMachineState);
    1217     HRESULT updateMachineStateOnClient();
     1373    void i_releaseSavedStateFile(const Utf8Str &strSavedStateFile, Snapshot *pSnapshotToIgnore);
     1374
     1375    void i_deleteSnapshotHandler(DeleteSnapshotTask &aTask);
     1376    void i_restoreSnapshotHandler(RestoreSnapshotTask &aTask);
     1377
     1378    HRESULT i_prepareDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
     1379                                          const Guid &machineId,
     1380                                          const Guid &snapshotId,
     1381                                          bool fOnlineMergePossible,
     1382                                          MediumLockList *aVMMALockList,
     1383                                          ComObjPtr<Medium> &aSource,
     1384                                          ComObjPtr<Medium> &aTarget,
     1385                                          bool &fMergeForward,
     1386                                          ComObjPtr<Medium> &pParentForTarget,
     1387                                          MediumLockList * &aChildrenToReparent,
     1388                                          bool &fNeedOnlineMerge,
     1389                                          MediumLockList * &aMediumLockList,
     1390                                          ComPtr<IToken> &aHDLockToken);
     1391    void i_cancelDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
     1392                                      const ComObjPtr<Medium> &aSource,
     1393                                      MediumLockList *aChildrenToReparent,
     1394                                      bool fNeedsOnlineMerge,
     1395                                      MediumLockList *aMediumLockList,
     1396                                      const ComPtr<IToken> &aHDLockToken,
     1397                                      const Guid &aMediumId,
     1398                                      const Guid &aSnapshotId);
     1399    HRESULT i_onlineMergeMedium(const ComObjPtr<MediumAttachment> &aMediumAttachment,
     1400                                const ComObjPtr<Medium> &aSource,
     1401                                const ComObjPtr<Medium> &aTarget,
     1402                                bool fMergeForward,
     1403                                const ComObjPtr<Medium> &pParentForTarget,
     1404                                MediumLockList *aChildrenToReparent,
     1405                                MediumLockList *aMediumLockList,
     1406                                ComObjPtr<Progress> &aProgress,
     1407                                bool *pfNeedsMachineSaveSettings);
     1408
     1409    HRESULT i_setMachineState(MachineState_T aMachineState);
     1410    HRESULT i_updateMachineStateOnClient();
    12181411
    12191412    HRESULT mRemoveSavedState;
     
    12771470    // public methods only for internal purposes
    12781471
    1279     virtual bool isSnapshotMachine() const
     1472    virtual bool i_isSnapshotMachine() const
    12801473    {
    12811474        return true;
    12821475    }
    12831476
    1284     HRESULT onSnapshotChange(Snapshot *aSnapshot);
     1477    HRESULT i_onSnapshotChange(Snapshot *aSnapshot);
    12851478
    12861479    // unsafe inline public methods for internal purposes only (ensure there is
    12871480    // a caller and a read lock before calling them!)
    12881481
    1289     const Guid& getSnapshotId() const { return mSnapshotId; }
     1482    const Guid& i_getSnapshotId() const { return mSnapshotId; }
    12901483
    12911484private:
     
    13021495// third party methods that depend on SnapshotMachine definition
    13031496
    1304 inline const Guid &Machine::getSnapshotId() const
     1497inline const Guid &Machine::i_getSnapshotId() const
    13051498{
    1306     return (isSnapshotMachine())
    1307                 ? static_cast<const SnapshotMachine*>(this)->getSnapshotId()
     1499    return (i_isSnapshotMachine())
     1500                ? static_cast<const SnapshotMachine*>(this)->i_getSnapshotId()
    13081501                : Guid::Empty;
    13091502}
  • trunk/src/VBox/Main/include/USBDeviceFilterImpl.h

    r49951 r51498  
    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
     
    178178
    179179    // util::Lockable interface
    180     RWLockHandle *i_lockHandle() const;
     180    RWLockHandle *lockHandle() const;
    181181
    182182private:
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r51092 r51498  
    5757* @return
    5858*/
    59 STDMETHODIMP Machine::ExportTo(IAppliance *aAppliance, IN_BSTR location, IVirtualSystemDescription **aDescription)
     59HRESULT Machine::exportTo(const ComPtr<IAppliance> &aAppliance, const com::Utf8Str &aLocation,
     60                          ComPtr<IVirtualSystemDescription> &aDescription)
    6061{
    6162    HRESULT rc = S_OK;
     
    6465        return E_POINTER;
    6566
    66     AutoCaller autoCaller(this);
    67     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    68 
    6967    ComObjPtr<VirtualSystemDescription> pNewDesc;
    7068
    7169    try
    7270    {
    73         Appliance *pAppliance = static_cast<Appliance*>(aAppliance);
    74         AutoCaller autoCaller1(pAppliance);
    75         if (FAILED(autoCaller1.rc())) return autoCaller1.rc();
     71        IAppliance *iAppliance = aAppliance;
     72        Appliance *pAppliance = static_cast<Appliance*>(iAppliance);
    7673
    7774        LocationInfo locInfo;
    78         i_parseURI(location, locInfo);
     75        i_parseURI(aLocation, locInfo);
    7976        // create a new virtual system to store in the appliance
    8077        rc = pNewDesc.createObject();
     
    9289        if (SUCCEEDED(rc))
    9390        {
    94             for (unsigned i = 0; i < usbControllers.size(); i++)
     91            for (unsigned i = 0; i < usbControllers.size(); ++i)
    9592            {
    9693                USBControllerType_T enmType;
     
    509506
    510507//     <const name="NetworkAdapter" />
    511         uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(getChipsetType());
     508        uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(i_getChipsetType());
    512509        size_t a;
    513510        for (a = 0; a < maxNetworkAdapters; ++a)
     
    557554        /* We return the new description to the caller */
    558555        ComPtr<IVirtualSystemDescription> copy(pNewDesc);
    559         copy.queryInterfaceTo(aDescription);
     556        copy.queryInterfaceTo(aDescription.asOutParam());
    560557
    561558        AutoWriteLock alock(pAppliance COMMA_LOCKVAL_SRC_POS);
     
    18441841        AutoWriteLock machineLock(vsdescThis->m->pMachine COMMA_LOCKVAL_SRC_POS);
    18451842        // fill the machine config
    1846         vsdescThis->m->pMachine->copyMachineDataToSettings(*pConfig);
     1843        vsdescThis->m->pMachine->i_copyMachineDataToSettings(*pConfig);
    18471844
    18481845        // Apply export tweaks to machine settings
     
    22862283            Utf8Str strMfFileName = Utf8Str(strMfFilePath).stripPath();
    22872284            pTask->pProgress->SetNextOperation(BstrFmt(tr("Creating manifest file '%s'"), strMfFileName.c_str()).raw(),
    2288                                                m->ulWeightForManifestOperation);     // operation's weight, as set up with the IProgress originally);
     2285                                               m->ulWeightForManifestOperation);     // operation's weight, as set up
     2286                                                                                     // with the IProgress originally);
    22892287            PRTMANIFESTTEST paManifestFiles = (PRTMANIFESTTEST)RTMemAlloc(sizeof(RTMANIFESTTEST) * fileList.size());
    22902288            size_t i = 0;
     
    24152413                           tr("Cannot find source file '%s' (%Rrc)"), strTmpOvf.c_str(), vrc);
    24162414        /* Add the OVF file */
    2417         filesList.push_back(pair<Utf8Str, ULONG>(strTmpOvf, m->ulWeightForXmlOperation)); /* Use 1% of the total for the OVF file upload */
     2415        filesList.push_back(pair<Utf8Str, ULONG>(strTmpOvf, m->ulWeightForXmlOperation)); /* Use 1% of the
     2416                                                                                             total for the OVF file upload */
    24182417        /* Add the manifest file */
    24192418        if (m->fManifest)
    24202419        {
    24212420            Utf8Str strMfFile = Utf8Str(strTmpOvf).stripSuffix().append(".mf");
    2422             filesList.push_back(pair<Utf8Str, ULONG>(strMfFile , m->ulWeightForXmlOperation)); /* Use 1% of the total for the manifest file upload */
     2421            filesList.push_back(pair<Utf8Str, ULONG>(strMfFile , m->ulWeightForXmlOperation)); /* Use 1% of the total
     2422                                                                                                  for the manifest file upload */
    24232423        }
    24242424
     
    24302430        {
    24312431            ComObjPtr<VirtualSystemDescription> vsdescThis = (*it);
    2432             std::list<VirtualSystemDescriptionEntry*> avsdeHDs = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage);
     2432            std::list<VirtualSystemDescriptionEntry*> avsdeHDs =
     2433                vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage);
    24332434            std::list<VirtualSystemDescriptionEntry*>::const_iterator itH;
    24342435            for (itH = avsdeHDs.begin();
     
    24502451        }
    24512452        /* Next we have to upload the OVF & all disk images */
    2452         vrc = RTS3Create(&hS3, pTask->locInfo.strUsername.c_str(), pTask->locInfo.strPassword.c_str(), pTask->locInfo.strHostname.c_str(), "virtualbox-agent/" VBOX_VERSION_STRING);
     2453        vrc = RTS3Create(&hS3, pTask->locInfo.strUsername.c_str(), pTask->locInfo.strPassword.c_str(),
     2454                         pTask->locInfo.strHostname.c_str(), "virtualbox-agent/" VBOX_VERSION_STRING);
    24532455        if (RT_FAILURE(vrc))
    24542456            throw setError(VBOX_E_IPRT_ERROR,
  • trunk/src/VBox/Main/src-server/AudioAdapterImpl.cpp

    r49875 r51498  
    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
     
    228228        alock.release();
    229229        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    230         mParent->setModified(Machine::IsModified_AudioAdapter);
     230        mParent->i_setModified(Machine::IsModified_AudioAdapter);
    231231    }
    232232
     
    262262            alock.release();
    263263            AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    264             mParent->setModified(Machine::IsModified_AudioAdapter);
     264            mParent->i_setModified(Machine::IsModified_AudioAdapter);
    265265        }
    266266        else
     
    308308                alock.release();
    309309                AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    310                 mParent->setModified(Machine::IsModified_AudioAdapter);
     310                mParent->i_setModified(Machine::IsModified_AudioAdapter);
    311311                break;
    312312            }
  • trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp

    r49871 r51498  
    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
     
    207207    alock.release();
    208208    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    209     m->pMachine->setModified(Machine::IsModified_BIOS);
     209    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    210210
    211211    return S_OK;
     
    236236    alock.release();
    237237    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    238     m->pMachine->setModified(Machine::IsModified_BIOS);
     238    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    239239
    240240    return S_OK;
     
    268268    alock.release();
    269269    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    270     m->pMachine->setModified(Machine::IsModified_BIOS);
     270    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    271271
    272272    return S_OK;
     
    296296    alock.release();
    297297    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    298     m->pMachine->setModified(Machine::IsModified_BIOS);
     298    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    299299
    300300    return S_OK;
     
    323323    alock.release();
    324324    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    325     m->pMachine->setModified(Machine::IsModified_BIOS);
     325    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    326326
    327327    return S_OK;
     
    352352    alock.release();
    353353    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    354     m->pMachine->setModified(Machine::IsModified_BIOS);
     354    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    355355
    356356    return S_OK;
     
    381381    alock.release();
    382382    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    383     m->pMachine->setModified(Machine::IsModified_BIOS);
     383    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    384384
    385385    return S_OK;
     
    410410    alock.release();
    411411    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    412     m->pMachine->setModified(Machine::IsModified_BIOS);
     412    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    413413
    414414    return S_OK;
     
    438438    alock.release();
    439439    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    440     m->pMachine->setModified(Machine::IsModified_BIOS);
     440    m->pMachine->i_setModified(Machine::IsModified_BIOS);
    441441
    442442    return S_OK;
  • trunk/src/VBox/Main/src-server/BandwidthControlImpl.cpp

    r50454 r51498  
    415415    if (FAILED(rc)) return rc;
    416416
    417     m->pParent->setModified(Machine::IsModified_BandwidthControl);
     417    m->pParent->i_setModified(Machine::IsModified_BandwidthControl);
    418418    m->llBandwidthGroups.backup();
    419419    m->llBandwidthGroups->push_back(group);
     
    439439
    440440    /* We can remove it now. */
    441     m->pParent->setModified(Machine::IsModified_BandwidthControl);
     441    m->pParent->i_setModified(Machine::IsModified_BandwidthControl);
    442442    m->llBandwidthGroups.backup();
    443443
  • trunk/src/VBox/Main/src-server/BandwidthGroupImpl.cpp

    r50436 r51498  
    245245    ComObjPtr<Machine> pMachine = m->pParent->i_getMachine();
    246246    alock.release();
    247     pMachine->onBandwidthGroupChange(this);
     247    pMachine->i_onBandwidthGroupChange(this);
    248248
    249249    return S_OK;
  • trunk/src/VBox/Main/src-server/ClientWatcher.cpp

    r50355 r51498  
    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
     
    211211            {
    212212                /* machine mutex is released */
    213                 (machines[rc - WAIT_OBJECT_0 - 1])->checkForDeath();
     213                (machines[rc - WAIT_OBJECT_0 - 1])->i_checkForDeath();
    214214                update = true;
    215215            }
     
    217217            {
    218218                /* machine mutex is abandoned due to client process termination */
    219                 (machines[rc - WAIT_ABANDONED_0 - 1])->checkForDeath();
     219                (machines[rc - WAIT_ABANDONED_0 - 1])->i_checkForDeath();
    220220                update = true;
    221221            }
     
    224224                /* spawned VM process has terminated (normally or abnormally) */
    225225                (spawnedMachines[rc - WAIT_OBJECT_0 - cnt - 1])->
    226                     checkForSpawnFailure();
     226                    i_checkForSpawnFailure();
    227227                update = true;
    228228            }
     
    253253
    254254                    ComObjPtr<SessionMachine> sm;
    255                     if ((*it)->isSessionOpenOrClosing(sm))
     255                    if ((*it)->i_isSessionOpenOrClosing(sm))
    256256                    {
    257257                        AutoCaller smCaller(sm);
     
    259259                        {
    260260                            AutoReadLock smLock(sm COMMA_LOCKVAL_SRC_POS);
    261                             Machine::ClientToken *ct = sm->getClientToken();
     261                            Machine::ClientToken *ct = sm->i_getClientToken();
    262262                            if (ct)
    263263                            {
     
    285285                                   ("MAXIMUM_WAIT_OBJECTS reached"));
    286286
    287                     if ((*it)->isSessionSpawning())
     287                    if ((*it)->i_isSessionSpawning())
    288288                    {
    289289                        ULONG pid;
     
    388388                            }
    389389#endif
    390                             machines[semId]->checkForDeath();
     390                            machines[semId]->i_checkForDeath();
    391391                        }
    392392                        update = true;
     
    417417                                    }
    418418#endif
    419                                     machines[i]->checkForDeath();
     419                                    machines[i]->i_checkForDeath();
    420420                                }
    421421                            }
     
    433433                    for (size_t i = 0; i < cntSpawned; ++i)
    434434                        updateSpawned |= (spawnedMachines[i])->
    435                             checkForSpawnFailure();
     435                            i_checkForSpawnFailure();
    436436                }
    437437            }
     
    464464
    465465                        ComObjPtr<SessionMachine> sm;
    466                         if ((*it)->isSessionOpenOrClosing(sm))
     466                        if ((*it)->i_isSessionOpenOrClosing(sm))
    467467                        {
    468468                            AutoCaller smCaller(sm);
     
    470470                            {
    471471                                AutoReadLock smLock(sm COMMA_LOCKVAL_SRC_POS);
    472                                 ClientToken *ct = sm->getClientToken();
     472                                ClientToken *ct = sm->i_getClientToken();
    473473                                if (ct)
    474474                                {
     
    505505                         it != allMachines.end(); ++it)
    506506                    {
    507                         if ((*it)->isSessionSpawning())
     507                        if ((*it)->i_isSessionSpawning())
    508508                            spawnedMachines.push_back(*it);
    509509                    }
     
    589589                    {
    590590                        ComObjPtr<SessionMachine> sm;
    591                         if ((*it)->isSessionOpenOrClosing(sm))
     591                        if ((*it)->i_isSessionOpenOrClosing(sm))
    592592                            machines.push_back(sm);
    593593                    }
     
    606606                         ++it)
    607607                    {
    608                         if ((*it)->isSessionSpawning())
     608                        if ((*it)->i_isSessionSpawning())
    609609                            spawnedMachines.push_back(*it);
    610610                    }
     
    619619            update = false;
    620620            for (size_t i = 0; i < cnt; ++i)
    621                 update |= (machines[i])->checkForDeath();
     621                update |= (machines[i])->i_checkForDeath();
    622622
    623623            updateSpawned = false;
    624624            for (size_t i = 0; i < cntSpawned; ++i)
    625                 updateSpawned |= (spawnedMachines[i])->checkForSpawnFailure();
     625                updateSpawned |= (spawnedMachines[i])->i_checkForSpawnFailure();
    626626
    627627            /* reap child processes */
     
    757757                         ++it)
    758758                    {
    759                         if ((*it)->isSessionSpawning())
     759                        if ((*it)->i_isSessionSpawning())
    760760                            spawnedMachines.push_back(*it);
    761761                    }
     
    771771            updateSpawned = false;
    772772            for (size_t i = 0; i < cntSpawned; ++i)
    773                 updateSpawned |= (spawnedMachines[i])->checkForSpawnFailure();
     773                updateSpawned |= (spawnedMachines[i])->i_checkForSpawnFailure();
    774774
    775775            /* reap child processes */
  • trunk/src/VBox/Main/src-server/HostPower.cpp

    r50355 r51498  
    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
     
    168168                    if (FAILED(rc))
    169169                    {
    170                         LogRel(("SaveState '%s' failed with %Rhrc\n", pMachine->getName().c_str(), rc));
     170                        LogRel(("SaveState '%s' failed with %Rhrc\n", pMachine->i_getName().c_str(), rc));
    171171                        continue;
    172172                    }
     
    185185                    if (SUCCEEDED(rc))
    186186                    {
    187                         LogRel(("SaveState '%s' succeeded\n", pMachine->getName().c_str()));
     187                        LogRel(("SaveState '%s' succeeded\n", pMachine->i_getName().c_str()));
    188188                        ++saved;
    189189                    }
  • trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp

    r51092 r51498  
    55
    66/*
    7  * Copyright (C) 2005-2013 Oracle Corporation
     7 * Copyright (C) 2005-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    332332            return setError(E_INVALIDARG,
    333333                            tr("USB device '%s' with UUID {%RTuuid} is already captured by the virtual machine '%s'"),
    334                             mName, mId.raw(), mMachine->getName().c_str());
     334                            mName, mId.raw(), mMachine->i_getName().c_str());
    335335        }
    336336        if (mUniState >= kHostUSBDeviceState_FirstTransitional)
     
    439439    LogFlowThisFunc(("{%s} Calling machine->onUSBDeviceAttach()...\n", mName));
    440440    alock.release();
    441     HRESULT hrc = aMachine->onUSBDeviceAttach(d, NULL, aMaskedIfs);
     441    HRESULT hrc = aMachine->i_onUSBDeviceAttach(d, NULL, aMaskedIfs);
    442442    LogFlowThisFunc(("{%s} Done machine->onUSBDeviceAttach()=%08X\n", mName, hrc));
    443443
     
    518518    alock.release();
    519519    LogFlowThisFunc(("{%s} Calling machine->onUSBDeviceDetach()...\n", mName));
    520     HRESULT hrc = mMachine->onUSBDeviceDetach(mId.toUtf16().raw(), NULL);
     520    HRESULT hrc = mMachine->i_onUSBDeviceDetach(mId.toUtf16().raw(), NULL);
    521521    LogFlowThisFunc(("{%s} Done machine->onUSBDeviceDetach()=%Rhrc\n", mName, hrc));
    522522    NOREF(hrc);
     
    17011701 * @note    The caller must own the write lock for this object.
    17021702 */
    1703 bool HostUSBDevice::i_setState(HostUSBDeviceState aNewState, HostUSBDeviceState aNewPendingState /*= kHostUSBDeviceState_Invalid*/,
    1704                              HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/)
     1703bool HostUSBDevice::i_setState(HostUSBDeviceState aNewState,
     1704                               HostUSBDeviceState aNewPendingState /*= kHostUSBDeviceState_Invalid*/,
     1705                               HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/)
    17051706{
    17061707    Assert(isWriteLockOnCurrentThread());
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r51476 r51498  
    167167    mVideoCaptureFPS = 25;
    168168    mVideoCaptureEnabled = false;
    169     for (unsigned i = 0; i < RT_ELEMENTS(maVideoCaptureScreens); i++)
     169    for (unsigned i = 0; i < RT_ELEMENTS(maVideoCaptureScreens); ++i)
    170170        maVideoCaptureScreens[i] = true;
    171171
     
    209209    mEmulatedUSBCardReaderEnabled = FALSE;
    210210
    211     for (size_t i = 0; i < RT_ELEMENTS(mCPUAttached); i++)
     211    for (size_t i = 0; i < RT_ELEMENTS(mCPUAttached); ++i)
    212212        mCPUAttached[i] = false;
    213213
     
    303303    if (FAILED(rc)) return rc;
    304304
    305     rc = tryCreateMachineConfigFile(fForceOverwrite);
     305    rc = i_tryCreateMachineConfigFile(fForceOverwrite);
    306306    if (FAILED(rc)) return rc;
    307307
     
    329329        // with the machine file; say so if the settings file name is the same as the
    330330        // settings file parent directory (machine directory)
    331         mUserData->s.fNameSync = isInOwnDir();
     331        mUserData->s.fNameSync = i_isInOwnDir();
    332332
    333333        // initialize the default snapshots folder
     
    358358        /* At this point the changing of the current state modification
    359359         * flag is allowed. */
    360         allowStateModification();
     360        i_allowStateModification();
    361361
    362362        /* commit all changes made during the initialization */
    363         commit();
     363        i_commit();
    364364    }
    365365
     
    421421        mData->mRegistered = TRUE;
    422422        // now load the settings from XML:
    423         rc = registeredInit();
     423        rc = i_registeredInit();
    424424            // this calls initDataAndChildObjects() and loadSettings()
    425425    }
     
    454454                unconst(mData->mUuid) = mData->pMachineConfigFile->uuid;
    455455
    456                 rc = loadMachineDataFromSettings(*mData->pMachineConfigFile,
     456                rc = i_loadMachineDataFromSettings(*mData->pMachineConfigFile,
    457457                                                 NULL /* puuidRegistry */);
    458458                if (FAILED(rc)) throw rc;
     
    460460                /* At this point the changing of the current state modification
    461461                 * flag is allowed. */
    462                 allowStateModification();
    463 
    464                 commit();
     462                i_allowStateModification();
     463
     464                i_commit();
    465465            }
    466466            catch (HRESULT err)
     
    487487            // uninit media from this machine's media registry, or else
    488488            // reloading the settings will fail
    489             mParent->i_unregisterMachineMedia(getId());
     489            mParent->i_unregisterMachineMedia(i_getId());
    490490        }
    491491    }
     
    533533    if (FAILED(rc)) return rc;
    534534
    535     rc = tryCreateMachineConfigFile(false /* fForceOverwrite */);
     535    rc = i_tryCreateMachineConfigFile(false /* fForceOverwrite */);
    536536    if (FAILED(rc)) return rc;
    537537
     
    549549        unconst(mData->mUuid).create();
    550550
    551         rc = loadMachineDataFromSettings(config,
    552                                          &mData->mUuid); // puuidRegistry: initialize media with this registry ID
     551        rc = i_loadMachineDataFromSettings(config,
     552                                           &mData->mUuid); // puuidRegistry: initialize media with this registry ID
    553553
    554554        // override VM name as well, it may be different
     
    559559            /* At this point the changing of the current state modification
    560560             * flag is allowed. */
    561             allowStateModification();
     561            i_allowStateModification();
    562562
    563563            /* commit all changes made during the initialization */
    564             commit();
     564            i_commit();
    565565        }
    566566    }
     
    574574        {
    575575            /* Ignore all errors from unregistering, they would destroy
    576              * the more interesting error information we already have,
    577              * pinpointing the issue with the VM config. */
     576-            * the more interesting error information we already have,
     577-            * pinpointing the issue with the VM config. */
    578578            ErrorInfoKeeper eik;
     579
    579580            autoInitSpan.setLimited();
    580581
    581582            // uninit media from this machine's media registry, or else
    582583            // reloading the settings will fail
    583             mParent->i_unregisterMachineMedia(getId());
     584            mParent->i_unregisterMachineMedia(i_getId());
    584585        }
    585586    }
     
    639640 * @return
    640641 */
    641 HRESULT Machine::tryCreateMachineConfigFile(bool fForceOverwrite)
     642HRESULT Machine::i_tryCreateMachineConfigFile(bool fForceOverwrite)
    642643{
    643644    HRESULT rc = S_OK;
     
    689690 *  @note Subclasses must not call this method.
    690691 */
    691 HRESULT Machine::registeredInit()
    692 {
    693     AssertReturn(!isSessionMachine(), E_FAIL);
    694     AssertReturn(!isSnapshotMachine(), E_FAIL);
     692HRESULT Machine::i_registeredInit()
     693{
     694    AssertReturn(!i_isSessionMachine(), E_FAIL);
     695    AssertReturn(!i_isSnapshotMachine(), E_FAIL);
    695696    AssertReturn(mData->mUuid.isValid(), E_FAIL);
    696697    AssertReturn(!mData->mAccessible, E_FAIL);
     
    719720                               mParent->i_settingsFilePath().c_str());
    720721
    721             rc = loadMachineDataFromSettings(*mData->pMachineConfigFile,
    722                                              NULL /* const Guid *puuidRegistry */);
     722            rc = i_loadMachineDataFromSettings(*mData->pMachineConfigFile,
     723                                               NULL /* const Guid *puuidRegistry */);
    723724            if (FAILED(rc)) throw rc;
    724725        }
     
    744745
    745746        /* commit all changes made during loading the settings file */
    746         commit(); // @todo r=dj why do we need a commit during init?!? this is very expensive
     747        i_commit(); // @todo r=dj why do we need a commit during init?!? this is very expensive
    747748        /// @todo r=klaus for some reason the settings loading logic backs up
    748749        // the settings, and therefore a commit is needed. Should probably be changed.
     
    761762
    762763        /* rollback all changes */
    763         rollback(false /* aNotify */);
     764        i_rollback(false /* aNotify */);
    764765
    765766        // uninit media from this machine's media registry, or else
    766767        // reloading the settings will fail
    767         mParent->i_unregisterMachineMedia(getId());
     768        mParent->i_unregisterMachineMedia(i_getId());
    768769
    769770        /* uninitialize the common part to make sure all data is reset to
     
    801802        {
    802803            AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    803             saveSettings(NULL, Machine::SaveS_Force);
     804            i_saveSettings(NULL, Machine::SaveS_Force);
    804805        }
    805806    }
     
    810811        return;
    811812
    812     Assert(!isSnapshotMachine());
    813     Assert(!isSessionMachine());
     813    Assert(!i_isSnapshotMachine());
     814    Assert(!i_isSessionMachine());
    814815    Assert(!!mData);
    815816
     
    840841            LogWarningThisFunc(("Setting state to Aborted!\n"));
    841842            /* set machine state using SessionMachine reimplementation */
    842             static_cast<Machine*>(mData->mSession.mMachine)->setMachineState(MachineState_Aborted);
     843            static_cast<Machine*>(mData->mSession.mMachine)->i_setMachineState(MachineState_Aborted);
    843844        }
    844845
     
    853854
    854855    // uninit media from this machine's media registry, if they're still there
    855     Guid uuidMachine(getId());
     856    Guid uuidMachine(i_getId());
    856857
    857858    /* the lock is no more necessary (SessionMachine is uninitialized) */
     
    870871    {
    871872        LogWarningThisFunc(("Discarding unsaved settings changes!\n"));
    872         rollback(false /* aNotify */);
     873        i_rollback(false /* aNotify */);
    873874    }
    874875
     
    882883}
    883884
    884 // IMachine properties
     885// Wrapped IMachine properties
    885886/////////////////////////////////////////////////////////////////////////////
    886 
    887 STDMETHODIMP Machine::COMGETTER(Parent)(IVirtualBox **aParent)
    888 {
    889     CheckComArgOutPointerValid(aParent);
    890 
    891     AutoLimitedCaller autoCaller(this);
    892     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    893 
     887HRESULT Machine::getParent(ComPtr<IVirtualBox> &aParent)
     888{
    894889    /* mParent is constant during life time, no need to lock */
    895890    ComObjPtr<VirtualBox> pVirtualBox(mParent);
    896     pVirtualBox.queryInterfaceTo(aParent);
    897 
    898     return S_OK;
    899 }
    900 
    901 STDMETHODIMP Machine::COMGETTER(Accessible)(BOOL *aAccessible)
    902 {
    903     CheckComArgOutPointerValid(aAccessible);
    904 
    905     AutoLimitedCaller autoCaller(this);
    906     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    907 
    908     LogFlowThisFunc(("ENTER\n"));
    909 
     891    pVirtualBox.queryInterfaceTo(aParent.asOutParam());
     892
     893    return S_OK;
     894}
     895
     896
     897HRESULT Machine::getAccessible(BOOL *aAccessible)
     898{
    910899    /* In some cases (medium registry related), it is necessary to be able to
    911900     * go through the list of all machines. Happens when an inaccessible VM
     
    936925        }
    937926
    938         rc = registeredInit();
     927        rc = i_registeredInit();
    939928
    940929        if (SUCCEEDED(rc) && mData->mAccessible)
     
    957946}
    958947
    959 STDMETHODIMP Machine::COMGETTER(AccessError)(IVirtualBoxErrorInfo **aAccessError)
    960 {
    961     CheckComArgOutPointerValid(aAccessError);
    962 
    963     AutoLimitedCaller autoCaller(this);
    964     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    965 
     948HRESULT Machine::getAccessError(ComPtr<IVirtualBoxErrorInfo> &aAccessError)
     949{
    966950    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    967951
     
    983967                        Utf8Str(mData->mAccessError.getComponent()).c_str(),
    984968                        Utf8Str(mData->mAccessError.getText()));
    985         rc = errorInfo.queryInterfaceTo(aAccessError);
     969        rc = errorInfo.queryInterfaceTo(aAccessError.asOutParam());
    986970    }
    987971
     
    989973}
    990974
    991 STDMETHODIMP Machine::COMGETTER(Name)(BSTR *aName)
    992 {
    993     CheckComArgOutPointerValid(aName);
    994 
    995     AutoCaller autoCaller(this);
    996     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    997 
     975HRESULT Machine::getName(com::Utf8Str &aName)
     976{
    998977    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    999978
    1000     mUserData->s.strName.cloneTo(aName);
    1001 
    1002     return S_OK;
    1003 }
    1004 
    1005 STDMETHODIMP Machine::COMSETTER(Name)(IN_BSTR aName)
    1006 {
    1007     CheckComArgStrNotEmptyOrNull(aName);
    1008 
    1009     AutoCaller autoCaller(this);
    1010     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1011 
     979    aName = mUserData->s.strName;
     980
     981    return S_OK;
     982}
     983
     984HRESULT Machine::setName(const com::Utf8Str &aName)
     985{
    1012986    // prohibit setting a UUID only as the machine name, or else it can
    1013987    // never be found by findMachine()
     
    1019993    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1020994
    1021     HRESULT rc = checkStateDependency(MutableStateDep);
     995    HRESULT rc = i_checkStateDependency(MutableStateDep);
    1022996    if (FAILED(rc)) return rc;
    1023997
    1024     setModified(IsModified_MachineData);
     998    i_setModified(IsModified_MachineData);
    1025999    mUserData.backup();
    10261000    mUserData->s.strName = aName;
     
    10291003}
    10301004
    1031 STDMETHODIMP Machine::COMGETTER(Description)(BSTR *aDescription)
    1032 {
    1033     CheckComArgOutPointerValid(aDescription);
    1034 
    1035     AutoCaller autoCaller(this);
    1036     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1037 
     1005HRESULT Machine::getDescription(com::Utf8Str &aDescription)
     1006{
    10381007    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    10391008
    1040     mUserData->s.strDescription.cloneTo(aDescription);
    1041 
    1042     return S_OK;
    1043 }
    1044 
    1045 STDMETHODIMP Machine::COMSETTER(Description)(IN_BSTR aDescription)
    1046 {
    1047     AutoCaller autoCaller(this);
    1048     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1049 
     1009    aDescription = mUserData->s.strDescription;
     1010
     1011    return S_OK;
     1012}
     1013
     1014HRESULT Machine::setDescription(const com::Utf8Str &aDescription)
     1015{
    10501016    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    10511017
     
    10531019    // significantly, but play safe by not messing around while complex
    10541020    // activities are going on
    1055     HRESULT rc = checkStateDependency(MutableOrSavedStateDep);
     1021    HRESULT rc = i_checkStateDependency(MutableOrSavedStateDep);
    10561022    if (FAILED(rc)) return rc;
    10571023
    1058     setModified(IsModified_MachineData);
     1024    i_setModified(IsModified_MachineData);
    10591025    mUserData.backup();
    10601026    mUserData->s.strDescription = aDescription;
     
    10631029}
    10641030
    1065 STDMETHODIMP Machine::COMGETTER(Id)(BSTR *aId)
    1066 {
    1067     CheckComArgOutPointerValid(aId);
    1068 
    1069     AutoLimitedCaller autoCaller(this);
    1070     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1071 
     1031HRESULT Machine::getId(com::Guid &aId)
     1032{
    10721033    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    10731034
    1074     mData->mUuid.toUtf16().cloneTo(aId);
    1075 
    1076     return S_OK;
    1077 }
    1078 
    1079 STDMETHODIMP Machine::COMGETTER(Groups)(ComSafeArrayOut(BSTR, aGroups))
    1080 {
    1081     CheckComArgOutSafeArrayPointerValid(aGroups);
    1082 
    1083     AutoCaller autoCaller(this);
    1084     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1085 
     1035    aId = mData->mUuid;
     1036
     1037    return S_OK;
     1038}
     1039
     1040HRESULT Machine::getGroups(std::vector<com::Utf8Str> &aGroups)
     1041{
    10861042    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1087     SafeArray<BSTR> groups(mUserData->s.llGroups.size());
     1043    aGroups.resize(mUserData->s.llGroups.size());
    10881044    size_t i = 0;
    10891045    for (StringsList::const_iterator it = mUserData->s.llGroups.begin();
    1090          it != mUserData->s.llGroups.end();
    1091          ++it, i++)
    1092     {
    1093         Bstr tmp = *it;
    1094         tmp.cloneTo(&groups[i]);
    1095     }
    1096     groups.detachTo(ComSafeArrayOutArg(aGroups));
    1097 
    1098     return S_OK;
    1099 }
    1100 
    1101 STDMETHODIMP Machine::COMSETTER(Groups)(ComSafeArrayIn(IN_BSTR, aGroups))
    1102 {
    1103     AutoCaller autoCaller(this);
    1104     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1105     std::vector<com::Utf8Str> tmplist;
    1106     SafeArray<IN_BSTR> tmp(ComSafeArrayInArg(aGroups));
    1107     tmplist.resize(tmp.size());
    1108     for (size_t i = 0; i < tmp.size(); ++i)
    1109         tmplist[i] = Utf8Str(tmp[i]);
    1110 
     1046         it != mUserData->s.llGroups.end(); ++it, ++i)
     1047        aGroups[i] = (*it);
     1048
     1049    return S_OK;
     1050}
     1051
     1052HRESULT Machine::setGroups(const std::vector<com::Utf8Str> &aGroups)
     1053{
    11111054    StringsList llGroups;
    1112     HRESULT rc = mParent->i_convertMachineGroups(tmplist, &llGroups);
     1055    HRESULT rc = mParent->i_convertMachineGroups(aGroups, &llGroups);
    11131056    if (FAILED(rc))
    11141057        return rc;
     
    11171060
    11181061    // changing machine groups is possible while the VM is offline
    1119     rc = checkStateDependency(OfflineStateDep);
     1062    rc = i_checkStateDependency(OfflineStateDep);
    11201063    if (FAILED(rc)) return rc;
    11211064
    1122     setModified(IsModified_MachineData);
     1065    i_setModified(IsModified_MachineData);
    11231066    mUserData.backup();
    11241067    mUserData->s.llGroups = llGroups;
     
    11271070}
    11281071
    1129 STDMETHODIMP Machine::COMGETTER(OSTypeId)(BSTR *aOSTypeId)
    1130 {
    1131     CheckComArgOutPointerValid(aOSTypeId);
    1132 
    1133     AutoCaller autoCaller(this);
    1134     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1135 
     1072HRESULT Machine::getOSTypeId(com::Utf8Str &aOSTypeId)
     1073{
    11361074    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    11371075
    1138     mUserData->s.strOsType.cloneTo(aOSTypeId);
    1139 
    1140     return S_OK;
    1141 }
    1142 
    1143 STDMETHODIMP Machine::COMSETTER(OSTypeId)(IN_BSTR aOSTypeId)
    1144 {
    1145     CheckComArgStrNotEmptyOrNull(aOSTypeId);
    1146 
    1147     AutoCaller autoCaller(this);
    1148     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1149 
     1076    aOSTypeId = mUserData->s.strOsType;
     1077
     1078    return S_OK;
     1079}
     1080
     1081HRESULT Machine::setOSTypeId(const com::Utf8Str &aOSTypeId)
     1082{
    11501083    /* look up the object by Id to check it is valid */
    11511084    ComPtr<IGuestOSType> guestOSType;
    1152     HRESULT rc = mParent->GetGuestOSType(aOSTypeId, guestOSType.asOutParam());
     1085    HRESULT rc = mParent->GetGuestOSType(Bstr(aOSTypeId).raw(), guestOSType.asOutParam());
    11531086    if (FAILED(rc)) return rc;
    11541087
     
    11611094    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    11621095
    1163     rc = checkStateDependency(MutableStateDep);
     1096    rc = i_checkStateDependency(MutableStateDep);
    11641097    if (FAILED(rc)) return rc;
    11651098
    1166     setModified(IsModified_MachineData);
     1099    i_setModified(IsModified_MachineData);
    11671100    mUserData.backup();
    11681101    mUserData->s.strOsType = osTypeId;
     
    11711104}
    11721105
    1173 
    1174 STDMETHODIMP Machine::COMGETTER(FirmwareType)(FirmwareType_T *aFirmwareType)
    1175 {
    1176     CheckComArgOutPointerValid(aFirmwareType);
    1177 
    1178     AutoCaller autoCaller(this);
    1179     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1180 
     1106HRESULT Machine::getFirmwareType(FirmwareType_T *aFirmwareType)
     1107{
    11811108    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    11821109
     
    11861113}
    11871114
    1188 STDMETHODIMP Machine::COMSETTER(FirmwareType)(FirmwareType_T aFirmwareType)
    1189 {
    1190     AutoCaller autoCaller(this);
    1191     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1115HRESULT Machine::setFirmwareType(FirmwareType_T aFirmwareType)
     1116{
    11921117    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    11931118
    1194     HRESULT rc = checkStateDependency(MutableStateDep);
     1119    HRESULT rc = i_checkStateDependency(MutableStateDep);
    11951120    if (FAILED(rc)) return rc;
    11961121
    1197     setModified(IsModified_MachineData);
     1122    i_setModified(IsModified_MachineData);
    11981123    mHWData.backup();
    11991124    mHWData->mFirmwareType = aFirmwareType;
     
    12021127}
    12031128
    1204 STDMETHODIMP Machine::COMGETTER(KeyboardHIDType)(KeyboardHIDType_T *aKeyboardHIDType)
    1205 {
    1206     CheckComArgOutPointerValid(aKeyboardHIDType);
    1207 
    1208     AutoCaller autoCaller(this);
    1209     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1210 
     1129HRESULT Machine::getKeyboardHIDType(KeyboardHIDType_T *aKeyboardHIDType)
     1130{
    12111131    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    12121132
     
    12161136}
    12171137
    1218 STDMETHODIMP Machine::COMSETTER(KeyboardHIDType)(KeyboardHIDType_T  aKeyboardHIDType)
    1219 {
    1220     AutoCaller autoCaller(this);
    1221     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1138HRESULT Machine::setKeyboardHIDType(KeyboardHIDType_T aKeyboardHIDType)
     1139{
    12221140    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    12231141
    1224     HRESULT rc = checkStateDependency(MutableStateDep);
     1142    HRESULT rc = i_checkStateDependency(MutableStateDep);
    12251143    if (FAILED(rc)) return rc;
    12261144
    1227     setModified(IsModified_MachineData);
     1145    i_setModified(IsModified_MachineData);
    12281146    mHWData.backup();
    12291147    mHWData->mKeyboardHIDType = aKeyboardHIDType;
     
    12321150}
    12331151
    1234 STDMETHODIMP Machine::COMGETTER(PointingHIDType)(PointingHIDType_T *aPointingHIDType)
    1235 {
    1236     CheckComArgOutPointerValid(aPointingHIDType);
    1237 
    1238     AutoCaller autoCaller(this);
    1239     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1240 
     1152HRESULT Machine::getPointingHIDType(PointingHIDType_T *aPointingHIDType)
     1153{
    12411154    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    12421155
     
    12461159}
    12471160
    1248 STDMETHODIMP Machine::COMSETTER(PointingHIDType)(PointingHIDType_T  aPointingHIDType)
    1249 {
    1250     AutoCaller autoCaller(this);
    1251     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1161HRESULT Machine::setPointingHIDType(PointingHIDType_T aPointingHIDType)
     1162{
    12521163    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    12531164
    1254     HRESULT rc = checkStateDependency(MutableStateDep);
     1165    HRESULT rc = i_checkStateDependency(MutableStateDep);
    12551166    if (FAILED(rc)) return rc;
    12561167
    1257     setModified(IsModified_MachineData);
     1168    i_setModified(IsModified_MachineData);
    12581169    mHWData.backup();
    12591170    mHWData->mPointingHIDType = aPointingHIDType;
     
    12621173}
    12631174
    1264 STDMETHODIMP Machine::COMGETTER(ChipsetType)(ChipsetType_T *aChipsetType)
    1265 {
    1266     CheckComArgOutPointerValid(aChipsetType);
    1267 
    1268     AutoCaller autoCaller(this);
    1269     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1270 
     1175HRESULT Machine::getChipsetType(ChipsetType_T *aChipsetType)
     1176{
    12711177    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    12721178
     
    12761182}
    12771183
    1278 STDMETHODIMP Machine::COMSETTER(ChipsetType)(ChipsetType_T aChipsetType)
    1279 {
    1280     AutoCaller autoCaller(this);
    1281     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1184HRESULT Machine::setChipsetType(ChipsetType_T aChipsetType)
     1185{
    12821186    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    12831187
    1284     HRESULT rc = checkStateDependency(MutableStateDep);
     1188    HRESULT rc = i_checkStateDependency(MutableStateDep);
    12851189    if (FAILED(rc)) return rc;
    12861190
    12871191    if (aChipsetType != mHWData->mChipsetType)
    12881192    {
    1289         setModified(IsModified_MachineData);
     1193        i_setModified(IsModified_MachineData);
    12901194        mHWData.backup();
    12911195        mHWData->mChipsetType = aChipsetType;
     
    13101214}
    13111215
    1312 STDMETHODIMP Machine::COMGETTER(ParavirtProvider)(ParavirtProvider_T *aParavirtProvider)
    1313 {
    1314     CheckComArgOutPointerValid(aParavirtProvider);
    1315 
    1316     AutoCaller autoCaller(this);
    1317     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1318 
     1216HRESULT Machine::getParavirtProvider(ParavirtProvider_T *aParavirtProvider)
     1217{
    13191218    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    13201219
     
    13241223}
    13251224
    1326 STDMETHODIMP Machine::COMSETTER(ParavirtProvider)(ParavirtProvider_T aParavirtProvider)
    1327 {
    1328     AutoCaller autoCaller(this);
    1329     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1225HRESULT Machine::setParavirtProvider(ParavirtProvider_T aParavirtProvider)
     1226{
    13301227    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    13311228
    1332     HRESULT rc = checkStateDependency(MutableStateDep);
     1229    HRESULT rc = i_checkStateDependency(MutableStateDep);
    13331230    if (FAILED(rc)) return rc;
    13341231
    13351232    if (aParavirtProvider != mHWData->mParavirtProvider)
    13361233    {
    1337         setModified(IsModified_MachineData);
     1234        i_setModified(IsModified_MachineData);
    13381235        mHWData.backup();
    13391236        mHWData->mParavirtProvider = aParavirtProvider;
     
    13431240}
    13441241
    1345 STDMETHODIMP Machine::COMGETTER(HardwareVersion)(BSTR *aHWVersion)
    1346 {
    1347     CheckComArgOutPointerValid(aHWVersion);
    1348 
    1349     AutoCaller autoCaller(this);
    1350     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1351 
     1242HRESULT Machine::getHardwareVersion(com::Utf8Str &aHardwareVersion)
     1243{
    13521244    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    13531245
    1354     mHWData->mHWVersion.cloneTo(aHWVersion);
    1355 
    1356     return S_OK;
    1357 }
    1358 
    1359 STDMETHODIMP Machine::COMSETTER(HardwareVersion)(IN_BSTR aHWVersion)
     1246    aHardwareVersion = mHWData->mHWVersion;
     1247
     1248    return S_OK;
     1249}
     1250
     1251HRESULT Machine::setHardwareVersion(const com::Utf8Str &aHardwareVersion)
    13601252{
    13611253    /* check known version */
    1362     Utf8Str hwVersion = aHWVersion;
     1254    Utf8Str hwVersion = aHardwareVersion;
    13631255    if (    hwVersion.compare("1") != 0
    13641256        &&  hwVersion.compare("2") != 0)
    13651257        return setError(E_INVALIDARG,
    1366                         tr("Invalid hardware version: %ls\n"), aHWVersion);
    1367 
    1368     AutoCaller autoCaller(this);
    1369     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1258                        tr("Invalid hardware version: %s\n"), aHardwareVersion.c_str());
    13701259
    13711260    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    13721261
    1373     HRESULT rc = checkStateDependency(MutableStateDep);
     1262    HRESULT rc = i_checkStateDependency(MutableStateDep);
    13741263    if (FAILED(rc)) return rc;
    13751264
    1376     setModified(IsModified_MachineData);
     1265    i_setModified(IsModified_MachineData);
    13771266    mHWData.backup();
    1378     mHWData->mHWVersion = hwVersion;
    1379 
    1380     return S_OK;
    1381 }
    1382 
    1383 STDMETHODIMP Machine::COMGETTER(HardwareUUID)(BSTR *aUUID)
    1384 {
    1385     CheckComArgOutPointerValid(aUUID);
    1386 
    1387     AutoCaller autoCaller(this);
    1388     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1389 
     1267    mHWData->mHWVersion = aHardwareVersion;
     1268
     1269    return S_OK;
     1270}
     1271
     1272HRESULT Machine::getHardwareUUID(com::Guid &aHardwareUUID)
     1273{
    13901274    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    13911275
    13921276    if (!mHWData->mHardwareUUID.isZero())
    1393         mHWData->mHardwareUUID.toUtf16().cloneTo(aUUID);
     1277        aHardwareUUID = mHWData->mHardwareUUID;
    13941278    else
    1395         mData->mUuid.toUtf16().cloneTo(aUUID);
    1396 
    1397     return S_OK;
    1398 }
    1399 
    1400 STDMETHODIMP Machine::COMSETTER(HardwareUUID)(IN_BSTR aUUID)
    1401 {
    1402     Guid hardwareUUID(aUUID);
    1403     if (!hardwareUUID.isValid())
     1279        aHardwareUUID = mData->mUuid;
     1280
     1281    return S_OK;
     1282}
     1283
     1284HRESULT Machine::setHardwareUUID(const com::Guid &aHardwareUUID)
     1285{
     1286    if (!aHardwareUUID.isValid())
    14041287        return E_INVALIDARG;
    14051288
    1406     AutoCaller autoCaller(this);
    1407     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1408 
    14091289    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    14101290
    1411     HRESULT rc = checkStateDependency(MutableStateDep);
     1291    HRESULT rc = i_checkStateDependency(MutableStateDep);
    14121292    if (FAILED(rc)) return rc;
    14131293
    1414     setModified(IsModified_MachineData);
     1294    i_setModified(IsModified_MachineData);
    14151295    mHWData.backup();
    1416     if (hardwareUUID == mData->mUuid)
     1296    if (aHardwareUUID == mData->mUuid)
    14171297        mHWData->mHardwareUUID.clear();
    14181298    else
    1419         mHWData->mHardwareUUID = hardwareUUID;
    1420 
    1421     return S_OK;
    1422 }
    1423 
    1424 STDMETHODIMP Machine::COMGETTER(MemorySize)(ULONG *memorySize)
    1425 {
    1426     CheckComArgOutPointerValid(memorySize);
    1427 
    1428     AutoCaller autoCaller(this);
    1429     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1430 
     1299        mHWData->mHardwareUUID = aHardwareUUID;
     1300
     1301    return S_OK;
     1302}
     1303
     1304HRESULT Machine::getMemorySize(ULONG *aMemorySize)
     1305{
    14311306    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    14321307
    1433     *memorySize = mHWData->mMemorySize;
    1434 
    1435     return S_OK;
    1436 }
    1437 
    1438 STDMETHODIMP Machine::COMSETTER(MemorySize)(ULONG memorySize)
     1308    *aMemorySize = mHWData->mMemorySize;
     1309
     1310    return S_OK;
     1311}
     1312
     1313HRESULT Machine::setMemorySize(ULONG aMemorySize)
    14391314{
    14401315    /* check RAM limits */
    1441     if (    memorySize < MM_RAM_MIN_IN_MB
    1442          || memorySize > MM_RAM_MAX_IN_MB
     1316    if (    aMemorySize < MM_RAM_MIN_IN_MB
     1317         || aMemorySize > MM_RAM_MAX_IN_MB
    14431318       )
    14441319        return setError(E_INVALIDARG,
    14451320                        tr("Invalid RAM size: %lu MB (must be in range [%lu, %lu] MB)"),
    1446                         memorySize, MM_RAM_MIN_IN_MB, MM_RAM_MAX_IN_MB);
    1447 
    1448     AutoCaller autoCaller(this);
    1449     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1321                        aMemorySize, MM_RAM_MIN_IN_MB, MM_RAM_MAX_IN_MB);
    14501322
    14511323    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    14521324
    1453     HRESULT rc = checkStateDependency(MutableStateDep);
     1325    HRESULT rc = i_checkStateDependency(MutableStateDep);
    14541326    if (FAILED(rc)) return rc;
    14551327
    1456     setModified(IsModified_MachineData);
     1328    i_setModified(IsModified_MachineData);
    14571329    mHWData.backup();
    1458     mHWData->mMemorySize = memorySize;
    1459 
    1460     return S_OK;
    1461 }
    1462 
    1463 STDMETHODIMP Machine::COMGETTER(CPUCount)(ULONG *CPUCount)
    1464 {
    1465     CheckComArgOutPointerValid(CPUCount);
    1466 
    1467     AutoCaller autoCaller(this);
    1468     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1469 
     1330    mHWData->mMemorySize = aMemorySize;
     1331
     1332    return S_OK;
     1333}
     1334
     1335HRESULT Machine::getCPUCount(ULONG *aCPUCount)
     1336{
    14701337    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    14711338
    1472     *CPUCount = mHWData->mCPUCount;
    1473 
    1474     return S_OK;
    1475 }
    1476 
    1477 STDMETHODIMP Machine::COMSETTER(CPUCount)(ULONG CPUCount)
     1339    *aCPUCount = mHWData->mCPUCount;
     1340
     1341    return S_OK;
     1342}
     1343
     1344HRESULT Machine::setCPUCount(ULONG aCPUCount)
    14781345{
    14791346    /* check CPU limits */
    1480     if (    CPUCount < SchemaDefs::MinCPUCount
    1481          || CPUCount > SchemaDefs::MaxCPUCount
     1347    if (    aCPUCount < SchemaDefs::MinCPUCount
     1348         || aCPUCount > SchemaDefs::MaxCPUCount
    14821349       )
    14831350        return setError(E_INVALIDARG,
    14841351                        tr("Invalid virtual CPU count: %lu (must be in range [%lu, %lu])"),
    1485                         CPUCount, SchemaDefs::MinCPUCount, SchemaDefs::MaxCPUCount);
    1486 
    1487     AutoCaller autoCaller(this);
    1488     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1352                        aCPUCount, SchemaDefs::MinCPUCount, SchemaDefs::MaxCPUCount);
    14891353
    14901354    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    14931357    if (mHWData->mCPUHotPlugEnabled)
    14941358    {
    1495         for (unsigned idx = CPUCount; idx < SchemaDefs::MaxCPUCount; idx++)
     1359        for (unsigned idx = aCPUCount; idx < SchemaDefs::MaxCPUCount; idx++)
    14961360        {
    14971361            if (mHWData->mCPUAttached[idx])
     
    14991363                                tr("There is still a CPU attached to socket %lu."
    15001364                                   "Detach the CPU before removing the socket"),
    1501                                 CPUCount, idx+1);
    1502         }
    1503     }
    1504 
    1505     HRESULT rc = checkStateDependency(MutableStateDep);
     1365                                aCPUCount, idx+1);
     1366        }
     1367    }
     1368
     1369    HRESULT rc = i_checkStateDependency(MutableStateDep);
    15061370    if (FAILED(rc)) return rc;
    15071371
    1508     setModified(IsModified_MachineData);
     1372    i_setModified(IsModified_MachineData);
    15091373    mHWData.backup();
    1510     mHWData->mCPUCount = CPUCount;
    1511 
    1512     return S_OK;
    1513 }
    1514 
    1515 STDMETHODIMP Machine::COMGETTER(CPUExecutionCap)(ULONG *aExecutionCap)
    1516 {
    1517     CheckComArgOutPointerValid(aExecutionCap);
    1518 
    1519     AutoCaller autoCaller(this);
    1520     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1521 
     1374    mHWData->mCPUCount = aCPUCount;
     1375
     1376    return S_OK;
     1377}
     1378
     1379HRESULT Machine::getCPUExecutionCap(ULONG *aCPUExecutionCap)
     1380{
    15221381    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    15231382
    1524     *aExecutionCap = mHWData->mCpuExecutionCap;
    1525 
    1526     return S_OK;
    1527 }
    1528 
    1529 STDMETHODIMP Machine::COMSETTER(CPUExecutionCap)(ULONG aExecutionCap)
     1383    *aCPUExecutionCap = mHWData->mCpuExecutionCap;
     1384
     1385    return S_OK;
     1386}
     1387
     1388HRESULT Machine::setCPUExecutionCap(ULONG aCPUExecutionCap)
    15301389{
    15311390    HRESULT rc = S_OK;
    15321391
    15331392    /* check throttle limits */
    1534     if (    aExecutionCap < 1
    1535          || aExecutionCap > 100
     1393    if (    aCPUExecutionCap < 1
     1394         || aCPUExecutionCap > 100
    15361395       )
    15371396        return setError(E_INVALIDARG,
    15381397                        tr("Invalid CPU execution cap value: %lu (must be in range [%lu, %lu])"),
    1539                         aExecutionCap, 1, 100);
    1540 
    1541     AutoCaller autoCaller(this);
    1542     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1398                        aCPUExecutionCap, 1, 100);
    15431399
    15441400    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    15451401
    15461402    alock.release();
    1547     rc = onCPUExecutionCapChange(aExecutionCap);
     1403    rc = i_onCPUExecutionCapChange(aCPUExecutionCap);
    15481404    alock.acquire();
    15491405    if (FAILED(rc)) return rc;
    15501406
    1551     setModified(IsModified_MachineData);
     1407    i_setModified(IsModified_MachineData);
    15521408    mHWData.backup();
    1553     mHWData->mCpuExecutionCap = aExecutionCap;
     1409    mHWData->mCpuExecutionCap = aCPUExecutionCap;
    15541410
    15551411    /** Save settings if online - @todo why is this required? -- @bugref{6818} */
    15561412    if (Global::IsOnline(mData->mMachineState))
    1557         saveSettings(NULL);
    1558 
    1559     return S_OK;
    1560 }
    1561 
    1562 
    1563 STDMETHODIMP Machine::COMGETTER(CPUHotPlugEnabled)(BOOL *aEnabled)
    1564 {
    1565     CheckComArgOutPointerValid(aEnabled);
    1566 
    1567     AutoCaller autoCaller(this);
    1568     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1569 
     1413        i_saveSettings(NULL);
     1414
     1415    return S_OK;
     1416}
     1417
     1418HRESULT Machine::getCPUHotPlugEnabled(BOOL *aCPUHotPlugEnabled)
     1419{
    15701420    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    15711421
    1572     *aEnabled = mHWData->mCPUHotPlugEnabled;
    1573 
    1574     return S_OK;
    1575 }
    1576 
    1577 STDMETHODIMP Machine::COMSETTER(CPUHotPlugEnabled)(BOOL aEnabled)
     1422    *aCPUHotPlugEnabled = mHWData->mCPUHotPlugEnabled;
     1423
     1424    return S_OK;
     1425}
     1426
     1427HRESULT Machine::setCPUHotPlugEnabled(BOOL aCPUHotPlugEnabled)
    15781428{
    15791429    HRESULT rc = S_OK;
    15801430
    1581     AutoCaller autoCaller(this);
    1582     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1583 
    15841431    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    15851432
    1586     rc = checkStateDependency(MutableStateDep);
     1433    rc = i_checkStateDependency(MutableStateDep);
    15871434    if (FAILED(rc)) return rc;
    15881435
    1589     if (mHWData->mCPUHotPlugEnabled != aEnabled)
    1590     {
    1591         if (aEnabled)
    1592         {
    1593             setModified(IsModified_MachineData);
     1436    if (mHWData->mCPUHotPlugEnabled != aCPUHotPlugEnabled)
     1437    {
     1438        if (aCPUHotPlugEnabled)
     1439        {
     1440            i_setModified(IsModified_MachineData);
    15941441            mHWData.backup();
    15951442
    15961443            /* Add the amount of CPUs currently attached */
    1597             for (unsigned i = 0; i < mHWData->mCPUCount; i++)
    1598             {
     1444            for (unsigned i = 0; i < mHWData->mCPUCount; ++i)
    15991445                mHWData->mCPUAttached[i] = true;
    1600             }
    16011446        }
    16021447        else
     
    16091454            unsigned iHighestId = 0;
    16101455
    1611             for (unsigned i = 0; i < SchemaDefs::MaxCPUCount; i++)
     1456            for (unsigned i = 0; i < SchemaDefs::MaxCPUCount; ++i)
    16121457            {
    16131458                if (mHWData->mCPUAttached[i])
     
    16231468                                tr("CPU hotplugging can't be disabled because the maximum number of CPUs is not equal to the amount of CPUs attached"));
    16241469
    1625             setModified(IsModified_MachineData);
     1470            i_setModified(IsModified_MachineData);
    16261471            mHWData.backup();
    16271472        }
    16281473    }
    16291474
    1630     mHWData->mCPUHotPlugEnabled = aEnabled;
     1475    mHWData->mCPUHotPlugEnabled = aCPUHotPlugEnabled;
    16311476
    16321477    return rc;
    16331478}
    16341479
    1635 STDMETHODIMP Machine::COMGETTER(EmulatedUSBCardReaderEnabled)(BOOL *aEnabled)
     1480HRESULT Machine::getEmulatedUSBCardReaderEnabled(BOOL *aEmulatedUSBCardReaderEnabled)
    16361481{
    16371482#ifdef VBOX_WITH_USB_CARDREADER
    1638     CheckComArgOutPointerValid(aEnabled);
    1639 
    1640     AutoCaller autoCaller(this);
    1641     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1642 
    16431483    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    16441484
    1645     *aEnabled = mHWData->mEmulatedUSBCardReaderEnabled;
     1485    *aEmulatedUSBCardReaderEnabled = mHWData->mEmulatedUSBCardReaderEnabled;
    16461486
    16471487    return S_OK;
    16481488#else
    1649     NOREF(aEnabled);
     1489    NOREF(aEmulatedUSBCardReaderEnabled);
    16501490    return E_NOTIMPL;
    16511491#endif
    16521492}
    16531493
    1654 STDMETHODIMP Machine::COMSETTER(EmulatedUSBCardReaderEnabled)(BOOL aEnabled)
     1494HRESULT Machine::setEmulatedUSBCardReaderEnabled(BOOL aEmulatedUSBCardReaderEnabled)
    16551495{
    16561496#ifdef VBOX_WITH_USB_CARDREADER
    1657     AutoCaller autoCaller(this);
    1658     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    16591497    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    16601498
    1661     HRESULT rc = checkStateDependency(MutableStateDep);
     1499    HRESULT rc = i_checkStateDependency(MutableStateDep);
    16621500    if (FAILED(rc)) return rc;
    16631501
    1664     setModified(IsModified_MachineData);
     1502    i_setModified(IsModified_MachineData);
    16651503    mHWData.backup();
    1666     mHWData->mEmulatedUSBCardReaderEnabled = aEnabled;
     1504    mHWData->mEmulatedUSBCardReaderEnabled = aEmulatedUSBCardReaderEnabled;
    16671505
    16681506    return S_OK;
    16691507#else
    1670     NOREF(aEnabled);
     1508    NOREF(aEmulatedUSBCardReaderEnabled);
    16711509    return E_NOTIMPL;
    16721510#endif
    16731511}
    16741512
    1675 STDMETHODIMP Machine::COMGETTER(HPETEnabled)(BOOL *aEnabled)
    1676 {
    1677     CheckComArgOutPointerValid(aEnabled);
    1678 
    1679     AutoCaller autoCaller(this);
    1680     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1513HRESULT Machine::getHPETEnabled(BOOL *aHPETEnabled)
     1514{
    16811515    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    16821516
    1683     *aEnabled = mHWData->mHPETEnabled;
    1684 
    1685     return S_OK;
    1686 }
    1687 
    1688 STDMETHODIMP Machine::COMSETTER(HPETEnabled)(BOOL aEnabled)
     1517    *aHPETEnabled = mHWData->mHPETEnabled;
     1518
     1519    return S_OK;
     1520}
     1521
     1522HRESULT Machine::setHPETEnabled(BOOL aHPETEnabled)
    16891523{
    16901524    HRESULT rc = S_OK;
    16911525
    1692     AutoCaller autoCaller(this);
    1693     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    16941526    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    16951527
    1696     rc = checkStateDependency(MutableStateDep);
     1528    rc = i_checkStateDependency(MutableStateDep);
    16971529    if (FAILED(rc)) return rc;
    16981530
    1699     setModified(IsModified_MachineData);
     1531    i_setModified(IsModified_MachineData);
    17001532    mHWData.backup();
    17011533
    1702     mHWData->mHPETEnabled = aEnabled;
     1534    mHWData->mHPETEnabled = aHPETEnabled;
    17031535
    17041536    return rc;
    17051537}
    17061538
    1707 STDMETHODIMP Machine::COMGETTER(VideoCaptureEnabled)(BOOL *fEnabled)
    1708 {
    1709     AutoCaller autoCaller(this);
    1710     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1711 
     1539HRESULT Machine::getVideoCaptureEnabled(BOOL *aVideoCaptureEnabled)
     1540{
    17121541    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    17131542
    1714     *fEnabled = mHWData->mVideoCaptureEnabled;
    1715     return S_OK;
    1716 }
    1717 
    1718 STDMETHODIMP Machine::COMSETTER(VideoCaptureEnabled)(BOOL fEnabled)
     1543    *aVideoCaptureEnabled = mHWData->mVideoCaptureEnabled;
     1544    return S_OK;
     1545}
     1546
     1547HRESULT Machine::setVideoCaptureEnabled(BOOL aVideoCaptureEnabled)
    17191548{
    17201549    HRESULT rc = S_OK;
    17211550
    1722     AutoCaller autoCaller(this);
    1723     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    17241551    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    17251552
    1726     setModified(IsModified_MachineData);
     1553    i_setModified(IsModified_MachineData);
    17271554    mHWData.backup();
    1728     mHWData->mVideoCaptureEnabled = fEnabled;
     1555    mHWData->mVideoCaptureEnabled = aVideoCaptureEnabled;
    17291556
    17301557    alock.release();
    1731     rc = onVideoCaptureChange();
     1558    rc = i_onVideoCaptureChange();
    17321559    alock.acquire();
    17331560    if (FAILED(rc))
    17341561    {
    17351562        /*
    1736          * Normally we would do the actual change _after_ onVideoCaptureChange() succeeded.
     1563         * Normally we would do the actual change _after_ i_onVideoCaptureChange() succeeded.
    17371564         * We cannot do this because that function uses Machine::GetVideoCaptureEnabled to
    17381565         * determine if it should start or stop capturing. Therefore we need to manually
     
    17451572    /** Save settings if online - @todo why is this required? -- @bugref{6818} */
    17461573    if (Global::IsOnline(mData->mMachineState))
    1747         saveSettings(NULL);
     1574        i_saveSettings(NULL);
    17481575
    17491576    return rc;
    17501577}
    17511578
    1752 STDMETHODIMP Machine::COMGETTER(VideoCaptureScreens)(ComSafeArrayOut(BOOL, aScreens))
    1753 {
    1754     CheckComArgOutSafeArrayPointerValid(aScreens);
    1755 
    1756     AutoCaller autoCaller(this);
    1757     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1758 
     1579HRESULT Machine::getVideoCaptureScreens(std::vector<BOOL> &aVideoCaptureScreens)
     1580{
    17591581    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1760 
    1761     SafeArray<BOOL> screens(mHWData->mMonitorCount);
    1762     for (unsigned i = 0; i < screens.size(); i++)
    1763         screens[i] = mHWData->maVideoCaptureScreens[i];
    1764     screens.detachTo(ComSafeArrayOutArg(aScreens));
    1765     return S_OK;
    1766 }
    1767 
    1768 STDMETHODIMP Machine::COMSETTER(VideoCaptureScreens)(ComSafeArrayIn(BOOL, aScreens))
    1769 {
    1770     SafeArray<BOOL> screens(ComSafeArrayInArg(aScreens));
     1582    aVideoCaptureScreens.resize(mHWData->mMonitorCount);
     1583    for (unsigned i = 0; i < mHWData->mMonitorCount; ++i)
     1584        aVideoCaptureScreens[i] = mHWData->maVideoCaptureScreens[i];
     1585    return S_OK;
     1586}
     1587
     1588HRESULT Machine::setVideoCaptureScreens(const std::vector<BOOL> &aVideoCaptureScreens)
     1589{
     1590    SafeArray<BOOL> screens(aVideoCaptureScreens);
    17711591    AssertReturn(screens.size() <= RT_ELEMENTS(mHWData->maVideoCaptureScreens), E_INVALIDARG);
    17721592    bool fChanged = false;
     
    17741594    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    17751595
    1776     for (unsigned i = 0; i < screens.size(); i++)
     1596    for (unsigned i = 0; i < screens.size(); ++i)
    17771597    {
    17781598        if (mHWData->maVideoCaptureScreens[i] != RT_BOOL(screens[i]))
     
    17851605    {
    17861606        alock.release();
    1787         HRESULT rc = onVideoCaptureChange();
     1607        HRESULT rc = i_onVideoCaptureChange();
    17881608        alock.acquire();
    17891609        if (FAILED(rc)) return rc;
    1790         setModified(IsModified_MachineData);
     1610        i_setModified(IsModified_MachineData);
    17911611
    17921612        /** Save settings if online - @todo why is this required? -- @bugref{6818} */
    17931613        if (Global::IsOnline(mData->mMachineState))
    1794             saveSettings(NULL);
    1795     }
    1796 
    1797     return S_OK;
    1798 }
    1799 
    1800 STDMETHODIMP Machine::COMGETTER(VideoCaptureFile)(BSTR *apFile)
    1801 {
    1802     AutoCaller autoCaller(this);
    1803     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1804 
     1614            i_saveSettings(NULL);
     1615    }
     1616
     1617    return S_OK;
     1618}
     1619
     1620HRESULT Machine::getVideoCaptureFile(com::Utf8Str &aVideoCaptureFile)
     1621{
    18051622    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    18061623    if (mHWData->mVideoCaptureFile.isEmpty())
    1807     {
    1808         Utf8Str defaultFile;
    1809         getDefaultVideoCaptureFile(defaultFile);
    1810         defaultFile.cloneTo(apFile);
    1811     }
     1624        i_getDefaultVideoCaptureFile(aVideoCaptureFile);
    18121625    else
    1813         mHWData->mVideoCaptureFile.cloneTo(apFile);
    1814     return S_OK;
    1815 }
    1816 
    1817 STDMETHODIMP Machine::COMSETTER(VideoCaptureFile)(IN_BSTR aFile)
    1818 {
    1819     Utf8Str strFile(aFile);
    1820     AutoCaller autoCaller(this);
    1821     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1822 
     1626        aVideoCaptureFile = mHWData->mVideoCaptureFile;
     1627    return S_OK;
     1628}
     1629
     1630HRESULT Machine::setVideoCaptureFile(const com::Utf8Str &aVideoCaptureFile)
     1631{
     1632    Utf8Str strFile(aVideoCaptureFile);
    18231633    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    18241634
     
    18331643    {
    18341644        Utf8Str defaultFile;
    1835         getDefaultVideoCaptureFile(defaultFile);
     1645        i_getDefaultVideoCaptureFile(defaultFile);
    18361646        if (!RTPathCompare(strFile.c_str(), defaultFile.c_str()))
    18371647            strFile.setNull();
    18381648    }
    18391649
    1840     setModified(IsModified_MachineData);
     1650    i_setModified(IsModified_MachineData);
    18411651    mHWData.backup();
    18421652    mHWData->mVideoCaptureFile = strFile;
     
    18451655}
    18461656
    1847 STDMETHODIMP Machine::COMGETTER(VideoCaptureWidth)(ULONG *aHorzRes)
    1848 {
    1849     AutoCaller autoCaller(this);
    1850     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1851 
     1657HRESULT Machine::getVideoCaptureWidth(ULONG *aVideoCaptureWidth)
     1658{
    18521659    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1853     *aHorzRes = mHWData->mVideoCaptureWidth;
    1854     return S_OK;
    1855 }
    1856 
    1857 STDMETHODIMP Machine::COMSETTER(VideoCaptureWidth)(ULONG aHorzRes)
    1858 {
    1859     AutoCaller autoCaller(this);
    1860     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1861 
     1660    *aVideoCaptureWidth = mHWData->mVideoCaptureWidth;
     1661    return S_OK;
     1662}
     1663
     1664HRESULT Machine::setVideoCaptureWidth(ULONG aVideoCaptureWidth)
     1665{
    18621666    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    18631667
     
    18661670        return setError(E_INVALIDARG, tr("Cannot change parameters while capturing is enabled"));
    18671671
    1868     setModified(IsModified_MachineData);
     1672    i_setModified(IsModified_MachineData);
    18691673    mHWData.backup();
    1870     mHWData->mVideoCaptureWidth = aHorzRes;
    1871 
    1872     return S_OK;
    1873 }
    1874 
    1875 STDMETHODIMP Machine::COMGETTER(VideoCaptureHeight)(ULONG *aVertRes)
    1876 {
    1877     AutoCaller autoCaller(this);
    1878     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1879 
     1674    mHWData->mVideoCaptureWidth = aVideoCaptureWidth;
     1675
     1676    return S_OK;
     1677}
     1678
     1679HRESULT Machine::getVideoCaptureHeight(ULONG *aVideoCaptureHeight)
     1680{
    18801681    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1881      *aVertRes = mHWData->mVideoCaptureHeight;
    1882     return S_OK;
    1883 }
    1884 
    1885 STDMETHODIMP Machine::COMSETTER(VideoCaptureHeight)(ULONG aVertRes)
    1886 {
    1887     AutoCaller autoCaller(this);
    1888     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1889 
     1682    *aVideoCaptureHeight = mHWData->mVideoCaptureHeight;
     1683    return S_OK;
     1684}
     1685
     1686HRESULT Machine::setVideoCaptureHeight(ULONG aVideoCaptureHeight)
     1687{
    18901688    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    18911689
     
    18941692        return setError(E_INVALIDARG, tr("Cannot change parameters while capturing is enabled"));
    18951693
    1896     setModified(IsModified_MachineData);
     1694    i_setModified(IsModified_MachineData);
    18971695    mHWData.backup();
    1898     mHWData->mVideoCaptureHeight = aVertRes;
    1899 
    1900     return S_OK;
    1901 }
    1902 
    1903 STDMETHODIMP Machine::COMGETTER(VideoCaptureRate)(ULONG *aRate)
    1904 {
    1905     AutoCaller autoCaller(this);
    1906     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1907 
     1696    mHWData->mVideoCaptureHeight = aVideoCaptureHeight;
     1697
     1698    return S_OK;
     1699}
     1700
     1701HRESULT Machine::getVideoCaptureRate(ULONG *aVideoCaptureRate)
     1702{
    19081703    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1909      *aRate = mHWData->mVideoCaptureRate;
    1910     return S_OK;
    1911 }
    1912 
    1913 STDMETHODIMP Machine::COMSETTER(VideoCaptureRate)(ULONG aRate)
    1914 {
    1915     AutoCaller autoCaller(this);
    1916     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1917 
     1704    *aVideoCaptureRate = mHWData->mVideoCaptureRate;
     1705    return S_OK;
     1706}
     1707
     1708HRESULT Machine::setVideoCaptureRate(ULONG aVideoCaptureRate)
     1709{
    19181710    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    19191711
     
    19221714        return setError(E_INVALIDARG, tr("Cannot change parameters while capturing is enabled"));
    19231715
    1924     setModified(IsModified_MachineData);
     1716    i_setModified(IsModified_MachineData);
    19251717    mHWData.backup();
    1926     mHWData->mVideoCaptureRate = aRate;
    1927 
    1928     return S_OK;
    1929 }
    1930 
    1931 STDMETHODIMP Machine::COMGETTER(VideoCaptureFPS)(ULONG *aFPS)
    1932 {
    1933     AutoCaller autoCaller(this);
    1934     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1935 
     1718    mHWData->mVideoCaptureRate = aVideoCaptureRate;
     1719
     1720    return S_OK;
     1721}
     1722
     1723HRESULT Machine::getVideoCaptureFPS(ULONG *aVideoCaptureFPS)
     1724{
    19361725    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1937      *aFPS = mHWData->mVideoCaptureFPS;
    1938     return S_OK;
    1939 }
    1940 
    1941 STDMETHODIMP Machine::COMSETTER(VideoCaptureFPS)(ULONG aFPS)
    1942 {
    1943     AutoCaller autoCaller(this);
    1944     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1945 
     1726    *aVideoCaptureFPS = mHWData->mVideoCaptureFPS;
     1727    return S_OK;
     1728}
     1729
     1730HRESULT Machine::setVideoCaptureFPS(ULONG aVideoCaptureFPS)
     1731{
    19461732    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    19471733
     
    19501736        return setError(E_INVALIDARG, tr("Cannot change parameters while capturing is enabled"));
    19511737
    1952     setModified(IsModified_MachineData);
     1738    i_setModified(IsModified_MachineData);
    19531739    mHWData.backup();
    1954     mHWData->mVideoCaptureFPS = aFPS;
    1955 
    1956     return S_OK;
    1957 }
    1958 
    1959 STDMETHODIMP Machine::COMGETTER(GraphicsControllerType)(GraphicsControllerType_T *aGraphicsControllerType)
    1960 {
    1961     CheckComArgOutPointerValid(aGraphicsControllerType);
    1962 
    1963     AutoCaller autoCaller(this);
    1964     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1965 
     1740    mHWData->mVideoCaptureFPS = aVideoCaptureFPS;
     1741
     1742    return S_OK;
     1743}
     1744
     1745HRESULT Machine::getGraphicsControllerType(GraphicsControllerType_T *aGraphicsControllerType)
     1746{
    19661747    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    19671748
     
    19711752}
    19721753
    1973 STDMETHODIMP Machine::COMSETTER(GraphicsControllerType)(GraphicsControllerType_T aGraphicsControllerType)
     1754HRESULT Machine::setGraphicsControllerType(GraphicsControllerType_T aGraphicsControllerType)
    19741755{
    19751756    switch (aGraphicsControllerType)
     
    19851766    }
    19861767
    1987     AutoCaller autoCaller(this);
    1988     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1989 
    19901768    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    19911769
    1992     HRESULT rc = checkStateDependency(MutableStateDep);
     1770    HRESULT rc = i_checkStateDependency(MutableStateDep);
    19931771    if (FAILED(rc)) return rc;
    19941772
    1995     setModified(IsModified_MachineData);
     1773    i_setModified(IsModified_MachineData);
    19961774    mHWData.backup();
    19971775    mHWData->mGraphicsControllerType = aGraphicsControllerType;
     
    20001778}
    20011779
    2002 STDMETHODIMP Machine::COMGETTER(VRAMSize)(ULONG *memorySize)
    2003 {
    2004     CheckComArgOutPointerValid(memorySize);
    2005 
    2006     AutoCaller autoCaller(this);
    2007     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2008 
     1780HRESULT Machine::getVRAMSize(ULONG *aVRAMSize)
     1781{
    20091782    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    20101783
    2011     *memorySize = mHWData->mVRAMSize;
    2012 
    2013     return S_OK;
    2014 }
    2015 
    2016 STDMETHODIMP Machine::COMSETTER(VRAMSize)(ULONG memorySize)
     1784    *aVRAMSize = mHWData->mVRAMSize;
     1785
     1786    return S_OK;
     1787}
     1788
     1789HRESULT Machine::setVRAMSize(ULONG aVRAMSize)
    20171790{
    20181791    /* check VRAM limits */
    2019     if (memorySize < SchemaDefs::MinGuestVRAM ||
    2020         memorySize > SchemaDefs::MaxGuestVRAM)
     1792    if (aVRAMSize < SchemaDefs::MinGuestVRAM ||
     1793        aVRAMSize > SchemaDefs::MaxGuestVRAM)
    20211794        return setError(E_INVALIDARG,
    20221795                        tr("Invalid VRAM size: %lu MB (must be in range [%lu, %lu] MB)"),
    2023                         memorySize, SchemaDefs::MinGuestVRAM, SchemaDefs::MaxGuestVRAM);
    2024 
    2025     AutoCaller autoCaller(this);
    2026     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1796                        aVRAMSize, SchemaDefs::MinGuestVRAM, SchemaDefs::MaxGuestVRAM);
    20271797
    20281798    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    20291799
    2030     HRESULT rc = checkStateDependency(MutableStateDep);
     1800    HRESULT rc = i_checkStateDependency(MutableStateDep);
    20311801    if (FAILED(rc)) return rc;
    20321802
    2033     setModified(IsModified_MachineData);
     1803    i_setModified(IsModified_MachineData);
    20341804    mHWData.backup();
    2035     mHWData->mVRAMSize = memorySize;
     1805    mHWData->mVRAMSize = aVRAMSize;
    20361806
    20371807    return S_OK;
     
    20391809
    20401810/** @todo this method should not be public */
    2041 STDMETHODIMP Machine::COMGETTER(MemoryBalloonSize)(ULONG *memoryBalloonSize)
    2042 {
    2043     CheckComArgOutPointerValid(memoryBalloonSize);
    2044 
    2045     AutoCaller autoCaller(this);
    2046     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2047 
     1811HRESULT Machine::getMemoryBalloonSize(ULONG *aMemoryBalloonSize)
     1812{
    20481813    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    20491814
    2050     *memoryBalloonSize = mHWData->mMemoryBalloonSize;
     1815    *aMemoryBalloonSize = mHWData->mMemoryBalloonSize;
    20511816
    20521817    return S_OK;
     
    20591824 * we have to make sure that we never call IGuest from here.
    20601825 */
    2061 STDMETHODIMP Machine::COMSETTER(MemoryBalloonSize)(ULONG memoryBalloonSize)
     1826HRESULT Machine::setMemoryBalloonSize(ULONG aMemoryBalloonSize)
    20621827{
    20631828    /* This must match GMMR0Init; currently we only support memory ballooning on all 64-bit hosts except Mac OS X */
    20641829#if HC_ARCH_BITS == 64 && (defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) || defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD))
    20651830    /* check limits */
    2066     if (memoryBalloonSize >= VMMDEV_MAX_MEMORY_BALLOON(mHWData->mMemorySize))
     1831    if (aMemoryBalloonSize >= VMMDEV_MAX_MEMORY_BALLOON(mHWData->mMemorySize))
    20671832        return setError(E_INVALIDARG,
    20681833                        tr("Invalid memory balloon size: %lu MB (must be in range [%lu, %lu] MB)"),
    2069                         memoryBalloonSize, 0, VMMDEV_MAX_MEMORY_BALLOON(mHWData->mMemorySize));
    2070 
    2071     AutoCaller autoCaller(this);
    2072     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1834                        aMemoryBalloonSize, 0, VMMDEV_MAX_MEMORY_BALLOON(mHWData->mMemorySize));
    20731835
    20741836    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    20751837
    2076     setModified(IsModified_MachineData);
     1838    i_setModified(IsModified_MachineData);
    20771839    mHWData.backup();
    2078     mHWData->mMemoryBalloonSize = memoryBalloonSize;
     1840    mHWData->mMemoryBalloonSize = aMemoryBalloonSize;
    20791841
    20801842    return S_OK;
    20811843#else
    2082     NOREF(memoryBalloonSize);
     1844    NOREF(aMemoryBalloonSize);
    20831845    return setError(E_NOTIMPL, tr("Memory ballooning is only supported on 64-bit hosts"));
    20841846#endif
    20851847}
    20861848
    2087 STDMETHODIMP Machine::COMGETTER(PageFusionEnabled) (BOOL *aEnabled)
    2088 {
    2089     CheckComArgOutPointerValid(aEnabled);
    2090 
    2091     AutoCaller autoCaller(this);
    2092     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2093 
     1849HRESULT Machine::getPageFusionEnabled(BOOL *aPageFusionEnabled)
     1850{
    20941851    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    20951852
    2096     *aEnabled = mHWData->mPageFusionEnabled;
    2097     return S_OK;
    2098 }
    2099 
    2100 STDMETHODIMP Machine::COMSETTER(PageFusionEnabled) (BOOL aEnabled)
     1853    *aPageFusionEnabled = mHWData->mPageFusionEnabled;
     1854    return S_OK;
     1855}
     1856
     1857HRESULT Machine::setPageFusionEnabled(BOOL aPageFusionEnabled)
    21011858{
    21021859#ifdef VBOX_WITH_PAGE_SHARING
    2103     AutoCaller autoCaller(this);
    2104     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2105 
    21061860    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    21071861
    21081862    /** @todo must support changes for running vms and keep this in sync with IGuest. */
    2109     setModified(IsModified_MachineData);
     1863    i_setModified(IsModified_MachineData);
    21101864    mHWData.backup();
    2111     mHWData->mPageFusionEnabled = aEnabled;
     1865    mHWData->mPageFusionEnabled = aPageFusionEnabled;
    21121866    return S_OK;
    21131867#else
    2114     NOREF(aEnabled);
     1868    NOREF(aPageFusionEnabled);
    21151869    return setError(E_NOTIMPL, tr("Page fusion is only supported on 64-bit hosts"));
    21161870#endif
    21171871}
    21181872
    2119 STDMETHODIMP Machine::COMGETTER(Accelerate3DEnabled)(BOOL *aEnabled)
    2120 {
    2121     CheckComArgOutPointerValid(aEnabled);
    2122 
    2123     AutoCaller autoCaller(this);
    2124     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2125 
     1873HRESULT Machine::getAccelerate3DEnabled(BOOL *aAccelerate3DEnabled)
     1874{
    21261875    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    21271876
    2128     *aEnabled = mHWData->mAccelerate3DEnabled;
    2129 
    2130     return S_OK;
    2131 }
    2132 
    2133 STDMETHODIMP Machine::COMSETTER(Accelerate3DEnabled)(BOOL enable)
    2134 {
    2135     AutoCaller autoCaller(this);
    2136     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2137 
     1877    *aAccelerate3DEnabled = mHWData->mAccelerate3DEnabled;
     1878
     1879    return S_OK;
     1880}
     1881
     1882HRESULT Machine::setAccelerate3DEnabled(BOOL aAccelerate3DEnabled)
     1883{
    21381884    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    21391885
    2140     HRESULT rc = checkStateDependency(MutableStateDep);
     1886    HRESULT rc = i_checkStateDependency(MutableStateDep);
    21411887    if (FAILED(rc)) return rc;
    21421888
    21431889    /** @todo check validity! */
    21441890
    2145     setModified(IsModified_MachineData);
     1891    i_setModified(IsModified_MachineData);
    21461892    mHWData.backup();
    2147     mHWData->mAccelerate3DEnabled = enable;
    2148 
    2149     return S_OK;
    2150 }
    2151 
    2152 
    2153 STDMETHODIMP Machine::COMGETTER(Accelerate2DVideoEnabled)(BOOL *aEnabled)
    2154 {
    2155     CheckComArgOutPointerValid(aEnabled);
    2156 
    2157     AutoCaller autoCaller(this);
    2158     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2159 
     1893    mHWData->mAccelerate3DEnabled = aAccelerate3DEnabled;
     1894
     1895    return S_OK;
     1896}
     1897
     1898
     1899HRESULT Machine::getAccelerate2DVideoEnabled(BOOL *aAccelerate2DVideoEnabled)
     1900{
    21601901    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    21611902
    2162     *aEnabled = mHWData->mAccelerate2DVideoEnabled;
    2163 
    2164     return S_OK;
    2165 }
    2166 
    2167 STDMETHODIMP Machine::COMSETTER(Accelerate2DVideoEnabled)(BOOL enable)
    2168 {
    2169     AutoCaller autoCaller(this);
    2170     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2171 
     1903    *aAccelerate2DVideoEnabled = mHWData->mAccelerate2DVideoEnabled;
     1904
     1905    return S_OK;
     1906}
     1907
     1908HRESULT Machine::setAccelerate2DVideoEnabled(BOOL aAccelerate2DVideoEnabled)
     1909{
    21721910    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    21731911
    2174     HRESULT rc = checkStateDependency(MutableStateDep);
     1912    HRESULT rc = i_checkStateDependency(MutableStateDep);
    21751913    if (FAILED(rc)) return rc;
    21761914
    21771915    /** @todo check validity! */
    2178 
    2179     setModified(IsModified_MachineData);
     1916    i_setModified(IsModified_MachineData);
    21801917    mHWData.backup();
    2181     mHWData->mAccelerate2DVideoEnabled = enable;
    2182 
    2183     return S_OK;
    2184 }
    2185 
    2186 STDMETHODIMP Machine::COMGETTER(MonitorCount)(ULONG *monitorCount)
    2187 {
    2188     CheckComArgOutPointerValid(monitorCount);
    2189 
    2190     AutoCaller autoCaller(this);
    2191     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2192 
     1918    mHWData->mAccelerate2DVideoEnabled = aAccelerate2DVideoEnabled;
     1919
     1920    return S_OK;
     1921}
     1922
     1923HRESULT Machine::getMonitorCount(ULONG *aMonitorCount)
     1924{
    21931925    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    21941926
    2195     *monitorCount = mHWData->mMonitorCount;
    2196 
    2197     return S_OK;
    2198 }
    2199 
    2200 STDMETHODIMP Machine::COMSETTER(MonitorCount)(ULONG monitorCount)
     1927    *aMonitorCount = mHWData->mMonitorCount;
     1928
     1929    return S_OK;
     1930}
     1931
     1932HRESULT Machine::setMonitorCount(ULONG aMonitorCount)
    22011933{
    22021934    /* make sure monitor count is a sensible number */
    2203     if (monitorCount < 1 || monitorCount > SchemaDefs::MaxGuestMonitors)
     1935    if (aMonitorCount < 1 || aMonitorCount > SchemaDefs::MaxGuestMonitors)
    22041936        return setError(E_INVALIDARG,
    22051937                        tr("Invalid monitor count: %lu (must be in range [%lu, %lu])"),
    2206                         monitorCount, 1, SchemaDefs::MaxGuestMonitors);
    2207 
    2208     AutoCaller autoCaller(this);
    2209     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1938                        aMonitorCount, 1, SchemaDefs::MaxGuestMonitors);
    22101939
    22111940    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    22121941
    2213     HRESULT rc = checkStateDependency(MutableStateDep);
     1942    HRESULT rc = i_checkStateDependency(MutableStateDep);
    22141943    if (FAILED(rc)) return rc;
    22151944
    2216     setModified(IsModified_MachineData);
     1945    i_setModified(IsModified_MachineData);
    22171946    mHWData.backup();
    2218     mHWData->mMonitorCount = monitorCount;
    2219 
    2220     return S_OK;
    2221 }
    2222 
    2223 STDMETHODIMP Machine::COMGETTER(BIOSSettings)(IBIOSSettings **biosSettings)
    2224 {
    2225     CheckComArgOutPointerValid(biosSettings);
    2226 
    2227     AutoCaller autoCaller(this);
    2228     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2229 
     1947    mHWData->mMonitorCount = aMonitorCount;
     1948
     1949    return S_OK;
     1950}
     1951
     1952HRESULT Machine::getBIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings)
     1953{
    22301954    /* mBIOSSettings is constant during life time, no need to lock */
    2231     mBIOSSettings.queryInterfaceTo(biosSettings);
    2232 
    2233     return S_OK;
    2234 }
    2235 
    2236 STDMETHODIMP Machine::GetCPUProperty(CPUPropertyType_T property, BOOL *aVal)
    2237 {
    2238     CheckComArgOutPointerValid(aVal);
    2239 
    2240     AutoCaller autoCaller(this);
    2241     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2242 
     1955    mBIOSSettings.queryInterfaceTo(aBIOSSettings.asOutParam());
     1956
     1957    return S_OK;
     1958}
     1959
     1960HRESULT Machine::getCPUProperty(CPUPropertyType_T aProperty, BOOL *aValue)
     1961{
    22431962    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    22441963
    2245     switch (property)
     1964    switch (aProperty)
    22461965    {
    22471966        case CPUPropertyType_PAE:
    2248             *aVal = mHWData->mPAEEnabled;
     1967            *aValue = mHWData->mPAEEnabled;
    22491968            break;
    22501969
    22511970        case CPUPropertyType_Synthetic:
    2252             *aVal = mHWData->mSyntheticCpu;
     1971            *aValue = mHWData->mSyntheticCpu;
    22531972            break;
    22541973
    22551974        case CPUPropertyType_LongMode:
    22561975            if (mHWData->mLongMode == settings::Hardware::LongMode_Enabled)
    2257                 *aVal = TRUE;
     1976                *aValue = TRUE;
    22581977            else if (mHWData->mLongMode == settings::Hardware::LongMode_Disabled)
    2259                 *aVal = FALSE;
     1978                *aValue = FALSE;
    22601979#if HC_ARCH_BITS == 64
    22611980            else
    2262                 *aVal = TRUE;
     1981                *aValue = TRUE;
    22631982#else
    22641983            else
    22651984            {
    2266                 *aVal = FALSE;
     1985                *aValue = FALSE;
    22671986
    22681987                ComPtr<IGuestOSType> ptrGuestOSType;
     
    22741993                    if (SUCCEEDED(hrc2) && fIs64Bit)
    22751994                    {
    2276                         ComObjPtr<Host> ptrHost = mParent->i_host();
     1995                        ComObjPtr<Host> ptrHost = mParent->host();
    22771996                        alock.release();
    22781997
    22791998                        hrc2 = ptrHost->GetProcessorFeature(ProcessorFeature_LongMode, aVal); AssertComRC(hrc2);
    22801999                        if (FAILED(hrc2))
    2281                             *aVal = FALSE;
     2000                            *aValue = FALSE;
    22822001                    }
    22832002                }
     
    22872006
    22882007        case CPUPropertyType_TripleFaultReset:
    2289             *aVal = mHWData->mTripleFaultReset;
     2008            *aValue = mHWData->mTripleFaultReset;
    22902009            break;
    22912010
     
    22962015}
    22972016
    2298 STDMETHODIMP Machine::SetCPUProperty(CPUPropertyType_T property, BOOL aVal)
    2299 {
    2300     AutoCaller autoCaller(this);
    2301     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2302 
     2017HRESULT Machine::setCPUProperty(CPUPropertyType_T aProperty, BOOL aValue)
     2018{
    23032019    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    23042020
    2305     HRESULT rc = checkStateDependency(MutableStateDep);
     2021    HRESULT rc = i_checkStateDependency(MutableStateDep);
    23062022    if (FAILED(rc)) return rc;
    23072023
    2308     switch (property)
     2024    switch (aProperty)
    23092025    {
    23102026        case CPUPropertyType_PAE:
    2311             setModified(IsModified_MachineData);
     2027            i_setModified(IsModified_MachineData);
    23122028            mHWData.backup();
    2313             mHWData->mPAEEnabled = !!aVal;
     2029            mHWData->mPAEEnabled = !!aValue;
    23142030            break;
    23152031
    23162032        case CPUPropertyType_Synthetic:
    2317             setModified(IsModified_MachineData);
     2033            i_setModified(IsModified_MachineData);
    23182034            mHWData.backup();
    2319             mHWData->mSyntheticCpu = !!aVal;
     2035            mHWData->mSyntheticCpu = !!aValue;
    23202036            break;
    23212037
    23222038        case CPUPropertyType_LongMode:
    2323             setModified(IsModified_MachineData);
     2039            i_setModified(IsModified_MachineData);
    23242040            mHWData.backup();
    2325             mHWData->mLongMode = !aVal ? settings::Hardware::LongMode_Disabled : settings::Hardware::LongMode_Enabled;
     2041            mHWData->mLongMode = !aValue ? settings::Hardware::LongMode_Disabled : settings::Hardware::LongMode_Enabled;
    23262042            break;
    23272043
    23282044        case CPUPropertyType_TripleFaultReset:
    2329             setModified(IsModified_MachineData);
     2045            i_setModified(IsModified_MachineData);
    23302046            mHWData.backup();
    2331             mHWData->mTripleFaultReset = !!aVal;
     2047            mHWData->mTripleFaultReset = !!aValue;
    23322048            break;
    23332049
     
    23382054}
    23392055
    2340 STDMETHODIMP Machine::GetCPUIDLeaf(ULONG aId, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx)
    2341 {
    2342     CheckComArgOutPointerValid(aValEax);
    2343     CheckComArgOutPointerValid(aValEbx);
    2344     CheckComArgOutPointerValid(aValEcx);
    2345     CheckComArgOutPointerValid(aValEdx);
    2346 
    2347     AutoCaller autoCaller(this);
    2348     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2349 
     2056HRESULT Machine::getCPUIDLeaf(ULONG aId, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx)
     2057{
    23502058    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    23512059
     
    23982106}
    23992107
    2400 STDMETHODIMP Machine::SetCPUIDLeaf(ULONG aId, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx)
    2401 {
    2402     AutoCaller autoCaller(this);
    2403     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2404 
     2108
     2109HRESULT Machine::setCPUIDLeaf(ULONG aId, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx)
     2110{
    24052111    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    24062112
    2407     HRESULT rc = checkStateDependency(MutableStateDep);
     2113    HRESULT rc = i_checkStateDependency(MutableStateDep);
    24082114    if (FAILED(rc)) return rc;
    24092115
     
    24232129            AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xB);
    24242130            AssertRelease(aId < RT_ELEMENTS(mHWData->mCpuIdStdLeafs));
    2425             setModified(IsModified_MachineData);
     2131            i_setModified(IsModified_MachineData);
    24262132            mHWData.backup();
    24272133            mHWData->mCpuIdStdLeafs[aId].ulId  = aId;
     
    24452151            AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xB);
    24462152            AssertRelease(aId - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs));
    2447             setModified(IsModified_MachineData);
     2153            i_setModified(IsModified_MachineData);
    24482154            mHWData.backup();
    24492155            mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulId  = aId;
     
    24602166}
    24612167
    2462 STDMETHODIMP Machine::RemoveCPUIDLeaf(ULONG aId)
    2463 {
    2464     AutoCaller autoCaller(this);
    2465     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2466 
     2168HRESULT Machine::removeCPUIDLeaf(ULONG aId)
     2169{
    24672170    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    24682171
    2469     HRESULT rc = checkStateDependency(MutableStateDep);
     2172    HRESULT rc = i_checkStateDependency(MutableStateDep);
    24702173    if (FAILED(rc)) return rc;
    24712174
     
    24852188            AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xB);
    24862189            AssertRelease(aId < RT_ELEMENTS(mHWData->mCpuIdStdLeafs));
    2487             setModified(IsModified_MachineData);
     2190            i_setModified(IsModified_MachineData);
    24882191            mHWData.backup();
    24892192            /* Invalidate leaf. */
     
    25042207            AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xB);
    25052208            AssertRelease(aId - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs));
    2506             setModified(IsModified_MachineData);
     2209            i_setModified(IsModified_MachineData);
    25072210            mHWData.backup();
    25082211            /* Invalidate leaf. */
     
    25162219}
    25172220
    2518 STDMETHODIMP Machine::RemoveAllCPUIDLeaves()
    2519 {
    2520     AutoCaller autoCaller(this);
    2521     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2522 
     2221HRESULT Machine::removeAllCPUIDLeaves()
     2222{
    25232223    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    25242224
    2525     HRESULT rc = checkStateDependency(MutableStateDep);
     2225    HRESULT rc = i_checkStateDependency(MutableStateDep);
    25262226    if (FAILED(rc)) return rc;
    25272227
    2528     setModified(IsModified_MachineData);
     2228    i_setModified(IsModified_MachineData);
    25292229    mHWData.backup();
    25302230
    25312231    /* Invalidate all standard leafs. */
    2532     for (unsigned i = 0; i < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); i++)
     2232    for (unsigned i = 0; i < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); ++i)
    25332233        mHWData->mCpuIdStdLeafs[i].ulId = UINT32_MAX;
    25342234
    25352235    /* Invalidate all extended leafs. */
    2536     for (unsigned i = 0; i < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); i++)
     2236    for (unsigned i = 0; i < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); ++i)
    25372237        mHWData->mCpuIdExtLeafs[i].ulId = UINT32_MAX;
    25382238
    25392239    return S_OK;
    25402240}
    2541 
    2542 STDMETHODIMP Machine::GetHWVirtExProperty(HWVirtExPropertyType_T property, BOOL *aVal)
    2543 {
    2544     CheckComArgOutPointerValid(aVal);
    2545 
    2546     AutoCaller autoCaller(this);
    2547     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2548 
     2241HRESULT Machine::getHWVirtExProperty(HWVirtExPropertyType_T aProperty, BOOL *aValue)
     2242{
    25492243    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    25502244
    2551     switch(property)
     2245    switch(aProperty)
    25522246    {
    25532247        case HWVirtExPropertyType_Enabled:
    2554             *aVal = mHWData->mHWVirtExEnabled;
     2248            *aValue = mHWData->mHWVirtExEnabled;
    25552249            break;
    25562250
    25572251        case HWVirtExPropertyType_VPID:
    2558             *aVal = mHWData->mHWVirtExVPIDEnabled;
     2252            *aValue = mHWData->mHWVirtExVPIDEnabled;
    25592253            break;
    25602254
    25612255        case HWVirtExPropertyType_NestedPaging:
    2562             *aVal = mHWData->mHWVirtExNestedPagingEnabled;
     2256            *aValue = mHWData->mHWVirtExNestedPagingEnabled;
    25632257            break;
    25642258
    25652259        case HWVirtExPropertyType_UnrestrictedExecution:
    2566             *aVal = mHWData->mHWVirtExUXEnabled;
     2260            *aValue = mHWData->mHWVirtExUXEnabled;
    25672261            break;
    25682262
    25692263        case HWVirtExPropertyType_LargePages:
    2570             *aVal = mHWData->mHWVirtExLargePagesEnabled;
     2264            *aValue = mHWData->mHWVirtExLargePagesEnabled;
    25712265#if defined(DEBUG_bird) && defined(RT_OS_LINUX) /* This feature is deadly here */
    2572             *aVal = FALSE;
     2266            *aValue = FALSE;
    25732267#endif
    25742268            break;
    25752269
    25762270        case HWVirtExPropertyType_Force:
    2577             *aVal = mHWData->mHWVirtExForceEnabled;
     2271            *aValue = mHWData->mHWVirtExForceEnabled;
    25782272            break;
    25792273
     
    25842278}
    25852279
    2586 STDMETHODIMP Machine::SetHWVirtExProperty(HWVirtExPropertyType_T property, BOOL aVal)
    2587 {
    2588     AutoCaller autoCaller(this);
    2589     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2590 
     2280HRESULT Machine::setHWVirtExProperty(HWVirtExPropertyType_T aProperty, BOOL aValue)
     2281{
    25912282    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    25922283
    2593     HRESULT rc = checkStateDependency(MutableStateDep);
     2284    HRESULT rc = i_checkStateDependency(MutableStateDep);
    25942285    if (FAILED(rc)) return rc;
    25952286
    2596     switch(property)
     2287    switch(aProperty)
    25972288    {
    25982289        case HWVirtExPropertyType_Enabled:
    2599             setModified(IsModified_MachineData);
     2290            i_setModified(IsModified_MachineData);
    26002291            mHWData.backup();
    2601             mHWData->mHWVirtExEnabled = !!aVal;
     2292            mHWData->mHWVirtExEnabled = !!aValue;
    26022293            break;
    26032294
    26042295        case HWVirtExPropertyType_VPID:
    2605             setModified(IsModified_MachineData);
     2296            i_setModified(IsModified_MachineData);
    26062297            mHWData.backup();
    2607             mHWData->mHWVirtExVPIDEnabled = !!aVal;
     2298            mHWData->mHWVirtExVPIDEnabled = !!aValue;
    26082299            break;
    26092300
    26102301        case HWVirtExPropertyType_NestedPaging:
    2611             setModified(IsModified_MachineData);
     2302            i_setModified(IsModified_MachineData);
    26122303            mHWData.backup();
    2613             mHWData->mHWVirtExNestedPagingEnabled = !!aVal;
     2304            mHWData->mHWVirtExNestedPagingEnabled = !!aValue;
    26142305            break;
    26152306
    26162307        case HWVirtExPropertyType_UnrestrictedExecution:
    2617             setModified(IsModified_MachineData);
     2308            i_setModified(IsModified_MachineData);
    26182309            mHWData.backup();
    2619             mHWData->mHWVirtExUXEnabled = !!aVal;
     2310            mHWData->mHWVirtExUXEnabled = !!aValue;
    26202311            break;
    26212312
    26222313        case HWVirtExPropertyType_LargePages:
    2623             setModified(IsModified_MachineData);
     2314            i_setModified(IsModified_MachineData);
    26242315            mHWData.backup();
    2625             mHWData->mHWVirtExLargePagesEnabled = !!aVal;
     2316            mHWData->mHWVirtExLargePagesEnabled = !!aValue;
    26262317            break;
    26272318
    26282319        case HWVirtExPropertyType_Force:
    2629             setModified(IsModified_MachineData);
     2320            i_setModified(IsModified_MachineData);
    26302321            mHWData.backup();
    2631             mHWData->mHWVirtExForceEnabled = !!aVal;
     2322            mHWData->mHWVirtExForceEnabled = !!aValue;
    26322323            break;
    26332324
     
    26392330}
    26402331
    2641 STDMETHODIMP Machine::COMGETTER(SnapshotFolder)(BSTR *aSnapshotFolder)
    2642 {
    2643     CheckComArgOutPointerValid(aSnapshotFolder);
    2644 
    2645     AutoCaller autoCaller(this);
    2646     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2647 
     2332HRESULT Machine::getSnapshotFolder(com::Utf8Str &aSnapshotFolder)
     2333{
    26482334    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    26492335
    2650     Utf8Str strFullSnapshotFolder;
    2651     calculateFullPath(mUserData->s.strSnapshotFolder, strFullSnapshotFolder);
    2652     strFullSnapshotFolder.cloneTo(aSnapshotFolder);
    2653 
    2654     return S_OK;
    2655 }
    2656 
    2657 STDMETHODIMP Machine::COMSETTER(SnapshotFolder)(IN_BSTR aSnapshotFolder)
     2336    i_calculateFullPath(mUserData->s.strSnapshotFolder, aSnapshotFolder);
     2337
     2338    return S_OK;
     2339}
     2340
     2341HRESULT Machine::setSnapshotFolder(const com::Utf8Str &aSnapshotFolder)
    26582342{
    26592343    /* @todo (r=dmik):
     
    26652349     */
    26662350
    2667     AutoCaller autoCaller(this);
    2668     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2669 
    26702351    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    26712352
    2672     HRESULT rc = checkStateDependency(MutableStateDep);
     2353    HRESULT rc = i_checkStateDependency(MutableStateDep);
    26732354    if (FAILED(rc)) return rc;
    26742355
     
    26772358                        tr("The snapshot folder of a machine with snapshots cannot be changed (please delete all snapshots first)"));
    26782359
    2679     Utf8Str strSnapshotFolder0(aSnapshotFolder);       // keep original
    2680 
    2681     Utf8Str strSnapshotFolder(strSnapshotFolder0);
     2360    Utf8Str strSnapshotFolder(aSnapshotFolder);       // keep original
     2361
    26822362    if (strSnapshotFolder.isEmpty())
    26832363        strSnapshotFolder = "Snapshots";
    2684     int vrc = calculateFullPath(strSnapshotFolder,
     2364    int vrc = i_calculateFullPath(strSnapshotFolder,
    26852365                                strSnapshotFolder);
    26862366    if (RT_FAILURE(vrc))
    26872367        return setError(E_FAIL,
    2688                         tr("Invalid snapshot folder '%ls' (%Rrc)"),
    2689                         aSnapshotFolder, vrc);
    2690 
    2691     setModified(IsModified_MachineData);
     2368                        tr("Invalid snapshot folder '%s' (%Rrc)"),
     2369                        strSnapshotFolder.c_str(), vrc);
     2370
     2371    i_setModified(IsModified_MachineData);
    26922372    mUserData.backup();
    26932373
    2694     copyPathRelativeToMachine(strSnapshotFolder, mUserData->s.strSnapshotFolder);
    2695 
    2696     return S_OK;
    2697 }
    2698 
    2699 STDMETHODIMP Machine::COMGETTER(MediumAttachments)(ComSafeArrayOut(IMediumAttachment*, aAttachments))
    2700 {
    2701     CheckComArgOutSafeArrayPointerValid(aAttachments);
    2702 
    2703     AutoCaller autoCaller(this);
    2704     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2705 
     2374    i_copyPathRelativeToMachine(strSnapshotFolder, mUserData->s.strSnapshotFolder);
     2375
     2376    return S_OK;
     2377}
     2378
     2379HRESULT Machine::getMediumAttachments(std::vector<ComPtr<IMediumAttachment> > &aMediumAttachments)
     2380{
    27062381    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    27072382
    2708     SafeIfaceArray<IMediumAttachment> attachments(mMediaData->mAttachments);
    2709     attachments.detachTo(ComSafeArrayOutArg(aAttachments));
    2710 
    2711     return S_OK;
    2712 }
    2713 
    2714 STDMETHODIMP Machine::COMGETTER(VRDEServer)(IVRDEServer **vrdeServer)
    2715 {
    2716     CheckComArgOutPointerValid(vrdeServer);
    2717 
    2718     AutoCaller autoCaller(this);
    2719     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2720 
     2383    aMediumAttachments.resize(mMediaData->mAttachments.size());
     2384    size_t i = 0;
     2385    for (MediaData::AttachmentList::iterator it = mMediaData->mAttachments.begin();
     2386         it != mMediaData->mAttachments.end(); ++it, ++i)
     2387        (*it).queryInterfaceTo(aMediumAttachments[i].asOutParam());
     2388
     2389    return S_OK;
     2390}
     2391
     2392HRESULT Machine::getVRDEServer(ComPtr<IVRDEServer> &aVRDEServer)
     2393{
    27212394    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    27222395
    27232396    Assert(!!mVRDEServer);
    2724     mVRDEServer.queryInterfaceTo(vrdeServer);
    2725 
    2726     return S_OK;
    2727 }
    2728 
    2729 STDMETHODIMP Machine::COMGETTER(AudioAdapter)(IAudioAdapter **audioAdapter)
    2730 {
    2731     CheckComArgOutPointerValid(audioAdapter);
    2732 
    2733     AutoCaller autoCaller(this);
    2734     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2735 
     2397
     2398    mVRDEServer.queryInterfaceTo(aVRDEServer.asOutParam());
     2399
     2400    return S_OK;
     2401}
     2402
     2403HRESULT Machine::getAudioAdapter(ComPtr<IAudioAdapter> &aAudioAdapter)
     2404{
    27362405    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    27372406
    2738     mAudioAdapter.queryInterfaceTo(audioAdapter);
    2739     return S_OK;
    2740 }
    2741 
    2742 STDMETHODIMP Machine::COMGETTER(USBControllers)(ComSafeArrayOut(IUSBController *, aUSBControllers))
     2407    mAudioAdapter.queryInterfaceTo(aAudioAdapter.asOutParam());
     2408
     2409    return S_OK;
     2410}
     2411
     2412HRESULT Machine::getUSBControllers(std::vector<ComPtr<IUSBController> > &aUSBControllers)
    27432413{
    27442414#ifdef VBOX_WITH_VUSB
    2745     CheckComArgOutPointerValid(aUSBControllers);
    2746 
    2747     AutoCaller autoCaller(this);
    2748     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2749 
    27502415    clearError();
    27512416    MultiResult rc(S_OK);
     
    27582423    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    27592424
    2760     SafeIfaceArray<IUSBController> ctrls(*mUSBControllers.data());
    2761     ctrls.detachTo(ComSafeArrayOutArg(aUSBControllers));
     2425    USBControllerList data = *mUSBControllers.data();
     2426    aUSBControllers.resize(data.size());
     2427    size_t i = 0;
     2428    for (USBControllerList::iterator it = data.begin(); it != data.end(); ++i, ++it)
     2429        (*it).queryInterfaceTo(aUSBControllers[i].asOutParam());
     2430
    27622431    return S_OK;
    27632432#else
     
    27702439}
    27712440
    2772 STDMETHODIMP Machine::COMGETTER(USBDeviceFilters)(IUSBDeviceFilters **aUSBDeviceFilters)
     2441HRESULT Machine::getUSBDeviceFilters(ComPtr<IUSBDeviceFilters> &aUSBDeviceFilters)
    27732442{
    27742443#ifdef VBOX_WITH_VUSB
    2775     CheckComArgOutPointerValid(aUSBDeviceFilters);
    2776 
    2777     AutoCaller autoCaller(this);
    2778     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2779 
    27802444    clearError();
    27812445    MultiResult rc(S_OK);
     
    27882452    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    27892453
    2790     return rc = mUSBDeviceFilters.queryInterfaceTo(aUSBDeviceFilters);
     2454    return rc = mUSBDeviceFilters.queryInterfaceTo(aUSBDeviceFilters.asOutParam());
    27912455#else
    27922456    /* Note: The GUI depends on this method returning E_NOTIMPL with no
     
    27982462}
    27992463
    2800 STDMETHODIMP Machine::COMGETTER(SettingsFilePath)(BSTR *aFilePath)
    2801 {
    2802     CheckComArgOutPointerValid(aFilePath);
    2803 
    2804     AutoLimitedCaller autoCaller(this);
    2805     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2806 
     2464HRESULT Machine::getSettingsFilePath(com::Utf8Str &aSettingsFilePath)
     2465{
    28072466    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    28082467
    2809     mData->m_strConfigFileFull.cloneTo(aFilePath);
    2810     return S_OK;
    2811 }
    2812 
    2813 STDMETHODIMP Machine::COMGETTER(SettingsModified)(BOOL *aModified)
    2814 {
    2815     CheckComArgOutPointerValid(aModified);
    2816 
    2817     AutoCaller autoCaller(this);
    2818     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2819 
     2468    aSettingsFilePath = mData->m_strConfigFileFull;
     2469
     2470    return S_OK;
     2471}
     2472
     2473HRESULT Machine::getSettingsModified(BOOL *aSettingsModified)
     2474{
    28202475    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    28212476
    2822     HRESULT rc = checkStateDependency(MutableStateDep);
     2477    HRESULT rc = i_checkStateDependency(MutableStateDep);
    28232478    if (FAILED(rc)) return rc;
    28242479
    28252480    if (!mData->pMachineConfigFile->fileExists())
    28262481        // this is a new machine, and no config file exists yet:
    2827         *aModified = TRUE;
     2482        *aSettingsModified = TRUE;
    28282483    else
    2829         *aModified = (mData->flModifications != 0);
    2830 
    2831     return S_OK;
    2832 }
    2833 
    2834 STDMETHODIMP Machine::COMGETTER(SessionState)(SessionState_T *aSessionState)
    2835 {
    2836     CheckComArgOutPointerValid(aSessionState);
    2837 
    2838     AutoCaller autoCaller(this);
    2839     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     2484        *aSettingsModified = (mData->flModifications != 0);
     2485
     2486    return S_OK;
     2487}
     2488
     2489HRESULT Machine::getSessionState(SessionState_T *aSessionState)
     2490{
    28402491
    28412492    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    28462497}
    28472498
    2848 STDMETHODIMP Machine::COMGETTER(SessionType)(BSTR *aSessionType)
    2849 {
    2850     CheckComArgOutPointerValid(aSessionType);
    2851 
    2852     AutoCaller autoCaller(this);
    2853     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2854 
     2499HRESULT Machine::getSessionType(com::Utf8Str &aSessionType)
     2500{
    28552501    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    28562502
    2857     mData->mSession.mType.cloneTo(aSessionType);
    2858 
    2859     return S_OK;
    2860 }
    2861 
    2862 STDMETHODIMP Machine::COMGETTER(SessionPID)(ULONG *aSessionPID)
    2863 {
    2864     CheckComArgOutPointerValid(aSessionPID);
    2865 
    2866     AutoCaller autoCaller(this);
    2867     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2868 
     2503    aSessionType = mData->mSession.mType;
     2504
     2505    return S_OK;
     2506}
     2507
     2508HRESULT Machine::getSessionPID(ULONG *aSessionPID)
     2509{
    28692510    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    28702511
     
    28742515}
    28752516
    2876 STDMETHODIMP Machine::COMGETTER(State)(MachineState_T *machineState)
    2877 {
    2878     CheckComArgOutPointerValid(machineState);
    2879 
    2880     AutoCaller autoCaller(this);
    2881     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2882 
     2517HRESULT Machine::getState(MachineState_T *aState)
     2518{
    28832519    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    28842520
    2885     *machineState = mData->mMachineState;
    2886 
    2887     return S_OK;
    2888 }
    2889 
    2890 STDMETHODIMP Machine::COMGETTER(LastStateChange)(LONG64 *aLastStateChange)
    2891 {
    2892     CheckComArgOutPointerValid(aLastStateChange);
    2893 
    2894     AutoCaller autoCaller(this);
    2895     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2896 
     2521    *aState = mData->mMachineState;
     2522
     2523    return S_OK;
     2524}
     2525
     2526HRESULT Machine::getLastStateChange(LONG64 *aLastStateChange)
     2527{
    28972528    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    28982529
     
    29022533}
    29032534
    2904 STDMETHODIMP Machine::COMGETTER(StateFilePath)(BSTR *aStateFilePath)
    2905 {
    2906     CheckComArgOutPointerValid(aStateFilePath);
    2907 
    2908     AutoCaller autoCaller(this);
    2909     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2910 
     2535HRESULT Machine::getStateFilePath(com::Utf8Str &aStateFilePath)
     2536{
    29112537    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    29122538
    2913     mSSData->strStateFilePath.cloneTo(aStateFilePath);
    2914 
    2915     return S_OK;
    2916 }
    2917 
    2918 STDMETHODIMP Machine::COMGETTER(LogFolder)(BSTR *aLogFolder)
    2919 {
    2920     CheckComArgOutPointerValid(aLogFolder);
    2921 
    2922     AutoCaller autoCaller(this);
    2923     AssertComRCReturnRC(autoCaller.rc());
    2924 
     2539    aStateFilePath = mSSData->strStateFilePath;
     2540
     2541    return S_OK;
     2542}
     2543
     2544HRESULT Machine::getLogFolder(com::Utf8Str &aLogFolder)
     2545{
    29252546    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    29262547
    2927     Utf8Str logFolder;
    2928     getLogFolder(logFolder);
    2929     logFolder.cloneTo(aLogFolder);
    2930 
    2931     return S_OK;
    2932 }
    2933 
    2934 STDMETHODIMP Machine::COMGETTER(CurrentSnapshot) (ISnapshot **aCurrentSnapshot)
    2935 {
    2936     CheckComArgOutPointerValid(aCurrentSnapshot);
    2937 
    2938     AutoCaller autoCaller(this);
    2939     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2940 
     2548    i_getLogFolder(aLogFolder);
     2549
     2550    return S_OK;
     2551}
     2552
     2553HRESULT Machine::getCurrentSnapshot(ComPtr<ISnapshot> &aCurrentSnapshot)
     2554{
    29412555    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    29422556
    2943     mData->mCurrentSnapshot.queryInterfaceTo(aCurrentSnapshot);
    2944 
    2945     return S_OK;
    2946 }
    2947 
    2948 STDMETHODIMP Machine::COMGETTER(SnapshotCount)(ULONG *aSnapshotCount)
    2949 {
    2950     CheckComArgOutPointerValid(aSnapshotCount);
    2951 
    2952     AutoCaller autoCaller(this);
    2953     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2954 
     2557    mData->mCurrentSnapshot.queryInterfaceTo(aCurrentSnapshot.asOutParam());
     2558
     2559    return S_OK;
     2560}
     2561
     2562HRESULT Machine::getSnapshotCount(ULONG *aSnapshotCount)
     2563{
    29552564    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    29562565
     
    29622571}
    29632572
    2964 STDMETHODIMP Machine::COMGETTER(CurrentStateModified)(BOOL *aCurrentStateModified)
    2965 {
    2966     CheckComArgOutPointerValid(aCurrentStateModified);
    2967 
    2968     AutoCaller autoCaller(this);
    2969     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2970 
     2573HRESULT Machine::getCurrentStateModified(BOOL *aCurrentStateModified)
     2574{
    29712575    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    29722576
     
    29822586}
    29832587
    2984 STDMETHODIMP Machine::COMGETTER(SharedFolders)(ComSafeArrayOut(ISharedFolder *, aSharedFolders))
    2985 {
    2986     CheckComArgOutSafeArrayPointerValid(aSharedFolders);
    2987 
    2988     AutoCaller autoCaller(this);
    2989     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2990 
     2588HRESULT Machine::getSharedFolders(std::vector<ComPtr<ISharedFolder> > &aSharedFolders)
     2589{
    29912590    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    29922591
    2993     SafeIfaceArray<ISharedFolder> folders(mHWData->mSharedFolders);
    2994     folders.detachTo(ComSafeArrayOutArg(aSharedFolders));
    2995 
    2996     return S_OK;
    2997 }
    2998 
    2999 STDMETHODIMP Machine::COMGETTER(ClipboardMode)(ClipboardMode_T *aClipboardMode)
    3000 {
    3001     CheckComArgOutPointerValid(aClipboardMode);
    3002 
    3003     AutoCaller autoCaller(this);
    3004     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3005 
     2592    aSharedFolders.resize(mHWData->mSharedFolders.size());
     2593    size_t i = 0;
     2594    for (std::list<ComObjPtr<SharedFolder> >::iterator it = mHWData->mSharedFolders.begin();
     2595         it != mHWData->mSharedFolders.end(); ++i, ++it)
     2596        (*it).queryInterfaceTo(aSharedFolders[i].asOutParam());
     2597
     2598    return S_OK;
     2599}
     2600
     2601HRESULT Machine::getClipboardMode(ClipboardMode_T *aClipboardMode)
     2602{
    30062603    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    30072604
     
    30112608}
    30122609
    3013 STDMETHODIMP Machine::COMSETTER(ClipboardMode)(ClipboardMode_T aClipboardMode)
     2610HRESULT Machine::setClipboardMode(ClipboardMode_T aClipboardMode)
    30142611{
    30152612    HRESULT rc = S_OK;
    30162613
    3017     AutoCaller autoCaller(this);
    3018     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3019 
    30202614    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    30212615
    30222616    alock.release();
    3023     rc = onClipboardModeChange(aClipboardMode);
     2617    rc = i_onClipboardModeChange(aClipboardMode);
    30242618    alock.acquire();
    30252619    if (FAILED(rc)) return rc;
    30262620
    3027     setModified(IsModified_MachineData);
     2621    i_setModified(IsModified_MachineData);
    30282622    mHWData.backup();
    30292623    mHWData->mClipboardMode = aClipboardMode;
     
    30312625    /** Save settings if online - @todo why is this required? -- @bugref{6818} */
    30322626    if (Global::IsOnline(mData->mMachineState))
    3033         saveSettings(NULL);
    3034 
    3035     return S_OK;
    3036 }
    3037 
    3038 STDMETHODIMP Machine::COMGETTER(DnDMode)(DnDMode_T *aDnDMode)
    3039 {
    3040     CheckComArgOutPointerValid(aDnDMode);
    3041 
    3042     AutoCaller autoCaller(this);
    3043     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3044 
     2627        i_saveSettings(NULL);
     2628
     2629    return S_OK;
     2630}
     2631
     2632HRESULT Machine::getDnDMode(DnDMode_T *aDnDMode)
     2633{
    30452634    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    30462635
     
    30502639}
    30512640
    3052 STDMETHODIMP Machine::COMSETTER(DnDMode)(DnDMode_T aDnDMode)
     2641HRESULT Machine::setDnDMode(DnDMode_T aDnDMode)
    30532642{
    30542643    HRESULT rc = S_OK;
    30552644
    3056     AutoCaller autoCaller(this);
    3057     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3058 
    30592645    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    30602646
    30612647    alock.release();
    3062     rc = onDnDModeChange(aDnDMode);
     2648    rc = i_onDnDModeChange(aDnDMode);
     2649
    30632650    alock.acquire();
    30642651    if (FAILED(rc)) return rc;
    30652652
    3066     setModified(IsModified_MachineData);
     2653    i_setModified(IsModified_MachineData);
    30672654    mHWData.backup();
    30682655    mHWData->mDnDMode = aDnDMode;
     
    30702657    /** Save settings if online - @todo why is this required? -- @bugref{6818} */
    30712658    if (Global::IsOnline(mData->mMachineState))
    3072         saveSettings(NULL);
    3073 
    3074     return S_OK;
    3075 }
    3076 
    3077 STDMETHODIMP Machine::COMGETTER(GuestPropertyNotificationPatterns)(BSTR *aPatterns)
    3078 {
    3079     CheckComArgOutPointerValid(aPatterns);
    3080 
    3081     AutoCaller autoCaller(this);
    3082     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3083 
     2659        i_saveSettings(NULL);
     2660
     2661    return S_OK;
     2662}
     2663
     2664HRESULT Machine::getGuestPropertyNotificationPatterns(com::Utf8Str &aGuestPropertyNotificationPatterns)
     2665{
    30842666    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    30852667
    30862668    try
    30872669    {
    3088         mHWData->mGuestPropertyNotificationPatterns.cloneTo(aPatterns);
     2670        aGuestPropertyNotificationPatterns = mHWData->mGuestPropertyNotificationPatterns;
    30892671    }
    30902672    catch (...)
     
    30962678}
    30972679
    3098 STDMETHODIMP Machine::COMSETTER(GuestPropertyNotificationPatterns)(IN_BSTR aPatterns)
    3099 {
    3100     AutoCaller autoCaller(this);
    3101     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3102 
     2680HRESULT Machine::setGuestPropertyNotificationPatterns(const com::Utf8Str &aGuestPropertyNotificationPatterns)
     2681{
    31032682    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    31042683
    3105     HRESULT rc = checkStateDependency(MutableStateDep);
     2684    HRESULT rc = i_checkStateDependency(MutableStateDep);
    31062685    if (FAILED(rc)) return rc;
    31072686
    3108     setModified(IsModified_MachineData);
     2687    i_setModified(IsModified_MachineData);
    31092688    mHWData.backup();
    3110     mHWData->mGuestPropertyNotificationPatterns = aPatterns;
     2689    mHWData->mGuestPropertyNotificationPatterns = aGuestPropertyNotificationPatterns;
    31112690    return rc;
    31122691}
    31132692
    3114 STDMETHODIMP Machine::COMGETTER(StorageControllers)(ComSafeArrayOut(IStorageController *, aStorageControllers))
    3115 {
    3116     CheckComArgOutSafeArrayPointerValid(aStorageControllers);
    3117 
    3118     AutoCaller autoCaller(this);
    3119     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3120 
     2693HRESULT Machine::getStorageControllers(std::vector<ComPtr<IStorageController> > &aStorageControllers)
     2694{
    31212695    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    3122 
    3123     SafeIfaceArray<IStorageController> ctrls(*mStorageControllers.data());
    3124     ctrls.detachTo(ComSafeArrayOutArg(aStorageControllers));
    3125 
    3126     return S_OK;
    3127 }
    3128 
    3129 STDMETHODIMP Machine::COMGETTER(TeleporterEnabled)(BOOL *aEnabled)
    3130 {
    3131     CheckComArgOutPointerValid(aEnabled);
    3132 
    3133     AutoCaller autoCaller(this);
    3134     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3135 
     2696    StorageControllerList data = *mStorageControllers.data();
     2697    size_t i = 0;
     2698    aStorageControllers.resize(data.size());
     2699    for (StorageControllerList::iterator it = data.begin(); it != data.end(); ++it, ++i)
     2700        (*it).queryInterfaceTo(aStorageControllers[i].asOutParam());
     2701    return S_OK;
     2702}
     2703
     2704HRESULT Machine::getTeleporterEnabled(BOOL *aEnabled)
     2705{
    31362706    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    31372707
     
    31412711}
    31422712
    3143 STDMETHODIMP Machine::COMSETTER(TeleporterEnabled)(BOOL aEnabled)
    3144 {
    3145     AutoCaller autoCaller(this);
    3146     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3147 
     2713HRESULT Machine::setTeleporterEnabled(BOOL aTeleporterEnabled)
     2714{
    31482715    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    31492716
    31502717    /* Only allow it to be set to true when PoweredOff or Aborted.
    31512718       (Clearing it is always permitted.) */
    3152     if (    aEnabled
     2719    if (    aTeleporterEnabled
    31532720        &&  mData->mRegistered
    3154         &&  (   !isSessionMachine()
     2721        &&  (   !i_isSessionMachine()
    31552722             || (   mData->mMachineState != MachineState_PoweredOff
    31562723                 && mData->mMachineState != MachineState_Teleported
     
    31632730                        Global::stringifyMachineState(mData->mMachineState));
    31642731
    3165     setModified(IsModified_MachineData);
     2732    i_setModified(IsModified_MachineData);
    31662733    mUserData.backup();
    3167     mUserData->s.fTeleporterEnabled = !!aEnabled;
    3168 
    3169     return S_OK;
    3170 }
    3171 
    3172 STDMETHODIMP Machine::COMGETTER(TeleporterPort)(ULONG *aPort)
    3173 {
    3174     CheckComArgOutPointerValid(aPort);
    3175 
    3176     AutoCaller autoCaller(this);
    3177     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3178 
     2734    mUserData->s.fTeleporterEnabled = !! aTeleporterEnabled;
     2735
     2736    return S_OK;
     2737}
     2738
     2739HRESULT Machine::getTeleporterPort(ULONG *aTeleporterPort)
     2740{
    31792741    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    31802742
    3181     *aPort = (ULONG)mUserData->s.uTeleporterPort;
    3182 
    3183     return S_OK;
    3184 }
    3185 
    3186 STDMETHODIMP Machine::COMSETTER(TeleporterPort)(ULONG aPort)
    3187 {
    3188     if (aPort >= _64K)
    3189         return setError(E_INVALIDARG, tr("Invalid port number %d"), aPort);
    3190 
    3191     AutoCaller autoCaller(this);
    3192     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     2743    *aTeleporterPort = (ULONG)mUserData->s.uTeleporterPort;
     2744
     2745    return S_OK;
     2746}
     2747
     2748HRESULT Machine::setTeleporterPort(ULONG aTeleporterPort)
     2749{
     2750    if (aTeleporterPort >= _64K)
     2751        return setError(E_INVALIDARG, tr("Invalid port number %d"), aTeleporterPort);
    31932752
    31942753    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    31952754
    3196     HRESULT rc = checkStateDependency(MutableStateDep);
     2755    HRESULT rc = i_checkStateDependency(MutableStateDep);
    31972756    if (FAILED(rc)) return rc;
    31982757
    3199     setModified(IsModified_MachineData);
     2758    i_setModified(IsModified_MachineData);
    32002759    mUserData.backup();
    3201     mUserData->s.uTeleporterPort = (uint32_t)aPort;
    3202 
    3203     return S_OK;
    3204 }
    3205 
    3206 STDMETHODIMP Machine::COMGETTER(TeleporterAddress)(BSTR *aAddress)
    3207 {
    3208     CheckComArgOutPointerValid(aAddress);
    3209 
    3210     AutoCaller autoCaller(this);
    3211     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3212 
     2760    mUserData->s.uTeleporterPort = (uint32_t)aTeleporterPort;
     2761
     2762    return S_OK;
     2763}
     2764
     2765HRESULT Machine::getTeleporterAddress(com::Utf8Str &aTeleporterAddress)
     2766{
    32132767    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    32142768
    3215     mUserData->s.strTeleporterAddress.cloneTo(aAddress);
    3216 
    3217     return S_OK;
    3218 }
    3219 
    3220 STDMETHODIMP Machine::COMSETTER(TeleporterAddress)(IN_BSTR aAddress)
    3221 {
    3222     AutoCaller autoCaller(this);
    3223     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3224 
     2769    aTeleporterAddress = mUserData->s.strTeleporterAddress;
     2770
     2771    return S_OK;
     2772}
     2773
     2774HRESULT Machine::setTeleporterAddress(const com::Utf8Str &aTeleporterAddress)
     2775{
    32252776    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    32262777
    3227     HRESULT rc = checkStateDependency(MutableStateDep);
     2778    HRESULT rc = i_checkStateDependency(MutableStateDep);
    32282779    if (FAILED(rc)) return rc;
    32292780
    3230     setModified(IsModified_MachineData);
     2781    i_setModified(IsModified_MachineData);
    32312782    mUserData.backup();
    3232     mUserData->s.strTeleporterAddress = aAddress;
    3233 
    3234     return S_OK;
    3235 }
    3236 
    3237 STDMETHODIMP Machine::COMGETTER(TeleporterPassword)(BSTR *aPassword)
    3238 {
    3239     CheckComArgOutPointerValid(aPassword);
    3240 
    3241     AutoCaller autoCaller(this);
    3242     HRESULT hrc = autoCaller.rc();
    3243     if (SUCCEEDED(hrc))
    3244     {
    3245         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    3246         mUserData->s.strTeleporterPassword.cloneTo(aPassword);
    3247     }
    3248 
    3249     return hrc;
    3250 }
    3251 
    3252 STDMETHODIMP Machine::COMSETTER(TeleporterPassword)(IN_BSTR aPassword)
     2783    mUserData->s.strTeleporterAddress = aTeleporterAddress;
     2784
     2785    return S_OK;
     2786}
     2787
     2788HRESULT Machine::getTeleporterPassword(com::Utf8Str &aTeleporterPassword)
     2789{
     2790    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     2791    aTeleporterPassword =  mUserData->s.strTeleporterPassword;
     2792
     2793    return S_OK;
     2794}
     2795
     2796HRESULT Machine::setTeleporterPassword(const com::Utf8Str &aTeleporterPassword)
    32532797{
    32542798    /*
    32552799     * Hash the password first.
    32562800     */
    3257     Utf8Str strPassword(aPassword);
    3258     if (!strPassword.isEmpty())
    3259     {
    3260         if (VBoxIsPasswordHashed(&strPassword))
     2801    com::Utf8Str aT = aTeleporterPassword;
     2802
     2803    if (!aT.isEmpty())
     2804    {
     2805        if (VBoxIsPasswordHashed(&aT))
    32612806            return setError(E_INVALIDARG, tr("Cannot set an already hashed password, only plain text password please"));
    3262         VBoxHashPassword(&strPassword);
     2807        VBoxHashPassword(&aT);
    32632808    }
    32642809
     
    32662811     * Do the update.
    32672812     */
    3268     AutoCaller autoCaller(this);
    3269     HRESULT hrc = autoCaller.rc();
     2813    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     2814    HRESULT hrc = i_checkStateDependency(MutableStateDep);
    32702815    if (SUCCEEDED(hrc))
    32712816    {
    3272         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    3273         hrc = checkStateDependency(MutableStateDep);
    3274         if (SUCCEEDED(hrc))
    3275         {
    3276             setModified(IsModified_MachineData);
    3277             mUserData.backup();
    3278             mUserData->s.strTeleporterPassword = strPassword;
    3279         }
     2817        i_setModified(IsModified_MachineData);
     2818        mUserData.backup();
     2819        mUserData->s.strTeleporterPassword = aT;
    32802820    }
    32812821
     
    32832823}
    32842824
    3285 STDMETHODIMP Machine::COMGETTER(FaultToleranceState)(FaultToleranceState_T *aState)
    3286 {
    3287     CheckComArgOutPointerValid(aState);
    3288 
    3289     AutoCaller autoCaller(this);
    3290     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3291 
     2825HRESULT Machine::getFaultToleranceState(FaultToleranceState_T *aFaultToleranceState)
     2826{
    32922827    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    32932828
    3294     *aState = mUserData->s.enmFaultToleranceState;
    3295     return S_OK;
    3296 }
    3297 
    3298 STDMETHODIMP Machine::COMSETTER(FaultToleranceState)(FaultToleranceState_T aState)
    3299 {
    3300     AutoCaller autoCaller(this);
    3301     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3302 
     2829    *aFaultToleranceState = mUserData->s.enmFaultToleranceState;
     2830    return S_OK;
     2831}
     2832
     2833HRESULT Machine::setFaultToleranceState(FaultToleranceState_T aFaultToleranceState)
     2834{
    33032835    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    33042836
    33052837    /* @todo deal with running state change. */
    3306     HRESULT rc = checkStateDependency(MutableStateDep);
     2838    HRESULT rc = i_checkStateDependency(MutableStateDep);
    33072839    if (FAILED(rc)) return rc;
    33082840
    3309     setModified(IsModified_MachineData);
     2841    i_setModified(IsModified_MachineData);
    33102842    mUserData.backup();
    3311     mUserData->s.enmFaultToleranceState = aState;
    3312     return S_OK;
    3313 }
    3314 
    3315 STDMETHODIMP Machine::COMGETTER(FaultToleranceAddress)(BSTR *aAddress)
    3316 {
    3317     CheckComArgOutPointerValid(aAddress);
    3318 
    3319     AutoCaller autoCaller(this);
    3320     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3321 
     2843    mUserData->s.enmFaultToleranceState = aFaultToleranceState;
     2844    return S_OK;
     2845}
     2846
     2847HRESULT Machine::getFaultToleranceAddress(com::Utf8Str &aFaultToleranceAddress)
     2848{
    33222849    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    33232850
    3324     mUserData->s.strFaultToleranceAddress.cloneTo(aAddress);
    3325     return S_OK;
    3326 }
    3327 
    3328 STDMETHODIMP Machine::COMSETTER(FaultToleranceAddress)(IN_BSTR aAddress)
    3329 {
    3330     AutoCaller autoCaller(this);
    3331     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3332 
     2851    aFaultToleranceAddress = mUserData->s.strFaultToleranceAddress;
     2852    return S_OK;
     2853}
     2854
     2855HRESULT Machine::setFaultToleranceAddress(const com::Utf8Str &aFaultToleranceAddress)
     2856{
    33332857    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    33342858
    33352859    /* @todo deal with running state change. */
    3336     HRESULT rc = checkStateDependency(MutableStateDep);
     2860    HRESULT rc = i_checkStateDependency(MutableStateDep);
    33372861    if (FAILED(rc)) return rc;
    33382862
    3339     setModified(IsModified_MachineData);
     2863    i_setModified(IsModified_MachineData);
    33402864    mUserData.backup();
    3341     mUserData->s.strFaultToleranceAddress = aAddress;
    3342     return S_OK;
    3343 }
    3344 
    3345 STDMETHODIMP Machine::COMGETTER(FaultTolerancePort)(ULONG *aPort)
    3346 {
    3347     CheckComArgOutPointerValid(aPort);
    3348 
    3349     AutoCaller autoCaller(this);
    3350     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3351 
     2865    mUserData->s.strFaultToleranceAddress = aFaultToleranceAddress;
     2866    return S_OK;
     2867}
     2868
     2869HRESULT Machine::getFaultTolerancePort(ULONG *aFaultTolerancePort)
     2870{
    33522871    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    33532872
    3354     *aPort = mUserData->s.uFaultTolerancePort;
    3355     return S_OK;
    3356 }
    3357 
    3358 STDMETHODIMP Machine::COMSETTER(FaultTolerancePort)(ULONG aPort)
    3359 {
    3360     AutoCaller autoCaller(this);
    3361     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3362 
     2873    *aFaultTolerancePort = mUserData->s.uFaultTolerancePort;
     2874    return S_OK;
     2875}
     2876
     2877HRESULT Machine::setFaultTolerancePort(ULONG aFaultTolerancePort)
     2878{
    33632879    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    33642880
    33652881    /* @todo deal with running state change. */
    3366     HRESULT rc = checkStateDependency(MutableStateDep);
     2882    HRESULT rc = i_checkStateDependency(MutableStateDep);
    33672883    if (FAILED(rc)) return rc;
    33682884
    3369     setModified(IsModified_MachineData);
     2885    i_setModified(IsModified_MachineData);
    33702886    mUserData.backup();
    3371     mUserData->s.uFaultTolerancePort = aPort;
    3372     return S_OK;
    3373 }
    3374 
    3375 STDMETHODIMP Machine::COMGETTER(FaultTolerancePassword)(BSTR *aPassword)
    3376 {
    3377     CheckComArgOutPointerValid(aPassword);
    3378 
    3379     AutoCaller autoCaller(this);
    3380     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3381 
     2887    mUserData->s.uFaultTolerancePort = aFaultTolerancePort;
     2888    return S_OK;
     2889}
     2890
     2891HRESULT Machine::getFaultTolerancePassword(com::Utf8Str &aFaultTolerancePassword)
     2892{
    33822893    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    33832894
    3384     mUserData->s.strFaultTolerancePassword.cloneTo(aPassword);
    3385 
    3386     return S_OK;
    3387 }
    3388 
    3389 STDMETHODIMP Machine::COMSETTER(FaultTolerancePassword)(IN_BSTR aPassword)
    3390 {
    3391     AutoCaller autoCaller(this);
    3392     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3393 
     2895    aFaultTolerancePassword = mUserData->s.strFaultTolerancePassword;
     2896
     2897    return S_OK;
     2898}
     2899
     2900HRESULT Machine::setFaultTolerancePassword(const com::Utf8Str &aFaultTolerancePassword)
     2901{
    33942902    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    33952903
    33962904    /* @todo deal with running state change. */
    3397     HRESULT rc = checkStateDependency(MutableStateDep);
     2905    HRESULT rc = i_checkStateDependency(MutableStateDep);
    33982906    if (FAILED(rc)) return rc;
    33992907
    3400     setModified(IsModified_MachineData);
     2908    i_setModified(IsModified_MachineData);
    34012909    mUserData.backup();
    3402     mUserData->s.strFaultTolerancePassword = aPassword;
    3403 
    3404     return S_OK;
    3405 }
    3406 
    3407 STDMETHODIMP Machine::COMGETTER(FaultToleranceSyncInterval)(ULONG *aInterval)
    3408 {
    3409     CheckComArgOutPointerValid(aInterval);
    3410 
    3411     AutoCaller autoCaller(this);
    3412     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3413 
     2910    mUserData->s.strFaultTolerancePassword = aFaultTolerancePassword;
     2911
     2912    return S_OK;
     2913}
     2914
     2915HRESULT Machine::getFaultToleranceSyncInterval(ULONG *aFaultToleranceSyncInterval)
     2916{
    34142917    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    34152918
    3416     *aInterval = mUserData->s.uFaultToleranceInterval;
    3417     return S_OK;
    3418 }
    3419 
    3420 STDMETHODIMP Machine::COMSETTER(FaultToleranceSyncInterval)(ULONG aInterval)
    3421 {
    3422     AutoCaller autoCaller(this);
    3423     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3424 
     2919    *aFaultToleranceSyncInterval = mUserData->s.uFaultToleranceInterval;
     2920    return S_OK;
     2921}
     2922
     2923HRESULT Machine::setFaultToleranceSyncInterval(ULONG aFaultToleranceSyncInterval)
     2924{
    34252925    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    34262926
    34272927    /* @todo deal with running state change. */
    3428     HRESULT rc = checkStateDependency(MutableStateDep);
     2928    HRESULT rc = i_checkStateDependency(MutableStateDep);
    34292929    if (FAILED(rc)) return rc;
    34302930
    3431     setModified(IsModified_MachineData);
     2931    i_setModified(IsModified_MachineData);
    34322932    mUserData.backup();
    3433     mUserData->s.uFaultToleranceInterval = aInterval;
    3434     return S_OK;
    3435 }
    3436 
    3437 STDMETHODIMP Machine::COMGETTER(RTCUseUTC)(BOOL *aEnabled)
    3438 {
    3439     CheckComArgOutPointerValid(aEnabled);
    3440 
    3441     AutoCaller autoCaller(this);
    3442     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3443 
     2933    mUserData->s.uFaultToleranceInterval = aFaultToleranceSyncInterval;
     2934    return S_OK;
     2935}
     2936
     2937HRESULT Machine::getRTCUseUTC(BOOL *aRTCUseUTC)
     2938{
    34442939    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    34452940
    3446     *aEnabled = mUserData->s.fRTCUseUTC;
    3447 
    3448     return S_OK;
    3449 }
    3450 
    3451 STDMETHODIMP Machine::COMSETTER(RTCUseUTC)(BOOL aEnabled)
    3452 {
    3453     AutoCaller autoCaller(this);
    3454     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3455 
     2941    *aRTCUseUTC = mUserData->s.fRTCUseUTC;
     2942
     2943    return S_OK;
     2944}
     2945
     2946HRESULT Machine::setRTCUseUTC(BOOL aRTCUseUTC)
     2947{
    34562948    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    34572949
    34582950    /* Only allow it to be set to true when PoweredOff or Aborted.
    34592951       (Clearing it is always permitted.) */
    3460     if (    aEnabled
     2952    if (    aRTCUseUTC
    34612953        &&  mData->mRegistered
    3462         &&  (   !isSessionMachine()
     2954        &&  (   !i_isSessionMachine()
    34632955             || (   mData->mMachineState != MachineState_PoweredOff
    34642956                 && mData->mMachineState != MachineState_Teleported
     
    34712963                        Global::stringifyMachineState(mData->mMachineState));
    34722964
    3473     setModified(IsModified_MachineData);
     2965    i_setModified(IsModified_MachineData);
    34742966    mUserData.backup();
    3475     mUserData->s.fRTCUseUTC = !!aEnabled;
    3476 
    3477     return S_OK;
    3478 }
    3479 
    3480 STDMETHODIMP Machine::COMGETTER(IOCacheEnabled)(BOOL *aEnabled)
    3481 {
    3482     CheckComArgOutPointerValid(aEnabled);
    3483 
    3484     AutoCaller autoCaller(this);
    3485     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3486 
     2967    mUserData->s.fRTCUseUTC = !!aRTCUseUTC;
     2968
     2969    return S_OK;
     2970}
     2971
     2972HRESULT Machine::getIOCacheEnabled(BOOL *aIOCacheEnabled)
     2973{
    34872974    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    34882975
    3489     *aEnabled = mHWData->mIOCacheEnabled;
    3490 
    3491     return S_OK;
    3492 }
    3493 
    3494 STDMETHODIMP Machine::COMSETTER(IOCacheEnabled)(BOOL aEnabled)
    3495 {
    3496     AutoCaller autoCaller(this);
    3497     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3498 
     2976    *aIOCacheEnabled = mHWData->mIOCacheEnabled;
     2977
     2978    return S_OK;
     2979}
     2980
     2981HRESULT Machine::setIOCacheEnabled(BOOL aIOCacheEnabled)
     2982{
    34992983    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    35002984
    3501     HRESULT rc = checkStateDependency(MutableStateDep);
     2985    HRESULT rc = i_checkStateDependency(MutableStateDep);
    35022986    if (FAILED(rc)) return rc;
    35032987
    3504     setModified(IsModified_MachineData);
     2988    i_setModified(IsModified_MachineData);
    35052989    mHWData.backup();
    3506     mHWData->mIOCacheEnabled = aEnabled;
    3507 
    3508     return S_OK;
    3509 }
    3510 
    3511 STDMETHODIMP Machine::COMGETTER(IOCacheSize)(ULONG *aIOCacheSize)
    3512 {
    3513     CheckComArgOutPointerValid(aIOCacheSize);
    3514 
    3515     AutoCaller autoCaller(this);
    3516     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3517 
     2990    mHWData->mIOCacheEnabled = aIOCacheEnabled;
     2991
     2992    return S_OK;
     2993}
     2994
     2995HRESULT Machine::getIOCacheSize(ULONG *aIOCacheSize)
     2996{
    35182997    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    35192998
     
    35233002}
    35243003
    3525 STDMETHODIMP Machine::COMSETTER(IOCacheSize)(ULONG  aIOCacheSize)
    3526 {
    3527     AutoCaller autoCaller(this);
    3528     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3529 
     3004HRESULT Machine::setIOCacheSize(ULONG aIOCacheSize)
     3005{
    35303006    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    35313007
    3532     HRESULT rc = checkStateDependency(MutableStateDep);
     3008    HRESULT rc = i_checkStateDependency(MutableStateDep);
    35333009    if (FAILED(rc)) return rc;
    35343010
    3535     setModified(IsModified_MachineData);
     3011    i_setModified(IsModified_MachineData);
    35363012    mHWData.backup();
    35373013    mHWData->mIOCacheSize = aIOCacheSize;
     
    35443020 *  @note Locks objects!
    35453021 */
    3546 STDMETHODIMP Machine::LockMachine(ISession *aSession,
    3547                                   LockType_T lockType)
    3548 {
    3549     CheckComArgNotNull(aSession);
    3550 
    3551     AutoCaller autoCaller(this);
    3552     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3553 
     3022HRESULT Machine::lockMachine(const ComPtr<ISession> &aSession,
     3023                             LockType_T aLockType)
     3024
     3025{
    35543026    /* check the session state */
    35553027    SessionState_T state;
     
    35903062
    35913063    // try again now
    3592     if (    (mData->mSession.mState == SessionState_Locked)         // machine is write-locked already (i.e. session machine exists)
    3593          && (lockType == LockType_Shared)                           // caller wants a shared link to the existing session that holds the write lock:
     3064    if (    (mData->mSession.mState == SessionState_Locked)         // machine is write-locked already
     3065                                                                    // (i.e. session machine exists)
     3066         && (aLockType == LockType_Shared)                          // caller wants a shared link to the
     3067                                                                    // existing session that holds the write lock:
    35943068       )
    35953069    {
     
    37243198            /* Get the client token ID to be passed to the client process */
    37253199            Utf8Str strTokenId;
    3726             sessionMachine->getTokenId(strTokenId);
     3200            sessionMachine->i_getTokenId(strTokenId);
    37273201            Assert(!strTokenId.isEmpty());
    37283202#else /* VBOX_WITH_GENERIC_SESSION_WATCHER */
    37293203            /* Get the client token to be passed to the client process */
    3730             ComPtr<IToken> pToken(sessionMachine->getToken());
     3204            ComPtr<IToken> pToken(sessionMachine->i_getToken());
    37313205            /* The token is now "owned" by pToken, fix refcount */
    37323206            if (!pToken.isNull())
     
    37483222            LogFlowThisFunc(("Calling AssignMachine()...\n"));
    37493223#ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
    3750             rc = pSessionControl->AssignMachine(sessionMachine, lockType, Bstr(strTokenId).raw());
     3224            rc = pSessionControl->AssignMachine(sessionMachine, aLockType, Bstr(strTokenId).raw());
    37513225#else /* VBOX_WITH_GENERIC_SESSION_WATCHER */
    3752             rc = pSessionControl->AssignMachine(sessionMachine, lockType, pToken);
     3226            rc = pSessionControl->AssignMachine(sessionMachine, aLockType, pToken);
    37533227            /* Now the token is owned by the client process. */
    37543228            pToken.setNull();
     
    38753349        if (oldState != SessionState_Locked)
    38763350            /* fire an event */
    3877             mParent->i_onSessionStateChange(getId(), SessionState_Locked);
     3351            mParent->i_onSessionStateChange(i_getId(), SessionState_Locked);
    38783352    }
    38793353
     
    38843358 *  @note Locks objects!
    38853359 */
    3886 STDMETHODIMP Machine::LaunchVMProcess(ISession *aSession,
    3887                                       IN_BSTR aFrontend,
    3888                                       IN_BSTR aEnvironment,
    3889                                       IProgress **aProgress)
    3890 {
    3891     CheckComArgStr(aFrontend);
    3892     Utf8Str strFrontend(aFrontend);
     3360HRESULT Machine::launchVMProcess(const ComPtr<ISession> &aSession,
     3361                                 const com::Utf8Str &aType,
     3362                                 const com::Utf8Str &aEnvironment,
     3363                                 ComPtr<IProgress> &aProgress)
     3364{
     3365    Utf8Str strFrontend(aType);
    38933366    Utf8Str strEnvironment(aEnvironment);
    38943367    /* "emergencystop" doesn't need the session, so skip the checks/interface
     
    38983371    if (strFrontend != "emergencystop")
    38993372        CheckComArgNotNull(aSession);
    3900     CheckComArgOutPointerValid(aProgress);
    3901 
    3902     AutoCaller autoCaller(this);
    3903     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    39043373
    39053374    HRESULT rc = S_OK;
     
    39623431                            TRUE /* aCancelable */,
    39633432                            fTeleporterEnabled ? 20 : 10 /* uTotalOperationsWeight */,
    3964                             BstrFmt(tr("Creating process for virtual machine \"%s\" (%s)"), mUserData->s.strName.c_str(), strFrontend.c_str()).raw(),
     3433                            BstrFmt(tr("Creating process for virtual machine \"%s\" (%s)"),
     3434                            mUserData->s.strName.c_str(), strFrontend.c_str()).raw(),
    39653435                            2 /* uFirstOperationWeight */,
    39663436                            fTeleporterEnabled ? 3 : 1 /* cOtherProgressObjectOperations */);
     
    39683438        if (SUCCEEDED(rc))
    39693439        {
    3970             rc = launchVMProcess(control, strFrontend, strEnvironment, progress);
     3440            rc = i_launchVMProcess(control, strFrontend, strEnvironment, progress);
    39713441            if (SUCCEEDED(rc))
    39723442            {
    3973                 progress.queryInterfaceTo(aProgress);
     3443                progress.queryInterfaceTo(aProgress.asOutParam());
    39743444
    39753445                /* signal the client watcher thread */
     
    39773447
    39783448                /* fire an event */
    3979                 mParent->i_onSessionStateChange(getId(), SessionState_Spawning);
     3449                mParent->i_onSessionStateChange(i_getId(), SessionState_Spawning);
    39803450            }
    39813451        }
     
    39843454    {
    39853455        /* no progress object - either instant success or failure */
    3986         *aProgress = NULL;
     3456        aProgress = NULL;
    39873457
    39883458        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    40123482}
    40133483
    4014 STDMETHODIMP Machine::SetBootOrder(ULONG aPosition, DeviceType_T aDevice)
     3484HRESULT Machine::setBootOrder(ULONG aPosition, DeviceType_T aDevice)
    40153485{
    40163486    if (aPosition < 1 || aPosition > SchemaDefs::MaxBootPosition)
     
    40233493                        tr("Booting from USB device is currently not supported"));
    40243494
    4025     AutoCaller autoCaller(this);
    4026     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    4027 
    40283495    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    40293496
    4030     HRESULT rc = checkStateDependency(MutableStateDep);
     3497    HRESULT rc = i_checkStateDependency(MutableStateDep);
    40313498    if (FAILED(rc)) return rc;
    40323499
    4033     setModified(IsModified_MachineData);
     3500    i_setModified(IsModified_MachineData);
    40343501    mHWData.backup();
    40353502    mHWData->mBootOrder[aPosition - 1] = aDevice;
     
    40383505}
    40393506
    4040 STDMETHODIMP Machine::GetBootOrder(ULONG aPosition, DeviceType_T *aDevice)
     3507HRESULT Machine::getBootOrder(ULONG aPosition, DeviceType_T *aDevice)
    40413508{
    40423509    if (aPosition < 1 || aPosition > SchemaDefs::MaxBootPosition)
     
    40453512                       aPosition, SchemaDefs::MaxBootPosition);
    40463513
    4047     AutoCaller autoCaller(this);
    4048     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    4049 
    40503514    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    40513515
     
    40553519}
    40563520
    4057 STDMETHODIMP Machine::AttachDevice(IN_BSTR aControllerName,
    4058                                    LONG aControllerPort,
    4059                                    LONG aDevice,
    4060                                    DeviceType_T aType,
    4061                                    IMedium *aMedium)
    4062 {
    4063     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aType=%d aMedium=%p\n",
    4064                      aControllerName, aControllerPort, aDevice, aType, aMedium));
    4065 
    4066     CheckComArgStrNotEmptyOrNull(aControllerName);
    4067 
    4068     AutoCaller autoCaller(this);
    4069     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     3521HRESULT Machine::attachDevice(const com::Utf8Str &aName,
     3522                              LONG aControllerPort,
     3523                              LONG aDevice,
     3524                              DeviceType_T aType,
     3525                              const ComPtr<IMedium> &aMedium)
     3526{
     3527    IMedium *aM = aMedium;
     3528    LogFlowThisFunc(("aControllerName=\"%s\" aControllerPort=%d aDevice=%d aType=%d aMedium=%p\n",
     3529                     aName.c_str(), aControllerPort, aDevice, aType, aM));
    40703530
    40713531    // request the host lock first, since might be calling Host methods for getting host drives;
     
    40743534    AutoWriteLock treeLock(&mParent->i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    40753535
    4076     HRESULT rc = checkStateDependency(MutableStateDep);
     3536    HRESULT rc = i_checkStateDependency(MutableStateDep);
    40773537    if (FAILED(rc)) return rc;
    40783538
     
    40863546    /* Check for an existing controller. */
    40873547    ComObjPtr<StorageController> ctl;
    4088     rc = getStorageControllerByName(aControllerName, ctl, true /* aSetError */);
     3548    rc = i_getStorageControllerByName(aName, ctl, true /* aSetError */);
    40893549    if (FAILED(rc)) return rc;
    40903550
     
    40933553    if (FAILED(rc))
    40943554        return setError(E_FAIL,
    4095                         tr("Could not get type of controller '%ls'"),
    4096                         aControllerName);
     3555                        tr("Could not get type of controller '%s'"),
     3556                        aName.c_str());
    40973557
    40983558    bool fSilent = false;
     
    41003560
    41013561    /* Check whether the flag to allow silent storage attachment reconfiguration is set. */
    4102     strReconfig = getExtraData(Utf8Str("VBoxInternal2/SilentReconfigureWhilePaused"));
     3562    strReconfig = i_getExtraData(Utf8Str("VBoxInternal2/SilentReconfigureWhilePaused"));
    41033563    if (   mData->mMachineState == MachineState_Paused
    41043564        && strReconfig == "1")
     
    41103570        fHotplug = true;
    41113571
    4112     if (fHotplug && !isControllerHotplugCapable(ctrlType))
     3572    if (fHotplug && !i_isControllerHotplugCapable(ctrlType))
    41133573        return setError(VBOX_E_INVALID_VM_STATE,
    4114                         tr("Controller '%ls' does not support hotplugging"),
    4115                         aControllerName);
     3574                        tr("Controller '%s' does not support hotplugging"),
     3575                        aName.c_str());
    41163576
    41173577    // check that the port and device are not out of range
     
    41213581    /* check if the device slot is already busy */
    41223582    MediumAttachment *pAttachTemp;
    4123     if ((pAttachTemp = findAttachment(mMediaData->mAttachments,
    4124                                       aControllerName,
    4125                                       aControllerPort,
    4126                                       aDevice)))
     3583    if ((pAttachTemp = i_findAttachment(mMediaData->mAttachments,
     3584                                        Bstr(aName).raw(),
     3585                                        aControllerPort,
     3586                                        aDevice)))
    41273587    {
    41283588        Medium *pMedium = pAttachTemp->i_getMedium();
     
    41313591            AutoReadLock mediumLock(pMedium COMMA_LOCKVAL_SRC_POS);
    41323592            return setError(VBOX_E_OBJECT_IN_USE,
    4133                             tr("Medium '%s' is already attached to port %d, device %d of controller '%ls' of this virtual machine"),
     3593                            tr("Medium '%s' is already attached to port %d, device %d of controller '%s' of this virtual machine"),
    41343594                            pMedium->i_getLocationFull().c_str(),
    41353595                            aControllerPort,
    41363596                            aDevice,
    4137                             aControllerName);
     3597                            aName.c_str());
    41383598        }
    41393599        else
    41403600            return setError(VBOX_E_OBJECT_IN_USE,
    4141                             tr("Device is already attached to port %d, device %d of controller '%ls' of this virtual machine"),
    4142                             aControllerPort, aDevice, aControllerName);
    4143     }
    4144 
    4145     ComObjPtr<Medium> medium = static_cast<Medium*>(aMedium);
     3601                            tr("Device is already attached to port %d, device %d of controller '%s' of this virtual machine"),
     3602                            aControllerPort, aDevice, aName.c_str());
     3603    }
     3604
     3605    ComObjPtr<Medium> medium = static_cast<Medium*>(aM);
    41463606    if (aMedium && medium.isNull())
    41473607        return setError(E_INVALIDARG, "The given medium pointer is invalid");
     
    41523612    AutoWriteLock mediumLock(medium COMMA_LOCKVAL_SRC_POS);
    41533613
    4154     if (    (pAttachTemp = findAttachment(mMediaData->mAttachments, medium))
     3614    if (    (pAttachTemp = i_findAttachment(mMediaData->mAttachments, medium))
    41553615         && !medium.isNull()
    41563616       )
     
    42043664             * changing attachments in which case the attachment just needs to
    42053665             * be restored */
    4206             if ((pAttachTemp = findAttachment(oldAtts, medium)))
     3666            if ((pAttachTemp = i_findAttachment(oldAtts, medium)))
    42073667            {
    42083668                AssertReturn(!fIndirect, E_FAIL);
    42093669
    42103670                /* see if it's the same bus/channel/device */
    4211                 if (pAttachTemp->i_matches(aControllerName, aControllerPort, aDevice))
     3671                if (pAttachTemp->i_matches(Bstr(aName).raw(), aControllerPort, aDevice))
    42123672                {
    42133673                    /* the simplest case: restore the whole attachment
     
    42433703                        if (SUCCEEDED(rc))
    42443704                        {
    4245                             rc = onStorageDeviceChange(pAttachTemp, FALSE /* aRemove */, fSilent);
     3705                            rc = i_onStorageDeviceChange(pAttachTemp, FALSE /* aRemove */, fSilent);
    42463706                            /* Remove lock list in case of error. */
    42473707                            if (FAILED(rc))
     
    42843744                uint32_t foundLevel = 0;
    42853745
    4286                 for (MediaData::AttachmentList::const_iterator it = oldAtts.begin();
    4287                      it != oldAtts.end();
    4288                      ++it)
     3746                for (MediaData::AttachmentList::const_iterator it = oldAtts.begin(); it != oldAtts.end(); ++it)
    42893747                {
    42903748                    uint32_t level = 0;
     
    42993757                        /* skip the hard disk if its currently attached (we
    43003758                         * cannot attach the same hard disk twice) */
    4301                         if (findAttachment(mMediaData->mAttachments,
    4302                                            pMedium))
     3759                        if (i_findAttachment(mMediaData->mAttachments,
     3760                                             pMedium))
    43033761                            continue;
    43043762
     
    43083766                         * descendant of medium will be used
    43093767                         */
    4310                         if (pAttach->i_matches(aControllerName, aControllerPort, aDevice))
     3768                        if (pAttach->i_matches(Bstr(aName).raw(), aControllerPort, aDevice))
    43113769                        {
    43123770                            /* the simplest case: restore the whole attachment
     
    43423800                                if (SUCCEEDED(rc))
    43433801                                {
    4344                                     rc = onStorageDeviceChange(pAttachTemp, FALSE /* aRemove */, fSilent);
     3802                                    rc = i_onStorageDeviceChange(pAttachTemp, FALSE /* aRemove */, fSilent);
    43453803                                    /* Remove lock list in case of error. */
    43463804                                    if (FAILED(rc))
     
    43993857                uint32_t foundLevel = 0;
    44003858
    4401                 for (MediaData::AttachmentList::const_iterator it = snapAtts.begin();
    4402                      it != snapAtts.end();
    4403                      ++it)
     3859                for (MediaData::AttachmentList::const_iterator it = snapAtts.begin(); it != snapAtts.end(); ++it)
    44043860                {
    44053861                    MediumAttachment *pAttach = *it;
     
    44193875                        if (    pAttach->i_getDevice() == aDevice
    44203876                             && pAttach->i_getPort() == aControllerPort
    4421                              && pAttach->i_getControllerName() == aControllerName
     3877                             && pAttach->i_getControllerName() == aName
    44223878                           )
    44233879                        {
     
    44593915
    44603916        Utf8Str strFullSnapshotFolder;
    4461         calculateFullPath(mUserData->s.strSnapshotFolder, strFullSnapshotFolder);
     3917        i_calculateFullPath(mUserData->s.strSnapshotFolder, strFullSnapshotFolder);
    44623918
    44633919        ComObjPtr<Medium> diff;
     
    44743930            treeLock.release();
    44753931            alock.release();
    4476             addMediumToRegistry(medium);
     3932            i_addMediumToRegistry(medium);
    44773933            alock.acquire();
    44783934            treeLock.acquire();
     
    45123968                 * operation, so protect with the special state */
    45133969                MachineState_T oldState = mData->mMachineState;
    4514                 setMachineState(MachineState_SettingUp);
     3970                i_setMachineState(MachineState_SettingUp);
    45153971
    45163972                mediumLock.release();
     
    45283984                mediumLock.acquire();
    45293985
    4530                 setMachineState(oldState);
     3986                i_setMachineState(oldState);
    45313987            }
    45323988        }
     
    45494005    rc = attachment->init(this,
    45504006                          medium,
    4551                           aControllerName,
     4007                          aName,
    45524008                          aControllerPort,
    45534009                          aDevice,
     
    45724028        treeLock.release();
    45734029        alock.release();
    4574         addMediumToRegistry(medium);
     4030        i_addMediumToRegistry(medium);
    45754031        alock.acquire();
    45764032        treeLock.acquire();
     
    45794035
    45804036    /* success: finally remember the attachment */
    4581     setModified(IsModified_Storage);
     4037    i_setModified(IsModified_Storage);
    45824038    mMediaData.backup();
    45834039    mMediaData->mAttachments.push_back(attachment);
     
    45944050
    45954051            rc = medium->i_createMediumLockList(true /* fFailIfInaccessible */,
    4596                                               true /* fMediumLockWrite */,
    4597                                               NULL,
    4598                                               *pMediumLockList);
     4052                                                true /* fMediumLockWrite */,
     4053                                                NULL,
     4054                                                *pMediumLockList);
    45994055            alock.acquire();
    46004056            if (FAILED(rc))
     
    46134069        if (SUCCEEDED(rc))
    46144070        {
    4615             rc = onStorageDeviceChange(attachment, FALSE /* aRemove */, fSilent);
     4071            rc = i_onStorageDeviceChange(attachment, FALSE /* aRemove */, fSilent);
    46164072            /* Remove lock list in case of error. */
    46174073            if (FAILED(rc))
     
    46294085}
    46304086
    4631 STDMETHODIMP Machine::DetachDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4632                                    LONG aDevice)
    4633 {
    4634     CheckComArgStrNotEmptyOrNull(aControllerName);
    4635 
    4636     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d\n",
    4637                      aControllerName, aControllerPort, aDevice));
    4638 
    4639     AutoCaller autoCaller(this);
    4640     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4087HRESULT Machine::detachDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4088                              LONG aDevice)
     4089{
     4090    LogFlowThisFunc(("aControllerName=\"%s\" aControllerPort=%d aDevice=%d\n",
     4091                     aName.c_str(), aControllerPort, aDevice));
    46414092
    46424093    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    46434094
    4644     HRESULT rc = checkStateDependency(MutableStateDep);
     4095    HRESULT rc = i_checkStateDependency(MutableStateDep);
    46454096    if (FAILED(rc)) return rc;
    46464097
     
    46494100    /* Check for an existing controller. */
    46504101    ComObjPtr<StorageController> ctl;
    4651     rc = getStorageControllerByName(aControllerName, ctl, true /* aSetError */);
     4102    rc = i_getStorageControllerByName(aName, ctl, true /* aSetError */);
    46524103    if (FAILED(rc)) return rc;
    46534104
     
    46564107    if (FAILED(rc))
    46574108        return setError(E_FAIL,
    4658                         tr("Could not get type of controller '%ls'"),
    4659                         aControllerName);
     4109                        tr("Could not get type of controller '%s'"),
     4110                        aName.c_str());
    46604111
    46614112    bool fSilent = false;
     
    46634114
    46644115    /* Check whether the flag to allow silent storage attachment reconfiguration is set. */
    4665     strReconfig = getExtraData(Utf8Str("VBoxInternal2/SilentReconfigureWhilePaused"));
     4116    strReconfig = i_getExtraData(Utf8Str("VBoxInternal2/SilentReconfigureWhilePaused"));
    46664117    if (   mData->mMachineState == MachineState_Paused
    46674118        && strReconfig == "1")
     
    46734124        fHotplug = true;
    46744125
    4675     if (fHotplug && !isControllerHotplugCapable(ctrlType))
     4126    if (fHotplug && !i_isControllerHotplugCapable(ctrlType))
    46764127        return setError(VBOX_E_INVALID_VM_STATE,
    4677                         tr("Controller '%ls' does not support hotplugging"),
    4678                         aControllerName);
    4679 
    4680     MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments,
    4681                                                aControllerName,
    4682                                                aControllerPort,
    4683                                                aDevice);
     4128                        tr("Controller '%s' does not support hotplugging"),
     4129                        aName.c_str());
     4130
     4131    MediumAttachment *pAttach = i_findAttachment(mMediaData->mAttachments,
     4132                                                 Bstr(aName).raw(),
     4133                                                 aControllerPort,
     4134                                                 aDevice);
    46844135    if (!pAttach)
    46854136        return setError(VBOX_E_OBJECT_NOT_FOUND,
    4686                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    4687                         aDevice, aControllerPort, aControllerName);
     4137                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4138                        aDevice, aControllerPort, aName.c_str());
    46884139
    46894140    if (fHotplug && !pAttach->i_getHotPluggable())
    46904141        return setError(VBOX_E_NOT_SUPPORTED,
    4691                         tr("The device slot %d on port %d of controller '%ls' does not support hotplugging"),
    4692                         aDevice, aControllerPort, aControllerName);
     4142                        tr("The device slot %d on port %d of controller '%s' does not support hotplugging"),
     4143                        aDevice, aControllerPort, aName.c_str());
    46934144
    46944145    /*
     
    46994150    {
    47004151        alock.release();
    4701         rc = onStorageDeviceChange(pAttach, TRUE /* aRemove */, fSilent);
     4152        rc = i_onStorageDeviceChange(pAttach, TRUE /* aRemove */, fSilent);
    47024153        alock.acquire();
    47034154    }
     
    47054156
    47064157    /* If we are here everything went well and we can delete the implicit now. */
    4707     rc = detachDevice(pAttach, alock, NULL /* pSnapshot */);
     4158    rc = i_detachDevice(pAttach, alock, NULL /* pSnapshot */);
    47084159
    47094160    alock.release();
     
    47144165}
    47154166
    4716 STDMETHODIMP Machine::PassthroughDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4717                                         LONG aDevice, BOOL aPassthrough)
    4718 {
    4719     CheckComArgStrNotEmptyOrNull(aControllerName);
    4720 
    4721     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aPassthrough=%d\n",
    4722                      aControllerName, aControllerPort, aDevice, aPassthrough));
    4723 
    4724     AutoCaller autoCaller(this);
    4725     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4167HRESULT Machine::passthroughDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4168                                   LONG aDevice, BOOL aPassthrough)
     4169{
     4170    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d aPassthrough=%d\n",
     4171                     aName.c_str(), aControllerPort, aDevice, aPassthrough));
    47264172
    47274173    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    47284174
    4729     HRESULT rc = checkStateDependency(MutableStateDep);
     4175    HRESULT rc = i_checkStateDependency(MutableStateDep);
    47304176    if (FAILED(rc)) return rc;
    47314177
     
    47374183                        Global::stringifyMachineState(mData->mMachineState));
    47384184
    4739     MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments,
    4740                                                aControllerName,
    4741                                                aControllerPort,
    4742                                                aDevice);
     4185    MediumAttachment *pAttach = i_findAttachment(mMediaData->mAttachments,
     4186                                                 Bstr(aName).raw(),
     4187                                                 aControllerPort,
     4188                                                 aDevice);
    47434189    if (!pAttach)
    47444190        return setError(VBOX_E_OBJECT_NOT_FOUND,
    4745                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    4746                         aDevice, aControllerPort, aControllerName);
    4747 
    4748 
    4749     setModified(IsModified_Storage);
     4191                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4192                        aDevice, aControllerPort, aName.c_str());
     4193
     4194
     4195    i_setModified(IsModified_Storage);
    47504196    mMediaData.backup();
    47514197
     
    47544200    if (pAttach->i_getType() != DeviceType_DVD)
    47554201        return setError(E_INVALIDARG,
    4756                         tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"),
    4757                         aDevice, aControllerPort, aControllerName);
     4202                        tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%s' is not a DVD"),
     4203                        aDevice, aControllerPort, aName.c_str());
    47584204    pAttach->i_updatePassthrough(!!aPassthrough);
    47594205
     
    47614207}
    47624208
    4763 STDMETHODIMP Machine::TemporaryEjectDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4764                                            LONG aDevice, BOOL aTemporaryEject)
    4765 {
    4766     CheckComArgStrNotEmptyOrNull(aControllerName);
    4767 
    4768     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aTemporaryEject=%d\n",
    4769                      aControllerName, aControllerPort, aDevice, aTemporaryEject));
    4770 
    4771     AutoCaller autoCaller(this);
    4772     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4209HRESULT Machine::temporaryEjectDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4210                                      LONG aDevice, BOOL aTemporaryEject)
     4211{
     4212
     4213    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d aTemporaryEject=%d\n",
     4214                     aName.c_str(), aControllerPort, aDevice, aTemporaryEject));
    47734215
    47744216    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    47754217
    4776     HRESULT rc = checkStateDependency(MutableStateDep);
     4218    HRESULT rc = i_checkStateDependency(MutableStateDep);
    47774219    if (FAILED(rc)) return rc;
    47784220
    4779     MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments,
    4780                                                aControllerName,
    4781                                                aControllerPort,
    4782                                                aDevice);
     4221    MediumAttachment *pAttach = i_findAttachment(mMediaData->mAttachments,
     4222                                                 Bstr(aName).raw(),
     4223                                                 aControllerPort,
     4224                                                 aDevice);
    47834225    if (!pAttach)
    47844226        return setError(VBOX_E_OBJECT_NOT_FOUND,
    4785                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    4786                         aDevice, aControllerPort, aControllerName);
    4787 
    4788 
    4789     setModified(IsModified_Storage);
     4227                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4228                        aDevice, aControllerPort, aName.c_str());
     4229
     4230
     4231    i_setModified(IsModified_Storage);
    47904232    mMediaData.backup();
    47914233
     
    47944236    if (pAttach->i_getType() != DeviceType_DVD)
    47954237        return setError(E_INVALIDARG,
    4796                         tr("Setting temporary eject flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"),
    4797                         aDevice, aControllerPort, aControllerName);
     4238                        tr("Setting temporary eject flag rejected as the device attached to device slot %d on port %d of controller '%s' is not a DVD"),
     4239                        aDevice, aControllerPort, aName.c_str());
    47984240    pAttach->i_updateTempEject(!!aTemporaryEject);
    47994241
     
    48014243}
    48024244
    4803 STDMETHODIMP Machine::NonRotationalDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4804                                           LONG aDevice, BOOL aNonRotational)
    4805 {
    4806     CheckComArgStrNotEmptyOrNull(aControllerName);
    4807 
    4808     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aNonRotational=%d\n",
    4809                      aControllerName, aControllerPort, aDevice, aNonRotational));
    4810 
    4811     AutoCaller autoCaller(this);
    4812     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4245HRESULT Machine::nonRotationalDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4246                                     LONG aDevice, BOOL aNonRotational)
     4247{
     4248
     4249    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d aNonRotational=%d\n",
     4250                     aName.c_str(), aControllerPort, aDevice, aNonRotational));
    48134251
    48144252    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    48154253
    4816     HRESULT rc = checkStateDependency(MutableStateDep);
     4254    HRESULT rc = i_checkStateDependency(MutableStateDep);
    48174255    if (FAILED(rc)) return rc;
    48184256
     
    48244262                        Global::stringifyMachineState(mData->mMachineState));
    48254263
    4826     MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments,
    4827                                                aControllerName,
    4828                                                aControllerPort,
    4829                                                aDevice);
     4264    MediumAttachment *pAttach = i_findAttachment(mMediaData->mAttachments,
     4265                                                 Bstr(aName).raw(),
     4266                                                 aControllerPort,
     4267                                                 aDevice);
    48304268    if (!pAttach)
    48314269        return setError(VBOX_E_OBJECT_NOT_FOUND,
    4832                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    4833                         aDevice, aControllerPort, aControllerName);
    4834 
    4835 
    4836     setModified(IsModified_Storage);
     4270                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4271                        aDevice, aControllerPort, aName.c_str());
     4272
     4273
     4274    i_setModified(IsModified_Storage);
    48374275    mMediaData.backup();
    48384276
     
    48414279    if (pAttach->i_getType() != DeviceType_HardDisk)
    48424280        return setError(E_INVALIDARG,
    4843                         tr("Setting the non-rotational medium flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a hard disk"),
    4844                         aDevice, aControllerPort, aControllerName);
     4281                        tr("Setting the non-rotational medium flag rejected as the device attached to device slot %d on port %d of controller '%s' is not a hard disk"),
     4282                        aDevice, aControllerPort, aName.c_str());
    48454283    pAttach->i_updateNonRotational(!!aNonRotational);
    48464284
     
    48484286}
    48494287
    4850 STDMETHODIMP Machine::SetAutoDiscardForDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4851                                               LONG aDevice, BOOL aDiscard)
    4852 {
    4853     CheckComArgStrNotEmptyOrNull(aControllerName);
    4854 
    4855     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aDiscard=%d\n",
    4856                      aControllerName, aControllerPort, aDevice, aDiscard));
    4857 
    4858     AutoCaller autoCaller(this);
    4859     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4288HRESULT Machine::setAutoDiscardForDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4289                                         LONG aDevice, BOOL aDiscard)
     4290{
     4291
     4292    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d aDiscard=%d\n",
     4293                     aName.c_str(), aControllerPort, aDevice, aDiscard));
    48604294
    48614295    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    48624296
    4863     HRESULT rc = checkStateDependency(MutableStateDep);
     4297    HRESULT rc = i_checkStateDependency(MutableStateDep);
    48644298    if (FAILED(rc)) return rc;
    48654299
     
    48714305                        Global::stringifyMachineState(mData->mMachineState));
    48724306
    4873     MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments,
    4874                                                aControllerName,
    4875                                                aControllerPort,
    4876                                                aDevice);
     4307    MediumAttachment *pAttach = i_findAttachment(mMediaData->mAttachments,
     4308                                                 Bstr(aName).raw(),
     4309                                                 aControllerPort,
     4310                                                 aDevice);
    48774311    if (!pAttach)
    48784312        return setError(VBOX_E_OBJECT_NOT_FOUND,
    4879                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    4880                         aDevice, aControllerPort, aControllerName);
    4881 
    4882 
    4883     setModified(IsModified_Storage);
     4313                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4314                        aDevice, aControllerPort, aName.c_str());
     4315
     4316
     4317    i_setModified(IsModified_Storage);
    48844318    mMediaData.backup();
    48854319
     
    48884322    if (pAttach->i_getType() != DeviceType_HardDisk)
    48894323        return setError(E_INVALIDARG,
    4890                         tr("Setting the discard medium flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a hard disk"),
    4891                         aDevice, aControllerPort, aControllerName);
     4324                        tr("Setting the discard medium flag rejected as the device attached to device slot %d on port %d of controller '%s' is not a hard disk"),
     4325                        aDevice, aControllerPort, aName.c_str());
    48924326    pAttach->i_updateDiscard(!!aDiscard);
    48934327
     
    48954329}
    48964330
    4897 STDMETHODIMP Machine::SetHotPluggableForDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4898                                                LONG aDevice, BOOL aHotPluggable)
    4899 {
    4900     CheckComArgStrNotEmptyOrNull(aControllerName);
    4901 
    4902     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aHotPluggable=%d\n",
    4903                      aControllerName, aControllerPort, aDevice, aHotPluggable));
    4904 
    4905     AutoCaller autoCaller(this);
    4906     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4331HRESULT Machine::setHotPluggableForDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4332                                          LONG aDevice, BOOL aHotPluggable)
     4333{
     4334    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d aHotPluggable=%d\n",
     4335                     aName.c_str(), aControllerPort, aDevice, aHotPluggable));
    49074336
    49084337    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    49094338
    4910     HRESULT rc = checkStateDependency(MutableStateDep);
     4339    HRESULT rc = i_checkStateDependency(MutableStateDep);
    49114340    if (FAILED(rc)) return rc;
    49124341
     
    49184347                        Global::stringifyMachineState(mData->mMachineState));
    49194348
    4920     MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments,
    4921                                                aControllerName,
    4922                                                aControllerPort,
    4923                                                aDevice);
     4349    MediumAttachment *pAttach = i_findAttachment(mMediaData->mAttachments,
     4350                                                 Bstr(aName).raw(),
     4351                                                 aControllerPort,
     4352                                                 aDevice);
    49244353    if (!pAttach)
    49254354        return setError(VBOX_E_OBJECT_NOT_FOUND,
    4926                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    4927                         aDevice, aControllerPort, aControllerName);
     4355                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4356                        aDevice, aControllerPort, aName.c_str());
    49284357
    49294358    /* Check for an existing controller. */
    49304359    ComObjPtr<StorageController> ctl;
    4931     rc = getStorageControllerByName(aControllerName, ctl, true /* aSetError */);
     4360    rc = i_getStorageControllerByName(aName, ctl, true /* aSetError */);
    49324361    if (FAILED(rc)) return rc;
    49334362
     
    49364365    if (FAILED(rc))
    49374366        return setError(E_FAIL,
    4938                         tr("Could not get type of controller '%ls'"),
    4939                         aControllerName);
    4940 
    4941     if (!isControllerHotplugCapable(ctrlType))
     4367                        tr("Could not get type of controller '%s'"),
     4368                        aName.c_str());
     4369
     4370    if (!i_isControllerHotplugCapable(ctrlType))
    49424371    return setError(VBOX_E_NOT_SUPPORTED,
    4943                     tr("Controller '%ls' does not support changing the hot-pluggable device flag"),
    4944                     aControllerName);
    4945 
    4946     setModified(IsModified_Storage);
     4372                    tr("Controller '%s' does not support changing the hot-pluggable device flag"),
     4373                    aName.c_str());
     4374
     4375    i_setModified(IsModified_Storage);
    49474376    mMediaData.backup();
    49484377
     
    49514380    if (pAttach->i_getType() == DeviceType_Floppy)
    49524381        return setError(E_INVALIDARG,
    4953                         tr("Setting the hot-pluggable device flag rejected as the device attached to device slot %d on port %d of controller '%ls' is a floppy drive"),
    4954                         aDevice, aControllerPort, aControllerName);
     4382                        tr("Setting the hot-pluggable device flag rejected as the device attached to device slot %d on port %d of controller '%s' is a floppy drive"),
     4383                        aDevice, aControllerPort, aName.c_str());
    49554384    pAttach->i_updateHotPluggable(!!aHotPluggable);
    49564385
     
    49584387}
    49594388
    4960 STDMETHODIMP Machine::SetNoBandwidthGroupForDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4961                                                    LONG aDevice)
     4389HRESULT Machine::setNoBandwidthGroupForDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4390                                              LONG aDevice)
    49624391{
    49634392    int rc = S_OK;
    4964     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d\n",
    4965                      aControllerName, aControllerPort, aDevice));
    4966 
    4967     rc = SetBandwidthGroupForDevice(aControllerName, aControllerPort, aDevice, NULL);
     4393    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d\n",
     4394                     aName.c_str(), aControllerPort, aDevice));
     4395
     4396    rc = setBandwidthGroupForDevice(aName, aControllerPort, aDevice, NULL);
    49684397
    49694398    return rc;
    49704399}
    49714400
    4972 STDMETHODIMP Machine::SetBandwidthGroupForDevice(IN_BSTR aControllerName, LONG aControllerPort,
    4973                                                  LONG aDevice, IBandwidthGroup *aBandwidthGroup)
    4974 {
    4975     CheckComArgStrNotEmptyOrNull(aControllerName);
    4976 
    4977     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d\n",
    4978                      aControllerName, aControllerPort, aDevice));
    4979 
    4980     AutoCaller autoCaller(this);
    4981     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4401HRESULT Machine::setBandwidthGroupForDevice(const com::Utf8Str &aName, LONG aControllerPort,
     4402                                            LONG aDevice, const ComPtr<IBandwidthGroup> &aBandwidthGroup)
     4403{
     4404    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d\n",
     4405                     aName.c_str(), aControllerPort, aDevice));
    49824406
    49834407    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    49844408
    4985     HRESULT rc = checkStateDependency(MutableStateDep);
     4409    HRESULT rc = i_checkStateDependency(MutableStateDep);
    49864410    if (FAILED(rc)) return rc;
    49874411
     
    49934417                        Global::stringifyMachineState(mData->mMachineState));
    49944418
    4995     MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments,
    4996                                                aControllerName,
    4997                                                aControllerPort,
    4998                                                aDevice);
     4419    MediumAttachment *pAttach = i_findAttachment(mMediaData->mAttachments,
     4420                                                 Bstr(aName).raw(),
     4421                                                 aControllerPort,
     4422                                                 aDevice);
    49994423    if (!pAttach)
    50004424        return setError(VBOX_E_OBJECT_NOT_FOUND,
    5001                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    5002                         aDevice, aControllerPort, aControllerName);
    5003 
    5004 
    5005     setModified(IsModified_Storage);
     4425                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4426                        aDevice, aControllerPort, aName.c_str());
     4427
     4428
     4429    i_setModified(IsModified_Storage);
    50064430    mMediaData.backup();
    50074431
    5008     ComObjPtr<BandwidthGroup> group = static_cast<BandwidthGroup*>(aBandwidthGroup);
     4432    IBandwidthGroup *iB = aBandwidthGroup;
     4433    ComObjPtr<BandwidthGroup> group = static_cast<BandwidthGroup*>(iB);
    50094434    if (aBandwidthGroup && group.isNull())
    50104435        return setError(E_INVALIDARG, "The given bandwidth group pointer is invalid");
     
    50174442        /* Get the bandwidth group object and release it - this must not fail. */
    50184443        ComObjPtr<BandwidthGroup> pBandwidthGroupOld;
    5019         rc = getBandwidthGroup(strBandwidthGroupOld, pBandwidthGroupOld, false);
     4444        rc = i_getBandwidthGroup(strBandwidthGroupOld, pBandwidthGroupOld, false);
    50204445        Assert(SUCCEEDED(rc));
    50214446
     
    50334458}
    50344459
    5035 STDMETHODIMP Machine::AttachDeviceWithoutMedium(IN_BSTR aControllerName,
    5036                                                 LONG    aControllerPort,
    5037                                                 LONG    aDevice,
    5038                                                 DeviceType_T aType)
     4460HRESULT Machine::attachDeviceWithoutMedium(const com::Utf8Str &aName,
     4461                                           LONG aControllerPort,
     4462                                           LONG aDevice,
     4463                                           DeviceType_T aType)
    50394464{
    50404465     HRESULT rc = S_OK;
    50414466
    5042      LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aType=%d aMedium=%p\n",
    5043                       aControllerName, aControllerPort, aDevice, aType));
    5044 
    5045      rc = AttachDevice(aControllerName, aControllerPort, aDevice, aType, NULL);
     4467     LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d aType=%d aMedium=%p\n",
     4468                      aName.c_str(), aControllerPort, aDevice, aType));
     4469
     4470     rc = AttachDevice(Bstr(aName).raw(), aControllerPort, aDevice, aType, NULL);
    50464471
    50474472     return rc;
     
    50494474
    50504475
    5051 
    5052 STDMETHODIMP Machine::UnmountMedium(IN_BSTR aControllerName,
    5053                                     LONG    aControllerPort,
    5054                                     LONG    aDevice,
    5055                                     BOOL    aForce)
     4476HRESULT Machine::unmountMedium(const com::Utf8Str &aName,
     4477                               LONG aControllerPort,
     4478                               LONG aDevice,
     4479                               BOOL aForce)
    50564480{
    50574481     int rc = S_OK;
    5058      LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d",
    5059                       aControllerName, aControllerPort, aForce));
    5060 
    5061      rc = MountMedium(aControllerName, aControllerPort, aDevice, NULL, aForce);
     4482     LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d",
     4483                      aName.c_str(), aControllerPort, aForce));
     4484
     4485     rc = mountMedium(aName, aControllerPort, aDevice, NULL, aForce);
    50624486
    50634487     return rc;
    50644488}
    50654489
    5066 STDMETHODIMP Machine::MountMedium(IN_BSTR aControllerName,
    5067                                   LONG aControllerPort,
    5068                                   LONG aDevice,
    5069                                   IMedium *aMedium,
    5070                                   BOOL aForce)
     4490HRESULT Machine::mountMedium(const com::Utf8Str &aName,
     4491                             LONG aControllerPort,
     4492                             LONG aDevice,
     4493                             const ComPtr<IMedium> &aMedium,
     4494                             BOOL aForce)
    50714495{
    50724496    int rc = S_OK;
    5073     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aForce=%d\n",
    5074                      aControllerName, aControllerPort, aDevice, aForce));
    5075 
    5076     CheckComArgStrNotEmptyOrNull(aControllerName);
    5077 
    5078     AutoCaller autoCaller(this);
    5079     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4497    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d aForce=%d\n",
     4498                     aName.c_str(), aControllerPort, aDevice, aForce));
    50804499
    50814500    // request the host lock first, since might be calling Host methods for getting host drives;
     
    50854504                                  &mParent->i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    50864505
    5087     ComObjPtr<MediumAttachment> pAttach = findAttachment(mMediaData->mAttachments,
    5088                                                          aControllerName,
    5089                                                          aControllerPort,
    5090                                                          aDevice);
     4506    ComObjPtr<MediumAttachment> pAttach = i_findAttachment(mMediaData->mAttachments,
     4507                                                           Bstr(aName).raw(),
     4508                                                           aControllerPort,
     4509                                                           aDevice);
    50914510    if (pAttach.isNull())
    50924511        return setError(VBOX_E_OBJECT_NOT_FOUND,
    5093                         tr("No drive attached to device slot %d on port %d of controller '%ls'"),
    5094                         aDevice, aControllerPort, aControllerName);
     4512                        tr("No drive attached to device slot %d on port %d of controller '%s'"),
     4513                        aDevice, aControllerPort, aName.c_str());
    50954514
    50964515    /* Remember previously mounted medium. The medium before taking the
     
    50994518    oldmedium = pAttach->i_getMedium();
    51004519
    5101     ComObjPtr<Medium> pMedium = static_cast<Medium*>(aMedium);
     4520    IMedium *iM = aMedium;
     4521    ComObjPtr<Medium> pMedium = static_cast<Medium*>(iM);
    51024522    if (aMedium && pMedium.isNull())
    51034523        return setError(E_INVALIDARG, "The given medium pointer is invalid");
     
    51184538            default:
    51194539                return setError(VBOX_E_INVALID_OBJECT_STATE,
    5120                                 tr("The device at port %d, device %d of controller '%ls' of this virtual machine is not removeable"),
     4540                                tr("The device at port %d, device %d of controller '%s' of this virtual machine is not removeable"),
    51214541                                aControllerPort,
    51224542                                aDevice,
    5123                                 aControllerName);
    5124         }
    5125     }
    5126 
    5127     setModified(IsModified_Storage);
     4543                                aName.c_str());
     4544        }
     4545    }
     4546
     4547    i_setModified(IsModified_Storage);
    51284548    mMediaData.backup();
    51294549
     
    51314551        // The backup operation makes the pAttach reference point to the
    51324552        // old settings. Re-get the correct reference.
    5133         pAttach = findAttachment(mMediaData->mAttachments,
    5134                                  aControllerName,
    5135                                  aControllerPort,
    5136                                  aDevice);
     4553        pAttach = i_findAttachment(mMediaData->mAttachments,
     4554                                   Bstr(aName).raw(),
     4555                                   aControllerPort,
     4556                                   aDevice);
    51374557        if (!oldmedium.isNull())
    51384558            oldmedium->i_removeBackReference(mData->mUuid);
     
    51434563            mediumLock.release();
    51444564            multiLock.release();
    5145             addMediumToRegistry(pMedium);
     4565            i_addMediumToRegistry(pMedium);
    51464566            multiLock.acquire();
    51474567            mediumLock.acquire();
     
    51524572    }
    51534573
    5154     setModified(IsModified_Storage);
     4574    i_setModified(IsModified_Storage);
    51554575
    51564576    mediumLock.release();
    51574577    multiLock.release();
    5158     rc = onMediumChange(pAttach, aForce);
     4578    rc = i_onMediumChange(pAttach, aForce);
    51594579    multiLock.acquire();
    51604580    mediumLock.acquire();
     
    51654585        if (!pMedium.isNull())
    51664586            pMedium->i_removeBackReference(mData->mUuid);
    5167         pAttach = findAttachment(mMediaData->mAttachments,
    5168                                  aControllerName,
    5169                                  aControllerPort,
    5170                                  aDevice);
     4587        pAttach = i_findAttachment(mMediaData->mAttachments,
     4588                                   Bstr(aName).raw(),
     4589                                   aControllerPort,
     4590                                   aDevice);
    51714591        /* If the attachment is gone in the meantime, bail out. */
    51724592        if (pAttach.isNull())
     
    51854605    return rc;
    51864606}
    5187 
    5188 STDMETHODIMP Machine::GetMedium(IN_BSTR aControllerName,
    5189                                 LONG aControllerPort,
    5190                                 LONG aDevice,
    5191                                 IMedium **aMedium)
    5192 {
    5193     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d\n",
    5194                      aControllerName, aControllerPort, aDevice));
    5195 
    5196     CheckComArgStrNotEmptyOrNull(aControllerName);
    5197     CheckComArgOutPointerValid(aMedium);
    5198 
    5199     AutoCaller autoCaller(this);
    5200     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4607HRESULT Machine::getMedium(const com::Utf8Str &aName,
     4608                           LONG aControllerPort,
     4609                           LONG aDevice,
     4610                           ComPtr<IMedium> &aMedium)
     4611{
     4612    LogFlowThisFunc(("aName=\"%s\" aControllerPort=%d aDevice=%d\n",
     4613                     aName.c_str(), aControllerPort, aDevice));
    52014614
    52024615    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    52034616
    5204     *aMedium = NULL;
    5205 
    5206     ComObjPtr<MediumAttachment> pAttach = findAttachment(mMediaData->mAttachments,
    5207                                                          aControllerName,
    5208                                                          aControllerPort,
    5209                                                          aDevice);
     4617    aMedium = NULL;
     4618
     4619    ComObjPtr<MediumAttachment> pAttach = i_findAttachment(mMediaData->mAttachments,
     4620                                                           Bstr(aName).raw(),
     4621                                                           aControllerPort,
     4622                                                           aDevice);
    52104623    if (pAttach.isNull())
    52114624        return setError(VBOX_E_OBJECT_NOT_FOUND,
    5212                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    5213                         aDevice, aControllerPort, aControllerName);
    5214 
    5215     pAttach->i_getMedium().queryInterfaceTo(aMedium);
    5216 
    5217     return S_OK;
    5218 }
    5219 
    5220 STDMETHODIMP Machine::GetSerialPort(ULONG slot, ISerialPort **port)
    5221 {
    5222     CheckComArgOutPointerValid(port);
    5223     CheckComArgExpr(slot, slot < RT_ELEMENTS(mSerialPorts));
    5224 
    5225     AutoCaller autoCaller(this);
    5226     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4625                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     4626                        aDevice, aControllerPort, aName.c_str());
     4627
     4628    pAttach->i_getMedium().queryInterfaceTo(aMedium.asOutParam());
     4629
     4630    return S_OK;
     4631}
     4632
     4633HRESULT Machine::getSerialPort(ULONG aSlot, ComPtr<ISerialPort> &aPort)
     4634{
    52274635
    52284636    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    52294637
    5230     mSerialPorts[slot].queryInterfaceTo(port);
    5231 
    5232     return S_OK;
    5233 }
    5234 
    5235 STDMETHODIMP Machine::GetParallelPort(ULONG slot, IParallelPort **port)
    5236 {
    5237     CheckComArgOutPointerValid(port);
    5238     CheckComArgExpr(slot, slot < RT_ELEMENTS(mParallelPorts));
    5239 
    5240     AutoCaller autoCaller(this);
    5241     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5242 
     4638    mSerialPorts[aSlot].queryInterfaceTo(aPort.asOutParam());
     4639
     4640    return S_OK;
     4641}
     4642
     4643HRESULT Machine::getParallelPort(ULONG aSlot, ComPtr<IParallelPort> &aPort)
     4644{
    52434645    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    52444646
    5245     mParallelPorts[slot].queryInterfaceTo(port);
    5246 
    5247     return S_OK;
    5248 }
    5249 
    5250 STDMETHODIMP Machine::GetNetworkAdapter(ULONG slot, INetworkAdapter **adapter)
    5251 {
    5252     CheckComArgOutPointerValid(adapter);
     4647    mParallelPorts[aSlot].queryInterfaceTo(aPort.asOutParam());
     4648
     4649    return S_OK;
     4650}
     4651
     4652HRESULT Machine::getNetworkAdapter(ULONG aSlot, ComPtr<INetworkAdapter> &aAdapter)
     4653{
    52534654    /* Do not assert if slot is out of range, just return the advertised
    52544655       status.  testdriver/vbox.py triggers this in logVmInfo. */
    5255     if (slot >= mNetworkAdapters.size())
     4656    if (aSlot >= mNetworkAdapters.size())
    52564657        return setError(E_INVALIDARG,
    52574658                        tr("No network adapter in slot %RU32 (total %RU32 adapters)"),
    5258                         slot, mNetworkAdapters.size());
    5259 
    5260     AutoCaller autoCaller(this);
    5261     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     4659                        aSlot, mNetworkAdapters.size());
    52624660
    52634661    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    52644662
    5265     mNetworkAdapters[slot].queryInterfaceTo(adapter);
    5266 
    5267     return S_OK;
    5268 }
    5269 
    5270 STDMETHODIMP Machine::GetExtraDataKeys(ComSafeArrayOut(BSTR, aKeys))
    5271 {
    5272     CheckComArgOutSafeArrayPointerValid(aKeys);
    5273 
    5274     AutoCaller autoCaller(this);
    5275     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5276 
     4663    mNetworkAdapters[aSlot].queryInterfaceTo(aAdapter.asOutParam());
     4664
     4665    return S_OK;
     4666}
     4667
     4668HRESULT Machine::getExtraDataKeys(std::vector<com::Utf8Str> &aKeys)
     4669{
    52774670    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    52784671
    52794672    com::SafeArray<BSTR> saKeys(mData->pMachineConfigFile->mapExtraDataItems.size());
    5280     int i = 0;
     4673    aKeys.resize(mData->pMachineConfigFile->mapExtraDataItems.size());
     4674    size_t i = 0;
    52814675    for (settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.begin();
    52824676         it != mData->pMachineConfigFile->mapExtraDataItems.end();
    52834677         ++it, ++i)
    5284     {
    5285         const Utf8Str &strKey = it->first;
    5286         strKey.cloneTo(&saKeys[i]);
    5287     }
    5288     saKeys.detachTo(ComSafeArrayOutArg(aKeys));
    5289 
    5290     return S_OK;
    5291   }
     4678        aKeys[i] = it->first;
     4679
     4680    return S_OK;
     4681}
    52924682
    52934683  /**
    52944684   *  @note Locks this object for reading.
    52954685   */
    5296 STDMETHODIMP Machine::GetExtraData(IN_BSTR aKey,
    5297                                    BSTR *aValue)
    5298 {
    5299     CheckComArgStrNotEmptyOrNull(aKey);
    5300     CheckComArgOutPointerValid(aValue);
    5301 
    5302     AutoCaller autoCaller(this);
    5303     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5304 
     4686HRESULT Machine::getExtraData(const com::Utf8Str &aKey,
     4687                              com::Utf8Str &aValue)
     4688{
    53054689    /* start with nothing found */
    5306     Bstr bstrResult("");
     4690    aValue = "";
    53074691
    53084692    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    53094693
    5310     settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(Utf8Str(aKey));
     4694    settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(aKey);
    53114695    if (it != mData->pMachineConfigFile->mapExtraDataItems.end())
    53124696        // found:
    5313         bstrResult = it->second; // source is a Utf8Str
     4697        aValue = it->second; // source is a Utf8Str
    53144698
    53154699    /* return the result to caller (may be empty) */
    5316     bstrResult.cloneTo(aValue);
    5317 
    53184700    return S_OK;
    53194701}
     
    53224704   *  @note Locks mParent for writing + this object for writing.
    53234705   */
    5324 STDMETHODIMP Machine::SetExtraData(IN_BSTR aKey, IN_BSTR aValue)
    5325 {
    5326     CheckComArgStrNotEmptyOrNull(aKey);
    5327 
    5328     AutoCaller autoCaller(this);
    5329     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5330 
    5331     Utf8Str strKey(aKey);
    5332     Utf8Str strValue(aValue);
     4706HRESULT Machine::setExtraData(const com::Utf8Str &aKey, const com::Utf8Str &aValue)
     4707{
    53334708    Utf8Str strOldValue;            // empty
    53344709
     
    53434718    {
    53444719        AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); // hold read lock only while looking up
    5345         settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(strKey);
     4720        settings::StringsMap::const_iterator it = mData->pMachineConfigFile->mapExtraDataItems.find(aKey);
    53464721        if (it != mData->pMachineConfigFile->mapExtraDataItems.end())
    53474722            strOldValue = it->second;
     
    53494724
    53504725    bool fChanged;
    5351     if ((fChanged = (strOldValue != strValue)))
     4726    if ((fChanged = (strOldValue != aValue)))
    53524727    {
    53534728        // ask for permission from all listeners outside the locks;
     
    53574732        Bstr bstrValue(aValue);
    53584733
    5359         if (!mParent->i_onExtraDataCanChange(mData->mUuid, aKey, bstrValue.raw(), error))
     4734        if (!mParent->i_onExtraDataCanChange(mData->mUuid, Bstr(aKey).raw(), bstrValue.raw(), error))
    53604735        {
    53614736            const char *sep = error.isEmpty() ? "" : ": ";
     
    53644739                            sep, err));
    53654740            return setError(E_ACCESSDENIED,
    5366                             tr("Could not set extra data because someone refused the requested change of '%ls' to '%ls'%s%ls"),
    5367                             aKey,
    5368                             bstrValue.raw(),
     4741                            tr("Could not set extra data because someone refused the requested change of '%s' to '%s'%s%ls"),
     4742                            aKey.c_str(),
     4743                            aValue.c_str(),
    53694744                            sep,
    53704745                            err);
     
    53744749        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    53754750
    5376         if (isSnapshotMachine())
    5377         {
    5378             HRESULT rc = checkStateDependency(MutableStateDep);
     4751        if (i_isSnapshotMachine())
     4752        {
     4753            HRESULT rc = i_checkStateDependency(MutableStateDep);
    53794754            if (FAILED(rc)) return rc;
    53804755        }
    53814756
    5382         if (strValue.isEmpty())
    5383             mData->pMachineConfigFile->mapExtraDataItems.erase(strKey);
     4757        if (aValue.isEmpty())
     4758            mData->pMachineConfigFile->mapExtraDataItems.erase(aKey);
    53844759        else
    5385             mData->pMachineConfigFile->mapExtraDataItems[strKey] = strValue;
     4760            mData->pMachineConfigFile->mapExtraDataItems[aKey] = aValue;
    53864761                // creates a new key if needed
    53874762
    53884763        bool fNeedsGlobalSaveSettings = false;
    5389         saveSettings(&fNeedsGlobalSaveSettings);
     4764        i_saveSettings(&fNeedsGlobalSaveSettings);
    53904765
    53914766        if (fNeedsGlobalSaveSettings)
     
    54004775    // fire notification outside the lock
    54014776    if (fChanged)
    5402         mParent->i_onExtraDataChange(mData->mUuid, aKey, aValue);
    5403 
    5404     return S_OK;
    5405 }
    5406 
    5407 STDMETHODIMP Machine::SetSettingsFilePath(IN_BSTR aFilePath, IProgress **aProgress)
    5408 {
    5409     CheckComArgStrNotEmptyOrNull(aFilePath);
    5410     CheckComArgOutPointerValid(aProgress);
    5411 
    5412     AutoCaller autoCaller(this);
    5413     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5414 
    5415     *aProgress = NULL;
     4777        mParent->i_onExtraDataChange(mData->mUuid, Bstr(aKey).raw(), Bstr(aValue).raw());
     4778
     4779    return S_OK;
     4780}
     4781
     4782HRESULT Machine::setSettingsFilePath(const com::Utf8Str &aSettingsFilePath, ComPtr<IProgress> &aProgress)
     4783{
     4784    aProgress = NULL;
     4785    NOREF(aSettingsFilePath);
    54164786    ReturnComNotImplemented();
    54174787}
    54184788
    5419 STDMETHODIMP Machine::SaveSettings()
    5420 {
    5421     AutoCaller autoCaller(this);
    5422     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5423 
     4789HRESULT Machine::saveSettings()
     4790{
    54244791    AutoWriteLock mlock(this COMMA_LOCKVAL_SRC_POS);
    54254792
    54264793    /* when there was auto-conversion, we want to save the file even if
    54274794     * the VM is saved */
    5428     HRESULT rc = checkStateDependency(MutableOrSavedStateDep);
     4795    HRESULT rc = i_checkStateDependency(MutableOrSavedStateDep);
    54294796    if (FAILED(rc)) return rc;
    54304797
     
    54344801    /* save all VM data excluding snapshots */
    54354802    bool fNeedsGlobalSaveSettings = false;
    5436     rc = saveSettings(&fNeedsGlobalSaveSettings);
     4803    rc = i_saveSettings(&fNeedsGlobalSaveSettings);
    54374804    mlock.release();
    54384805
     
    54474814}
    54484815
    5449 STDMETHODIMP Machine::DiscardSettings()
    5450 {
    5451     AutoCaller autoCaller(this);
    5452     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5453 
     4816
     4817HRESULT Machine::discardSettings()
     4818{
    54544819    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    54554820
    5456     HRESULT rc = checkStateDependency(MutableStateDep);
     4821    HRESULT rc = i_checkStateDependency(MutableStateDep);
    54574822    if (FAILED(rc)) return rc;
    54584823
     
    54614826     *  been actually changed
    54624827     */
    5463     rollback(true /* aNotify */);
     4828    i_rollback(true /* aNotify */);
    54644829
    54654830    return S_OK;
     
    54674832
    54684833/** @note Locks objects! */
    5469 STDMETHODIMP Machine::Unregister(CleanupMode_T cleanupMode,
    5470                                  ComSafeArrayOut(IMedium*, aMedia))
     4834HRESULT Machine::unregister(CleanupMode_T aCleanupMode,
     4835                            std::vector<ComPtr<IMedium> > &aMedia)
    54714836{
    54724837    // use AutoLimitedCaller because this call is valid on inaccessible machines as well
     
    54764841    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    54774842
    5478     Guid id(getId());
     4843    Guid id(i_getId());
    54794844
    54804845    if (mData->mSession.mState != SessionState_Unlocked)
     
    54844849
    54854850    // wait for state dependents to drop to zero
    5486     ensureNoStateDependencies();
     4851    i_ensureNoStateDependencies();
    54874852
    54884853    if (!mData->mAccessible)
     
    54984863
    54994864        mParent->i_unregisterMachine(this, id);
    5500             // calls VirtualBox::saveSettings()
     4865            // calls VirtualBox::i_saveSettings()
    55014866
    55024867        return S_OK;
     
    55224887    if (mData->mFirstSnapshot)
    55234888        cSnapshots = mData->mFirstSnapshot->i_getAllChildrenCount() + 1;
    5524     if (cSnapshots && cleanupMode == CleanupMode_UnregisterOnly)
     4889    if (cSnapshots && aCleanupMode == CleanupMode_UnregisterOnly)
    55254890        // fail now before we start detaching media
    55264891        return setError(VBOX_E_INVALID_OBJECT_STATE,
     
    55444909    {
    55454910        // we have media attachments: detach them all and add the Medium objects to our list
    5546         if (cleanupMode != CleanupMode_UnregisterOnly)
    5547             detachAllMedia(alock, NULL /* pSnapshot */, cleanupMode, llMedia);
     4911        if (aCleanupMode != CleanupMode_UnregisterOnly)
     4912            i_detachAllMedia(alock, NULL /* pSnapshot */, aCleanupMode, llMedia);
    55484913        else
    55494914            return setError(VBOX_E_INVALID_OBJECT_STATE,
     
    55714936
    55724937        // GO!
    5573         pFirstSnapshot->i_uninitRecursively(alock, cleanupMode, llMedia, mData->llFilesToDelete);
     4938        pFirstSnapshot->i_uninitRecursively(alock, aCleanupMode, llMedia, mData->llFilesToDelete);
    55744939
    55754940        mData->mMachineState = oldState;
     
    55784943    if (FAILED(rc))
    55794944    {
    5580         rollbackMedia();
     4945        i_rollbackMedia();
    55814946        return rc;
    55824947    }
    55834948
    55844949    // commit all the media changes made above
    5585     commitMedia();
     4950    i_commitMedia();
    55864951
    55874952    mData->mRegistered = false;
     
    55914956
    55924957    // return media to caller
    5593     SafeIfaceArray<IMedium> sfaMedia(llMedia);
    5594     sfaMedia.detachTo(ComSafeArrayOutArg(aMedia));
     4958    size_t i = 0;
     4959    aMedia.resize(llMedia.size());
     4960    for (MediaList::iterator it = llMedia.begin(); it != llMedia.end(); ++it, ++i)
     4961        (*it).queryInterfaceTo(aMedia[i].asOutParam());
    55954962
    55964963    mParent->i_unregisterMachine(this, id);
    5597             // calls VirtualBox::saveSettings() and VirtualBox::i_saveModifiedRegistries()
     4964            // calls VirtualBox::i_saveSettings() and VirtualBox::saveModifiedRegistries()
    55984965
    55994966    return S_OK;
     
    56084975};
    56094976
    5610 STDMETHODIMP Machine::DeleteConfig(ComSafeArrayIn(IMedium*, aMedia), IProgress **aProgress)
    5611 {
    5612     LogFlowFuncEnter();
    5613 
    5614     AutoCaller autoCaller(this);
    5615     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5616 
     4977HRESULT Machine::deleteConfig(const std::vector<ComPtr<IMedium> > &aMedia, ComPtr<IProgress> &aProgress)
     4978{
    56174979    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    56184980
    5619     HRESULT rc = checkStateDependency(MutableStateDep);
     4981    HRESULT rc = i_checkStateDependency(MutableStateDep);
    56204982    if (FAILED(rc)) return rc;
    56214983
     
    56264988    DeleteTask *pTask = new DeleteTask;
    56274989    pTask->pMachine = this;
    5628     com::SafeIfaceArray<IMedium> sfaMedia(ComSafeArrayInArg(aMedia));
    56294990
    56304991    // collect files to delete
    56314992    pTask->llFilesToDelete = mData->llFilesToDelete;            // saved states pushed here by Unregister()
    56324993
    5633     for (size_t i = 0; i < sfaMedia.size(); ++i)
    5634     {
    5635         IMedium *pIMedium(sfaMedia[i]);
     4994    for (size_t i = 0; i < aMedia.size(); ++i)
     4995    {
     4996        IMedium *pIMedium(aMedia[i]);
    56364997        ComObjPtr<Medium> pMedium = static_cast<Medium*>(pIMedium);
    56374998        if (pMedium.isNull())
     
    56505011
    56515012    pTask->pProgress.createObject();
    5652     pTask->pProgress->init(getVirtualBox(),
     5013    pTask->pProgress->init(i_getVirtualBox(),
    56535014                           static_cast<IMachine*>(this) /* aInitiator */,
    56545015                           Bstr(tr("Deleting files")).raw(),
     
    56655026                             "MachineDelete");
    56665027
    5667     pTask->pProgress.queryInterfaceTo(aProgress);
     5028    pTask->pProgress.queryInterfaceTo(aProgress.asOutParam());
    56685029
    56695030    if (RT_FAILURE(vrc))
     
    56955056    Assert(pTask->pProgress);
    56965057
    5697     HRESULT rc = pTask->pMachine->deleteTaskWorker(*pTask);
     5058    HRESULT rc = pTask->pMachine->i_deleteTaskWorker(*pTask);
    56985059    pTask->pProgress->i_notifyComplete(rc);
    56995060
     
    57125073 * @return
    57135074 */
    5714 HRESULT Machine::deleteTaskWorker(DeleteTask &task)
     5075HRESULT Machine::i_deleteTaskWorker(DeleteTask &task)
    57155076{
    57165077    AutoCaller autoCaller(this);
     
    57355096
    57365097        MachineState_T oldState = mData->mMachineState;
    5737         setMachineState(MachineState_SettingUp);
     5098        i_setMachineState(MachineState_SettingUp);
    57385099        alock.release();
    57395100        for (size_t i = 0; i < task.llMediums.size(); ++i)
     
    57635124
    57645125            /* Close the medium, deliberately without checking the return
    5765              * code, and without leaving any trace in the error info, as
    5766              * a failure here is a very minor issue, which shouldn't happen
    5767              * as above we even managed to delete the medium. */
     5126-            * code, and without leaving any trace in the error info, as
     5127-            * a failure here is a very minor issue, which shouldn't happen
     5128-            * as above we even managed to delete the medium. */
    57685129            {
    57695130                ErrorInfoKeeper eik;
     
    57715132            }
    57725133        }
    5773         setMachineState(oldState);
     5134        i_setMachineState(oldState);
    57745135        alock.acquire();
    57755136
     
    58465207             * some private files there that we don't want to delete) */
    58475208            Utf8Str strFullSnapshotFolder;
    5848             calculateFullPath(mUserData->s.strSnapshotFolder, strFullSnapshotFolder);
     5209            i_calculateFullPath(mUserData->s.strSnapshotFolder, strFullSnapshotFolder);
    58495210            Assert(!strFullSnapshotFolder.isEmpty());
    58505211            if (RTDirExists(strFullSnapshotFolder.c_str()))
     
    58545215            // if it matches the VM name
    58555216            Utf8Str settingsDir;
    5856             if (isInOwnDir(&settingsDir))
     5217            if (i_isInOwnDir(&settingsDir))
    58575218                RTDirRemove(settingsDir.c_str());
    58585219        }
     
    58675228}
    58685229
    5869 STDMETHODIMP Machine::FindSnapshot(IN_BSTR aNameOrId, ISnapshot **aSnapshot)
    5870 {
    5871     CheckComArgOutPointerValid(aSnapshot);
    5872 
    5873     AutoCaller autoCaller(this);
    5874     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5875 
     5230HRESULT Machine::findSnapshot(const com::Utf8Str &aNameOrId, ComPtr<ISnapshot> &aSnapshot)
     5231{
    58765232    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    58775233
     
    58795235    HRESULT rc;
    58805236
    5881     if (!aNameOrId || !*aNameOrId)
    5882         // null case (caller wants root snapshot): findSnapshotById() handles this
    5883         rc = findSnapshotById(Guid(), pSnapshot, true /* aSetError */);
     5237    if (aNameOrId.isEmpty())
     5238        // null case (caller wants root snapshot): i_findSnapshotById() handles this
     5239        rc = i_findSnapshotById(Guid(), pSnapshot, true /* aSetError */);
    58845240    else
    58855241    {
    58865242        Guid uuid(aNameOrId);
    58875243        if (uuid.isValid())
    5888             rc = findSnapshotById(uuid, pSnapshot, true /* aSetError */);
     5244            rc = i_findSnapshotById(uuid, pSnapshot, true /* aSetError */);
    58895245        else
    5890             rc = findSnapshotByName(Utf8Str(aNameOrId), pSnapshot, true /* aSetError */);
    5891     }
    5892     pSnapshot.queryInterfaceTo(aSnapshot);
     5246            rc = i_findSnapshotByName(aNameOrId, pSnapshot, true /* aSetError */);
     5247    }
     5248    pSnapshot.queryInterfaceTo(aSnapshot.asOutParam());
    58935249
    58945250    return rc;
    58955251}
    58965252
    5897 STDMETHODIMP Machine::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount)
    5898 {
    5899     CheckComArgStrNotEmptyOrNull(aName);
    5900     CheckComArgStrNotEmptyOrNull(aHostPath);
    5901 
    5902     AutoCaller autoCaller(this);
    5903     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5904 
     5253HRESULT Machine::createSharedFolder(const com::Utf8Str &aName, const com::Utf8Str &aHostPath, BOOL  aWritable, BOOL  aAutomount)
     5254{
    59055255    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    59065256
    5907     HRESULT rc = checkStateDependency(MutableStateDep);
     5257    HRESULT rc = i_checkStateDependency(MutableStateDep);
    59085258    if (FAILED(rc)) return rc;
    59095259
    5910     Utf8Str strName(aName);
    5911 
    59125260    ComObjPtr<SharedFolder> sharedFolder;
    5913     rc = findSharedFolder(strName, sharedFolder, false /* aSetError */);
     5261    rc = i_findSharedFolder(aName, sharedFolder, false /* aSetError */);
    59145262    if (SUCCEEDED(rc))
    59155263        return setError(VBOX_E_OBJECT_IN_USE,
    59165264                        tr("Shared folder named '%s' already exists"),
    5917                         strName.c_str());
     5265                        aName.c_str());
    59185266
    59195267    sharedFolder.createObject();
    5920     rc = sharedFolder->init(getMachine(),
    5921                             strName,
     5268    rc = sharedFolder->init(i_getMachine(),
     5269                            aName,
    59225270                            aHostPath,
    59235271                            !!aWritable,
    5924                             !!aAutoMount,
     5272                            !!aAutomount,
    59255273                            true /* fFailOnError */);
    59265274    if (FAILED(rc)) return rc;
    59275275
    5928     setModified(IsModified_SharedFolders);
     5276    i_setModified(IsModified_SharedFolders);
    59295277    mHWData.backup();
    59305278    mHWData->mSharedFolders.push_back(sharedFolder);
     
    59325280    /* inform the direct session if any */
    59335281    alock.release();
    5934     onSharedFolderChange();
    5935 
    5936     return S_OK;
    5937 }
    5938 
    5939 STDMETHODIMP Machine::RemoveSharedFolder(IN_BSTR aName)
    5940 {
    5941     CheckComArgStrNotEmptyOrNull(aName);
    5942 
    5943     AutoCaller autoCaller(this);
    5944     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    5945 
     5282    i_onSharedFolderChange();
     5283
     5284    return S_OK;
     5285}
     5286
     5287HRESULT Machine::removeSharedFolder(const com::Utf8Str &aName)
     5288{
    59465289    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    59475290
    5948     HRESULT rc = checkStateDependency(MutableStateDep);
     5291    HRESULT rc = i_checkStateDependency(MutableStateDep);
    59495292    if (FAILED(rc)) return rc;
    59505293
    59515294    ComObjPtr<SharedFolder> sharedFolder;
    5952     rc = findSharedFolder(aName, sharedFolder, true /* aSetError */);
     5295    rc = i_findSharedFolder(aName, sharedFolder, true /* aSetError */);
    59535296    if (FAILED(rc)) return rc;
    59545297
    5955     setModified(IsModified_SharedFolders);
     5298    i_setModified(IsModified_SharedFolders);
    59565299    mHWData.backup();
    59575300    mHWData->mSharedFolders.remove(sharedFolder);
     
    59595302    /* inform the direct session if any */
    59605303    alock.release();
    5961     onSharedFolderChange();
    5962 
    5963     return S_OK;
    5964 }
    5965 
    5966 STDMETHODIMP Machine::CanShowConsoleWindow(BOOL *aCanShow)
    5967 {
    5968     CheckComArgOutPointerValid(aCanShow);
    5969 
     5304    i_onSharedFolderChange();
     5305
     5306    return S_OK;
     5307}
     5308
     5309HRESULT Machine::canShowConsoleWindow(BOOL *aCanShow)
     5310{
    59705311    /* start with No */
    59715312    *aCanShow = FALSE;
    5972 
    5973     AutoCaller autoCaller(this);
    5974     AssertComRCReturnRC(autoCaller.rc());
    59755313
    59765314    ComPtr<IInternalSessionControl> directControl;
     
    59945332}
    59955333
    5996 STDMETHODIMP Machine::ShowConsoleWindow(LONG64 *aWinId)
    5997 {
    5998     CheckComArgOutPointerValid(aWinId);
    5999 
    6000     AutoCaller autoCaller(this);
    6001     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    6002 
     5334HRESULT Machine::showConsoleWindow(LONG64 *aWinId)
     5335{
    60035336    ComPtr<IInternalSessionControl> directControl;
    60045337    {
     
    60255358 * Look up a guest property in VBoxSVC's internal structures.
    60265359 */
    6027 HRESULT Machine::getGuestPropertyFromService(IN_BSTR aName,
    6028                                              BSTR *aValue,
    6029                                              LONG64 *aTimestamp,
    6030                                              BSTR *aFlags) const
     5360HRESULT Machine::i_getGuestPropertyFromService(const com::Utf8Str &aName,
     5361                                               com::Utf8Str &aValue,
     5362                                               LONG64 *aTimestamp,
     5363                                               com::Utf8Str &aFlags) const
    60315364{
    60325365    using namespace guestProp;
    60335366
    60345367    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    6035     Utf8Str strName(aName);
    6036     HWData::GuestPropertyMap::const_iterator it = mHWData->mGuestProperties.find(strName);
     5368    HWData::GuestPropertyMap::const_iterator it = mHWData->mGuestProperties.find(aName);
    60375369
    60385370    if (it != mHWData->mGuestProperties.end())
    60395371    {
    60405372        char szFlags[MAX_FLAGS_LEN + 1];
    6041         it->second.strValue.cloneTo(aValue);
     5373        aValue = it->second.strValue;
    60425374        *aTimestamp = it->second.mTimestamp;
    60435375        writeFlags(it->second.mFlags, szFlags);
    6044         Bstr(szFlags).cloneTo(aFlags);
     5376        aFlags = Utf8Str(szFlags);
    60455377    }
    60465378
     
    60545386 *          VBoxSVC.
    60555387 */
    6056 HRESULT Machine::getGuestPropertyFromVM(IN_BSTR aName,
    6057                                         BSTR *aValue,
    6058                                         LONG64 *aTimestamp,
    6059                                         BSTR *aFlags) const
    6060 {
    6061     HRESULT rc;
     5388HRESULT Machine::i_getGuestPropertyFromVM(const com::Utf8Str &aName,
     5389                                          com::Utf8Str &aValue,
     5390                                          LONG64 *aTimestamp,
     5391                                          com::Utf8Str &aFlags) const
     5392{
     5393    HRESULT rc = S_OK;
     5394    BSTR bValue;
     5395    BSTR bFlags;
     5396
    60625397    ComPtr<IInternalSessionControl> directControl;
    60635398    directControl = mData->mSession.mDirectControl;
     
    60725407        rc = E_ACCESSDENIED;
    60735408    else
    6074         rc = directControl->AccessGuestProperty(aName, NULL, NULL,
     5409        rc = directControl->AccessGuestProperty(Bstr(aName).raw(), NULL, NULL,
    60755410                                                false /* isSetter */,
    6076                                                 aValue, aTimestamp, aFlags);
     5411                                                &bValue, aTimestamp, &bFlags);
     5412
     5413    aValue = bValue;
     5414    aFlags = bFlags;
     5415
    60775416    return rc;
    60785417}
    60795418#endif // VBOX_WITH_GUEST_PROPS
    60805419
    6081 STDMETHODIMP Machine::GetGuestProperty(IN_BSTR aName,
    6082                                        BSTR *aValue,
    6083                                        LONG64 *aTimestamp,
    6084                                        BSTR *aFlags)
     5420HRESULT Machine::getGuestProperty(const com::Utf8Str &aName,
     5421                                  com::Utf8Str &aValue,
     5422                                  LONG64 *aTimestamp,
     5423                                  com::Utf8Str &aFlags)
    60855424{
    60865425#ifndef VBOX_WITH_GUEST_PROPS
    60875426    ReturnComNotImplemented();
    60885427#else // VBOX_WITH_GUEST_PROPS
    6089     CheckComArgStrNotEmptyOrNull(aName);
    6090     CheckComArgOutPointerValid(aValue);
    6091     CheckComArgOutPointerValid(aTimestamp);
    6092     CheckComArgOutPointerValid(aFlags);
    6093 
    6094     AutoCaller autoCaller(this);
    6095     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6096 
    6097     HRESULT rc = getGuestPropertyFromVM(aName, aValue, aTimestamp, aFlags);
     5428
     5429    HRESULT rc = i_getGuestPropertyFromVM(aName, aValue, aTimestamp, aFlags);
     5430
    60985431    if (rc == E_ACCESSDENIED)
    60995432        /* The VM is not running or the service is not (yet) accessible */
    6100         rc = getGuestPropertyFromService(aName, aValue, aTimestamp, aFlags);
     5433        rc = i_getGuestPropertyFromService(aName, aValue, aTimestamp, aFlags);
    61015434    return rc;
    61025435#endif // VBOX_WITH_GUEST_PROPS
    61035436}
    61045437
    6105 STDMETHODIMP Machine::GetGuestPropertyValue(IN_BSTR aName, BSTR *aValue)
     5438HRESULT Machine::getGuestPropertyValue(const com::Utf8Str &aProperty, com::Utf8Str &aValue)
    61065439{
    61075440    LONG64 dummyTimestamp;
    6108     Bstr dummyFlags;
    6109     return GetGuestProperty(aName, aValue, &dummyTimestamp, dummyFlags.asOutParam());
    6110 }
    6111 
    6112 STDMETHODIMP Machine::GetGuestPropertyTimestamp(IN_BSTR aName, LONG64 *aTimestamp)
    6113 {
    6114     Bstr dummyValue;
    6115     Bstr dummyFlags;
    6116     return GetGuestProperty(aName, dummyValue.asOutParam(), aTimestamp, dummyFlags.asOutParam());
     5441    com::Utf8Str dummyFlags;
     5442    HRESULT rc = getGuestProperty(aProperty, aValue, &dummyTimestamp, dummyFlags);
     5443    return rc;
     5444
     5445}
     5446HRESULT Machine::getGuestPropertyTimestamp(const com::Utf8Str &aProperty, LONG64 *aValue)
     5447{
     5448    com::Utf8Str dummyFlags;
     5449    com::Utf8Str dummyValue;
     5450    HRESULT rc = getGuestProperty(aProperty, dummyValue, aValue, dummyFlags);
     5451    return rc;
    61175452}
    61185453
     
    61215456 * Set a guest property in VBoxSVC's internal structures.
    61225457 */
    6123 HRESULT Machine::setGuestPropertyToService(IN_BSTR aName, IN_BSTR aValue,
    6124                                            IN_BSTR aFlags)
     5458HRESULT Machine::i_setGuestPropertyToService(const com::Utf8Str &aName, const com::Utf8Str &aValue,
     5459                                             const com::Utf8Str &aFlags)
    61255460{
    61265461    using namespace guestProp;
     
    61295464    HRESULT rc = S_OK;
    61305465
    6131     rc = checkStateDependency(MutableStateDep);
     5466    rc = i_checkStateDependency(MutableStateDep);
    61325467    if (FAILED(rc)) return rc;
    61335468
    61345469    try
    61355470    {
    6136         Utf8Str utf8Name(aName);
    6137         Utf8Str utf8Flags(aFlags);
    61385471        uint32_t fFlags = NILFLAG;
    6139         if (   aFlags != NULL
    6140             && RT_FAILURE(validateFlags(utf8Flags.c_str(), &fFlags)))
    6141             return setError(E_INVALIDARG,
    6142                             tr("Invalid guest property flag values: '%ls'"),
    6143                             aFlags);
    6144 
    6145         bool fDelete = !RT_VALID_PTR(aValue) || *(aValue) == '\0';
    6146         HWData::GuestPropertyMap::iterator it = mHWData->mGuestProperties.find(utf8Name);
     5472        if (aFlags.length() && RT_FAILURE(validateFlags(aFlags.c_str(), &fFlags)))
     5473            return setError(E_INVALIDARG, tr("Invalid guest property flag values: '%s'"), aFlags.c_str());
     5474
     5475        bool fDelete = aValue.isEmpty();
     5476        HWData::GuestPropertyMap::iterator it = mHWData->mGuestProperties.find(aName);
    61475477        if (it == mHWData->mGuestProperties.end())
    61485478        {
    61495479            if (!fDelete)
    61505480            {
    6151                 setModified(IsModified_MachineData);
     5481                i_setModified(IsModified_MachineData);
    61525482                mHWData.backupEx();
    61535483
    61545484                RTTIMESPEC time;
    61555485                HWData::GuestProperty prop;
    6156                 prop.strValue   = aValue;
     5486                prop.strValue   = Bstr(aValue).raw();
    61575487                prop.mTimestamp = RTTimeSpecGetNano(RTTimeNow(&time));
    61585488                prop.mFlags     = fFlags;
    6159                 mHWData->mGuestProperties[Utf8Str(aName)] = prop;
     5489                mHWData->mGuestProperties[aName] = prop;
    61605490            }
    61615491        }
     
    61645494            if (it->second.mFlags & (RDONLYHOST))
    61655495            {
    6166                 rc = setError(E_ACCESSDENIED,
    6167                               tr("The property '%ls' cannot be changed by the host"),
    6168                               aName);
     5496                rc = setError(E_ACCESSDENIED, tr("The property '%s' cannot be changed by the host"), aName.c_str());
    61695497            }
    61705498            else
    61715499            {
    6172                 setModified(IsModified_MachineData);
     5500                i_setModified(IsModified_MachineData);
    61735501                mHWData.backupEx();
    61745502
    61755503                /* The backupEx() operation invalidates our iterator,
    61765504                 * so get a new one. */
    6177                 it = mHWData->mGuestProperties.find(utf8Name);
     5505                it = mHWData->mGuestProperties.find(aName);
    61785506                Assert(it != mHWData->mGuestProperties.end());
    61795507
     
    61945522                || RTStrSimplePatternMultiMatch(mHWData->mGuestPropertyNotificationPatterns.c_str(),
    61955523                                                RTSTR_MAX,
    6196                                                 utf8Name.c_str(),
     5524                                                aName.c_str(),
    61975525                                                RTSTR_MAX,
    61985526                                                NULL)
     
    62025530            alock.release();
    62035531
    6204             mParent->i_onGuestPropertyChange(mData->mUuid, aName,
    6205                                              aValue ? aValue : Bstr("").raw(),
    6206                                              aFlags ? aFlags : Bstr("").raw());
     5532            mParent->i_onGuestPropertyChange(mData->mUuid,
     5533                                             Bstr(aName).raw(),
     5534                                             Bstr(aValue).raw(),
     5535                                             Bstr(aFlags).raw());
    62075536        }
    62085537    }
     
    62215550 *          VBoxSVC.
    62225551 */
    6223 HRESULT Machine::setGuestPropertyToVM(IN_BSTR aName, IN_BSTR aValue,
    6224                                       IN_BSTR aFlags)
     5552HRESULT Machine::i_setGuestPropertyToVM(const com::Utf8Str &aName, const com::Utf8Str &aValue,
     5553                                        const com::Utf8Str &aFlags)
    62255554{
    62265555    HRESULT rc;
     
    62365565        else
    62375566            /** @todo Fix when adding DeleteGuestProperty(), see defect. */
    6238             rc = directControl->AccessGuestProperty(aName, aValue, aFlags,
     5567            rc = directControl->AccessGuestProperty(Bstr(aName).raw(), Bstr(aValue).raw(), Bstr(aFlags).raw(),
    62395568                                                    true /* isSetter */,
    62405569                                                    &dummy, &dummy64, &dummy);
     
    62495578#endif // VBOX_WITH_GUEST_PROPS
    62505579
    6251 STDMETHODIMP Machine::SetGuestProperty(IN_BSTR aName, IN_BSTR aValue,
    6252                                        IN_BSTR aFlags)
     5580HRESULT Machine::setGuestProperty(const com::Utf8Str &aProperty, const com::Utf8Str &aValue,
     5581                                  const com::Utf8Str &aFlags)
    62535582{
    62545583#ifndef VBOX_WITH_GUEST_PROPS
    62555584    ReturnComNotImplemented();
    62565585#else // VBOX_WITH_GUEST_PROPS
    6257     CheckComArgStrNotEmptyOrNull(aName);
    6258     CheckComArgMaybeNull(aFlags);
    6259     CheckComArgMaybeNull(aValue);
    6260 
    6261     AutoCaller autoCaller(this);
    6262     if (FAILED(autoCaller.rc()))
    6263         return autoCaller.rc();
    6264 
    6265     HRESULT rc = setGuestPropertyToVM(aName, aValue, aFlags);
     5586    HRESULT rc = i_setGuestPropertyToVM(aProperty, aValue, aFlags);
    62665587    if (rc == E_ACCESSDENIED)
    62675588        /* The VM is not running or the service is not (yet) accessible */
    6268         rc = setGuestPropertyToService(aName, aValue, aFlags);
     5589        rc = i_setGuestPropertyToService(aProperty, aValue, aFlags);
    62695590    return rc;
    62705591#endif // VBOX_WITH_GUEST_PROPS
    62715592}
    62725593
    6273 STDMETHODIMP Machine::SetGuestPropertyValue(IN_BSTR aName, IN_BSTR aValue)
    6274 {
    6275     return SetGuestProperty(aName, aValue, NULL);
    6276 }
    6277 
    6278 STDMETHODIMP Machine::DeleteGuestProperty(IN_BSTR aName)
    6279 {
    6280     return SetGuestProperty(aName, NULL, NULL);
     5594HRESULT Machine::setGuestPropertyValue(const com::Utf8Str &aProperty, const com::Utf8Str &aValue)
     5595{
     5596    return setGuestProperty(aProperty, aValue, "");
     5597}
     5598
     5599HRESULT Machine::deleteGuestProperty(const com::Utf8Str &aName)
     5600{
     5601    return setGuestProperty(aName, "", "");
    62815602}
    62825603
     
    62855606 * Enumerate the guest properties in VBoxSVC's internal structures.
    62865607 */
    6287 HRESULT Machine::enumerateGuestPropertiesInService
    6288                 (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames),
    6289                  ComSafeArrayOut(BSTR, aValues),
    6290                  ComSafeArrayOut(LONG64, aTimestamps),
    6291                  ComSafeArrayOut(BSTR, aFlags))
     5608HRESULT Machine::i_enumerateGuestPropertiesInService(const com::Utf8Str &aPatterns,
     5609                                                     std::vector<com::Utf8Str> &aNames,
     5610                                                     std::vector<com::Utf8Str> &aValues,
     5611                                                     std::vector<LONG64> &aTimestamps,
     5612                                                     std::vector<com::Utf8Str> &aFlags)
    62925613{
    62935614    using namespace guestProp;
     
    63115632                                            NULL)
    63125633           )
    6313         {
    63145634            propMap.insert(*it);
    6315         }
    6316 
    63175635        it++;
    63185636    }
     
    63245642     */
    63255643    size_t cEntries = propMap.size();
    6326     SafeArray<BSTR> names(cEntries);
    6327     SafeArray<BSTR> values(cEntries);
    6328     SafeArray<LONG64> timestamps(cEntries);
    6329     SafeArray<BSTR> flags(cEntries);
    6330     size_t iProp = 0;
    6331 
    6332     it = propMap.begin();
    6333     while (it != propMap.end())
    6334     {
    6335          char szFlags[MAX_FLAGS_LEN + 1];
    6336          it->first.cloneTo(&names[iProp]);
    6337          it->second.strValue.cloneTo(&values[iProp]);
    6338          timestamps[iProp] = it->second.mTimestamp;
    6339          writeFlags(it->second.mFlags, szFlags);
    6340          Bstr(szFlags).cloneTo(&flags[iProp++]);
    6341          it++;
    6342     }
    6343     names.detachTo(ComSafeArrayOutArg(aNames));
    6344     values.detachTo(ComSafeArrayOutArg(aValues));
    6345     timestamps.detachTo(ComSafeArrayOutArg(aTimestamps));
    6346     flags.detachTo(ComSafeArrayOutArg(aFlags));
     5644
     5645    aNames.resize(cEntries);
     5646    aValues.resize(cEntries);
     5647    aTimestamps.resize(cEntries);
     5648    aFlags.resize(cEntries);
     5649
     5650    char szFlags[MAX_FLAGS_LEN + 1];
     5651    size_t i= 0;
     5652    for (it = propMap.begin(); it != propMap.end(); ++i, ++it)
     5653    {
     5654        aNames[i] = it->first;
     5655        aValues[i] = it->second.strValue;
     5656        aTimestamps[i] = it->second.mTimestamp;
     5657        writeFlags(it->second.mFlags, szFlags);
     5658        aFlags[i] = Utf8Str(szFlags);
     5659    }
     5660
    63475661    return S_OK;
    63485662}
     
    63545668 *          VBoxSVC.
    63555669 */
    6356 HRESULT Machine::enumerateGuestPropertiesOnVM
    6357                 (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames),
    6358                  ComSafeArrayOut(BSTR, aValues),
    6359                  ComSafeArrayOut(LONG64, aTimestamps),
    6360                  ComSafeArrayOut(BSTR, aFlags))
     5670HRESULT Machine::i_enumerateGuestPropertiesOnVM(const com::Utf8Str &aPatterns,
     5671                                                std::vector<com::Utf8Str> &aNames,
     5672                                                std::vector<com::Utf8Str> &aValues,
     5673                                                std::vector<LONG64> &aTimestamps,
     5674                                                std::vector<com::Utf8Str> &aFlags)
    63615675{
    63625676    HRESULT rc;
     
    63645678    directControl = mData->mSession.mDirectControl;
    63655679
     5680
     5681    com::SafeArray<BSTR> bNames;
     5682    com::SafeArray<BSTR> bValues;
     5683    com::SafeArray<LONG64> bTimestamps;
     5684    com::SafeArray<BSTR> bFlags;
     5685
    63665686    if (!directControl)
    63675687        rc = E_ACCESSDENIED;
    63685688    else
    6369         rc = directControl->EnumerateGuestProperties
    6370                      (aPatterns, ComSafeArrayOutArg(aNames),
    6371                       ComSafeArrayOutArg(aValues),
    6372                       ComSafeArrayOutArg(aTimestamps),
    6373                       ComSafeArrayOutArg(aFlags));
     5689        rc = directControl->EnumerateGuestProperties(Bstr(aPatterns).raw(),
     5690                                                     ComSafeArrayAsOutParam(bNames),
     5691                                                     ComSafeArrayAsOutParam(bValues),
     5692                                                     ComSafeArrayAsOutParam(bTimestamps),
     5693                                                     ComSafeArrayAsOutParam(bFlags));
     5694    size_t i;
     5695    aNames.resize(bNames.size());
     5696    for (i = 0; i < bNames.size(); ++i)
     5697        aNames[i] = Utf8Str(bNames[i]);
     5698    aValues.resize(bValues.size());
     5699    for (i = 0; i < bValues.size(); ++i)
     5700        aValues[i] = Utf8Str(bValues[i]);
     5701    aTimestamps.resize(bTimestamps.size());
     5702    for (i = 0; i < bTimestamps.size(); ++i)
     5703        aTimestamps[i] = bTimestamps[i];
     5704    aFlags.resize(bFlags.size());
     5705    for (i = 0; i < bFlags.size(); ++i)
     5706        aFlags[i] = Utf8Str(bFlags[i]);
     5707
    63745708    return rc;
    63755709}
    63765710#endif // VBOX_WITH_GUEST_PROPS
    6377 
    6378 STDMETHODIMP Machine::EnumerateGuestProperties(IN_BSTR aPatterns,
    6379                                                ComSafeArrayOut(BSTR, aNames),
    6380                                                ComSafeArrayOut(BSTR, aValues),
    6381                                                ComSafeArrayOut(LONG64, aTimestamps),
    6382                                                ComSafeArrayOut(BSTR, aFlags))
     5711HRESULT Machine::enumerateGuestProperties(const com::Utf8Str &aPatterns,
     5712                                          std::vector<com::Utf8Str> &aNames,
     5713                                          std::vector<com::Utf8Str> &aValues,
     5714                                          std::vector<LONG64> &aTimestamps,
     5715                                          std::vector<com::Utf8Str> &aFlags)
    63835716{
    63845717#ifndef VBOX_WITH_GUEST_PROPS
    63855718    ReturnComNotImplemented();
    63865719#else // VBOX_WITH_GUEST_PROPS
    6387     CheckComArgMaybeNull(aPatterns);
    6388     CheckComArgOutSafeArrayPointerValid(aNames);
    6389     CheckComArgOutSafeArrayPointerValid(aValues);
    6390     CheckComArgOutSafeArrayPointerValid(aTimestamps);
    6391     CheckComArgOutSafeArrayPointerValid(aFlags);
    6392 
    6393     AutoCaller autoCaller(this);
    6394     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6395 
    6396     HRESULT rc = enumerateGuestPropertiesOnVM
    6397                      (aPatterns, ComSafeArrayOutArg(aNames),
    6398                       ComSafeArrayOutArg(aValues),
    6399                       ComSafeArrayOutArg(aTimestamps),
    6400                       ComSafeArrayOutArg(aFlags));
     5720
     5721    HRESULT rc = i_enumerateGuestPropertiesOnVM(aPatterns, aNames, aValues, aTimestamps, aFlags);
     5722
    64015723    if (rc == E_ACCESSDENIED)
    64025724        /* The VM is not running or the service is not (yet) accessible */
    6403         rc = enumerateGuestPropertiesInService
    6404                      (aPatterns, ComSafeArrayOutArg(aNames),
    6405                       ComSafeArrayOutArg(aValues),
    6406                       ComSafeArrayOutArg(aTimestamps),
    6407                       ComSafeArrayOutArg(aFlags));
     5725        rc = i_enumerateGuestPropertiesInService(aPatterns, aNames, aValues, aTimestamps, aFlags);
    64085726    return rc;
    64095727#endif // VBOX_WITH_GUEST_PROPS
    64105728}
    64115729
    6412 STDMETHODIMP Machine::GetMediumAttachmentsOfController(IN_BSTR aName,
    6413                                                        ComSafeArrayOut(IMediumAttachment*, aAttachments))
     5730HRESULT Machine::getMediumAttachmentsOfController(const com::Utf8Str &aName,
     5731                                                  std::vector<ComPtr<IMediumAttachment> > &aMediumAttachments)
    64145732{
    64155733    MediaData::AttachmentList atts;
    64165734
    6417     HRESULT rc = getMediumAttachmentsOfController(aName, atts);
     5735    HRESULT rc = i_getMediumAttachmentsOfController(aName, atts);
    64185736    if (FAILED(rc)) return rc;
    64195737
    6420     SafeIfaceArray<IMediumAttachment> attachments(atts);
    6421     attachments.detachTo(ComSafeArrayOutArg(aAttachments));
    6422 
    6423     return S_OK;
    6424 }
    6425 
    6426 STDMETHODIMP Machine::GetMediumAttachment(IN_BSTR aControllerName,
    6427                                           LONG aControllerPort,
    6428                                           LONG aDevice,
    6429                                           IMediumAttachment **aAttachment)
    6430 {
    6431     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d\n",
    6432                      aControllerName, aControllerPort, aDevice));
    6433 
    6434     CheckComArgStrNotEmptyOrNull(aControllerName);
    6435     CheckComArgOutPointerValid(aAttachment);
    6436 
    6437     AutoCaller autoCaller(this);
    6438     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     5738    size_t i = 0;
     5739    aMediumAttachments.resize(atts.size());
     5740    for (MediaData::AttachmentList::iterator it = atts.begin(); it != atts.end(); ++it, ++i)
     5741        (*it).queryInterfaceTo(aMediumAttachments[i].asOutParam());
     5742
     5743    return S_OK;
     5744}
     5745
     5746HRESULT Machine::getMediumAttachment(const com::Utf8Str &aName,
     5747                                     LONG aControllerPort,
     5748                                     LONG aDevice,
     5749                                     ComPtr<IMediumAttachment> &aAttachment)
     5750{
     5751    LogFlowThisFunc(("aControllerName=\"%s\" aControllerPort=%d aDevice=%d\n",
     5752                     aName.c_str(), aControllerPort, aDevice));
    64395753
    64405754    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    64415755
    6442     *aAttachment = NULL;
    6443 
    6444     ComObjPtr<MediumAttachment> pAttach = findAttachment(mMediaData->mAttachments,
    6445                                                          aControllerName,
    6446                                                          aControllerPort,
    6447                                                          aDevice);
     5756    aAttachment = NULL;
     5757
     5758    ComObjPtr<MediumAttachment> pAttach = i_findAttachment(mMediaData->mAttachments,
     5759                                                           Bstr(aName).raw(),
     5760                                                           aControllerPort,
     5761                                                           aDevice);
    64485762    if (pAttach.isNull())
    64495763        return setError(VBOX_E_OBJECT_NOT_FOUND,
    6450                         tr("No storage device attached to device slot %d on port %d of controller '%ls'"),
    6451                         aDevice, aControllerPort, aControllerName);
    6452 
    6453     pAttach.queryInterfaceTo(aAttachment);
    6454 
    6455     return S_OK;
    6456 }
    6457 
    6458 STDMETHODIMP Machine::AddStorageController(IN_BSTR aName,
    6459                                            StorageBus_T aConnectionType,
    6460                                            IStorageController **controller)
    6461 {
    6462     CheckComArgStrNotEmptyOrNull(aName);
    6463 
     5764                        tr("No storage device attached to device slot %d on port %d of controller '%s'"),
     5765                        aDevice, aControllerPort, aName.c_str());
     5766
     5767    pAttach.queryInterfaceTo(aAttachment.asOutParam());
     5768
     5769    return S_OK;
     5770}
     5771
     5772
     5773HRESULT Machine::addStorageController(const com::Utf8Str &aName,
     5774                                      StorageBus_T aConnectionType,
     5775                                      ComPtr<IStorageController> &aController)
     5776{
    64645777    if (   (aConnectionType <= StorageBus_Null)
    64655778        || (aConnectionType >  StorageBus_USB))
     
    64685781                        aConnectionType);
    64695782
    6470     AutoCaller autoCaller(this);
    6471     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6472 
    64735783    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    64745784
    6475     HRESULT rc = checkStateDependency(MutableStateDep);
     5785    HRESULT rc = i_checkStateDependency(MutableStateDep);
    64765786    if (FAILED(rc)) return rc;
    64775787
     
    64795789    ComObjPtr<StorageController> ctrl;
    64805790
    6481     rc = getStorageControllerByName(aName, ctrl, false /* aSetError */);
     5791    rc = i_getStorageControllerByName(aName, ctrl, false /* aSetError */);
    64825792    if (SUCCEEDED(rc))
    64835793        return setError(VBOX_E_OBJECT_IN_USE,
    6484                         tr("Storage controller named '%ls' already exists"),
    6485                         aName);
     5794                        tr("Storage controller named '%s' already exists"),
     5795                        aName.c_str());
    64865796
    64875797    ctrl.createObject();
     
    65105820    if (FAILED(rc)) return rc;
    65115821
    6512     setModified(IsModified_Storage);
     5822    i_setModified(IsModified_Storage);
    65135823    mStorageControllers.backup();
    65145824    mStorageControllers->push_back(ctrl);
    65155825
    6516     ctrl.queryInterfaceTo(controller);
     5826    ctrl.queryInterfaceTo(aController.asOutParam());
    65175827
    65185828    /* inform the direct session if any */
    65195829    alock.release();
    6520     onStorageControllerChange();
    6521 
    6522     return S_OK;
    6523 }
    6524 
    6525 STDMETHODIMP Machine::GetStorageControllerByName(IN_BSTR aName,
    6526                                                  IStorageController **aStorageController)
    6527 {
    6528     CheckComArgStrNotEmptyOrNull(aName);
    6529 
    6530     AutoCaller autoCaller(this);
    6531     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6532 
     5830    i_onStorageControllerChange();
     5831
     5832    return S_OK;
     5833}
     5834
     5835HRESULT Machine::getStorageControllerByName(const com::Utf8Str &aName,
     5836                                            ComPtr<IStorageController> &aStorageController)
     5837{
    65335838    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    65345839
    65355840    ComObjPtr<StorageController> ctrl;
    65365841
    6537     HRESULT rc = getStorageControllerByName(aName, ctrl, true /* aSetError */);
     5842    HRESULT rc = i_getStorageControllerByName(aName, ctrl, true /* aSetError */);
    65385843    if (SUCCEEDED(rc))
    6539         ctrl.queryInterfaceTo(aStorageController);
     5844        ctrl.queryInterfaceTo(aStorageController.asOutParam());
    65405845
    65415846    return rc;
    65425847}
    65435848
    6544 STDMETHODIMP Machine::GetStorageControllerByInstance(ULONG aInstance,
    6545                                                      IStorageController **aStorageController)
    6546 {
    6547     AutoCaller autoCaller(this);
    6548     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6549 
     5849HRESULT Machine::getStorageControllerByInstance(ULONG aInstance,
     5850                                                ComPtr<IStorageController> &aStorageController)
     5851{
    65505852    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    65515853
     
    65565858        if ((*it)->i_getInstance() == aInstance)
    65575859        {
    6558             (*it).queryInterfaceTo(aStorageController);
     5860            (*it).queryInterfaceTo(aStorageController.asOutParam());
    65595861            return S_OK;
    65605862        }
     
    65665868}
    65675869
    6568 STDMETHODIMP Machine::SetStorageControllerBootable(IN_BSTR aName, BOOL fBootable)
    6569 {
    6570     AutoCaller autoCaller(this);
    6571     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6572 
     5870HRESULT Machine::setStorageControllerBootable(const com::Utf8Str &aName, BOOL aBootable)
     5871{
    65735872    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    65745873
    6575     HRESULT rc = checkStateDependency(MutableStateDep);
     5874    HRESULT rc = i_checkStateDependency(MutableStateDep);
    65765875    if (FAILED(rc)) return rc;
    65775876
    65785877    ComObjPtr<StorageController> ctrl;
    65795878
    6580     rc = getStorageControllerByName(aName, ctrl, true /* aSetError */);
     5879    rc = i_getStorageControllerByName(aName, ctrl, true /* aSetError */);
    65815880    if (SUCCEEDED(rc))
    65825881    {
    65835882        /* Ensure that only one controller of each type is marked as bootable. */
    6584         if (fBootable == TRUE)
     5883        if (aBootable == TRUE)
    65855884        {
    65865885            for (StorageControllerList::const_iterator it = mStorageControllers->begin();
     
    65905889                ComObjPtr<StorageController> aCtrl = (*it);
    65915890
    6592                 if (   (aCtrl->i_getName() != Utf8Str(aName))
     5891                if (   (aCtrl->i_getName() != aName)
    65935892                    && aCtrl->i_getBootable() == TRUE
    65945893                    && aCtrl->i_getStorageBus() == ctrl->i_getStorageBus()
     
    66035902        if (SUCCEEDED(rc))
    66045903        {
    6605             ctrl->i_setBootable(fBootable);
    6606             setModified(IsModified_Storage);
     5904            ctrl->i_setBootable(aBootable);
     5905            i_setModified(IsModified_Storage);
    66075906        }
    66085907    }
     
    66125911        /* inform the direct session if any */
    66135912        alock.release();
    6614         onStorageControllerChange();
     5913        i_onStorageControllerChange();
    66155914    }
    66165915
     
    66185917}
    66195918
    6620 STDMETHODIMP Machine::RemoveStorageController(IN_BSTR aName)
    6621 {
    6622     CheckComArgStrNotEmptyOrNull(aName);
    6623 
    6624     AutoCaller autoCaller(this);
    6625     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6626 
     5919HRESULT Machine::removeStorageController(const com::Utf8Str &aName)
     5920{
    66275921    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    66285922
    6629     HRESULT rc = checkStateDependency(MutableStateDep);
     5923    HRESULT rc = i_checkStateDependency(MutableStateDep);
    66305924    if (FAILED(rc)) return rc;
    66315925
    66325926    ComObjPtr<StorageController> ctrl;
    6633     rc = getStorageControllerByName(aName, ctrl, true /* aSetError */);
     5927    rc = i_getStorageControllerByName(aName, ctrl, true /* aSetError */);
    66345928    if (FAILED(rc)) return rc;
    66355929
     
    66535947            if (pAttachTemp->i_getControllerName() == aName)
    66545948            {
    6655                 rc = detachDevice(pAttachTemp, alock, NULL);
     5949                rc = i_detachDevice(pAttachTemp, alock, NULL);
    66565950                if (FAILED(rc)) return rc;
    66575951            }
     
    66605954
    66615955    /* We can remove it now. */
    6662     setModified(IsModified_Storage);
     5956    i_setModified(IsModified_Storage);
    66635957    mStorageControllers.backup();
    66645958
     
    66695963    /* inform the direct session if any */
    66705964    alock.release();
    6671     onStorageControllerChange();
    6672 
    6673     return S_OK;
    6674 }
    6675 
    6676 STDMETHODIMP Machine::AddUSBController(IN_BSTR aName, USBControllerType_T aType,
    6677                                        IUSBController **controller)
     5965    i_onStorageControllerChange();
     5966
     5967    return S_OK;
     5968}
     5969
     5970HRESULT Machine::addUSBController(const com::Utf8Str &aName, USBControllerType_T aType,
     5971                                  ComPtr<IUSBController> &aController)
    66785972{
    66795973    if (   (aType <= USBControllerType_Null)
     
    66835977                        aType);
    66845978
    6685     AutoCaller autoCaller(this);
    6686     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6687 
    66885979    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    66895980
    6690     HRESULT rc = checkStateDependency(MutableStateDep);
     5981    HRESULT rc = i_checkStateDependency(MutableStateDep);
    66915982    if (FAILED(rc)) return rc;
    66925983
     
    66945985    ComObjPtr<USBController> ctrl;
    66955986
    6696     rc = getUSBControllerByName(aName, ctrl, false /* aSetError */);
     5987    rc = i_getUSBControllerByName(aName, ctrl, false /* aSetError */);
    66975988    if (SUCCEEDED(rc))
    66985989        return setError(VBOX_E_OBJECT_IN_USE,
    6699                         tr("USB controller named '%ls' already exists"),
    6700                         aName);
     5990                        tr("USB controller named '%s' already exists"),
     5991                        aName.c_str());
    67015992
    67025993    /* Check that we don't exceed the maximum number of USB controllers for the given type. */
     
    67065997        return rc;
    67075998
    6708     ULONG cInstances = getUSBControllerCountByType(aType);
     5999    ULONG cInstances = i_getUSBControllerCountByType(aType);
    67096000    if (cInstances >= maxInstances)
    67106001        return setError(E_INVALIDARG,
     
    67166007    if (FAILED(rc)) return rc;
    67176008
    6718     setModified(IsModified_USB);
     6009    i_setModified(IsModified_USB);
    67196010    mUSBControllers.backup();
    67206011    mUSBControllers->push_back(ctrl);
    67216012
    6722     ctrl.queryInterfaceTo(controller);
     6013    ctrl.queryInterfaceTo(aController.asOutParam());
    67236014
    67246015    /* inform the direct session if any */
    67256016    alock.release();
    6726     onUSBControllerChange();
    6727 
    6728     return S_OK;
    6729 }
    6730 
    6731 STDMETHODIMP Machine::GetUSBControllerByName(IN_BSTR aName, IUSBController **aUSBController)
    6732 {
    6733     CheckComArgStrNotEmptyOrNull(aName);
    6734 
    6735     AutoCaller autoCaller(this);
    6736     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6737 
     6017    i_onUSBControllerChange();
     6018
     6019    return S_OK;
     6020}
     6021
     6022HRESULT Machine::getUSBControllerByName(const com::Utf8Str &aName, ComPtr<IUSBController> &aController)
     6023{
    67386024    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    67396025
    67406026    ComObjPtr<USBController> ctrl;
    67416027
    6742     HRESULT rc = getUSBControllerByName(aName, ctrl, true /* aSetError */);
     6028    HRESULT rc = i_getUSBControllerByName(aName, ctrl, true /* aSetError */);
    67436029    if (SUCCEEDED(rc))
    6744         ctrl.queryInterfaceTo(aUSBController);
     6030        ctrl.queryInterfaceTo(aController.asOutParam());
    67456031
    67466032    return rc;
    67476033}
    67486034
    6749 STDMETHODIMP Machine::GetUSBControllerCountByType(USBControllerType_T aType,
    6750                                                   ULONG *aControllers)
    6751 {
    6752     CheckComArgOutPointerValid(aControllers);
    6753 
     6035HRESULT Machine::getUSBControllerCountByType(USBControllerType_T aType,
     6036                                             ULONG *aControllers)
     6037{
    67546038    if (   (aType <= USBControllerType_Null)
    67556039        || (aType >= USBControllerType_Last))
     
    67586042                        aType);
    67596043
    6760     AutoCaller autoCaller(this);
    6761     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    6762 
    67636044    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    67646045
    67656046    ComObjPtr<USBController> ctrl;
    67666047
    6767     *aControllers = getUSBControllerCountByType(aType);
    6768 
    6769     return S_OK;
    6770 }
    6771 
    6772 STDMETHODIMP Machine::RemoveUSBController(IN_BSTR aName)
    6773 {
    6774     CheckComArgStrNotEmptyOrNull(aName);
    6775 
    6776     AutoCaller autoCaller(this);
    6777     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     6048    *aControllers = i_getUSBControllerCountByType(aType);
     6049
     6050    return S_OK;
     6051}
     6052
     6053HRESULT Machine::removeUSBController(const com::Utf8Str &aName)
     6054{
    67786055
    67796056    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    67806057
    6781     HRESULT rc = checkStateDependency(MutableStateDep);
     6058    HRESULT rc = i_checkStateDependency(MutableStateDep);
    67826059    if (FAILED(rc)) return rc;
    67836060
    67846061    ComObjPtr<USBController> ctrl;
    6785     rc = getUSBControllerByName(aName, ctrl, true /* aSetError */);
     6062    rc = i_getUSBControllerByName(aName, ctrl, true /* aSetError */);
    67866063    if (FAILED(rc)) return rc;
    67876064
    6788     setModified(IsModified_USB);
     6065    i_setModified(IsModified_USB);
    67896066    mUSBControllers.backup();
    67906067
     
    67956072    /* inform the direct session if any */
    67966073    alock.release();
    6797     onUSBControllerChange();
    6798 
    6799     return S_OK;
    6800 }
    6801 
    6802 STDMETHODIMP Machine::QuerySavedGuestScreenInfo(ULONG uScreenId,
    6803                                                 ULONG *puOriginX,
    6804                                                 ULONG *puOriginY,
    6805                                                 ULONG *puWidth,
    6806                                                 ULONG *puHeight,
    6807                                                 BOOL *pfEnabled)
    6808 {
    6809     LogFlowThisFunc(("\n"));
    6810 
    6811     CheckComArgNotNull(puOriginX);
    6812     CheckComArgNotNull(puOriginY);
    6813     CheckComArgNotNull(puWidth);
    6814     CheckComArgNotNull(puHeight);
    6815     CheckComArgNotNull(pfEnabled);
    6816 
     6074    i_onUSBControllerChange();
     6075
     6076    return S_OK;
     6077}
     6078
     6079HRESULT Machine::querySavedGuestScreenInfo(ULONG aScreenId,
     6080                                           ULONG *aOriginX,
     6081                                           ULONG *aOriginY,
     6082                                           ULONG *aWidth,
     6083                                           ULONG *aHeight,
     6084                                           BOOL  *aEnabled)
     6085{
    68176086    uint32_t u32OriginX= 0;
    68186087    uint32_t u32OriginY= 0;
     
    68216090    uint16_t u16Flags = 0;
    68226091
    6823     int vrc = readSavedGuestScreenInfo(mSSData->strStateFilePath, uScreenId,
     6092    int vrc = readSavedGuestScreenInfo(mSSData->strStateFilePath, aScreenId,
    68246093                                       &u32OriginX, &u32OriginY, &u32Width, &u32Height, &u16Flags);
    68256094    if (RT_FAILURE(vrc))
     
    68326101         * are changed only if API succeeds.
    68336102         */
    6834         *pfEnabled = TRUE;
     6103        *aEnabled = TRUE;
    68356104#endif
    68366105        return setError(VBOX_E_IPRT_ERROR,
     
    68396108    }
    68406109
    6841     *puOriginX = u32OriginX;
    6842     *puOriginY = u32OriginY;
    6843     *puWidth = u32Width;
    6844     *puHeight = u32Height;
    6845     *pfEnabled = (u16Flags & VBVA_SCREEN_F_DISABLED) == 0;
    6846 
    6847     return S_OK;
    6848 }
    6849 
    6850 STDMETHODIMP Machine::QuerySavedThumbnailSize(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight)
    6851 {
    6852     LogFlowThisFunc(("\n"));
    6853 
    6854     CheckComArgNotNull(aSize);
    6855     CheckComArgNotNull(aWidth);
    6856     CheckComArgNotNull(aHeight);
    6857 
     6110    *aOriginX = u32OriginX;
     6111    *aOriginY = u32OriginY;
     6112    *aWidth = u32Width;
     6113    *aHeight = u32Height;
     6114    *aEnabled = (u16Flags & VBVA_SCREEN_F_DISABLED) == 0;
     6115
     6116    return S_OK;
     6117}
     6118
     6119HRESULT Machine::querySavedThumbnailSize(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight)
     6120{
    68586121    if (aScreenId != 0)
    68596122        return E_NOTIMPL;
    6860 
    6861     AutoCaller autoCaller(this);
    6862     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    68636123
    68646124    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    68856145}
    68866146
    6887 STDMETHODIMP Machine::ReadSavedThumbnailToArray(ULONG aScreenId, BOOL aBGR, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData))
    6888 {
    6889     LogFlowThisFunc(("\n"));
    6890 
    6891     CheckComArgNotNull(aWidth);
    6892     CheckComArgNotNull(aHeight);
    6893     CheckComArgOutSafeArrayPointerValid(aData);
    6894 
     6147
     6148HRESULT Machine::readSavedThumbnailToArray(ULONG aScreenId, BOOL aBGR, ULONG *aWidth, ULONG *aHeight, std::vector<BYTE> &aData)
     6149{
    68956150    if (aScreenId != 0)
    68966151        return E_NOTIMPL;
    6897 
    6898     AutoCaller autoCaller(this);
    6899     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    69006152
    69016153    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    69406192        }
    69416193    }
    6942     bitmap.detachTo(ComSafeArrayOutArg(aData));
     6194    aData.resize(bitmap.size());
     6195    for (size_t i = 0; i < bitmap.size(); ++i)
     6196        aData[i] = bitmap[i];
    69436197
    69446198    freeSavedDisplayScreenshot(pu8Data);
     
    69476201}
    69486202
    6949 
    6950 STDMETHODIMP Machine::ReadSavedThumbnailPNGToArray(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData))
    6951 {
    6952     LogFlowThisFunc(("\n"));
    6953 
    6954     CheckComArgNotNull(aWidth);
    6955     CheckComArgNotNull(aHeight);
    6956     CheckComArgOutSafeArrayPointerValid(aData);
    6957 
     6203HRESULT Machine::readSavedThumbnailPNGToArray(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, std::vector<BYTE> &aData)
     6204{
    69586205    if (aScreenId != 0)
    69596206        return E_NOTIMPL;
    6960 
    6961     AutoCaller autoCaller(this);
    6962     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    69636207
    69646208    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    69936237        if (pu8PNG)
    69946238            RTMemFree(pu8PNG);
    6995         screenData.detachTo(ComSafeArrayOutArg(aData));
     6239        aData.resize(screenData.size());
     6240        for (size_t i = 0; i < screenData.size(); ++i)
     6241            aData[i] = screenData[i];
    69966242    }
    69976243    else
     
    70096255}
    70106256
    7011 STDMETHODIMP Machine::QuerySavedScreenshotPNGSize(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight)
    7012 {
    7013     LogFlowThisFunc(("\n"));
    7014 
    7015     CheckComArgNotNull(aSize);
    7016     CheckComArgNotNull(aWidth);
    7017     CheckComArgNotNull(aHeight);
    7018 
     6257HRESULT Machine::querySavedScreenshotPNGSize(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight)
     6258{
    70196259    if (aScreenId != 0)
    70206260        return E_NOTIMPL;
    7021 
    7022     AutoCaller autoCaller(this);
    7023     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    70246261
    70256262    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    70466283}
    70476284
    7048 STDMETHODIMP Machine::ReadSavedScreenshotPNGToArray(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData))
    7049 {
    7050     LogFlowThisFunc(("\n"));
    7051 
    7052     CheckComArgNotNull(aWidth);
    7053     CheckComArgNotNull(aHeight);
    7054     CheckComArgOutSafeArrayPointerValid(aData);
    7055 
     6285HRESULT Machine::readSavedScreenshotPNGToArray(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, std::vector<BYTE> &aData)
     6286{
    70566287    if (aScreenId != 0)
    70576288        return E_NOTIMPL;
    7058 
    7059     AutoCaller autoCaller(this);
    7060     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    70616289
    70626290    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    70796307    com::SafeArray<BYTE> png(cbData);
    70806308    png.initFrom(pu8Data, cbData);
    7081     png.detachTo(ComSafeArrayOutArg(aData));
     6309    aData.resize(png.size());
     6310    for (size_t i = 0; i < png.size(); ++i)
     6311        aData[i] = png[i];
    70826312
    70836313    freeSavedDisplayScreenshot(pu8Data);
     
    70866316}
    70876317
    7088 STDMETHODIMP Machine::HotPlugCPU(ULONG aCpu)
     6318HRESULT Machine::hotPlugCPU(ULONG aCpu)
    70896319{
    70906320    HRESULT rc = S_OK;
    7091     LogFlowThisFunc(("\n"));
    7092 
    7093     AutoCaller autoCaller(this);
    7094     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7095 
    70966321    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    70976322
     
    71066331
    71076332    alock.release();
    7108     rc = onCPUChange(aCpu, false);
     6333    rc = i_onCPUChange(aCpu, false);
    71096334    alock.acquire();
    71106335    if (FAILED(rc)) return rc;
    71116336
    7112     setModified(IsModified_MachineData);
     6337    i_setModified(IsModified_MachineData);
    71136338    mHWData.backup();
    71146339    mHWData->mCPUAttached[aCpu] = true;
     
    71166341    /** Save settings if online - @todo why is this required? -- @bugref{6818} */
    71176342    if (Global::IsOnline(mData->mMachineState))
    7118         saveSettings(NULL);
    7119 
    7120     return S_OK;
    7121 }
    7122 
    7123 STDMETHODIMP Machine::HotUnplugCPU(ULONG aCpu)
     6343        i_saveSettings(NULL);
     6344
     6345    return S_OK;
     6346}
     6347
     6348HRESULT Machine::hotUnplugCPU(ULONG aCpu)
    71246349{
    71256350    HRESULT rc = S_OK;
    7126     LogFlowThisFunc(("\n"));
    7127 
    7128     AutoCaller autoCaller(this);
    7129     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    71306351
    71316352    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    71476368
    71486369    alock.release();
    7149     rc = onCPUChange(aCpu, true);
     6370    rc = i_onCPUChange(aCpu, true);
    71506371    alock.acquire();
    71516372    if (FAILED(rc)) return rc;
    71526373
    7153     setModified(IsModified_MachineData);
     6374    i_setModified(IsModified_MachineData);
    71546375    mHWData.backup();
    71556376    mHWData->mCPUAttached[aCpu] = false;
     
    71576378    /** Save settings if online - @todo why is this required? -- @bugref{6818} */
    71586379    if (Global::IsOnline(mData->mMachineState))
    7159         saveSettings(NULL);
    7160 
    7161     return S_OK;
    7162 }
    7163 
    7164 STDMETHODIMP Machine::GetCPUStatus(ULONG aCpu, BOOL *aCpuAttached)
    7165 {
    7166     LogFlowThisFunc(("\n"));
    7167 
    7168     CheckComArgNotNull(aCpuAttached);
    7169 
    7170     *aCpuAttached = false;
    7171 
    7172     AutoCaller autoCaller(this);
    7173     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     6380        i_saveSettings(NULL);
     6381
     6382    return S_OK;
     6383}
     6384
     6385HRESULT Machine::getCPUStatus(ULONG aCpu, BOOL *aAttached)
     6386{
     6387    *aAttached = false;
    71746388
    71756389    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    71796393    {
    71806394        if (aCpu < mHWData->mCPUCount)
    7181             *aCpuAttached = true;
     6395            *aAttached = true;
    71826396    }
    71836397    else
    71846398    {
    71856399        if (aCpu < SchemaDefs::MaxCPUCount)
    7186             *aCpuAttached = mHWData->mCPUAttached[aCpu];
    7187     }
    7188 
    7189     return S_OK;
    7190 }
    7191 
    7192 STDMETHODIMP Machine::QueryLogFilename(ULONG aIdx, BSTR *aName)
    7193 {
    7194     CheckComArgOutPointerValid(aName);
    7195 
    7196     AutoCaller autoCaller(this);
    7197     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7198 
     6400            *aAttached = mHWData->mCPUAttached[aCpu];
     6401    }
     6402
     6403    return S_OK;
     6404}
     6405
     6406HRESULT Machine::queryLogFilename(ULONG aIdx, com::Utf8Str &aFilename)
     6407{
    71996408    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    72006409
    7201     Utf8Str log = queryLogFilename(aIdx);
     6410    Utf8Str log = i_queryLogFilename(aIdx);
    72026411    if (!RTFileExists(log.c_str()))
    72036412        log.setNull();
    7204     log.cloneTo(aName);
    7205 
    7206     return S_OK;
    7207 }
    7208 
    7209 STDMETHODIMP Machine::ReadLog(ULONG aIdx, LONG64 aOffset, LONG64 aSize, ComSafeArrayOut(BYTE, aData))
    7210 {
    7211     LogFlowThisFunc(("\n"));
    7212     CheckComArgOutSafeArrayPointerValid(aData);
     6413    aFilename = log;
     6414
     6415    return S_OK;
     6416}
     6417
     6418HRESULT Machine::readLog(ULONG aIdx, LONG64 aOffset, LONG64 aSize, std::vector<BYTE> &aData)
     6419{
    72136420    if (aSize < 0)
    72146421        return setError(E_INVALIDARG, tr("The size argument (%lld) is negative"), aSize);
    72156422
    7216     AutoCaller autoCaller(this);
    7217     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7218 
    72196423    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    72206424
    72216425    HRESULT rc = S_OK;
    7222     Utf8Str log = queryLogFilename(aIdx);
     6426    Utf8Str log = i_queryLogFilename(aIdx);
    72236427
    72246428    /* do not unnecessarily hold the lock while doing something which does
     
    72536457    if (FAILED(rc))
    72546458        logData.resize(0);
    7255     logData.detachTo(ComSafeArrayOutArg(aData));
     6459
     6460    aData.resize(logData.size());
     6461    for (size_t i = 0; i < logData.size(); ++i)
     6462        aData[i] = logData[i];
    72566463
    72576464    return rc;
     
    72636470 * just makes sure it's plugged on next VM start.
    72646471 */
    7265 STDMETHODIMP Machine::AttachHostPCIDevice(LONG hostAddress, LONG desiredGuestAddress, BOOL /*tryToUnbind*/)
    7266 {
    7267     AutoCaller autoCaller(this);
    7268     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7269 
     6472HRESULT Machine::attachHostPCIDevice(LONG aHostAddress, LONG aDesiredGuestAddress, BOOL /* aTryToUnbind */)
     6473{
    72706474    // lock scope
    72716475    {
    72726476        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    72736477
    7274         HRESULT rc = checkStateDependency(MutableStateDep);
     6478        HRESULT rc = i_checkStateDependency(MutableStateDep);
    72756479        if (FAILED(rc)) return rc;
    72766480
     
    72936497            pAttach = *it;
    72946498            pAttach->COMGETTER(HostAddress)(&iHostAddress);
    7295             if (iHostAddress == hostAddress)
     6499            if (iHostAddress == aHostAddress)
    72966500                return setError(E_INVALIDARG,
    72976501                                tr("Device with host PCI address already attached to this VM"));
     
    73016505        char name[32];
    73026506
    7303         RTStrPrintf(name, sizeof(name), "host%02x:%02x.%x", (hostAddress>>8) & 0xff, (hostAddress & 0xf8) >> 3, hostAddress & 7);
     6507        RTStrPrintf(name, sizeof(name), "host%02x:%02x.%x", (aHostAddress>>8) & 0xff,
     6508                    (aHostAddress & 0xf8) >> 3, aHostAddress & 7);
    73046509        Bstr bname(name);
    73056510        pda.createObject();
    7306         pda->init(this, bname,  hostAddress, desiredGuestAddress, TRUE);
    7307         setModified(IsModified_MachineData);
     6511        pda->init(this, bname,  aHostAddress, aDesiredGuestAddress, TRUE);
     6512        i_setModified(IsModified_MachineData);
    73086513        mHWData.backup();
    73096514        mHWData->mPCIDeviceAssignments.push_back(pda);
     
    73176522 * just makes sure it's not plugged on next VM start.
    73186523 */
    7319 STDMETHODIMP Machine::DetachHostPCIDevice(LONG hostAddress)
    7320 {
    7321     AutoCaller autoCaller(this);
    7322     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7323 
     6524HRESULT Machine::detachHostPCIDevice(LONG aHostAddress)
     6525{
    73246526    ComObjPtr<PCIDeviceAttachment> pAttach;
    73256527    bool fRemoved = false;
     
    73306532        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    73316533
    7332         rc = checkStateDependency(MutableStateDep);
     6534        rc = i_checkStateDependency(MutableStateDep);
    73336535        if (FAILED(rc)) return rc;
    73346536
     
    73406542            pAttach = *it;
    73416543            pAttach->COMGETTER(HostAddress)(&iHostAddress);
    7342             if (iHostAddress  != -1  && iHostAddress == hostAddress)
     6544            if (iHostAddress  != -1  && iHostAddress == aHostAddress)
    73436545            {
    7344                 setModified(IsModified_MachineData);
     6546                i_setModified(IsModified_MachineData);
    73456547                mHWData.backup();
    73466548                mHWData->mPCIDeviceAssignments.remove(pAttach);
     
    73676569    return fRemoved ? S_OK : setError(VBOX_E_OBJECT_NOT_FOUND,
    73686570                                      tr("No host PCI device %08x attached"),
    7369                                       hostAddress
     6571                                      aHostAddress
    73706572                                      );
    73716573}
    73726574
    7373 STDMETHODIMP Machine::COMGETTER(PCIDeviceAssignments)(ComSafeArrayOut(IPCIDeviceAttachment *, aAssignments))
    7374 {
    7375     CheckComArgOutSafeArrayPointerValid(aAssignments);
    7376 
    7377     AutoCaller autoCaller(this);
    7378     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7379 
     6575HRESULT Machine::getPCIDeviceAssignments(std::vector<ComPtr<IPCIDeviceAttachment> > &aPCIDeviceAssignments)
     6576{
    73806577    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    73816578
    73826579    SafeIfaceArray<IPCIDeviceAttachment> assignments(mHWData->mPCIDeviceAssignments);
    7383     assignments.detachTo(ComSafeArrayOutArg(aAssignments));
    7384 
    7385     return S_OK;
    7386 }
    7387 
    7388 STDMETHODIMP Machine::COMGETTER(BandwidthControl)(IBandwidthControl **aBandwidthControl)
    7389 {
    7390     CheckComArgOutPointerValid(aBandwidthControl);
    7391 
    7392     AutoCaller autoCaller(this);
    7393     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7394 
    7395     mBandwidthControl.queryInterfaceTo(aBandwidthControl);
    7396 
    7397     return S_OK;
    7398 }
    7399 
    7400 STDMETHODIMP Machine::COMGETTER(TracingEnabled)(BOOL *pfEnabled)
    7401 {
    7402     CheckComArgOutPointerValid(pfEnabled);
    7403     AutoCaller autoCaller(this);
    7404     HRESULT hrc = autoCaller.rc();
     6580    aPCIDeviceAssignments.resize(assignments.size());
     6581    for (size_t i = 0; i < assignments.size(); ++i)
     6582        aPCIDeviceAssignments[i] = assignments[i];
     6583    return S_OK;
     6584}
     6585
     6586HRESULT Machine::getBandwidthControl(ComPtr<IBandwidthControl> &aBandwidthControl)
     6587{
     6588    mBandwidthControl.queryInterfaceTo(aBandwidthControl.asOutParam());
     6589
     6590    return S_OK;
     6591}
     6592
     6593HRESULT Machine::getTracingEnabled(BOOL *aTracingEnabled)
     6594{
     6595    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6596
     6597    *aTracingEnabled = mHWData->mDebugging.fTracingEnabled;
     6598
     6599    return S_OK;
     6600}
     6601
     6602HRESULT Machine::setTracingEnabled(BOOL aTracingEnabled)
     6603{
     6604    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6605    HRESULT hrc = i_checkStateDependency(MutableStateDep);
    74056606    if (SUCCEEDED(hrc))
    74066607    {
    7407         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7408         *pfEnabled = mHWData->mDebugging.fTracingEnabled;
     6608        hrc = mHWData.backupEx();
     6609        if (SUCCEEDED(hrc))
     6610        {
     6611            i_setModified(IsModified_MachineData);
     6612            mHWData->mDebugging.fTracingEnabled = aTracingEnabled != FALSE;
     6613        }
    74096614    }
    74106615    return hrc;
    74116616}
    74126617
    7413 STDMETHODIMP Machine::COMSETTER(TracingEnabled)(BOOL fEnabled)
    7414 {
    7415     AutoCaller autoCaller(this);
    7416     HRESULT hrc = autoCaller.rc();
     6618HRESULT Machine::getTracingConfig(com::Utf8Str &aTracingConfig)
     6619{
     6620    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6621    aTracingConfig = mHWData->mDebugging.strTracingConfig;
     6622    return S_OK;
     6623}
     6624
     6625HRESULT Machine::setTracingConfig(const com::Utf8Str &aTracingConfig)
     6626{
     6627    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6628    HRESULT hrc = i_checkStateDependency(MutableStateDep);
    74176629    if (SUCCEEDED(hrc))
    74186630    {
    7419         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7420         hrc = checkStateDependency(MutableStateDep);
     6631        hrc = mHWData.backupEx();
    74216632        if (SUCCEEDED(hrc))
     6633        {
     6634            mHWData->mDebugging.strTracingConfig = aTracingConfig;
     6635            if (SUCCEEDED(hrc))
     6636                i_setModified(IsModified_MachineData);
     6637        }
     6638    }
     6639    return hrc;
     6640}
     6641
     6642HRESULT Machine::getAllowTracingToAccessVM(BOOL *aAllowTracingToAccessVM)
     6643{
     6644    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6645
     6646    *aAllowTracingToAccessVM = mHWData->mDebugging.fAllowTracingToAccessVM;
     6647
     6648    return S_OK;
     6649}
     6650
     6651HRESULT Machine::setAllowTracingToAccessVM(BOOL aAllowTracingToAccessVM)
     6652{
     6653    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6654    HRESULT hrc = i_checkStateDependency(MutableStateDep);
     6655    if (SUCCEEDED(hrc))
     6656    {
     6657        hrc = mHWData.backupEx();
     6658        if (SUCCEEDED(hrc))
     6659        {
     6660            i_setModified(IsModified_MachineData);
     6661            mHWData->mDebugging.fAllowTracingToAccessVM = aAllowTracingToAccessVM != FALSE;
     6662        }
     6663    }
     6664    return hrc;
     6665}
     6666
     6667HRESULT Machine::getAutostartEnabled(BOOL *aAutostartEnabled)
     6668{
     6669    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6670
     6671    *aAutostartEnabled = mHWData->mAutostart.fAutostartEnabled;
     6672
     6673    return S_OK;
     6674}
     6675
     6676HRESULT Machine::setAutostartEnabled(BOOL aAutostartEnabled)
     6677{
     6678    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6679
     6680    HRESULT hrc = i_checkStateDependency(MutableStateDep);
     6681    if (   SUCCEEDED(hrc)
     6682        && mHWData->mAutostart.fAutostartEnabled != !!aAutostartEnabled)
     6683    {
     6684        AutostartDb *autostartDb = mParent->i_getAutostartDb();
     6685        int vrc;
     6686
     6687        if (aAutostartEnabled)
     6688            vrc = autostartDb->addAutostartVM(mUserData->s.strName.c_str());
     6689        else
     6690            vrc = autostartDb->removeAutostartVM(mUserData->s.strName.c_str());
     6691
     6692        if (RT_SUCCESS(vrc))
    74226693        {
    74236694            hrc = mHWData.backupEx();
    74246695            if (SUCCEEDED(hrc))
    74256696            {
    7426                 setModified(IsModified_MachineData);
    7427                 mHWData->mDebugging.fTracingEnabled = fEnabled != FALSE;
     6697                i_setModified(IsModified_MachineData);
     6698                mHWData->mAutostart.fAutostartEnabled = aAutostartEnabled != FALSE;
    74286699            }
    74296700        }
     6701        else if (vrc == VERR_NOT_SUPPORTED)
     6702            hrc = setError(VBOX_E_NOT_SUPPORTED,
     6703                           tr("The VM autostart feature is not supported on this platform"));
     6704        else if (vrc == VERR_PATH_NOT_FOUND)
     6705            hrc = setError(E_FAIL,
     6706                           tr("The path to the autostart database is not set"));
     6707        else
     6708            hrc = setError(E_UNEXPECTED,
     6709                           tr("%s machine '%s' to the autostart database failed with %Rrc"),
     6710                           aAutostartEnabled ? "Adding" : "Removing",
     6711                           mUserData->s.strName.c_str(), vrc);
    74306712    }
    74316713    return hrc;
    74326714}
    74336715
    7434 STDMETHODIMP Machine::COMGETTER(TracingConfig)(BSTR *pbstrConfig)
    7435 {
    7436     CheckComArgOutPointerValid(pbstrConfig);
    7437     AutoCaller autoCaller(this);
    7438     HRESULT hrc = autoCaller.rc();
     6716HRESULT Machine::getAutostartDelay(ULONG *aAutostartDelay)
     6717{
     6718    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6719
     6720    *aAutostartDelay = mHWData->mAutostart.uAutostartDelay;
     6721
     6722    return S_OK;
     6723}
     6724
     6725HRESULT Machine::setAutostartDelay(ULONG aAutostartDelay)
     6726{
     6727    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6728    HRESULT hrc = i_checkStateDependency(MutableStateDep);
    74396729    if (SUCCEEDED(hrc))
    74406730    {
    7441         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7442         hrc = mHWData->mDebugging.strTracingConfig.cloneToEx(pbstrConfig);
     6731        hrc = mHWData.backupEx();
     6732        if (SUCCEEDED(hrc))
     6733        {
     6734            i_setModified(IsModified_MachineData);
     6735            mHWData->mAutostart.uAutostartDelay = aAutostartDelay;
     6736        }
    74436737    }
    74446738    return hrc;
    74456739}
    74466740
    7447 STDMETHODIMP Machine::COMSETTER(TracingConfig)(IN_BSTR bstrConfig)
    7448 {
    7449     CheckComArgStr(bstrConfig);
    7450     AutoCaller autoCaller(this);
    7451     HRESULT hrc = autoCaller.rc();
     6741HRESULT Machine::getAutostopType(AutostopType_T *aAutostopType)
     6742{
     6743    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6744
     6745    *aAutostopType = mHWData->mAutostart.enmAutostopType;
     6746
     6747    return S_OK;
     6748}
     6749
     6750HRESULT Machine::setAutostopType(AutostopType_T aAutostopType)
     6751{
     6752   AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6753   HRESULT hrc = i_checkStateDependency(MutableStateDep);
     6754   if (   SUCCEEDED(hrc)
     6755       && mHWData->mAutostart.enmAutostopType != aAutostopType)
     6756   {
     6757       AutostartDb *autostartDb = mParent->i_getAutostartDb();
     6758       int vrc;
     6759
     6760       if (aAutostopType != AutostopType_Disabled)
     6761           vrc = autostartDb->addAutostopVM(mUserData->s.strName.c_str());
     6762       else
     6763           vrc = autostartDb->removeAutostopVM(mUserData->s.strName.c_str());
     6764
     6765       if (RT_SUCCESS(vrc))
     6766       {
     6767           hrc = mHWData.backupEx();
     6768           if (SUCCEEDED(hrc))
     6769           {
     6770               i_setModified(IsModified_MachineData);
     6771               mHWData->mAutostart.enmAutostopType = aAutostopType;
     6772           }
     6773       }
     6774       else if (vrc == VERR_NOT_SUPPORTED)
     6775           hrc = setError(VBOX_E_NOT_SUPPORTED,
     6776                          tr("The VM autostop feature is not supported on this platform"));
     6777       else if (vrc == VERR_PATH_NOT_FOUND)
     6778           hrc = setError(E_FAIL,
     6779                          tr("The path to the autostart database is not set"));
     6780       else
     6781           hrc = setError(E_UNEXPECTED,
     6782                          tr("%s machine '%s' to the autostop database failed with %Rrc"),
     6783                          aAutostopType != AutostopType_Disabled ? "Adding" : "Removing",
     6784                          mUserData->s.strName.c_str(), vrc);
     6785    }
     6786    return hrc;
     6787}
     6788
     6789HRESULT Machine::getDefaultFrontend(com::Utf8Str &aDefaultFrontend)
     6790{
     6791    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6792
     6793    aDefaultFrontend = mHWData->mDefaultFrontend;
     6794
     6795    return S_OK;
     6796}
     6797
     6798HRESULT Machine::setDefaultFrontend(const com::Utf8Str &aDefaultFrontend)
     6799{
     6800    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6801    HRESULT hrc = i_checkStateDependency(MutableOrSavedStateDep);
    74526802    if (SUCCEEDED(hrc))
    74536803    {
    7454         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7455         hrc = checkStateDependency(MutableStateDep);
     6804        hrc = mHWData.backupEx();
    74566805        if (SUCCEEDED(hrc))
    74576806        {
    7458             hrc = mHWData.backupEx();
    7459             if (SUCCEEDED(hrc))
    7460             {
    7461                 hrc = mHWData->mDebugging.strTracingConfig.cloneEx(bstrConfig);
    7462                 if (SUCCEEDED(hrc))
    7463                     setModified(IsModified_MachineData);
    7464             }
     6807            i_setModified(IsModified_MachineData);
     6808            mHWData->mDefaultFrontend = aDefaultFrontend;
    74656809        }
    74666810    }
    74676811    return hrc;
    7468 
    7469 }
    7470 
    7471 STDMETHODIMP Machine::COMGETTER(AllowTracingToAccessVM)(BOOL *pfAllow)
    7472 {
    7473     CheckComArgOutPointerValid(pfAllow);
    7474     AutoCaller autoCaller(this);
    7475     HRESULT hrc = autoCaller.rc();
     6812}
     6813
     6814HRESULT Machine::getIcon(std::vector<BYTE> &aIcon)
     6815{
     6816    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     6817    com::SafeArray<BYTE> icon(mUserData->mIcon.size());
     6818    aIcon.resize(mUserData->mIcon.size());
     6819    memcpy(icon.raw(), &mUserData->mIcon[0], mUserData->mIcon.size());
     6820    aIcon.resize(icon.size());
     6821    for (size_t i = 0; i < icon.size(); ++i)
     6822        aIcon[i] = icon[i];
     6823    return S_OK;
     6824}
     6825
     6826HRESULT Machine::setIcon(const std::vector<BYTE> &aIcon)
     6827{
     6828    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     6829    HRESULT hrc = i_checkStateDependency(MutableOrSavedStateDep);
    74766830    if (SUCCEEDED(hrc))
    74776831    {
    7478         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7479         *pfAllow = mHWData->mDebugging.fAllowTracingToAccessVM;
     6832        i_setModified(IsModified_MachineData);
     6833        mUserData.backup();
     6834        com::SafeArray<BYTE> icon(aIcon);
     6835        mUserData->mIcon.resize(aIcon.size());
     6836        memcpy(&mUserData->mIcon[0], icon.raw(), mUserData->mIcon.size());
    74806837    }
    74816838    return hrc;
    74826839}
    74836840
    7484 STDMETHODIMP Machine::COMSETTER(AllowTracingToAccessVM)(BOOL fAllow)
    7485 {
    7486     AutoCaller autoCaller(this);
    7487     HRESULT hrc = autoCaller.rc();
    7488     if (SUCCEEDED(hrc))
    7489     {
    7490         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7491         hrc = checkStateDependency(MutableStateDep);
    7492         if (SUCCEEDED(hrc))
    7493         {
    7494             hrc = mHWData.backupEx();
    7495             if (SUCCEEDED(hrc))
    7496             {
    7497                 setModified(IsModified_MachineData);
    7498                 mHWData->mDebugging.fAllowTracingToAccessVM = fAllow != FALSE;
    7499             }
    7500         }
    7501     }
    7502     return hrc;
    7503 }
    7504 
    7505 STDMETHODIMP Machine::COMGETTER(AutostartEnabled)(BOOL *pfEnabled)
    7506 {
    7507     CheckComArgOutPointerValid(pfEnabled);
    7508     AutoCaller autoCaller(this);
    7509     HRESULT hrc = autoCaller.rc();
    7510     if (SUCCEEDED(hrc))
    7511     {
    7512         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7513         *pfEnabled = mHWData->mAutostart.fAutostartEnabled;
    7514     }
    7515     return hrc;
    7516 }
    7517 
    7518 STDMETHODIMP Machine::COMSETTER(AutostartEnabled)(BOOL fEnabled)
    7519 {
    7520     AutoCaller autoCaller(this);
    7521     HRESULT hrc = autoCaller.rc();
    7522     if (SUCCEEDED(hrc))
    7523     {
    7524         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7525         hrc = checkStateDependency(MutableStateDep);
    7526         if (   SUCCEEDED(hrc)
    7527             && mHWData->mAutostart.fAutostartEnabled != !!fEnabled)
    7528         {
    7529             AutostartDb *autostartDb = mParent->i_getAutostartDb();
    7530             int vrc;
    7531 
    7532             if (fEnabled)
    7533                 vrc = autostartDb->addAutostartVM(mUserData->s.strName.c_str());
    7534             else
    7535                 vrc = autostartDb->removeAutostartVM(mUserData->s.strName.c_str());
    7536 
    7537             if (RT_SUCCESS(vrc))
    7538             {
    7539                 hrc = mHWData.backupEx();
    7540                 if (SUCCEEDED(hrc))
    7541                 {
    7542                     setModified(IsModified_MachineData);
    7543                     mHWData->mAutostart.fAutostartEnabled = fEnabled != FALSE;
    7544                 }
    7545             }
    7546             else if (vrc == VERR_NOT_SUPPORTED)
    7547                 hrc = setError(VBOX_E_NOT_SUPPORTED,
    7548                                tr("The VM autostart feature is not supported on this platform"));
    7549             else if (vrc == VERR_PATH_NOT_FOUND)
    7550                 hrc = setError(E_FAIL,
    7551                                tr("The path to the autostart database is not set"));
    7552             else
    7553                 hrc = setError(E_UNEXPECTED,
    7554                                tr("%s machine '%s' to the autostart database failed with %Rrc"),
    7555                                fEnabled ? "Adding" : "Removing",
    7556                                mUserData->s.strName.c_str(), vrc);
    7557         }
    7558     }
    7559     return hrc;
    7560 }
    7561 
    7562 STDMETHODIMP Machine::COMGETTER(AutostartDelay)(ULONG *puDelay)
    7563 {
    7564     CheckComArgOutPointerValid(puDelay);
    7565     AutoCaller autoCaller(this);
    7566     HRESULT hrc = autoCaller.rc();
    7567     if (SUCCEEDED(hrc))
    7568     {
    7569         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7570         *puDelay = mHWData->mAutostart.uAutostartDelay;
    7571     }
    7572     return hrc;
    7573 }
    7574 
    7575 STDMETHODIMP Machine::COMSETTER(AutostartDelay)(ULONG uDelay)
    7576 {
    7577     AutoCaller autoCaller(this);
    7578     HRESULT hrc = autoCaller.rc();
    7579     if (SUCCEEDED(hrc))
    7580     {
    7581         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7582         hrc = checkStateDependency(MutableStateDep);
    7583         if (SUCCEEDED(hrc))
    7584         {
    7585             hrc = mHWData.backupEx();
    7586             if (SUCCEEDED(hrc))
    7587             {
    7588                 setModified(IsModified_MachineData);
    7589                 mHWData->mAutostart.uAutostartDelay = uDelay;
    7590             }
    7591         }
    7592     }
    7593     return hrc;
    7594 }
    7595 
    7596 STDMETHODIMP Machine::COMGETTER(AutostopType)(AutostopType_T *penmAutostopType)
    7597 {
    7598     CheckComArgOutPointerValid(penmAutostopType);
    7599     AutoCaller autoCaller(this);
    7600     HRESULT hrc = autoCaller.rc();
    7601     if (SUCCEEDED(hrc))
    7602     {
    7603         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7604         *penmAutostopType = mHWData->mAutostart.enmAutostopType;
    7605     }
    7606     return hrc;
    7607 }
    7608 
    7609 STDMETHODIMP Machine::COMSETTER(AutostopType)(AutostopType_T enmAutostopType)
    7610 {
    7611     AutoCaller autoCaller(this);
    7612     HRESULT hrc = autoCaller.rc();
    7613     if (SUCCEEDED(hrc))
    7614     {
    7615         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7616         hrc = checkStateDependency(MutableStateDep);
    7617         if (   SUCCEEDED(hrc)
    7618             && mHWData->mAutostart.enmAutostopType != enmAutostopType)
    7619         {
    7620             AutostartDb *autostartDb = mParent->i_getAutostartDb();
    7621             int vrc;
    7622 
    7623             if (enmAutostopType != AutostopType_Disabled)
    7624                 vrc = autostartDb->addAutostopVM(mUserData->s.strName.c_str());
    7625             else
    7626                 vrc = autostartDb->removeAutostopVM(mUserData->s.strName.c_str());
    7627 
    7628             if (RT_SUCCESS(vrc))
    7629             {
    7630                 hrc = mHWData.backupEx();
    7631                 if (SUCCEEDED(hrc))
    7632                 {
    7633                     setModified(IsModified_MachineData);
    7634                     mHWData->mAutostart.enmAutostopType = enmAutostopType;
    7635                 }
    7636             }
    7637             else if (vrc == VERR_NOT_SUPPORTED)
    7638                 hrc = setError(VBOX_E_NOT_SUPPORTED,
    7639                                tr("The VM autostop feature is not supported on this platform"));
    7640             else if (vrc == VERR_PATH_NOT_FOUND)
    7641                 hrc = setError(E_FAIL,
    7642                                tr("The path to the autostart database is not set"));
    7643             else
    7644                 hrc = setError(E_UNEXPECTED,
    7645                                tr("%s machine '%s' to the autostop database failed with %Rrc"),
    7646                                enmAutostopType != AutostopType_Disabled ? "Adding" : "Removing",
    7647                                mUserData->s.strName.c_str(), vrc);
    7648         }
    7649     }
    7650     return hrc;
    7651 }
    7652 
    7653 STDMETHODIMP Machine::COMGETTER(DefaultFrontend)(BSTR *aDefaultFrontend)
    7654 {
    7655     CheckComArgOutPointerValid(aDefaultFrontend);
    7656     AutoCaller autoCaller(this);
    7657     HRESULT hrc = autoCaller.rc();
    7658     if (SUCCEEDED(hrc))
    7659     {
    7660         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7661         mHWData->mDefaultFrontend.cloneTo(aDefaultFrontend);
    7662     }
    7663     return hrc;
    7664 }
    7665 
    7666 STDMETHODIMP Machine::COMSETTER(DefaultFrontend)(IN_BSTR aDefaultFrontend)
    7667 {
    7668     CheckComArgStr(aDefaultFrontend);
    7669     AutoCaller autoCaller(this);
    7670     HRESULT hrc = autoCaller.rc();
    7671     if (SUCCEEDED(hrc))
    7672     {
    7673         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7674         hrc = checkStateDependency(MutableOrSavedStateDep);
    7675         if (SUCCEEDED(hrc))
    7676         {
    7677             hrc = mHWData.backupEx();
    7678             if (SUCCEEDED(hrc))
    7679             {
    7680                 setModified(IsModified_MachineData);
    7681                 mHWData->mDefaultFrontend = aDefaultFrontend;
    7682             }
    7683         }
    7684     }
    7685     return hrc;
    7686 }
    7687 
    7688 STDMETHODIMP Machine::COMGETTER(Icon)(ComSafeArrayOut(BYTE, aIcon))
    7689 {
    7690     CheckComArgSafeArrayNotNull(aIcon);
    7691     CheckComArgOutSafeArrayPointerValid(aIcon);
    7692     AutoCaller autoCaller(this);
    7693     HRESULT hrc = autoCaller.rc();
    7694     if (SUCCEEDED(hrc))
    7695     {
    7696         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7697         com::SafeArray<BYTE> icon(mUserData->mIcon.size());
    7698         memcpy(icon.raw(), &mUserData->mIcon[0], mUserData->mIcon.size());
    7699         icon.detachTo(ComSafeArrayOutArg(aIcon));
    7700     }
    7701     return hrc;
    7702 }
    7703 
    7704 STDMETHODIMP Machine::COMSETTER(Icon)(ComSafeArrayIn(BYTE, aIcon))
    7705 {
    7706     CheckComArgSafeArrayNotNull(aIcon);
    7707     AutoCaller autoCaller(this);
    7708     HRESULT hrc = autoCaller.rc();
    7709     if (SUCCEEDED(hrc))
    7710     {
    7711         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7712         hrc = checkStateDependency(MutableOrSavedStateDep);
    7713         if (SUCCEEDED(hrc))
    7714         {
    7715             setModified(IsModified_MachineData);
    7716             mUserData.backup();
    7717             com::SafeArray<BYTE> icon(ComSafeArrayInArg(aIcon));
    7718             mUserData->mIcon.resize(icon.size());
    7719             memcpy(&mUserData->mIcon[0], icon.raw(), mUserData->mIcon.size());
    7720          }
    7721     }
    7722     return hrc;
    7723 }
    7724 
    7725 STDMETHODIMP Machine::COMGETTER(USBProxyAvailable)(BOOL *aAvailable)
    7726 {
    7727     CheckComArgOutPointerValid(aAvailable);
    7728 
    7729     AutoCaller autoCaller(this);
    7730     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     6841HRESULT Machine::getUSBProxyAvailable(BOOL *aUSBProxyAvailable)
     6842{
    77316843
    77326844#ifdef VBOX_WITH_USB
    7733     *aAvailable = true;
     6845    *aUSBProxyAvailable = true;
    77346846#else
    7735     *aAvailable = false;
     6847    *aUSBProxyAvailable = false;
    77366848#endif
    77376849    return S_OK;
    77386850}
    77396851
    7740 STDMETHODIMP Machine::CloneTo(IMachine *pTarget, CloneMode_T mode, ComSafeArrayIn(CloneOptions_T, options), IProgress **pProgress)
    7741 {
    7742     LogFlowFuncEnter();
    7743 
    7744     CheckComArgNotNull(pTarget);
    7745     CheckComArgOutPointerValid(pProgress);
     6852HRESULT Machine::cloneTo(const ComPtr<IMachine> &aTarget, CloneMode_T aMode, const std::vector<CloneOptions_T> &aOptions,
     6853                         ComPtr<IProgress> &aProgress)
     6854{
     6855    ComObjPtr<Progress> pP;
     6856    Progress  *ppP = pP;
     6857    IProgress *iP  = static_cast<IProgress *>(ppP);
     6858    IProgress **pProgress = &iP;
     6859
     6860    IMachine  *pTarget    = aTarget;
    77466861
    77476862    /* Convert the options. */
    77486863    RTCList<CloneOptions_T> optList;
    7749     if (options != NULL)
    7750         optList = com::SafeArray<CloneOptions_T>(ComSafeArrayInArg(options)).toList();
     6864    if (aOptions.size())
     6865        for (size_t i = 0; i < aOptions.size(); ++i)
     6866            optList.append(aOptions[i]);
    77516867
    77526868    if (optList.contains(CloneOptions_Link))
    77536869    {
    7754         if (!isSnapshotMachine())
     6870        if (!i_isSnapshotMachine())
    77556871            return setError(E_INVALIDARG,
    77566872                            tr("Linked clone can only be created from a snapshot"));
    7757         if (mode != CloneMode_MachineState)
     6873        if (aMode != CloneMode_MachineState)
    77586874            return setError(E_INVALIDARG,
    77596875                            tr("Linked clone can only be created for a single machine state"));
     
    77616877    AssertReturn(!(optList.contains(CloneOptions_KeepAllMACs) && optList.contains(CloneOptions_KeepNATMACs)), E_INVALIDARG);
    77626878
    7763     AutoCaller autoCaller(this);
    7764     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    7765 
    7766 
    7767     MachineCloneVM *pWorker = new MachineCloneVM(this, static_cast<Machine*>(pTarget), mode, optList);
     6879    MachineCloneVM *pWorker = new MachineCloneVM(this, static_cast<Machine*>(pTarget), aMode, optList);
    77686880
    77696881    HRESULT rc = pWorker->start(pProgress);
    77706882
    7771     LogFlowFuncLeave();
     6883    pP = static_cast<Progress *>(*pProgress);
     6884    pP.queryInterfaceTo(aProgress.asOutParam());
    77726885
    77736886    return rc;
     6887
    77746888}
    77756889
     
    77796893/**
    77806894 * Adds the given IsModified_* flag to the dirty flags of the machine.
    7781  * This must be called either during loadSettings or under the machine write lock.
     6895 * This must be called either during i_loadSettings or under the machine write lock.
    77826896 * @param fl
    77836897 */
    7784 void Machine::setModified(uint32_t fl, bool fAllowStateModification /* = true */)
     6898void Machine::i_setModified(uint32_t fl, bool fAllowStateModification /* = true */)
    77856899{
    77866900    mData->flModifications |= fl;
    7787     if (fAllowStateModification && isStateModificationAllowed())
     6901    if (fAllowStateModification && i_isStateModificationAllowed())
    77886902        mData->mCurrentStateModified = true;
    77896903}
     
    77956909 * @param   fModifications      The flag to add.
    77966910 */
    7797 void Machine::setModifiedLock(uint32_t fModification, bool fAllowStateModification /* = true */)
     6911void Machine::i_setModifiedLock(uint32_t fModification, bool fAllowStateModification /* = true */)
    77986912{
    77996913    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    7800     setModified(fModification, fAllowStateModification);
     6914    i_setModified(fModification, fAllowStateModification);
    78016915}
    78026916
     
    78086922 *  @note locks this object for reading.
    78096923 */
    7810 HRESULT Machine::saveRegistryEntry(settings::MachineRegistryEntry &data)
     6924HRESULT Machine::i_saveRegistryEntry(settings::MachineRegistryEntry &data)
    78116925{
    78126926    AutoLimitedCaller autoCaller(this);
     
    78326946 * @note Locks this object for reading.
    78336947 */
    7834 int Machine::calculateFullPath(const Utf8Str &strPath, Utf8Str &aResult)
     6948int Machine::i_calculateFullPath(const Utf8Str &strPath, Utf8Str &aResult)
    78356949{
    78366950    AutoCaller autoCaller(this);
     
    78616975 * @note Locks this object for reading.
    78626976 */
    7863 void Machine::copyPathRelativeToMachine(const Utf8Str &strSource,
    7864                                         Utf8Str &strTarget)
     6977void Machine::i_copyPathRelativeToMachine(const Utf8Str &strSource,
     6978                                          Utf8Str &strTarget)
    78656979{
    78666980    AutoCaller autoCaller(this);
     
    78917005 *  \a aLogFolder argument.
    78927006 */
    7893 void Machine::getLogFolder(Utf8Str &aLogFolder)
     7007void Machine::i_getLogFolder(Utf8Str &aLogFolder)
    78947008{
    78957009    AutoCaller autoCaller(this);
     
    79297043 *  Returns the full path to the machine's log file for an given index.
    79307044 */
    7931 Utf8Str Machine::queryLogFilename(ULONG idx)
     7045Utf8Str Machine::i_queryLogFilename(ULONG idx)
    79327046{
    79337047    Utf8Str logFolder;
     
    79617075 * @param str
    79627076 */
    7963 void Machine::composeSavedStateFilename(Utf8Str &strStateFilePath)
     7077
     7078void Machine::i_composeSavedStateFilename(Utf8Str &strStateFilePath)
    79647079{
    79657080    AutoCaller autoCaller(this);
     
    79687083    {
    79697084        AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7970         calculateFullPath(mUserData->s.strSnapshotFolder, strStateFilePath);
     7085        i_calculateFullPath(mUserData->s.strSnapshotFolder, strStateFilePath);
    79717086    }
    79727087
     
    79857100 *  Returns the full path to the default video capture file.
    79867101 */
    7987 void Machine::getDefaultVideoCaptureFile(Utf8Str &strFile)
     7102void Machine::i_getDefaultVideoCaptureFile(Utf8Str &strFile)
    79887103{
    79897104    AutoCaller autoCaller(this);
     
    80007115 * Returns whether at least one USB controller is present for the VM.
    80017116 */
    8002 bool Machine::isUSBControllerPresent()
     7117bool Machine::i_isUSBControllerPresent()
    80037118{
    80047119    AutoCaller autoCaller(this);
     
    80147129 *        (inside the lock).
    80157130 */
    8016 HRESULT Machine::launchVMProcess(IInternalSessionControl *aControl,
    8017                                  const Utf8Str &strFrontend,
    8018                                  const Utf8Str &strEnvironment,
    8019                                  ProgressProxy *aProgress)
     7131HRESULT Machine::i_launchVMProcess(IInternalSessionControl *aControl,
     7132                                   const Utf8Str &strFrontend,
     7133                                   const Utf8Str &strEnvironment,
     7134                                   ProgressProxy *aProgress)
    80207135{
    80217136    LogFlowThisFuncEnter();
     
    81247239#define OSX_APP_PATH_FMT "/Resources/%s.app/Contents/MacOS/VirtualBoxVM"
    81257240
    8126         Utf8Str strAppOverride = getExtraData(Utf8Str("VBoxInternal2/VirtualBoxVMAppOverride"));
     7241        Utf8Str strAppOverride = i_getExtraData(Utf8Str("VBoxInternal2/VirtualBoxVMAppOverride"));
    81277242        if (   strAppOverride.contains(".")
    81287243            || strAppOverride.contains("/")
     
    81517266
    81527267        Utf8Str idStr = mData->mUuid.toString();
    8153         const char * args[] = {szPath, "--comment", mUserData->s.strName.c_str(), "--startvm", idStr.c_str(), "--no-startvm-errormsgbox", 0 };
     7268        const char * args[] = {szPath, "--comment", mUserData->s.strName.c_str(),
     7269                               "--startvm", idStr.c_str(), "--no-startvm-errormsgbox", 0 };
    81547270        vrc = RTProcCreate(szPath, args, env, 0, &pid);
    81557271    }
     
    82957411 * @note locks this object for reading.
    82967412 */
    8297 bool Machine::isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
    8298                             ComPtr<IInternalSessionControl> *aControl /*= NULL*/,
    8299                             bool aAllowClosing /*= false*/)
     7413bool Machine::i_isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
     7414                              ComPtr<IInternalSessionControl> *aControl /*= NULL*/,
     7415                              bool aAllowClosing /*= false*/)
    83007416{
    83017417    AutoLimitedCaller autoCaller(this);
     
    83307446 * @note locks this object for reading.
    83317447 */
    8332 bool Machine::isSessionSpawning()
     7448bool Machine::i_isSessionSpawning()
    83337449{
    83347450    AutoLimitedCaller autoCaller(this);
     
    83617477 * @note Locks this object for writing.
    83627478 */
    8363 bool Machine::checkForSpawnFailure()
     7479bool Machine::i_checkForSpawnFailure()
    83647480{
    83657481    AutoCaller autoCaller(this);
     
    83947510            rc = setError(E_FAIL,
    83957511                          tr("The virtual machine '%s' has terminated unexpectedly during startup with exit code %d"),
    8396                           getName().c_str(), status.iStatus);
     7512                          i_getName().c_str(), status.iStatus);
    83977513        else if (RT_SUCCESS(vrc) && status.enmReason == RTPROCEXITREASON_SIGNAL)
    83987514            rc = setError(E_FAIL,
    83997515                          tr("The virtual machine '%s' has terminated unexpectedly during startup because of signal %d"),
    8400                           getName().c_str(), status.iStatus);
     7516                          i_getName().c_str(), status.iStatus);
    84017517        else if (RT_SUCCESS(vrc) && status.enmReason == RTPROCEXITREASON_ABEND)
    84027518            rc = setError(E_FAIL,
    84037519                          tr("The virtual machine '%s' has terminated abnormally"),
    8404                           getName().c_str(), status.iStatus);
     7520                          i_getName().c_str(), status.iStatus);
    84057521        else
    84067522            rc = setError(E_FAIL,
    84077523                          tr("The virtual machine '%s' has terminated unexpectedly during startup (%Rrc)"),
    8408                           getName().c_str(), vrc);
     7524                          i_getName().c_str(), vrc);
    84097525    }
    84107526
     
    84287544        if (!mData->mSession.mProgress.isNull())
    84297545        {
    8430             mData->mSession.mProgress->i_notifyComplete(rc);
     7546            mData->mSession.mProgress->notifyComplete(rc);
    84317547            mData->mSession.mProgress.setNull();
    84327548        }
     
    84487564 *  children for writing.
    84497565 */
    8450 HRESULT Machine::prepareRegister()
     7566HRESULT Machine::i_prepareRegister()
    84517567{
    84527568    AssertReturn(mParent->isWriteLockOnCurrentThread(), E_FAIL);
     
    84587574
    84597575    /* wait for state dependents to drop to zero */
    8460     ensureNoStateDependencies();
     7576    i_ensureNoStateDependencies();
    84617577
    84627578    if (!mData->mAccessible)
     
    84777593
    84787594    // Ensure the settings are saved. If we are going to be registered and
    8479     // no config file exists yet, create it by calling saveSettings() too.
     7595    // no config file exists yet, create it by calling i_saveSettings() too.
    84807596    if (    (mData->flModifications)
    84817597         || (!mData->pMachineConfigFile->fileExists())
    84827598       )
    84837599    {
    8484         rc = saveSettings(NULL);
     7600        rc = i_saveSettings(NULL);
    84857601                // no need to check whether VirtualBox.xml needs saving too since
    84867602                // we can't have a machine XML file rename pending
     
    84937609    {
    84947610        /* we may have had implicit modifications we want to fix on success */
    8495         commit();
     7611        i_commit();
    84967612
    84977613        mData->mRegistered = true;
     
    85007616    {
    85017617        /* we may have had implicit modifications we want to cancel on failure*/
    8502         rollback(false /* aNotify */);
     7618        i_rollback(false /* aNotify */);
    85037619    }
    85047620
     
    85257641 * @note Locks this object for writing.
    85267642 */
    8527 HRESULT Machine::addStateDependency(StateDependency aDepType /* = AnyStateDep */,
    8528                                     MachineState_T *aState /* = NULL */,
    8529                                     BOOL *aRegistered /* = NULL */)
     7643HRESULT Machine::i_addStateDependency(StateDependency aDepType /* = AnyStateDep */,
     7644                                      MachineState_T *aState /* = NULL */,
     7645                                      BOOL *aRegistered /* = NULL */)
    85307646{
    85317647    AutoCaller autoCaller(this);
     
    85347650    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    85357651
    8536     HRESULT rc = checkStateDependency(aDepType);
     7652    HRESULT rc = i_checkStateDependency(aDepType);
    85377653    if (FAILED(rc)) return rc;
    85387654
     
    85407656        if (mData->mMachineStateChangePending != 0)
    85417657        {
    8542             /* ensureNoStateDependencies() is waiting for state dependencies to
     7658            /* i_ensureNoStateDependencies() is waiting for state dependencies to
    85437659             * drop to zero so don't add more. It may make sense to wait a bit
    85447660             * and retry before reporting an error (since the pending state
     
    85697685 * dependency is no more necessary.
    85707686 */
    8571 void Machine::releaseStateDependency()
     7687void Machine::i_releaseStateDependency()
    85727688{
    85737689    AutoCaller autoCaller(this);
     
    85827698    if (mData->mMachineStateDeps == 0)
    85837699    {
    8584         /* inform ensureNoStateDependencies() that there are no more deps */
     7700        /* inform i_ensureNoStateDependencies() that there are no more deps */
    85857701        if (mData->mMachineStateChangePending != 0)
    85867702        {
     
    85917707}
    85927708
    8593 Utf8Str Machine::getExtraData(const Utf8Str &strKey)
     7709Utf8Str Machine::i_getExtraData(const Utf8Str &strKey)
    85947710{
    85957711    /* start with nothing found */
     
    86417757 *        lock.
    86427758 */
    8643 HRESULT Machine::checkStateDependency(StateDependency aDepType)
     7759HRESULT Machine::i_checkStateDependency(StateDependency aDepType)
    86447760{
    86457761    switch (aDepType)
     
    86527768        {
    86537769            if (   mData->mRegistered
    8654                 && (   !isSessionMachine()  /** @todo This was just converted raw; Check if Running and Paused should actually be included here... (Live Migration) */
     7770                && (   !i_isSessionMachine()  /** @todo This was just converted raw; Check if Running and
     7771                                                  Paused should actually be included here... (Live Migration) */
    86557772                    || (   mData->mMachineState != MachineState_Paused
    86567773                        && mData->mMachineState != MachineState_Running
     
    86697786        {
    86707787            if (   mData->mRegistered
    8671                 && (   !isSessionMachine() /** @todo This was just converted raw; Check if Running and Paused should actually be included here... (Live Migration) */
     7788                && (   !i_isSessionMachine() /** @todo This was just converted raw; Check if Running and
     7789                                                 Paused should actually be included here... (Live Migration) */
    86727790                    || (   mData->mMachineState != MachineState_Paused
    86737791                        && mData->mMachineState != MachineState_Running
     
    86877805        {
    86887806            if (   mData->mRegistered
    8689                 && (   !isSessionMachine()
     7807                && (   !i_isSessionMachine()
    86907808                    || (   mData->mMachineState != MachineState_PoweredOff
    86917809                        && mData->mMachineState != MachineState_Saved
     
    87437861
    87447862    /* create associated serial port objects */
    8745     for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
     7863    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    87467864    {
    87477865        unconst(mSerialPorts[slot]).createObject();
     
    87507868
    87517869    /* create associated parallel port objects */
    8752     for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
     7870    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot)
    87537871    {
    87547872        unconst(mParallelPorts[slot]).createObject();
     
    87667884    /* create associated network adapter objects */
    87677885    mNetworkAdapters.resize(Global::getMaxNetworkAdapters(mHWData->mChipsetType));
    8768     for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
     7886    for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    87697887    {
    87707888        unconst(mNetworkAdapters[slot]).createObject();
     
    88027920    }
    88037921
    8804     for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
     7922    for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    88057923    {
    88067924        if (mNetworkAdapters[slot])
     
    88237941    }
    88247942
    8825     for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
     7943    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot)
    88267944    {
    88277945        if (mParallelPorts[slot])
     
    88327950    }
    88337951
    8834     for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
     7952    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    88357953    {
    88367954        if (mSerialPorts[slot])
     
    88627980     * code will not affect them. */
    88637981    if (    !!mMediaData
    8864          && (!isSessionMachine())
     7982         && (!i_isSessionMachine())
    88657983       )
    88667984    {
     
    88727990            if (pMedium.isNull())
    88737991                continue;
    8874             HRESULT rc = pMedium->i_removeBackReference(mData->mUuid, getSnapshotId());
     7992            HRESULT rc = pMedium->i_removeBackReference(mData->mUuid, i_getSnapshotId());
    88757993            AssertComRC(rc);
    88767994        }
    88777995    }
    88787996
    8879     if (!isSessionMachine() && !isSnapshotMachine())
     7997    if (!i_isSessionMachine() && !i_isSnapshotMachine())
    88807998    {
    88817999        // clean up the snapshots list (Snapshot::uninit() will handle the snapshot's children recursively)
     
    89118029 *  (primary) machine pointer.
    89128030 */
    8913 Machine* Machine::getMachine()
    8914 {
    8915     if (isSessionMachine())
     8031Machine* Machine::i_getMachine()
     8032{
     8033    if (i_isSessionMachine())
    89168034        return (Machine*)mPeer;
    89178035    return this;
     
    89318049 * @warning To be used only in methods that change the machine state!
    89328050 */
    8933 void Machine::ensureNoStateDependencies()
     8051void Machine::i_ensureNoStateDependencies()
    89348052{
    89358053    AssertReturnVoid(isWriteLockOnCurrentThread());
     
    89718089 * @note Locks this object for writing.
    89728090 */
    8973 HRESULT Machine::setMachineState(MachineState_T aMachineState)
     8091HRESULT Machine::i_setMachineState(MachineState_T aMachineState)
    89748092{
    89758093    LogFlowThisFuncEnter();
     
    89828100
    89838101    /* wait for state dependents to drop to zero */
    8984     ensureNoStateDependencies();
     8102    i_ensureNoStateDependencies();
    89858103
    89868104    if (mData->mMachineState != aMachineState)
     
    90118129 *      must be called from under the object's lock!
    90128130 */
    9013 HRESULT Machine::findSharedFolder(const Utf8Str &aName,
    9014                                   ComObjPtr<SharedFolder> &aSharedFolder,
    9015                                   bool aSetError /* = false */)
     8131HRESULT Machine::i_findSharedFolder(const Utf8Str &aName,
     8132                                    ComObjPtr<SharedFolder> &aSharedFolder,
     8133                                    bool aSetError /* = false */)
    90168134{
    90178135    HRESULT rc = VBOX_E_OBJECT_NOT_FOUND;
     
    90568174 *
    90578175 * @param config Machine settings from XML.
    9058  * @param puuidRegistry If != NULL, Medium::setRegistryIdIfFirst() gets called with this registry ID for each attached medium in the config.
     8176 * @param puuidRegistry If != NULL, Medium::setRegistryIdIfFirst() gets called with this registry ID
     8177 * for each attached medium in the config.
    90598178 * @return
    90608179 */
    9061 HRESULT Machine::loadMachineDataFromSettings(const settings::MachineConfigFile &config,
    9062                                              const Guid *puuidRegistry)
     8180HRESULT Machine::i_loadMachineDataFromSettings(const settings::MachineConfigFile &config,
     8181                                               const Guid *puuidRegistry)
    90638182{
    90648183    // copy name, description, OS type, teleporter, UTC etc.
     
    90968215    {
    90978216        Utf8Str stateFilePathFull(config.strStateFile);
    9098         int vrc = calculateFullPath(stateFilePathFull, stateFilePathFull);
     8217        int vrc = i_calculateFullPath(stateFilePathFull, stateFilePathFull);
    90998218        if (RT_FAILURE(vrc))
    91008219            return setError(E_FAIL,
     
    91308249    {
    91318250        // determine machine folder
    9132         Utf8Str strMachineFolder = getSettingsFileFull();
     8251        Utf8Str strMachineFolder = i_getSettingsFileFull();
    91338252        strMachineFolder.stripFilename();
    9134         rc = mParent->initMedia(getId(),         // media registry ID == machine UUID
     8253        rc = mParent->initMedia(i_getId(),       // media registry ID == machine UUID
    91358254                                config.mediaRegistry,
    91368255                                strMachineFolder);
     
    91478266        const settings::Snapshot &snap = config.llFirstSnapshot.front();
    91488267
    9149         rc = loadSnapshot(snap,
    9150                           config.uuidCurrentSnapshot,
    9151                           NULL);        // no parent == first snapshot
     8268        rc = i_loadSnapshot(snap,
     8269                            config.uuidCurrentSnapshot,
     8270                            NULL);        // no parent == first snapshot
    91528271        if (FAILED(rc)) return rc;
    91538272    }
    91548273
    91558274    // hardware data
    9156     rc = loadHardware(config.hardwareMachine, &config.debugging, &config.autostart);
     8275    rc = i_loadHardware(config.hardwareMachine, &config.debugging, &config.autostart);
    91578276    if (FAILED(rc)) return rc;
    91588277
    91598278    // load storage controllers
    9160     rc = loadStorageControllers(config.storageMachine,
    9161                                 puuidRegistry,
    9162                                 NULL /* puuidSnapshot */);
     8279    rc = i_loadStorageControllers(config.storageMachine,
     8280                                  puuidRegistry,
     8281                                  NULL /* puuidSnapshot */);
    91638282    if (FAILED(rc)) return rc;
    91648283
     
    91678286     *  otherwise it will be not possible to change the settings
    91688287     *  somewhere in the code above because all setters will be
    9169      *  blocked by checkStateDependency(MutableStateDep).
     8288     *  blocked by i_checkStateDependency(MutableStateDep).
    91708289     */
    91718290
     
    91758294        mSSData->strStateFilePath.setNull();
    91768295
    9177         /* no need to use setMachineState() during init() */
     8296        /* no need to use i_setMachineState() during init() */
    91788297        mData->mMachineState = MachineState_Aborted;
    91798298    }
    91808299    else if (!mSSData->strStateFilePath.isEmpty())
    91818300    {
    9182         /* no need to use setMachineState() during init() */
     8301        /* no need to use i_setMachineState() during init() */
    91838302        mData->mMachineState = MachineState_Saved;
    91848303    }
     
    91978316 *  @param aParentSnapshot  Parent snapshot.
    91988317 */
    9199 HRESULT Machine::loadSnapshot(const settings::Snapshot &data,
    9200                               const Guid &aCurSnapshotId,
    9201                               Snapshot *aParentSnapshot)
    9202 {
    9203     AssertReturn(!isSnapshotMachine(), E_FAIL);
    9204     AssertReturn(!isSessionMachine(), E_FAIL);
     8318HRESULT Machine::i_loadSnapshot(const settings::Snapshot &data,
     8319                                const Guid &aCurSnapshotId,
     8320                                Snapshot *aParentSnapshot)
     8321{
     8322    AssertReturn(!i_isSnapshotMachine(), E_FAIL);
     8323    AssertReturn(!i_isSessionMachine(), E_FAIL);
    92058324
    92068325    HRESULT rc = S_OK;
     
    92118330        /* optional */
    92128331        strStateFile = data.strStateFile;
    9213         int vrc = calculateFullPath(strStateFile, strStateFile);
     8332        int vrc = i_calculateFullPath(strStateFile, strStateFile);
    92148333        if (RT_FAILURE(vrc))
    92158334            return setError(E_FAIL,
     
    92618380        const settings::Snapshot &childData = *it;
    92628381        // recurse
    9263         rc = loadSnapshot(childData,
    9264                           aCurSnapshotId,
    9265                           pSnapshot);       // parent = the one we created above
     8382        rc = i_loadSnapshot(childData,
     8383                            aCurSnapshotId,
     8384                            pSnapshot);       // parent = the one we created above
    92668385        if (FAILED(rc)) return rc;
    92678386    }
     
    92778396 *  @param pAutostart     Pointer to the autostart settings.
    92788397 */
    9279 HRESULT Machine::loadHardware(const settings::Hardware &data, const settings::Debugging *pDbg,
    9280                               const settings::Autostart *pAutostart)
    9281 {
    9282     AssertReturn(!isSessionMachine(), E_FAIL);
     8398HRESULT Machine::i_loadHardware(const settings::Hardware &data, const settings::Debugging *pDbg,
     8399                                const settings::Autostart *pAutostart)
     8400{
     8401    AssertReturn(!i_isSessionMachine(), E_FAIL);
    92838402
    92848403    HRESULT rc = S_OK;
     
    93648483
    93658484        // boot order
    9366         for (size_t i = 0;
    9367              i < RT_ELEMENTS(mHWData->mBootOrder);
    9368              i++)
     8485        for (size_t i = 0; i < RT_ELEMENTS(mHWData->mBootOrder); ++i)
    93698486        {
    93708487            settings::BootOrderMap::const_iterator it = data.mapBootOrder.find(i);
     
    93838500        mHWData->mVideoCaptureHeight = data.ulVideoCaptureVertRes;
    93848501        mHWData->mVideoCaptureEnabled = data.fVideoCaptureEnabled;
    9385         for (unsigned i = 0; i < RT_ELEMENTS(mHWData->maVideoCaptureScreens); i++)
     8502        for (unsigned i = 0; i < RT_ELEMENTS(mHWData->maVideoCaptureScreens); ++i)
    93868503            mHWData->maVideoCaptureScreens[i] = ASMBitTest(&data.u64VideoCaptureScreens, i);
    93878504        AssertCompile(RT_ELEMENTS(mHWData->maVideoCaptureScreens) == sizeof(data.u64VideoCaptureScreens) * 8);
     
    93898506        mHWData->mVideoCaptureFPS = data.ulVideoCaptureFPS;
    93908507        if (!data.strVideoCaptureFile.isEmpty())
    9391             calculateFullPath(data.strVideoCaptureFile, mHWData->mVideoCaptureFile);
     8508            i_calculateFullPath(data.strVideoCaptureFile, mHWData->mVideoCaptureFile);
    93928509        else
    93938510            mHWData->mVideoCaptureFile.setNull();
     
    93968513        mHWData->mKeyboardHIDType = data.keyboardHIDType;
    93978514        mHWData->mChipsetType = data.chipsetType;
    9398         mHWData->mParavirtProvider = data.paravirtProvider;
    93998515        mHWData->mEmulatedUSBCardReaderEnabled = data.fEmulatedUSBCardReader;
    94008516        mHWData->mHPETEnabled = data.fHPETEnabled;
     
    94358551        {
    94368552            mNetworkAdapters.resize(newCount);
    9437             for (ULONG slot = oldCount; slot < mNetworkAdapters.size(); slot++)
     8553            for (ULONG slot = oldCount; slot < mNetworkAdapters.size(); ++slot)
    94388554            {
    94398555                unconst(mNetworkAdapters[slot]).createObject();
     
    94928608            ComObjPtr<SharedFolder> sharedFolder;
    94938609            /* Check for double entries. Not allowed! */
    9494             rc = findSharedFolder(sf.strName, sharedFolder, false /* aSetError */);
     8610            rc = i_findSharedFolder(sf.strName, sharedFolder, false /* aSetError */);
    94958611            if (SUCCEEDED(rc))
    94968612                return setError(VBOX_E_OBJECT_IN_USE,
     
    95018617             * reported when the machine starts. */
    95028618            sharedFolder.createObject();
    9503             rc = sharedFolder->init(getMachine(),
     8619            rc = sharedFolder->init(i_getMachine(),
    95048620                                    sf.strName,
    95058621                                    sf.strHostPath,
     
    95588674#endif /* VBOX_WITH_GUEST_PROPS defined */
    95598675
    9560         rc = loadDebugging(pDbg);
     8676        rc = i_loadDebugging(pDbg);
    95618677        if (FAILED(rc))
    95628678            return rc;
     
    95828698 * @param   pDbg        Pointer to the settings.
    95838699 */
    9584 HRESULT Machine::loadDebugging(const settings::Debugging *pDbg)
     8700HRESULT Machine::i_loadDebugging(const settings::Debugging *pDbg)
    95858701{
    95868702    mHWData->mDebugging = *pDbg;
     
    95908706
    95918707/**
    9592  *  Called from loadMachineDataFromSettings() for the storage controller data, including media.
     8708 *  Called from i_loadMachineDataFromSettings() for the storage controller data, including media.
    95938709 *
    95948710 * @param data
    9595  * @param puuidRegistry media registry ID to set media to or NULL; see Machine::loadMachineDataFromSettings()
     8711 * @param puuidRegistry media registry ID to set media to or NULL; see Machine::i_loadMachineDataFromSettings()
    95968712 * @param puuidSnapshot
    95978713 * @return
    95988714 */
    9599 HRESULT Machine::loadStorageControllers(const settings::Storage &data,
    9600                                         const Guid *puuidRegistry,
    9601                                         const Guid *puuidSnapshot)
    9602 {
    9603     AssertReturn(!isSessionMachine(), E_FAIL);
     8715HRESULT Machine::i_loadStorageControllers(const settings::Storage &data,
     8716                                          const Guid *puuidRegistry,
     8717                                          const Guid *puuidSnapshot)
     8718{
     8719    AssertReturn(!i_isSessionMachine(), E_FAIL);
    96048720
    96058721    HRESULT rc = S_OK;
     
    96138729        ComObjPtr<StorageController> pCtl;
    96148730        /* Try to find one with the name first. */
    9615         rc = getStorageControllerByName(ctlData.strName, pCtl, false /* aSetError */);
     8731        rc = i_getStorageControllerByName(ctlData.strName, pCtl, false /* aSetError */);
    96168732        if (SUCCEEDED(rc))
    96178733            return setError(VBOX_E_OBJECT_IN_USE,
     
    96508766
    96518767        /* Load the attached devices now. */
    9652         rc = loadStorageDevices(pCtl,
    9653                                 ctlData,
    9654                                 puuidRegistry,
    9655                                 puuidSnapshot);
     8768        rc = i_loadStorageDevices(pCtl,
     8769                                  ctlData,
     8770                                  puuidRegistry,
     8771                                  puuidSnapshot);
    96568772        if (FAILED(rc)) return rc;
    96578773    }
     
    96618777
    96628778/**
    9663  * Called from loadStorageControllers for a controller's devices.
     8779 * Called from i_loadStorageControllers for a controller's devices.
    96648780 *
    96658781 * @param aStorageController
    96668782 * @param data
    9667  * @param puuidRegistry media registry ID to set media to or NULL; see Machine::loadMachineDataFromSettings()
     8783 * @param puuidRegistry media registry ID to set media to or NULL; see Machine::i_loadMachineDataFromSettings()
    96688784 * @param aSnapshotId  pointer to the snapshot ID if this is a snapshot machine
    96698785 * @return
    96708786 */
    9671 HRESULT Machine::loadStorageDevices(StorageController *aStorageController,
    9672                                     const settings::StorageController &data,
    9673                                     const Guid *puuidRegistry,
    9674                                     const Guid *puuidSnapshot)
     8787HRESULT Machine::i_loadStorageDevices(StorageController *aStorageController,
     8788                                      const settings::StorageController &data,
     8789                                      const Guid *puuidRegistry,
     8790                                      const Guid *puuidSnapshot)
    96758791{
    96768792    HRESULT rc = S_OK;
     
    97178833            case DeviceType_DVD:
    97188834                if (dev.strHostDriveSrc.isNotEmpty())
    9719                     rc = mParent->i_host()->i_findHostDriveByName(dev.deviceType, dev.strHostDriveSrc, false /* fRefresh */, medium);
     8835                    rc = mParent->i_host()->i_findHostDriveByName(dev.deviceType, dev.strHostDriveSrc,
     8836                                                                  false /* fRefresh */, medium);
    97208837                else
    97218838                    rc = mParent->i_findRemoveableMedium(dev.deviceType,
     
    97258842                                                         medium);
    97268843                if (rc == VBOX_E_OBJECT_NOT_FOUND)
    9727                     // This is not an error. The host drive or UUID might have vanished, so just go ahead without this removeable medium attachment
     8844                    // This is not an error. The host drive or UUID might have vanished, so just go
     8845                    // ahead without this removeable medium attachment
    97288846                    rc = S_OK;
    97298847            break;
     
    97358853                if (FAILED(rc))
    97368854                {
    9737                     if (isSnapshotMachine())
     8855                    if (i_isSnapshotMachine())
    97388856                    {
    97398857                        // wrap another error message around the "cannot find hard disk" set by findHardDisk
     
    97538871                if (medium->i_getType() == MediumType_Immutable)
    97548872                {
    9755                     if (isSnapshotMachine())
     8873                    if (i_isSnapshotMachine())
    97568874                        return setError(E_FAIL,
    97578875                                        tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to snapshot with UUID {%RTuuid} "
     
    97738891                if (medium->i_getType() == MediumType_MultiAttach)
    97748892                {
    9775                     if (isSnapshotMachine())
     8893                    if (i_isSnapshotMachine())
    97768894                        return setError(E_FAIL,
    97778895                                        tr("Multi-attach hard disk '%s' with UUID {%RTuuid} cannot be directly attached to snapshot with UUID {%RTuuid} "
     
    97918909                }
    97928910
    9793                 if (    !isSnapshotMachine()
     8911                if (    !i_isSnapshotMachine()
    97948912                     && medium->i_getChildren().size() != 0
    97958913                   )
     
    98038921                                    medium->i_getChildren().size());
    98048922
    9805                 if (findAttachment(mMediaData->mAttachments,
    9806                                    medium))
     8923                if (i_findAttachment(mMediaData->mAttachments,
     8924                                     medium))
    98078925                    return setError(E_FAIL,
    98088926                                    tr("Hard disk '%s' with UUID {%RTuuid} is already attached to the virtual machine '%s' ('%s')"),
     
    98678985            AutoWriteLock mlock(medium COMMA_LOCKVAL_SRC_POS);
    98688986
    9869             if (isSnapshotMachine())
     8987            if (i_isSnapshotMachine())
    98708988                rc = medium->i_addBackReference(mData->mUuid, *puuidSnapshot);
    98718989            else
     
    98849002        /* back up mMediaData to let registeredInit() properly rollback on failure
    98859003         * (= limited accessibility) */
    9886         setModified(IsModified_Storage);
     9004        i_setModified(IsModified_Storage);
    98879005        mMediaData.backup();
    98889006        mMediaData->mAttachments.push_back(pAttachment);
     
    98999017 *  @param aSetError    true to set extended error info on failure
    99009018 */
    9901 HRESULT Machine::findSnapshotById(const Guid &aId,
    9902                                   ComObjPtr<Snapshot> &aSnapshot,
    9903                                   bool aSetError /* = false */)
     9019HRESULT Machine::i_findSnapshotById(const Guid &aId,
     9020                                    ComObjPtr<Snapshot> &aSnapshot,
     9021                                    bool aSetError /* = false */)
    99049022{
    99059023    AutoReadLock chlock(this COMMA_LOCKVAL_SRC_POS);
     
    99369054 *  @param aSetError    true to set extended error info on failure
    99379055 */
    9938 HRESULT Machine::findSnapshotByName(const Utf8Str &strName,
    9939                                     ComObjPtr<Snapshot> &aSnapshot,
    9940                                     bool aSetError /* = false */)
     9056HRESULT Machine::i_findSnapshotByName(const Utf8Str &strName,
     9057                                      ComObjPtr<Snapshot> &aSnapshot,
     9058                                      bool aSetError /* = false */)
    99419059{
    99429060    AssertReturn(!strName.isEmpty(), E_INVALIDARG);
     
    99729090 *  @param aSetError             true to set extended error info on failure
    99739091 */
    9974 HRESULT Machine::getStorageControllerByName(const Utf8Str &aName,
    9975                                             ComObjPtr<StorageController> &aStorageController,
    9976                                             bool aSetError /* = false */)
     9092HRESULT Machine::i_getStorageControllerByName(const Utf8Str &aName,
     9093                                              ComObjPtr<StorageController> &aStorageController,
     9094                                              bool aSetError /* = false */)
    99779095{
    99789096    AssertReturn(!aName.isEmpty(), E_INVALIDARG);
     
    100039121 *  @param aSetError             true to set extended error info on failure
    100049122 */
    10005 HRESULT Machine::getUSBControllerByName(const Utf8Str &aName,
    10006                                         ComObjPtr<USBController> &aUSBController,
    10007                                         bool aSetError /* = false */)
     9123HRESULT Machine::i_getUSBControllerByName(const Utf8Str &aName,
     9124                                          ComObjPtr<USBController> &aUSBController,
     9125                                          bool aSetError /* = false */)
    100089126{
    100099127    AssertReturn(!aName.isEmpty(), E_INVALIDARG);
     
    100329150 * @param enmType                USB controller type.
    100339151 */
    10034 ULONG Machine::getUSBControllerCountByType(USBControllerType_T enmType)
     9152ULONG Machine::i_getUSBControllerCountByType(USBControllerType_T enmType)
    100359153{
    100369154    ULONG cCtrls = 0;
     
    100479165}
    100489166
    10049 HRESULT Machine::getMediumAttachmentsOfController(CBSTR aName,
    10050                                                   MediaData::AttachmentList &atts)
     9167HRESULT Machine::i_getMediumAttachmentsOfController(const Utf8Str &aName,
     9168                                                    MediaData::AttachmentList &atts)
    100519169{
    100529170    AutoCaller autoCaller(this);
     
    100609178    {
    100619179        const ComObjPtr<MediumAttachment> &pAtt = *it;
    10062 
    100639180        // should never happen, but deal with NULL pointers in the list.
    100649181        AssertStmt(!pAtt.isNull(), continue);
     
    100739190        AutoReadLock attLock(pAtt COMMA_LOCKVAL_SRC_POS);
    100749191
    10075         if (pAtt->i_getControllerName() == aName)
     9192        if (pAtt->i_getControllerName() == Bstr(aName).raw())
    100769193            atts.push_back(pAtt);
    100779194    }
     
    100809197}
    100819198
     9199
    100829200/**
    10083  *  Helper for #saveSettings. Cares about renaming the settings directory and
     9201 *  Helper for #i_saveSettings. Cares about renaming the settings directory and
    100849202 *  file if the machine name was changed and about creating a new settings file
    100859203 *  if this is a new machine.
     
    100879205 *  @note Must be never called directly but only from #saveSettings().
    100889206 */
    10089 HRESULT Machine::prepareSaveSettings(bool *pfNeedsGlobalSaveSettings)
     9207HRESULT Machine::i_prepareSaveSettings(bool *pfNeedsGlobalSaveSettings)
    100909208{
    100919209    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
     
    101419259            newConfigDir = configDir;
    101429260            if (   configDir.length() >= groupPlusName.length()
    10143                 && !RTPathCompare(configDir.substr(configDir.length() - groupPlusName.length(), groupPlusName.length()).c_str(), groupPlusName.c_str()))
     9261                && !RTPathCompare(configDir.substr(configDir.length() - groupPlusName.length(), groupPlusName.length()).c_str(),
     9262                                  groupPlusName.c_str()))
    101449263            {
    101459264                newConfigDir = newConfigDir.substr(0, configDir.length() - groupPlusName.length());
     
    102259344            mParent->i_copyPathRelativeToConfig(newConfigFile, mData->m_strConfigFile);
    102269345
    10227             // store the old and new so that VirtualBox::saveSettings() can update
     9346            // store the old and new so that VirtualBox::i_saveSettings() can update
    102289347            // the media registry
    102299348            if (    mData->mRegistered
     
    103209439 * @param pfNeedsGlobalSaveSettings Optional pointer to a bool that must have been
    103219440 *          initialized to false and that will be set to true by this function if
    10322  *          the caller must invoke VirtualBox::saveSettings() because the global
     9441 *          the caller must invoke VirtualBox::i_saveSettings() because the global
    103239442 *          settings have changed. This will happen if a machine rename has been
    103249443 *          saved and the global machine and media registries will therefore need
    103259444 *          updating.
    103269445 */
    10327 HRESULT Machine::saveSettings(bool *pfNeedsGlobalSaveSettings,
    10328                               int aFlags /*= 0*/)
     9446HRESULT Machine::i_saveSettings(bool *pfNeedsGlobalSaveSettings,
     9447                                int aFlags /*= 0*/)
    103299448{
    103309449    LogFlowThisFuncEnter();
     
    103349453    /* make sure child objects are unable to modify the settings while we are
    103359454     * saving them */
    10336     ensureNoStateDependencies();
    10337 
    10338     AssertReturn(!isSnapshotMachine(),
     9455    i_ensureNoStateDependencies();
     9456
     9457    AssertReturn(!i_isSnapshotMachine(),
    103399458                 E_FAIL);
    103409459
     
    103459464     * settings directory and file if the machine name was changed and about
    103469465     * creating a new settings file if this is a new machine. */
    10347     rc = prepareSaveSettings(pfNeedsGlobalSaveSettings);
     9466    rc = i_prepareSaveSettings(pfNeedsGlobalSaveSettings);
    103489467    if (FAILED(rc)) return rc;
    103499468
     
    103599478
    103609479        // now go and copy all the settings data from COM to the settings structures
    10361         // (this calles saveSettings() on all the COM objects in the machine)
    10362         copyMachineDataToSettings(*pNewConfig);
     9480        // (this calles i_saveSettings() on all the COM objects in the machine)
     9481        i_copyMachineDataToSettings(*pNewConfig);
    103639482
    103649483        if (aFlags & SaveS_ResetCurStateModified)
     
    103999518        mData->pMachineConfigFile = pNewConfig;
    104009519        delete pOldConfig;
    10401         commit();
     9520        i_commit();
    104029521
    104039522        // after saving settings, we are no longer different from the XML on disk
     
    104259544         * to the client process that creates them) and thus don't need to
    104269545         * inform callbacks. */
    10427         if (isSessionMachine())
     9546        if (i_isSessionMachine())
    104289547            mParent->i_onMachineDataChange(mData->mUuid);
    104299548    }
     
    104419560 * This gets called from two locations:
    104429561 *
    10443  *  --  Machine::saveSettings(), during the regular XML writing;
     9562 *  --  Machine::i_saveSettings(), during the regular XML writing;
    104449563 *
    104459564 *  --  Appliance::buildXMLForOneVirtualSystem(), when a machine gets
     
    104599578 * This throws XML errors and HRESULT, so the caller must have a catch block!
    104609579 */
    10461 void Machine::copyMachineDataToSettings(settings::MachineConfigFile &config)
     9580void Machine::i_copyMachineDataToSettings(settings::MachineConfigFile &config)
    104629581{
    104639582    // deep copy extradata
     
    105029621        Assert(!mSSData->strStateFilePath.isEmpty());
    105039622        /* try to make the file name relative to the settings file dir */
    10504         copyPathRelativeToMachine(mSSData->strStateFilePath, config.strStateFile);
     9623        i_copyPathRelativeToMachine(mSSData->strStateFilePath, config.strStateFile);
    105059624    }
    105069625    else
     
    105199638    /// @todo Live Migration:        config.fTeleported = (mData->mMachineState == MachineState_Teleported);
    105209639
    10521     HRESULT rc = saveHardware(config.hardwareMachine, &config.debugging, &config.autostart);
     9640    HRESULT rc = i_saveHardware(config.hardwareMachine, &config.debugging, &config.autostart);
    105229641    if (FAILED(rc)) throw rc;
    105239642
    10524     rc = saveStorageControllers(config.storageMachine);
     9643    rc = i_saveStorageControllers(config.storageMachine);
    105259644    if (FAILED(rc)) throw rc;
    105269645
     
    105299648    {
    105309649        // determine machine folder
    10531         Utf8Str strMachineFolder = getSettingsFileFull();
     9650        Utf8Str strMachineFolder = i_getSettingsFileFull();
    105329651        strMachineFolder.stripFilename();
    105339652        mParent->i_saveMediaRegistry(config.mediaRegistry,
    10534                                      getId(),             // only media with registry ID == machine UUID
     9653                                     i_getId(),             // only media with registry ID == machine UUID
    105359654                                     strMachineFolder);
    105369655            // this throws HRESULT
     
    105389657
    105399658    // save snapshots
    10540     rc = saveAllSnapshots(config);
     9659    rc = i_saveAllSnapshots(config);
    105419660    if (FAILED(rc)) throw rc;
    105429661}
     
    105489667 * @return
    105499668 */
    10550 HRESULT Machine::saveAllSnapshots(settings::MachineConfigFile &config)
     9669HRESULT Machine::i_saveAllSnapshots(settings::MachineConfigFile &config)
    105519670{
    105529671    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
     
    105989717 *                        which happens to live in mHWData.
    105999718 */
    10600 HRESULT Machine::saveHardware(settings::Hardware &data, settings::Debugging *pDbg,
    10601                               settings::Autostart *pAutostart)
     9719HRESULT Machine::i_saveHardware(settings::Hardware &data, settings::Debugging *pDbg,
     9720                                settings::Autostart *pAutostart)
    106029721{
    106039722    HRESULT rc = S_OK;
     
    106109729             && mSSData->strStateFilePath.isEmpty()
    106119730           )
    10612             mHWData->mHWVersion = "2";  /** @todo Is this safe, to update mHWVersion here? If not some other point needs to be found where this can be done. */
     9731            mHWData->mHWVersion = "2";  /** @todo Is this safe, to update mHWVersion here? If not some
     9732                                            other point needs to be found where this can be done. */
    106139733
    106149734        data.strVersion = mHWData->mHWVersion;
     
    106299749        /* Standard and Extended CPUID leafs. */
    106309750        data.llCpuIdLeafs.clear();
    10631         for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); idx++)
     9751        for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); ++idx)
    106329752        {
    106339753            if (mHWData->mCpuIdStdLeafs[idx].ulId != UINT32_MAX)
    106349754                data.llCpuIdLeafs.push_back(mHWData->mCpuIdStdLeafs[idx]);
    106359755        }
    10636         for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); idx++)
     9756        for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); ++idx)
    106379757        {
    106389758            if (mHWData->mCpuIdExtLeafs[idx].ulId != UINT32_MAX)
     
    106479767        if (data.fCpuHotPlug)
    106489768        {
    10649             for (unsigned idx = 0; idx < data.cCPUs; idx++)
     9769            for (unsigned idx = 0; idx < data.cCPUs; ++idx)
    106509770            {
    106519771                if (mHWData->mCPUAttached[idx])
     
    106759795        data.paravirtProvider = mHWData->mParavirtProvider;
    106769796
     9797
    106779798        data.fEmulatedUSBCardReader = !!mHWData->mEmulatedUSBCardReaderEnabled;
    106789799
     
    106829803        // boot order
    106839804        data.mapBootOrder.clear();
    10684         for (size_t i = 0;
    10685              i < RT_ELEMENTS(mHWData->mBootOrder);
    10686              ++i)
     9805        for (size_t i = 0; i < RT_ELEMENTS(mHWData->mBootOrder); ++i)
    106879806            data.mapBootOrder[i] = mHWData->mBootOrder[i];
    106889807
     
    106989817        data.ulVideoCaptureFPS = mHWData->mVideoCaptureFPS;
    106999818        data.fVideoCaptureEnabled  = !!mHWData->mVideoCaptureEnabled;
    10700         for (unsigned i = 0; i < sizeof(data.u64VideoCaptureScreens) * 8; i++)
     9819        for (unsigned i = 0; i < sizeof(data.u64VideoCaptureScreens) * 8; ++i)
    107019820        {
    107029821            if (mHWData->maVideoCaptureScreens[i])
     
    107069825        }
    107079826        /* store relative video capture file if possible */
    10708         copyPathRelativeToMachine(mHWData->mVideoCaptureFile, data.strVideoCaptureFile);
     9827        i_copyPathRelativeToMachine(mHWData->mVideoCaptureFile, data.strVideoCaptureFile);
    107099828
    107109829        /* VRDEServer settings (optional) */
     
    107179836
    107189837        /* USB Controller (required) */
    10719         for (USBControllerList::const_iterator it = mUSBControllers->begin();
    10720              it != mUSBControllers->end();
    10721              ++it)
     9838        for (USBControllerList::const_iterator it = mUSBControllers->begin(); it != mUSBControllers->end(); ++it)
    107229839        {
    107239840            ComObjPtr<USBController> ctrl = *it;
     
    107569873        /* Serial ports */
    107579874        data.llSerialPorts.clear();
    10758         for (ULONG slot = 0;
    10759              slot < RT_ELEMENTS(mSerialPorts);
    10760              ++slot)
     9875        for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    107619876        {
    107629877            settings::SerialPort s;
     
    107709885        /* Parallel ports */
    107719886        data.llParallelPorts.clear();
    10772         for (ULONG slot = 0;
    10773              slot < RT_ELEMENTS(mParallelPorts);
    10774              ++slot)
     9887        for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot)
    107759888        {
    107769889            settings::ParallelPort p;
     
    1088810001 *  @param aNode    <StorageControllers> node to save the VM hardware configuration to.
    1088910002 */
    10890 HRESULT Machine::saveStorageControllers(settings::Storage &data)
     10003HRESULT Machine::i_saveStorageControllers(settings::Storage &data)
    1089110004{
    1089210005    data.llStorageControllers.clear();
     
    1093010043
    1093110044        /* save the devices now. */
    10932         rc = saveStorageDevices(pCtl, ctl);
     10045        rc = i_saveStorageDevices(pCtl, ctl);
    1093310046        ComAssertComRCRet(rc, rc);
    1093410047
     
    1094210055 *  Saves the hard disk configuration.
    1094310056 */
    10944 HRESULT Machine::saveStorageDevices(ComObjPtr<StorageController> aStorageController,
    10945                                     settings::StorageController &data)
     10057HRESULT Machine::i_saveStorageDevices(ComObjPtr<StorageController> aStorageController,
     10058                                      settings::StorageController &data)
    1094610059{
    1094710060    MediaData::AttachmentList atts;
    1094810061
    10949     HRESULT rc = getMediumAttachmentsOfController(Bstr(aStorageController->i_getName()).raw(), atts);
     10062    HRESULT rc = i_getMediumAttachmentsOfController(aStorageController->i_getName(), atts);
    1095010063    if (FAILED(rc)) return rc;
    1095110064
    1095210065    data.llAttachedDevices.clear();
    10953     for (MediaData::AttachmentList::const_iterator it = atts.begin();
     10066    for ( MediaData::AttachmentList::iterator it = atts.begin();
    1095410067         it != atts.end();
    1095510068         ++it)
    1095610069    {
    1095710070        settings::AttachedDevice dev;
    10958 
    10959         MediumAttachment *pAttach = *it;
     10071        IMediumAttachment *iA = *it;
     10072        MediumAttachment *pAttach = static_cast<MediumAttachment *>(iA);
    1096010073        Medium *pMedium = pAttach->i_getMedium();
    1096110074
     
    1099210105 *  @note Locks objects for writing.
    1099310106 */
    10994 HRESULT Machine::saveStateSettings(int aFlags)
     10107HRESULT Machine::i_saveStateSettings(int aFlags)
    1099510108{
    1099610109    if (aFlags == 0)
     
    1101710130            if (!mSSData->strStateFilePath.isEmpty())
    1101810131                /* try to make the file name relative to the settings file dir */
    11019                 copyPathRelativeToMachine(mSSData->strStateFilePath, mData->pMachineConfigFile->strStateFile);
     10132                i_copyPathRelativeToMachine(mSSData->strStateFilePath, mData->pMachineConfigFile->strStateFile);
    1102010133            else
    1102110134                mData->pMachineConfigFile->strStateFile.setNull();
     
    1105210165 * @param pMedium
    1105310166 */
    11054 void Machine::addMediumToRegistry(ComObjPtr<Medium> &pMedium)
     10167void Machine::i_addMediumToRegistry(ComObjPtr<Medium> &pMedium)
    1105510168{
    1105610169    /* Paranoia checks: do not hold machine or media tree locks. */
     
    1107210185    if (mData->pMachineConfigFile->canHaveOwnMediaRegistry())
    1107310186        // machine XML is VirtualBox 4.0 or higher:
    11074         uuid = getId();     // machine UUID
     10187        uuid = i_getId();     // machine UUID
    1107510188    else
    1107610189        uuid = mParent->i_getGlobalRegistryId(); // VirtualBox global registry UUID
     
    1111910232 * @note Locks this object and the media tree for writing.
    1112010233 */
    11121 HRESULT Machine::createImplicitDiffs(IProgress *aProgress,
    11122                                      ULONG aWeight,
    11123                                      bool aOnline)
     10234HRESULT Machine::i_createImplicitDiffs(IProgress *aProgress,
     10235                                       ULONG aWeight,
     10236                                       bool aOnline)
    1112410237{
    1112510238    LogFlowThisFunc(("aOnline=%d\n", aOnline));
     
    1124410357
    1124510358            Utf8Str strFullSnapshotFolder;
    11246             calculateFullPath(mUserData->s.strSnapshotFolder, strFullSnapshotFolder);
     10359            i_calculateFullPath(mUserData->s.strSnapshotFolder, strFullSnapshotFolder);
    1124710360
    1124810361            ComObjPtr<Medium> diff;
     
    1133910452 * @note Locks this object and the media tree for writing.
    1134010453 */
    11341 HRESULT Machine::deleteImplicitDiffs(bool aOnline)
     10454HRESULT Machine::i_deleteImplicitDiffs(bool aOnline)
    1134210455{
    1134310456    LogFlowThisFunc(("aOnline=%d\n", aOnline));
     
    1138810501        && oldState != MachineState_DeletingSnapshotPaused
    1138910502       )
    11390         setMachineState(MachineState_SettingUp);
     10503           i_setMachineState(MachineState_SettingUp);
    1139110504
    1139210505    // use appropriate locked media map (online or offline)
     
    1146610579
    1146710580            /* Was this medium attached before? */
    11468             if (!findAttachment(oldAtts, pMedium))
     10581            if (!i_findAttachment(oldAtts, pMedium))
    1146910582            {
    1147010583                /* no: de-associate */
     
    1150210615            alock.release();
    1150310616
    11504             for (MediaData::AttachmentList::const_iterator it = implicitAtts.begin();
    11505                  it != implicitAtts.end();
    11506                  ++it)
     10617            for (MediaData::AttachmentList::const_iterator it = implicitAtts.begin(); it != implicitAtts.end(); ++it)
    1150710618            {
    1150810619                // Remove medium associated with this attachment.
     
    1151510626                rc = pMedium->i_deleteStorage(NULL /*aProgress*/, true /*aWait*/);
    1151610627                // continue on delete failure, just collect error messages
    11517                 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt->i_getLogName(), pMedium->i_getLocationFull().c_str() ));
     10628                AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt->i_getLogName(),
     10629                                          pMedium->i_getLocationFull().c_str() ));
    1151810630                mrc = rc;
    1151910631            }
     
    1154110653
    1154210654    if (mData->mMachineState == MachineState_SettingUp)
    11543         setMachineState(oldState);
     10655        i_setMachineState(oldState);
    1154410656
    1154510657    /* unlock all hard disks we locked when there is no VM */
     
    1156710679 * @return
    1156810680 */
    11569 MediumAttachment* Machine::findAttachment(const MediaData::AttachmentList &ll,
    11570                                           IN_BSTR aControllerName,
    11571                                           LONG aControllerPort,
    11572                                           LONG aDevice)
    11573 {
    11574    for (MediaData::AttachmentList::const_iterator it = ll.begin();
    11575         it != ll.end();
    11576         ++it)
     10681MediumAttachment* Machine::i_findAttachment(const MediaData::AttachmentList &ll,
     10682                                            IN_BSTR aControllerName,
     10683                                            LONG aControllerPort,
     10684                                            LONG aDevice)
     10685{
     10686   for (MediaData::AttachmentList::const_iterator it = ll.begin(); it != ll.end(); ++it)
    1157710687    {
    1157810688        MediumAttachment *pAttach = *it;
     
    1159510705 * @return
    1159610706 */
    11597 MediumAttachment* Machine::findAttachment(const MediaData::AttachmentList &ll,
    11598                                           ComObjPtr<Medium> pMedium)
    11599 {
    11600    for (MediaData::AttachmentList::const_iterator it = ll.begin();
    11601         it != ll.end();
    11602         ++it)
     10707MediumAttachment* Machine::i_findAttachment(const MediaData::AttachmentList &ll,
     10708                                            ComObjPtr<Medium> pMedium)
     10709{
     10710   for (MediaData::AttachmentList::const_iterator it = ll.begin(); it != ll.end(); ++it)
    1160310711    {
    1160410712        MediumAttachment *pAttach = *it;
     
    1162210730 * @return
    1162310731 */
    11624 MediumAttachment* Machine::findAttachment(const MediaData::AttachmentList &ll,
    11625                                           Guid &id)
    11626 {
    11627    for (MediaData::AttachmentList::const_iterator it = ll.begin();
    11628          it != ll.end();
    11629          ++it)
     10732MediumAttachment* Machine::i_findAttachment(const MediaData::AttachmentList &ll,
     10733                                            Guid &id)
     10734{
     10735   for (MediaData::AttachmentList::const_iterator it = ll.begin(); it != ll.end(); ++it)
    1163010736    {
    1163110737        MediumAttachment *pAttach = *it;
     
    1164410750 * @param pAttach Medium attachment to detach.
    1164510751 * @param writeLock Machine write lock which the caller must have locked once. This may be released temporarily in here.
    11646  * @param pSnapshot If NULL, then the detachment is for the current machine. Otherwise this is for a SnapshotMachine, and this must be its snapshot.
     10752 * @param pSnapshot If NULL, then the detachment is for the current machine. Otherwise this is for a
     10753 * SnapshotMachine, and this must be its snapshot.
    1164710754 * @return
    1164810755 */
    11649 HRESULT Machine::detachDevice(MediumAttachment *pAttach,
    11650                               AutoWriteLock &writeLock,
    11651                               Snapshot *pSnapshot)
     10756HRESULT Machine::i_detachDevice(MediumAttachment *pAttach,
     10757                                AutoWriteLock &writeLock,
     10758                                Snapshot *pSnapshot)
    1165210759{
    1165310760    ComObjPtr<Medium> oldmedium = pAttach->i_getMedium();
     
    1166910776         * protect with the special state */
    1167010777        MachineState_T oldState = mData->mMachineState;
    11671         setMachineState(MachineState_SettingUp);
     10778        i_setMachineState(MachineState_SettingUp);
    1167210779
    1167310780        writeLock.release();
     
    1167810785        writeLock.acquire();
    1167910786
    11680         setMachineState(oldState);
     10787        i_setMachineState(oldState);
    1168110788
    1168210789        if (FAILED(rc)) return rc;
    1168310790    }
    1168410791
    11685     setModified(IsModified_Storage);
     10792    i_setModified(IsModified_Storage);
    1168610793    mMediaData.backup();
    1168710794    mMediaData->mAttachments.remove(pAttach);
     
    1170310810 * Goes thru all media of the given list and
    1170410811 *
    11705  * 1) calls detachDevice() on each of them for this machine and
     10812 * 1) calls i_detachDevice() on each of them for this machine and
    1170610813 * 2) adds all Medium objects found in the process to the given list,
    1170710814 *    depending on cleanupMode.
     
    1171510822 *
    1171610823 * Requires caller and locking. The machine lock must be passed in because it
    11717  * will be passed on to detachDevice which needs it for temporary unlocking.
     10824 * will be passed on to i_detachDevice which needs it for temporary unlocking.
    1171810825 *
    11719  * @param writeLock Machine lock from top-level caller; this gets passed to detachDevice.
     10826 * @param writeLock Machine lock from top-level caller; this gets passed to i_detachDevice.
    1172010827 * @param pSnapshot Must be NULL when called for a "real" Machine or a snapshot object if called for a SnapshotMachine.
    11721  * @param cleanupMode If DetachAllReturnHardDisksOnly, only hard disk media get added to llMedia; if Full, then all media get added;
     10828 * @param cleanupMode If DetachAllReturnHardDisksOnly, only hard disk media get added to llMedia; if
     10829 * Full, then all media get added;
    1172210830 *          otherwise no media get added.
    1172310831 * @param llMedia Caller's list to receive Medium objects which got detached so caller can close() them, depending on cleanupMode.
    1172410832 * @return
    1172510833 */
    11726 HRESULT Machine::detachAllMedia(AutoWriteLock &writeLock,
    11727                                 Snapshot *pSnapshot,
    11728                                 CleanupMode_T cleanupMode,
    11729                                 MediaList &llMedia)
     10834HRESULT Machine::i_detachAllMedia(AutoWriteLock &writeLock,
     10835                                  Snapshot *pSnapshot,
     10836                                  CleanupMode_T cleanupMode,
     10837                                  MediaList &llMedia)
    1173010838{
    1173110839    Assert(isWriteLockOnCurrentThread());
     
    1173310841    HRESULT rc;
    1173410842
    11735     // make a temporary list because detachDevice invalidates iterators into
     10843    // make a temporary list because i_detachDevice invalidates iterators into
    1173610844    // mMediaData->mAttachments
    1173710845    MediaData::AttachmentList llAttachments2 = mMediaData->mAttachments;
    1173810846
    11739     for (MediaData::AttachmentList::iterator it = llAttachments2.begin();
    11740          it != llAttachments2.end();
    11741          ++it)
     10847    for (MediaData::AttachmentList::iterator it = llAttachments2.begin(); it != llAttachments2.end(); ++it)
    1174210848    {
    1174310849        ComObjPtr<MediumAttachment> &pAttach = *it;
     
    1178510891
    1178610892        // real machine: then we need to use the proper method
    11787         rc = detachDevice(pAttach, writeLock, pSnapshot);
     10893        rc = i_detachDevice(pAttach, writeLock, pSnapshot);
    1178810894
    1178910895        if (FAILED(rc))
     
    1180810914 * @note Locks this object for writing!
    1180910915 */
    11810 void Machine::commitMedia(bool aOnline /*= false*/)
     10916void Machine::i_commitMedia(bool aOnline /*= false*/)
    1181110917{
    1181210918    AutoCaller autoCaller(this);
     
    1188310989        {
    1188410990            /* was this medium attached before? */
    11885             for (MediaData::AttachmentList::iterator oldIt = oldAtts.begin();
    11886                  oldIt != oldAtts.end();
    11887                  ++oldIt)
     10991            for (MediaData::AttachmentList::iterator oldIt = oldAtts.begin(); oldIt != oldAtts.end(); ++oldIt)
    1188810992            {
    1188910993                MediumAttachment *pOldAttach = *oldIt;
     
    1190211006    /* enumerate remaining old attachments and de-associate from the
    1190311007     * current machine state */
    11904     for (MediaData::AttachmentList::const_iterator it = oldAtts.begin();
    11905          it != oldAtts.end();
    11906          ++it)
     11008    for (MediaData::AttachmentList::const_iterator it = oldAtts.begin(); it != oldAtts.end(); ++it)
    1190711009    {
    1190811010        MediumAttachment *pAttach = *it;
     
    1195511057    mMediaData.commit();
    1195611058
    11957     if (isSessionMachine())
     11059    if (i_isSessionMachine())
    1195811060    {
    1195911061        /*
     
    1197111073             it != mMediaData->mAttachments.end();
    1197211074             ++it)
    11973         {
    1197411075            (*it)->i_updateParentMachine(mPeer);
    11975         }
    1197611076
    1197711077        /* attach new data to the primary machine and reshare it */
     
    1199011090 * @note Locks this object for writing!
    1199111091 */
    11992 void Machine::rollbackMedia()
     11092void Machine::i_rollbackMedia()
    1199311093{
    1199411094    AutoCaller autoCaller(this);
     
    1203811138    /** @todo convert all this Machine-based voodoo to MediumAttachment
    1203911139     * based rollback logic. */
    12040     deleteImplicitDiffs(Global::IsOnline(mData->mMachineState));
     11140    i_deleteImplicitDiffs(Global::IsOnline(mData->mMachineState));
    1204111141
    1204211142    return;
     
    1205411154 *  @note Not thread safe (must be called from this object's lock).
    1205511155 */
    12056 bool Machine::isInOwnDir(Utf8Str *aSettingsDir /* = NULL */) const
     11156bool Machine::i_isInOwnDir(Utf8Str *aSettingsDir /* = NULL */) const
    1205711157{
    1205811158    Utf8Str strMachineDirName(mData->m_strConfigFileFull);  // path/to/machinesfolder/vmname/vmname.vbox
     
    1208111181 * @note Locks objects for writing!
    1208211182 */
    12083 void Machine::rollback(bool aNotify)
     11183void Machine::i_rollback(bool aNotify)
    1208411184{
    1208511185    AutoCaller autoCaller(this);
     
    1216111261
    1216211262    if (mData->flModifications & IsModified_Storage)
    12163         rollbackMedia();
     11263        i_rollbackMedia();
    1216411264
    1216511265    if (mBIOSSettings)
     
    1218511285
    1218611286    if (mData->flModifications & IsModified_NetworkAdapters)
    12187         for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
     11287        for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    1218811288            if (    mNetworkAdapters[slot]
    1218911289                 && mNetworkAdapters[slot]->i_isModified())
     
    1219411294
    1219511295    if (mData->flModifications & IsModified_SerialPorts)
    12196         for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
     11296        for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    1219711297            if (    mSerialPorts[slot]
    1219811298                 && mSerialPorts[slot]->i_isModified())
     
    1220311303
    1220411304    if (mData->flModifications & IsModified_ParallelPorts)
    12205         for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
     11305        for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot)
    1220611306            if (    mParallelPorts[slot]
    1220711307                 && mParallelPorts[slot]->i_isModified())
     
    1222011320
    1222111321        if (flModifications & IsModified_SharedFolders)
    12222             that->onSharedFolderChange();
     11322            that->i_onSharedFolderChange();
    1222311323
    1222411324        if (flModifications & IsModified_VRDEServer)
    12225             that->onVRDEServerChange(/* aRestart */ TRUE);
     11325            that->i_onVRDEServerChange(/* aRestart */ TRUE);
    1222611326        if (flModifications & IsModified_USB)
    12227             that->onUSBControllerChange();
    12228 
    12229         for (ULONG slot = 0; slot < networkAdapters.size(); slot++)
     11327            that->i_onUSBControllerChange();
     11328
     11329        for (ULONG slot = 0; slot < networkAdapters.size(); ++slot)
    1223011330            if (networkAdapters[slot])
    12231                 that->onNetworkAdapterChange(networkAdapters[slot], FALSE);
    12232         for (ULONG slot = 0; slot < RT_ELEMENTS(serialPorts); slot++)
     11331                that->i_onNetworkAdapterChange(networkAdapters[slot], FALSE);
     11332        for (ULONG slot = 0; slot < RT_ELEMENTS(serialPorts); ++slot)
    1223311333            if (serialPorts[slot])
    12234                 that->onSerialPortChange(serialPorts[slot]);
    12235         for (ULONG slot = 0; slot < RT_ELEMENTS(parallelPorts); slot++)
     11334                that->i_onSerialPortChange(serialPorts[slot]);
     11335        for (ULONG slot = 0; slot < RT_ELEMENTS(parallelPorts); ++slot)
    1223611336            if (parallelPorts[slot])
    12237                 that->onParallelPortChange(parallelPorts[slot]);
     11337                that->i_onParallelPortChange(parallelPorts[slot]);
    1223811338
    1223911339        if (flModifications & IsModified_Storage)
    12240             that->onStorageControllerChange();
     11340            that->i_onStorageControllerChange();
    1224111341
    1224211342#if 0
     
    1225411354 * @note Locks this object and children for writing.
    1225511355 */
    12256 void Machine::commit()
     11356void Machine::i_commit()
    1225711357{
    1225811358    AutoCaller autoCaller(this);
     
    1227311373
    1227411374    if (mMediaData.isBackedUp())
    12275         commitMedia(Global::IsOnline(mData->mMachineState));
     11375        i_commitMedia(Global::IsOnline(mData->mMachineState));
    1227611376
    1227711377    mBIOSSettings->i_commit();
     
    1230811408        }
    1230911409        /* uninit any no longer needed network adapters */
    12310         for (size_t slot = newSize; slot < mNetworkAdapters.size(); slot++)
     11410        for (size_t slot = newSize; slot < mNetworkAdapters.size(); ++slot)
    1231111411            mNetworkAdapters[slot]->uninit();
    12312         for (size_t slot = newSize; slot < mPeer->mNetworkAdapters.size(); slot++)
     11412        for (size_t slot = newSize; slot < mPeer->mNetworkAdapters.size(); ++slot)
    1231311413        {
    1231411414            if (mPeer->mNetworkAdapters[slot])
     
    1232711427    }
    1232811428    if (commitNetworkAdapters)
    12329     {
    12330         for (size_t slot = 0; slot < mNetworkAdapters.size(); slot++)
     11429        for (size_t slot = 0; slot < mNetworkAdapters.size(); ++slot)
    1233111430            mNetworkAdapters[slot]->i_commit();
    12332     }
    12333 
    12334     for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
     11431
     11432    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    1233511433        mSerialPorts[slot]->i_commit();
    12336     for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
     11434    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot)
    1233711435        mParallelPorts[slot]->i_commit();
    1233811436
     
    1247911577    }
    1248011578
    12481     if (isSessionMachine())
     11579    if (i_isSessionMachine())
    1248211580    {
    1248311581        /* attach new data to the primary machine and reshare it */
     
    1250211600 *       unsaved.
    1250311601 */
    12504 void Machine::copyFrom(Machine *aThat)
    12505 {
    12506     AssertReturnVoid(!isSnapshotMachine());
    12507     AssertReturnVoid(aThat->isSnapshotMachine());
     11602void Machine::i_copyFrom(Machine *aThat)
     11603{
     11604    AssertReturnVoid(!i_isSnapshotMachine());
     11605    AssertReturnVoid(aThat->i_isSnapshotMachine());
    1250811606
    1250911607    AssertReturnVoid(!Global::IsOnline(mData->mMachineState));
     
    1251911617        ComObjPtr<SharedFolder> folder;
    1252011618        folder.createObject();
    12521         HRESULT rc = folder->initCopy(getMachine(), *it);
     11619        HRESULT rc = folder->initCopy(i_getMachine(), *it);
    1252211620        AssertComRC(rc);
    1252311621        *it = folder;
     
    1255711655
    1255811656    mNetworkAdapters.resize(aThat->mNetworkAdapters.size());
    12559     for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
     11657    for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    1256011658        mNetworkAdapters[slot]->i_copyFrom(aThat->mNetworkAdapters[slot]);
    12561     for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
     11659    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    1256211660        mSerialPorts[slot]->i_copyFrom(aThat->mSerialPorts[slot]);
    12563     for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
     11661    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot)
    1256411662        mParallelPorts[slot]->i_copyFrom(aThat->mParallelPorts[slot]);
    1256511663}
     
    1257211670 * @param   enmCtrlType    The controller type to check for.
    1257311671 */
    12574 bool Machine::isControllerHotplugCapable(StorageControllerType_T enmCtrlType)
     11672bool Machine::i_isControllerHotplugCapable(StorageControllerType_T enmCtrlType)
    1257511673{
    1257611674    ComPtr<ISystemProperties> systemProperties;
     
    1258711685#ifdef VBOX_WITH_RESOURCE_USAGE_API
    1258811686
    12589 void Machine::getDiskList(MediaList &list)
     11687void Machine::i_getDiskList(MediaList &list)
    1259011688{
    1259111689    for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     
    1260711705}
    1260811706
    12609 void Machine::registerMetrics(PerformanceCollector *aCollector, Machine *aMachine, RTPROCESS pid)
     11707void Machine::i_registerMetrics(PerformanceCollector *aCollector, Machine *aMachine, RTPROCESS pid)
    1261011708{
    1261111709    AssertReturnVoid(isWriteLockOnCurrentThread());
     
    1263411732    aCollector->registerBaseMetric(ramUsage);
    1263511733    MediaList disks;
    12636     getDiskList(disks);
     11734    i_getDiskList(disks);
    1263711735    pm::BaseMetric *diskUsage = new pm::MachineDiskUsage(hal, aMachine, disks,
    1263811736                                                         diskUsageUsed);
     
    1269011788    pm::SubMetric *guestMemBalloon = new pm::SubMetric("Guest/RAM/Usage/Balloon",  "Amount of ballooned physical guest RAM.");
    1269111789    pm::SubMetric *guestMemShared = new pm::SubMetric("Guest/RAM/Usage/Shared",  "Amount of shared physical guest RAM.");
    12692     pm::SubMetric *guestMemCache = new pm::SubMetric("Guest/RAM/Usage/Cache",        "Total amount of guest (disk) cache memory.");
    12693 
    12694     pm::SubMetric *guestPagedTotal = new pm::SubMetric("Guest/Pagefile/Usage/Total",    "Total amount of space in the page file.");
     11790    pm::SubMetric *guestMemCache = new pm::SubMetric(
     11791                                                "Guest/RAM/Usage/Cache",        "Total amount of guest (disk) cache memory.");
     11792
     11793    pm::SubMetric *guestPagedTotal = new pm::SubMetric(
     11794                                         "Guest/Pagefile/Usage/Total",    "Total amount of space in the page file.");
    1269511795
    1269611796    /* Create and register base metrics */
     
    1276511865}
    1276611866
    12767 void Machine::unregisterMetrics(PerformanceCollector *aCollector, Machine *aMachine)
     11867void Machine::i_unregisterMetrics(PerformanceCollector *aCollector, Machine *aMachine)
    1276811868{
    1276911869    AssertReturnVoid(isWriteLockOnCurrentThread());
     
    1288911989    mAudioAdapter->init(this, aMachine->mAudioAdapter);
    1289011990    /* create a list of serial ports that will be mutable */
    12891     for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
     11991    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    1289211992    {
    1289311993        unconst(mSerialPorts[slot]).createObject();
     
    1289511995    }
    1289611996    /* create a list of parallel ports that will be mutable */
    12897     for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
     11997    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); ++slot)
    1289811998    {
    1289911999        unconst(mParallelPorts[slot]).createObject();
     
    1290712007    /* create a list of network adapters that will be mutable */
    1290812008    mNetworkAdapters.resize(aMachine->mNetworkAdapters.size());
    12909     for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
     12009    for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    1291012010    {
    1291112011        unconst(mNetworkAdapters[slot]).createObject();
     
    1301812118#ifdef VBOX_WITH_RESOURCE_USAGE_API
    1301912119    /*
    13020      * It is safe to call Machine::unregisterMetrics() here because
     12120     * It is safe to call Machine::i_unregisterMetrics() here because
    1302112121     * PerformanceCollector::samplerCallback no longer accesses guest methods
    1302212122     * holding the lock.
    1302312123     */
    13024     unregisterMetrics(mParent->i_performanceCollector(), mPeer);
     12124    i_unregisterMetrics(mParent->i_performanceCollector(), mPeer);
    1302512125    /* The guest must be unregistered after its metrics (@bugref{5949}). */
    1302612126    LogAleksey(("{%p} " LOG_FN_FMT ": mCollectorGuest=%p\n",
     
    1304112141        /* reset the state to Aborted */
    1304212142        if (mData->mMachineState != MachineState_Aborted)
    13043             setMachineState(MachineState_Aborted);
     12143            i_setMachineState(MachineState_Aborted);
    1304412144    }
    1304512145
     
    1304812148    {
    1304912149        LogWarningThisFunc(("Discarding unsaved settings changes!\n"));
    13050         rollback(false /* aNotify */);
     12150        i_rollback(false /* aNotify */);
    1305112151    }
    1305212152
     
    1306412164        /* delete all differencing hard disks created (this will also attach
    1306512165         * their parents back by rolling back mMediaData) */
    13066         rollbackMedia();
     12166        i_rollbackMedia();
    1306712167
    1306812168        // delete the saved state file (it might have been already created)
     
    1307112171        Utf8Str strStateFile = mConsoleTaskData.mSnapshot->i_getStateFilePath();
    1307212172        mConsoleTaskData.mSnapshot->uninit();
    13073         releaseSavedStateFile(strStateFile, NULL /* pSnapshotToIgnore */ );
     12173        i_releaseSavedStateFile(strStateFile, NULL /* pSnapshotToIgnore */ );
    1307412174    }
    1307512175
     
    1310812208    for (; miNATNetworksStarted > 0; miNATNetworksStarted--)
    1310912209    {
    13110         for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
     12210        for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    1311112211        {
    1311212212            NetworkAttachmentType_T type;
    1311312213            HRESULT hrc;
    1311412214
    13115             hrc = mNetworkAdapters[slot]->COMGETTER(AttachmentType)(&type);
    13116             if (   SUCCEEDED(hrc)
    13117                 && type == NetworkAttachmentType_NATNetwork)
    13118             {
    13119                 Bstr name;
    13120                 hrc = mNetworkAdapters[slot]->COMGETTER(NATNetwork)(name.asOutParam());
    13121                 if (SUCCEEDED(hrc))
    13122                 {
    13123                     multilock.release();
    13124                     LogRel(("VM '%s' stops using NAT network '%ls'\n",
    13125                             mUserData->s.strName.c_str(), name.raw()));
    13126                     mParent->i_natNetworkRefDec(name.raw());
    13127                     multilock.acquire();
     12215             hrc = mNetworkAdapters[slot]->COMGETTER(AttachmentType)(&type);
     12216             if (   SUCCEEDED(hrc)
     12217                 && type == NetworkAttachmentType_NATNetwork)
     12218             {
     12219                 Bstr name;
     12220                 hrc = mNetworkAdapters[slot]->COMGETTER(NATNetwork)(name.asOutParam());
     12221                 if (SUCCEEDED(hrc))
     12222                 {
     12223                     multilock.release();
     12224                     LogRel(("VM '%s' stops using NAT network '%ls'\n",
     12225                             mUserData->s.strName.c_str(), name.raw()));
     12226                     mParent->i_natNetworkRefDec(name.raw());
     12227                     multilock.acquire();
    1312812228                }
    13129             }
    13130         }
    13131     }
     12229             }
     12230         }
     12231     }
    1313212232
    1313312233    /*
     
    1316312263        else
    1316412264            mData->mSession.mProgress->i_notifyComplete(E_FAIL,
    13165                                                        COM_IIDOF(ISession),
    13166                                                        getComponentName(),
    13167                                                        tr("The VM session was aborted"));
     12265                                                        COM_IIDOF(ISession),
     12266                                                        getComponentName(),
     12267                                                        tr("The VM session was aborted"));
    1316812268        mData->mSession.mProgress.setNull();
    1316912269    }
     
    1327512375
    1327612376/**
    13277  *  @note Locks the same as #setMachineState() does.
     12377 *  @note Locks the same as #i_setMachineState() does.
    1327812378 */
    1327912379STDMETHODIMP SessionMachine::UpdateState(MachineState_T aMachineState)
    1328012380{
    13281     return setMachineState(aMachineState);
     12381    return i_setMachineState(aMachineState);
    1328212382}
    1328312383
     
    1330312403    if (miNATNetworksStarted < 1)
    1330412404    {
    13305         for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
     12405        for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    1330612406        {
    1330712407            NetworkAttachmentType_T type;
     
    1335012450    if (mData->mSession.mProgress)
    1335112451    {
    13352         mData->mSession.mProgress->i_notifyComplete((HRESULT)iResult);
     12452        mData->mSession.mProgress->notifyComplete((HRESULT)iResult);
    1335312453        mData->mSession.mProgress.setNull();
    1335412454    }
     
    1336012460         * now to offer the performance metrics for a running machine
    1336112461         * object. Doing it earlier wouldn't be safe. */
    13362         registerMetrics(mParent->i_performanceCollector(), mPeer,
    13363                         mData->mSession.mPID);
     12462        i_registerMetrics(mParent->i_performanceCollector(), mPeer,
     12463                          mData->mSession.mPID);
    1336412464#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    1336512465    }
     
    1337512475    LogFlowThisFuncEnter();
    1337612476
    13377     CheckComArgOutPointerValid(aProgress);
    13378 
    1337912477    AutoCaller autoCaller(this);
    1338012478    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
     
    1338812486    ComObjPtr<Progress> pProgress;
    1338912487    pProgress.createObject();
    13390     pProgress->init(getVirtualBox(),
     12488    pProgress->init(i_getVirtualBox(),
    1339112489                    static_cast<IMachine *>(this) /* aInitiator */,
    1339212490                    Bstr(tr("Stopping the virtual machine")).raw(),
     
    1339812496
    1339912497    /* set the state to Stopping (this is expected by Console::PowerDown()) */
    13400     setMachineState(MachineState_Stopping);
     12498    i_setMachineState(MachineState_Stopping);
    1340112499
    1340212500    pProgress.queryInterfaceTo(aProgress);
     
    1342912527     */
    1343012528    if (FAILED(iResult))
    13431         setMachineState(mConsoleTaskData.mLastState);
     12529        i_setMachineState(mConsoleTaskData.mLastState);
    1343212530
    1343312531    /* notify the progress object about operation completion */
     
    1346712565{
    1346812566    LogFlowThisFunc(("\n"));
    13469 
    13470     CheckComArgNotNull(aUSBDevice);
    13471     CheckComArgOutPointerValid(aMatched);
    1347212567
    1347312568    AutoCaller autoCaller(this);
     
    1363912734            /* finalize the progress, someone might wait if a frontend
    1364012735             * closes the session before powering on the VM. */
    13641             mData->mSession.mProgress->i_notifyComplete(E_FAIL,
    13642                                                         COM_IIDOF(ISession),
    13643                                                         getComponentName(),
    13644                                                         tr("The VM session was closed before any attempt to power it on"));
     12736            mData->mSession.mProgress->notifyComplete(E_FAIL,
     12737                                                      COM_IIDOF(ISession),
     12738                                                      getComponentName(),
     12739                                                      tr("The VM session was closed before any attempt to power it on"));
    1364512740            mData->mSession.mProgress.setNull();
    1364612741        }
     
    1371012805    ComObjPtr<Progress> pProgress;
    1371112806    pProgress.createObject();
    13712     pProgress->init(getVirtualBox(),
     12807    pProgress->init(i_getVirtualBox(),
    1371312808                    static_cast<IMachine *>(this) /* aInitiator */,
    1371412809                    Bstr(tr("Saving the execution state of the virtual machine")).raw(),
     
    1371812813    /* stateFilePath is null when the machine is not running */
    1371912814    if (mData->mMachineState == MachineState_Paused)
    13720         composeSavedStateFilename(strStateFilePath);
     12815        i_composeSavedStateFilename(strStateFilePath);
    1372112816
    1372212817    /* fill in the console task data */
     
    1372612821
    1372712822    /* set the state to Saving (this is expected by Console::SaveState()) */
    13728     setMachineState(MachineState_Saving);
     12823    i_setMachineState(MachineState_Saving);
    1372912824
    1373012825    strStateFilePath.cloneTo(aStateFilePath);
     
    1376012855     */
    1376112856    if (FAILED(iResult))
    13762         setMachineState(mConsoleTaskData.mLastState);
     12857        i_setMachineState(mConsoleTaskData.mLastState);
    1376312858
    1376412859    return endSavingState(iResult, aErrMsg);
     
    1378512880
    1378612881    Utf8Str stateFilePathFull = aSavedStateFile;
    13787     int vrc = calculateFullPath(stateFilePathFull, stateFilePathFull);
     12882    int vrc = i_calculateFullPath(stateFilePathFull, stateFilePathFull);
    1378812883    if (RT_FAILURE(vrc))
    1378912884        return setError(VBOX_E_FILE_ERROR,
     
    1379412889    mSSData->strStateFilePath = stateFilePathFull;
    1379512890
    13796     /* The below setMachineState() will detect the state transition and will
     12891    /* The below i_setMachineState() will detect the state transition and will
    1379712892     * update the settings file */
    1379812893
    13799     return setMachineState(MachineState_Saved);
     12894    return i_setMachineState(MachineState_Saved);
    1380012895}
    1380112896
     
    1385612951STDMETHODIMP SessionMachine::PushGuestProperty(IN_BSTR aName,
    1385712952                                               IN_BSTR aValue,
    13858                                                LONG64 aTimestamp,
     12953                                               LONG64  aTimestamp,
    1385912954                                               IN_BSTR aFlags)
    1386012955{
     
    1390813003        }
    1390913004
    13910         setModified(IsModified_MachineData);
     13005        i_setModified(IsModified_MachineData);
    1391113006        mHWData.backup();
    1391213007
     
    1398413079STDMETHODIMP SessionMachine::UnlockMedia()
    1398513080{
    13986     unlockMedia();
    13987     return S_OK;
     13081    HRESULT hrc = unlockMedia();
     13082    return hrc;
    1398813083}
    1398913084
     
    1403013125        oldmedium = pAttach->i_getMedium();
    1403113126
    14032         setModified(IsModified_Storage);
     13127        i_setModified(IsModified_Storage);
    1403313128        mMediaData.backup();
    1403413129
    1403513130        // The backup operation makes the pAttach reference point to the
    1403613131        // old settings. Re-get the correct reference.
    14037         pAttach = findAttachment(mMediaData->mAttachments,
    14038                                  ctrlName.raw(),
    14039                                  lPort,
    14040                                  lDevice);
     13132        pAttach = i_findAttachment(mMediaData->mAttachments,
     13133                                   ctrlName.raw(),
     13134                                   lPort,
     13135                                   lDevice);
    1404113136
    1404213137        {
     
    1405213147        }
    1405313148
    14054         setModified(IsModified_Storage);
     13149        i_setModified(IsModified_Storage);
    1405513150    }
    1405613151    else
     
    1408613181 * @note Locks this object for writing.
    1408713182 */
    14088 bool SessionMachine::checkForDeath()
     13183bool SessionMachine::i_checkForDeath()
    1408913184{
    1409013185    Uninit::Reason reason;
     
    1412613221}
    1412713222
    14128 void SessionMachine::getTokenId(Utf8Str &strTokenId)
     13223void SessionMachine::i_getTokenId(Utf8Str &strTokenId)
    1412913224{
    1413013225    LogFlowThisFunc(("\n"));
     
    1414013235}
    1414113236#else /* VBOX_WITH_GENERIC_SESSION_WATCHER */
    14142 IToken *SessionMachine::getToken()
     13237IToken *SessionMachine::i_getToken()
    1414313238{
    1414413239    LogFlowThisFunc(("\n"));
     
    1415513250#endif /* VBOX_WITH_GENERIC_SESSION_WATCHER */
    1415613251
    14157 Machine::ClientToken *SessionMachine::getClientToken()
     13252Machine::ClientToken *SessionMachine::i_getClientToken()
    1415813253{
    1415913254    LogFlowThisFunc(("\n"));
     
    1416913264 *  @note Locks this object for reading.
    1417013265 */
    14171 HRESULT SessionMachine::onNetworkAdapterChange(INetworkAdapter *networkAdapter, BOOL changeAdapter)
     13266HRESULT SessionMachine::i_onNetworkAdapterChange(INetworkAdapter *networkAdapter, BOOL changeAdapter)
    1417213267{
    1417313268    LogFlowThisFunc(("\n"));
     
    1419213287 *  @note Locks this object for reading.
    1419313288 */
    14194 HRESULT SessionMachine::onNATRedirectRuleChange(ULONG ulSlot, BOOL aNatRuleRemove, IN_BSTR aRuleName,
    14195                                  NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort, IN_BSTR aGuestIp, LONG aGuestPort)
     13289HRESULT SessionMachine::i_onNATRedirectRuleChange(ULONG ulSlot, BOOL aNatRuleRemove, IN_BSTR aRuleName,
     13290                                                  NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort,
     13291                                                  IN_BSTR aGuestIp, LONG aGuestPort)
    1419613292{
    1419713293    LogFlowThisFunc(("\n"));
     
    1421313309     */
    1421413310
    14215     mParent->i_onNatRedirectChange(getId(), ulSlot, RT_BOOL(aNatRuleRemove), aRuleName, aProto, aHostIp, (uint16_t)aHostPort, aGuestIp, (uint16_t)aGuestPort);
     13311    mParent->i_onNatRedirectChange(i_getId(), ulSlot, RT_BOOL(aNatRuleRemove), aRuleName, aProto, aHostIp,
     13312                                   (uint16_t)aHostPort, aGuestIp, (uint16_t)aGuestPort);
    1421613313    return S_OK;
    1421713314}
     
    1422013317 *  @note Locks this object for reading.
    1422113318 */
    14222 HRESULT SessionMachine::onSerialPortChange(ISerialPort *serialPort)
     13319HRESULT SessionMachine::i_onSerialPortChange(ISerialPort *serialPort)
    1422313320{
    1422413321    LogFlowThisFunc(("\n"));
     
    1424313340 *  @note Locks this object for reading.
    1424413341 */
    14245 HRESULT SessionMachine::onParallelPortChange(IParallelPort *parallelPort)
     13342HRESULT SessionMachine::i_onParallelPortChange(IParallelPort *parallelPort)
    1424613343{
    1424713344    LogFlowThisFunc(("\n"));
     
    1426613363 *  @note Locks this object for reading.
    1426713364 */
    14268 HRESULT SessionMachine::onStorageControllerChange()
     13365HRESULT SessionMachine::i_onStorageControllerChange()
    1426913366{
    1427013367    LogFlowThisFunc(("\n"));
     
    1428913386 *  @note Locks this object for reading.
    1429013387 */
    14291 HRESULT SessionMachine::onMediumChange(IMediumAttachment *aAttachment, BOOL aForce)
     13388HRESULT SessionMachine::i_onMediumChange(IMediumAttachment *aAttachment, BOOL aForce)
    1429213389{
    1429313390    LogFlowThisFunc(("\n"));
     
    1431213409 *  @note Locks this object for reading.
    1431313410 */
    14314 HRESULT SessionMachine::onCPUChange(ULONG aCPU, BOOL aRemove)
     13411HRESULT SessionMachine::i_onCPUChange(ULONG aCPU, BOOL aRemove)
    1431513412{
    1431613413    LogFlowThisFunc(("\n"));
     
    1433213429}
    1433313430
    14334 HRESULT SessionMachine::onCPUExecutionCapChange(ULONG aExecutionCap)
     13431HRESULT SessionMachine::i_onCPUExecutionCapChange(ULONG aExecutionCap)
    1433513432{
    1433613433    LogFlowThisFunc(("\n"));
     
    1435513452 *  @note Locks this object for reading.
    1435613453 */
    14357 HRESULT SessionMachine::onVRDEServerChange(BOOL aRestart)
     13454HRESULT SessionMachine::i_onVRDEServerChange(BOOL aRestart)
    1435813455{
    1435913456    LogFlowThisFunc(("\n"));
     
    1437813475 * @note Locks this object for reading.
    1437913476 */
    14380 HRESULT SessionMachine::onVideoCaptureChange()
     13477HRESULT SessionMachine::i_onVideoCaptureChange()
    1438113478{
    1438213479    LogFlowThisFunc(("\n"));
     
    1440113498 *  @note Locks this object for reading.
    1440213499 */
    14403 HRESULT SessionMachine::onUSBControllerChange()
     13500HRESULT SessionMachine::i_onUSBControllerChange()
    1440413501{
    1440513502    LogFlowThisFunc(("\n"));
     
    1442413521 *  @note Locks this object for reading.
    1442513522 */
    14426 HRESULT SessionMachine::onSharedFolderChange()
     13523HRESULT SessionMachine::i_onSharedFolderChange()
    1442713524{
    1442813525    LogFlowThisFunc(("\n"));
     
    1444713544 * @note Locks this object for reading.
    1444813545 */
    14449 HRESULT SessionMachine::onClipboardModeChange(ClipboardMode_T aClipboardMode)
     13546HRESULT SessionMachine::i_onClipboardModeChange(ClipboardMode_T aClipboardMode)
    1445013547{
    1445113548    LogFlowThisFunc(("\n"));
     
    1447013567 * @note Locks this object for reading.
    1447113568 */
    14472 HRESULT SessionMachine::onDnDModeChange(DnDMode_T aDnDMode)
     13569HRESULT SessionMachine::i_onDnDModeChange(DnDMode_T aDnDMode)
    1447313570{
    1447413571    LogFlowThisFunc(("\n"));
     
    1449313590 *  @note Locks this object for reading.
    1449413591 */
    14495 HRESULT SessionMachine::onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup)
     13592HRESULT SessionMachine::i_onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup)
    1449613593{
    1449713594    LogFlowThisFunc(("\n"));
     
    1451613613 *  @note Locks this object for reading.
    1451713614 */
    14518 HRESULT SessionMachine::onStorageDeviceChange(IMediumAttachment *aAttachment, BOOL aRemove, BOOL aSilent)
     13615HRESULT SessionMachine::i_onStorageDeviceChange(IMediumAttachment *aAttachment, BOOL aRemove, BOOL aSilent)
    1451913616{
    1452013617    LogFlowThisFunc(("\n"));
     
    1454213639 *  @note locks this object for reading.
    1454313640 */
    14544 bool SessionMachine::hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
     13641bool SessionMachine::i_hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
    1454513642{
    1454613643    AutoCaller autoCaller(this);
     
    1457613673 *  @note The calls shall hold no locks. Will temporarily lock this object for reading.
    1457713674 */
    14578 HRESULT SessionMachine::onUSBDeviceAttach(IUSBDevice *aDevice,
    14579                                           IVirtualBoxErrorInfo *aError,
    14580                                           ULONG aMaskedIfs)
     13675HRESULT SessionMachine::i_onUSBDeviceAttach(IUSBDevice *aDevice,
     13676                                            IVirtualBoxErrorInfo *aError,
     13677                                            ULONG aMaskedIfs)
    1458113678{
    1458213679    LogFlowThisFunc(("\n"));
     
    1460913706 *  @note The calls shall hold no locks. Will temporarily lock this object for reading.
    1461013707 */
    14611 HRESULT SessionMachine::onUSBDeviceDetach(IN_BSTR aId,
    14612                                           IVirtualBoxErrorInfo *aError)
     13708HRESULT SessionMachine::i_onUSBDeviceDetach(IN_BSTR aId,
     13709                                            IVirtualBoxErrorInfo *aError)
    1461313710{
    1461413711    LogFlowThisFunc(("\n"));
     
    1466713764
    1466813765        /* save all VM settings */
    14669         rc = saveSettings(NULL);
     13766        rc = i_saveSettings(NULL);
    1467013767                // no need to check whether VirtualBox.xml needs saving also since
    1467113768                // we can't have a name change pending at this point
     
    1471313810 *
    1471413811 * @param strStateFile
    14715  * @param pSnapshotToIgnore  Passed to Snapshot::sharesSavedStateFile(); this snapshot is ignored in the test for whether the saved state file is in use.
     13812 * @param pSnapshotToIgnore  Passed to Snapshot::sharesSavedStateFile(); this snapshot is ignored in
     13813 * the test for whether the saved state file is in use.
    1471613814 */
    14717 void SessionMachine::releaseSavedStateFile(const Utf8Str &strStateFile,
    14718                                            Snapshot *pSnapshotToIgnore)
     13815void SessionMachine::i_releaseSavedStateFile(const Utf8Str &strStateFile,
     13816                                             Snapshot *pSnapshotToIgnore)
    1471913817{
    1472013818    // it is safe to delete this saved state file if it is not currently in use by the machine ...
     
    1482613924 * Undoes the locks made by by #lockMedia().
    1482713925 */
    14828 void SessionMachine::unlockMedia()
     13926HRESULT SessionMachine::unlockMedia()
    1482913927{
    1483013928    AutoCaller autoCaller(this);
    14831     AssertComRCReturnVoid(autoCaller.rc());
     13929    AssertComRCReturn(autoCaller.rc(),autoCaller.rc());
    1483213930
    1483313931    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    1483913937    HRESULT rc = mData->mSession.mLockedMedia.Clear();
    1484013938    AssertComRC(rc);
     13939    return rc;
    1484113940}
    1484213941
     
    1484513944 *
    1484613945 * @note Locks this object for writing.
    14847  * @note This method must not call saveSettings or SaveSettings, otherwise
     13946 * @note This method must not call i_saveSettings or SaveSettings, otherwise
    1484813947 *       it can cause crashes in random places due to unexpectedly committing
    1484913948 *       the current settings. The caller is responsible for that. The call
    1485013949 *       to saveStateSettings is fine, because this method does not commit.
    1485113950 */
    14852 HRESULT SessionMachine::setMachineState(MachineState_T aMachineState)
     13951HRESULT SessionMachine::i_setMachineState(MachineState_T aMachineState)
    1485313952{
    1485413953    LogFlowThisFuncEnter();
     
    1500114100
    1500214101    /* redirect to the underlying peer machine */
    15003     mPeer->setMachineState(aMachineState);
     14102    mPeer->i_setMachineState(aMachineState);
    1500414103
    1500514104    if (   aMachineState == MachineState_PoweredOff
     
    1505114150#endif
    1505214151
    15053     rc = saveStateSettings(stsFlags);
     14152    rc = i_saveStateSettings(stsFlags);
    1505414153
    1505514154    if (   (   oldMachineState != MachineState_PoweredOff
     
    1507714176 *  @note Locks this object for reading, then calls a client process.
    1507814177 */
    15079 HRESULT SessionMachine::updateMachineStateOnClient()
     14178HRESULT SessionMachine::i_updateMachineStateOnClient()
    1508014179{
    1508114180    AutoCaller autoCaller(this);
     
    1510514204    return directControl->UpdateMachineState(mData->mMachineState);
    1510614205}
     14206
     14207HRESULT Machine::setRemoveSavedStateFile(BOOL aRemove)
     14208{
     14209    NOREF(aRemove);
     14210    ReturnComNotImplemented();
     14211}
     14212
     14213HRESULT Machine::updateState(MachineState_T aState)
     14214{
     14215    NOREF(aState);
     14216    ReturnComNotImplemented();
     14217}
     14218
     14219HRESULT Machine::beginPowerUp(const ComPtr<IProgress> &aProgress)
     14220{
     14221    NOREF(aProgress);
     14222    ReturnComNotImplemented();
     14223}
     14224
     14225HRESULT Machine::endPowerUp(LONG aResult)
     14226{
     14227    NOREF(aResult);
     14228    ReturnComNotImplemented();
     14229}
     14230
     14231HRESULT Machine::beginPoweringDown(ComPtr<IProgress> &aProgress)
     14232{
     14233    NOREF(aProgress);
     14234    ReturnComNotImplemented();
     14235}
     14236
     14237HRESULT Machine::endPoweringDown(LONG aResult,
     14238                                 const com::Utf8Str &aErrMsg)
     14239{
     14240    NOREF(aResult);
     14241    NOREF(aErrMsg);
     14242    ReturnComNotImplemented();
     14243}
     14244
     14245HRESULT Machine::runUSBDeviceFilters(const ComPtr<IUSBDevice> &aDevice,
     14246                                     BOOL  *aMatched,
     14247                                     ULONG *aMaskedInterfaces)
     14248{
     14249    NOREF(aDevice);
     14250    NOREF(aMatched);
     14251    NOREF(aMaskedInterfaces);
     14252    ReturnComNotImplemented();
     14253
     14254}
     14255
     14256HRESULT Machine::captureUSBDevice(const com::Guid &aId)
     14257{
     14258    NOREF(aId);
     14259    ReturnComNotImplemented();
     14260}
     14261
     14262HRESULT Machine::detachUSBDevice(const com::Guid &aId,
     14263                                 BOOL aDone)
     14264{
     14265    NOREF(aId);
     14266    NOREF(aDone);
     14267    ReturnComNotImplemented();
     14268}
     14269
     14270HRESULT Machine::autoCaptureUSBDevices()
     14271{
     14272    ReturnComNotImplemented();
     14273}
     14274
     14275HRESULT Machine::detachAllUSBDevices(BOOL aDone)
     14276{
     14277    NOREF(aDone);
     14278    ReturnComNotImplemented();
     14279}
     14280
     14281HRESULT Machine::onSessionEnd(const ComPtr<ISession> &aSession,
     14282                              ComPtr<IProgress> &aProgress)
     14283{
     14284    NOREF(aSession);
     14285    NOREF(aProgress);
     14286    ReturnComNotImplemented();
     14287}
     14288
     14289HRESULT Machine::beginSavingState(ComPtr<IProgress> &aProgress,
     14290                                  com::Utf8Str &aStateFilePath)
     14291{
     14292    NOREF(aProgress);
     14293    NOREF(aStateFilePath);
     14294    ReturnComNotImplemented();
     14295}
     14296
     14297HRESULT Machine::endSavingState(LONG aResult,
     14298                                const com::Utf8Str &aErrMsg)
     14299{
     14300    NOREF(aResult);
     14301    NOREF(aErrMsg);
     14302    ReturnComNotImplemented();
     14303}
     14304
     14305HRESULT Machine::adoptSavedState(const com::Utf8Str &aSavedStateFile)
     14306{
     14307    NOREF(aSavedStateFile);
     14308    ReturnComNotImplemented();
     14309}
     14310
     14311HRESULT Machine::beginTakingSnapshot(const ComPtr<IConsole> &aInitiator,
     14312                                     const com::Utf8Str &aName,
     14313                                     const com::Utf8Str &aDescription,
     14314                                     const ComPtr<IProgress> &aConsoleProgress,
     14315                                     BOOL aFTakingSnapshotOnline,
     14316                                     com::Utf8Str &aStateFilePath)
     14317{
     14318    NOREF(aInitiator);
     14319    NOREF(aName);
     14320    NOREF(aDescription);
     14321    NOREF(aConsoleProgress);
     14322    NOREF(aFTakingSnapshotOnline);
     14323    NOREF(aStateFilePath);
     14324    ReturnComNotImplemented();
     14325}
     14326
     14327HRESULT Machine::endTakingSnapshot(BOOL aSuccess)
     14328{
     14329    NOREF(aSuccess);
     14330    ReturnComNotImplemented();
     14331}
     14332
     14333HRESULT Machine::deleteSnapshot(const ComPtr<IConsole> &aInitiator,
     14334                                const com::Guid &aStartId,
     14335                                const com::Guid &aEndId,
     14336                                BOOL aDeleteAllChildren,
     14337                                MachineState_T *aMachineState,
     14338                                ComPtr<IProgress> &aProgress)
     14339{
     14340    NOREF(aInitiator);
     14341    NOREF(aStartId);
     14342    NOREF(aEndId);
     14343    NOREF(aDeleteAllChildren);
     14344    NOREF(aMachineState);
     14345    NOREF(aProgress);
     14346    ReturnComNotImplemented();
     14347}
     14348
     14349HRESULT Machine::finishOnlineMergeMedium()
     14350{
     14351    ReturnComNotImplemented();
     14352}
     14353
     14354HRESULT Machine::restoreSnapshot(const ComPtr<IConsole> &aInitiator,
     14355                                 const ComPtr<ISnapshot> &aSnapshot,
     14356                                 MachineState_T *aMachineState,
     14357                                 ComPtr<IProgress> &aProgress)
     14358{
     14359    NOREF(aInitiator);
     14360    NOREF(aSnapshot);
     14361    NOREF(aMachineState);
     14362    NOREF(aProgress);
     14363    ReturnComNotImplemented();
     14364}
     14365
     14366HRESULT Machine::pullGuestProperties(std::vector<com::Utf8Str> &aNames,
     14367                                     std::vector<com::Utf8Str> &aValues,
     14368                                     std::vector<LONG64> &aTimestamps,
     14369                                     std::vector<com::Utf8Str> &aFlags)
     14370{
     14371    NOREF(aNames);
     14372    NOREF(aValues);
     14373    NOREF(aTimestamps);
     14374    NOREF(aFlags);
     14375    ReturnComNotImplemented();
     14376}
     14377
     14378HRESULT Machine::pushGuestProperty(const com::Utf8Str &aName,
     14379                                   const com::Utf8Str &aValue,
     14380                                   LONG64 aTimestamp,
     14381                                   const com::Utf8Str &aFlags)
     14382{
     14383    NOREF(aName);
     14384    NOREF(aValue);
     14385    NOREF(aTimestamp);
     14386    NOREF(aFlags);
     14387    ReturnComNotImplemented();
     14388}
     14389
     14390HRESULT Machine::lockMedia()
     14391{
     14392    ReturnComNotImplemented();
     14393}
     14394
     14395HRESULT Machine::unlockMedia()
     14396{
     14397    ReturnComNotImplemented();
     14398}
     14399
     14400HRESULT Machine::ejectMedium(const ComPtr<IMediumAttachment> &aAttachment,
     14401                             ComPtr<IMediumAttachment> &aNewAttachment)
     14402{
     14403    NOREF(aAttachment);
     14404    NOREF(aNewAttachment);
     14405    ReturnComNotImplemented();
     14406}
     14407
     14408HRESULT Machine::reportVmStatistics(ULONG aValidStats,
     14409                                    ULONG aCpuUser,
     14410                                    ULONG aCpuKernel,
     14411                                    ULONG aCpuIdle,
     14412                                    ULONG aMemTotal,
     14413                                    ULONG aMemFree,
     14414                                    ULONG aMemBalloon,
     14415                                    ULONG aMemShared,
     14416                                    ULONG aMemCache,
     14417                                    ULONG aPagedTotal,
     14418                                    ULONG aMemAllocTotal,
     14419                                    ULONG aMemFreeTotal,
     14420                                    ULONG aMemBalloonTotal,
     14421                                    ULONG aMemSharedTotal,
     14422                                    ULONG aVmNetRx,
     14423                                    ULONG aVmNetTx)
     14424{
     14425    NOREF(aValidStats);
     14426    NOREF(aCpuUser);
     14427    NOREF(aCpuKernel);
     14428    NOREF(aCpuIdle);
     14429    NOREF(aMemTotal);
     14430    NOREF(aMemFree);
     14431    NOREF(aMemBalloon);
     14432    NOREF(aMemShared);
     14433    NOREF(aMemCache);
     14434    NOREF(aPagedTotal);
     14435    NOREF(aMemAllocTotal);
     14436    NOREF(aMemFreeTotal);
     14437    NOREF(aMemBalloonTotal);
     14438    NOREF(aMemSharedTotal);
     14439    NOREF(aVmNetRx);
     14440    NOREF(aVmNetTx);
     14441    ReturnComNotImplemented();
     14442}
  • trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp

    r50899 r51498  
    55
    66/*
    7  * Copyright (C) 2011-2013 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    208208    {
    209209        SAVESTATETASK sst;
    210         sst.snapshotUuid     = machine->getSnapshotId();
     210        sst.snapshotUuid     = machine->i_getSnapshotId();
    211211        sst.strSaveStateFile = bstrSrcSaveStatePath;
    212212        uint64_t cbSize;
     
    674674        ComObjPtr<Medium> diff;
    675675        diff.createObject();
    676         rc = diff->init(p->getVirtualBox(),
     676        rc = diff->init(p->i_getVirtualBox(),
    677677                        pParent->i_getPreferredDiffFormat(),
    678678                        Utf8StrFmt("%s%c", strSnapshotFolder.c_str(), RTPATH_DELIMITER),
     
    753753        /** @todo r=klaus this code cannot deal with someone crazy specifying
    754754         * IMachine corresponding to a mutable machine as d->pSrcMachine */
    755         if (d->pSrcMachine->isSessionMachine())
     755        if (d->pSrcMachine->i_isSessionMachine())
    756756            throw p->setError(E_INVALIDARG, "The source machine is mutable");
    757757
     
    761761         * just replace the source (snapshot) machine with the current machine. */
    762762        if (   d->mode == CloneMode_AllStates
    763             && d->pSrcMachine->isSnapshotMachine())
     763            && d->pSrcMachine->i_isSnapshotMachine())
    764764        {
    765765            Bstr bstrSrcMachineId;
     
    767767            if (FAILED(rc)) throw rc;
    768768            ComPtr<IMachine> newSrcMachine;
    769             rc = d->pSrcMachine->getVirtualBox()->FindMachine(bstrSrcMachineId.raw(), newSrcMachine.asOutParam());
     769            rc = d->pSrcMachine->i_getVirtualBox()->FindMachine(bstrSrcMachineId.raw(), newSrcMachine.asOutParam());
    770770            if (FAILED(rc)) throw rc;
    771771            d->pSrcMachine = (Machine*)(IMachine*)newSrcMachine;
     
    775775        if (d->mode == CloneMode_MachineAndChildStates)
    776776        {
    777             if (d->pSrcMachine->isSnapshotMachine())
     777            if (d->pSrcMachine->i_isSnapshotMachine())
    778778            {
    779779                /* find machine object for current snapshot of current state */
     
    782782                if (FAILED(rc)) throw rc;
    783783                ComPtr<IMachine> pCurr;
    784                 rc = d->pSrcMachine->getVirtualBox()->FindMachine(bstrSrcMachineId.raw(), pCurr.asOutParam());
     784                rc = d->pSrcMachine->i_getVirtualBox()->FindMachine(bstrSrcMachineId.raw(), pCurr.asOutParam());
    785785                if (FAILED(rc)) throw rc;
    786786                if (pCurr.isNull())
     
    827827        AutoWriteLock trgLock(d->pTrgMachine COMMA_LOCKVAL_SRC_POS);
    828828
    829         if (d->pSrcMachine->isSnapshotMachine())
    830             d->snapshotId = d->pSrcMachine->getSnapshotId();
     829        if (d->pSrcMachine->i_isSnapshotMachine())
     830            d->snapshotId = d->pSrcMachine->i_getSnapshotId();
    831831
    832832        /* Add the current machine and all snapshot machines below this machine
     
    912912        rc = d->pProgress.createObject();
    913913        if (FAILED(rc)) throw rc;
    914         rc = d->pProgress->init(p->getVirtualBox(),
     914        rc = d->pProgress->init(p->i_getVirtualBox(),
    915915                                static_cast<IMachine*>(d->pSrcMachine) /* aInitiator */,
    916916                                Bstr(p->tr("Cloning Machine")).raw(),
     
    958958    /* Where should all the media go? */
    959959    Utf8Str strTrgSnapshotFolder;
    960     Utf8Str strTrgMachineFolder = d->pTrgMachine->getSettingsFileFull();
     960    Utf8Str strTrgMachineFolder = d->pTrgMachine->i_getSettingsFileFull();
    961961    strTrgMachineFolder.stripFilename();
    962962
     
    13891389             * over to the new machine. The machine have to be mutable for
    13901390             * this. */
    1391             rc = d->pTrgMachine->checkStateDependency(p->MutableStateDep);
     1391            rc = d->pTrgMachine->i_checkStateDependency(p->MutableStateDep);
    13921392            if (FAILED(rc)) throw rc;
    1393             rc = d->pTrgMachine->loadMachineDataFromSettings(trgMCF,
    1394                                                              &d->pTrgMachine->mData->mUuid);
     1393            rc = d->pTrgMachine->i_loadMachineDataFromSettings(trgMCF, &d->pTrgMachine->mData->mUuid);
    13951394            if (FAILED(rc)) throw rc;
    13961395            /* save all VM data */
    13971396            bool fNeedsGlobalSaveSettings = false;
    1398             rc = d->pTrgMachine->saveSettings(&fNeedsGlobalSaveSettings, Machine::SaveS_Force);
     1397            rc = d->pTrgMachine->i_saveSettings(&fNeedsGlobalSaveSettings, Machine::SaveS_Force);
    13991398            if (FAILED(rc)) throw rc;
    14001399            /* Release all locks */
  • trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp

    r51092 r51498  
    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
     
    365365    {
    366366        ComObjPtr<BandwidthGroup> pBwGroup;
    367         hrc = m->pMachine->getBandwidthGroup(m->bd->strBandwidthGroup, pBwGroup, true /* fSetError */);
     367        hrc = m->pMachine->i_getBandwidthGroup(m->bd->strBandwidthGroup, pBwGroup, true /* fSetError */);
    368368
    369369        Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the
  • trunk/src/VBox/Main/src-server/NATEngineImpl.cpp

    r51092 r51498  
    55
    66/*
    7  * Copyright (C) 2010-2013 Oracle Corporation
     7 * Copyright (C) 2010-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    259259
    260260    if (m_fModified)
    261         mParent->setModified(Machine::IsModified_NetworkAdapters);
     261        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    262262    return S_OK;
    263263}
     
    327327    r.u16GuestPort = aGuestPort;
    328328    mNATRules.insert(std::make_pair(name, r));
    329     mParent->setModified(Machine::IsModified_NetworkAdapters);
     329    mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    330330    m_fModified = true;
    331331
     
    334334
    335335    alock.release();
    336     mParent->onNATRedirectRuleChange(ulSlot, FALSE, Bstr(name).raw(), aProto, Bstr(r.strHostIP).raw(),
    337                                      r.u16HostPort, Bstr(r.strGuestIP).raw(), r.u16GuestPort);
     336    mParent->i_onNATRedirectRuleChange(ulSlot, FALSE, Bstr(name).raw(), aProto, Bstr(r.strHostIP).raw(),
     337                                       r.u16HostPort, Bstr(r.strGuestIP).raw(), r.u16GuestPort);
    338338    return S_OK;
    339339}
     
    356356
    357357    mNATRules.erase(it);
    358     mParent->setModified(Machine::IsModified_NetworkAdapters);
     358    mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    359359    m_fModified = true;
    360360    mData->m.commit();
    361361    alock.release();
    362     mParent->onNATRedirectRuleChange(ulSlot, TRUE, Bstr(aName).raw(), proto, Bstr(strHostIP).raw(),
    363                                      u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort);
     362    mParent->i_onNATRedirectRuleChange(ulSlot, TRUE, Bstr(aName).raw(), proto, Bstr(strHostIP).raw(),
     363                                       u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort);
    364364    return S_OK;
    365365}
     
    443443        mData->m.backup();
    444444        mData->m->mNetwork = aNetwork;
    445         mParent->setModified(Machine::IsModified_NetworkAdapters);
     445        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    446446        m_fModified = true;
    447447    }
     
    468468        mData->m.backup();
    469469        mData->m->mBindIP = aHostIP;
    470         mParent->setModified(Machine::IsModified_NetworkAdapters);
     470        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    471471        m_fModified = true;
    472472    }
     
    490490        mData->m.backup();
    491491        mData->m->mTFTPPrefix = aTFTPPrefix;
    492         mParent->setModified(Machine::IsModified_NetworkAdapters);
     492        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    493493        m_fModified = true;
    494494    }
     
    516516        mData->m.backup();
    517517        mData->m->mTFTPBootFile = aTFTPBootFile;
    518         mParent->setModified(Machine::IsModified_NetworkAdapters);
     518        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    519519        m_fModified = true;
    520520    }
     
    542542        mData->m.backup();
    543543        mData->m->mTFTPNextServer = aTFTPNextServer;
    544         mParent->setModified(Machine::IsModified_NetworkAdapters);
     544        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    545545        m_fModified = true;
    546546    }
     
    568568        mData->m.backup();
    569569        mData->m->mDNSPassDomain = aDNSPassDomain;
    570         mParent->setModified(Machine::IsModified_NetworkAdapters);
     570        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    571571        m_fModified = true;
    572572    }
     
    590590        mData->m.backup();
    591591        mData->m->mDNSProxy = aDNSProxy;
    592         mParent->setModified(Machine::IsModified_NetworkAdapters);
     592        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    593593        m_fModified = true;
    594594    }
     
    618618        mData->m.backup();
    619619        mData->m->mDNSUseHostResolver = aDNSUseHostResolver;
    620         mParent->setModified(Machine::IsModified_NetworkAdapters);
     620        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    621621        m_fModified = true;
    622622    }
     
    632632        mData->m.backup();
    633633        mData->m->mAliasMode = aAliasMode;
    634         mParent->setModified(Machine::IsModified_NetworkAdapters);
     634        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    635635        m_fModified = true;
    636636    }
  • trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp

    r51441 r51498  
    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
     
    7070
    7171    ComAssertRet(aParent, E_INVALIDARG);
    72     uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(aParent->getChipsetType());
     72    uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(aParent->i_getChipsetType());
    7373    ComAssertRet(aSlot < maxNetworkAdapters, E_INVALIDARG);
    7474
     
    261261
    262262        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    263         mParent->setModified(Machine::IsModified_NetworkAdapters);
     263        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    264264        mlock.release();
    265265
    266266        /* Changing the network adapter type during runtime is not allowed,
    267267         * therefore no immediate change in CFGM logic => changeAdapter=FALSE. */
    268         mParent->onNetworkAdapterChange(this, FALSE);
     268        mParent->i_onNetworkAdapterChange(this, FALSE);
    269269    }
    270270
     
    309309
    310310        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    311         mParent->setModified(Machine::IsModified_NetworkAdapters);
     311        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    312312        mlock.release();
    313313
    314314        /* Disabling the network adapter during runtime is not allowed
    315315         * therefore no immediate change in CFGM logic => changeAdapter=FALSE. */
    316         mParent->onNetworkAdapterChange(this, FALSE);
     316        mParent->i_onNetworkAdapterChange(this, FALSE);
    317317    }
    318318
     
    400400
    401401        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    402         mParent->setModified(Machine::IsModified_NetworkAdapters);
     402        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    403403        mlock.release();
    404404
    405405        /* Changing the MAC via the Main API during runtime is not allowed,
    406406         * therefore no immediate change in CFGM logic => changeAdapter=FALSE. */
    407         mParent->onNetworkAdapterChange(this, FALSE);
     407        mParent->i_onNetworkAdapterChange(this, FALSE);
    408408    }
    409409
     
    454454
    455455        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    456         mParent->setModified(Machine::IsModified_NetworkAdapters);
     456        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    457457        mlock.release();
    458458
     
    464464
    465465        /* Adapt the CFGM logic and notify the guest => changeAdapter=TRUE. */
    466         mParent->onNetworkAdapterChange(this, TRUE);
     466        mParent->i_onNetworkAdapterChange(this, TRUE);
    467467    }
    468468
     
    506506
    507507        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    508         mParent->setModified(Machine::IsModified_NetworkAdapters);
     508        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    509509        mlock.release();
    510510
     
    512512         * change immediately effect and to notify the guest that the network
    513513         * might have changed, therefore changeAdapter=TRUE. */
    514         mParent->onNetworkAdapterChange(this, TRUE);
     514        mParent->i_onNetworkAdapterChange(this, TRUE);
    515515    }
    516516
     
    555555
    556556        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    557         mParent->setModified(Machine::IsModified_NetworkAdapters);
     557        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    558558        mlock.release();
    559559
     
    561561         * change immediately effect and to notify the guest that the network
    562562         * might have changed, therefore changeAdapter=TRUE. */
    563         mParent->onNetworkAdapterChange(this, TRUE);
     563        mParent->i_onNetworkAdapterChange(this, TRUE);
    564564    }
    565565
     
    602602
    603603        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    604         mParent->setModified(Machine::IsModified_NetworkAdapters);
     604        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    605605        mlock.release();
    606606
     
    608608         * change immediately effect and to notify the guest that the network
    609609         * might have changed, therefore changeAdapter=TRUE. */
    610         mParent->onNetworkAdapterChange(this, TRUE);
     610        mParent->i_onNetworkAdapterChange(this, TRUE);
    611611    }
    612612
     
    653653
    654654        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    655         mParent->setModified(Machine::IsModified_NetworkAdapters);
     655        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    656656        mlock.release();
    657657        i_checkAndSwitchFromNatNetworking(oldNatNetworkName.raw());
     
    661661         * change immediately effect and to notify the guest that the network
    662662         * might have changed, therefore changeAdapter=TRUE. */
    663         mParent->onNetworkAdapterChange(this, TRUE);
     663        mParent->i_onNetworkAdapterChange(this, TRUE);
    664664    }
    665665
     
    692692        alock.release();
    693693
    694         mParent->onNetworkAdapterChange(this, FALSE);
     694        mParent->i_onNetworkAdapterChange(this, FALSE);
    695695    }
    696696
     
    727727
    728728        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    729         mParent->setModified(Machine::IsModified_NetworkAdapters);
     729        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    730730        mlock.release();
    731731
    732732        /* No change in CFGM logic => changeAdapter=FALSE. */
    733         mParent->onNetworkAdapterChange(this, FALSE);
     733        mParent->i_onNetworkAdapterChange(this, FALSE);
    734734    }
    735735
     
    765765
    766766        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    767         mParent->setModified(Machine::IsModified_NetworkAdapters);
     767        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    768768        mlock.release();
    769769
    770770        /* No change in CFGM logic => changeAdapter=FALSE. */
    771         mParent->onNetworkAdapterChange(this, FALSE);
     771        mParent->i_onNetworkAdapterChange(this, FALSE);
    772772    }
    773773
     
    809809
    810810            alock.release();
    811             mParent->setModifiedLock(Machine::IsModified_NetworkAdapters);
    812             mParent->onNetworkAdapterChange(this, TRUE);
     811            mParent->i_setModifiedLock(Machine::IsModified_NetworkAdapters);
     812            mParent->i_onNetworkAdapterChange(this, TRUE);
    813813        }
    814814    }
     
    846846
    847847        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    848         mParent->setModified(Machine::IsModified_NetworkAdapters);
     848        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    849849        mlock.release();
    850850
    851851        /* Adapt the CFGM logic changeAdapter=TRUE */
    852         mParent->onNetworkAdapterChange(this, TRUE);
     852        mParent->i_onNetworkAdapterChange(this, TRUE);
    853853    }
    854854
     
    884884
    885885        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    886         mParent->setModified(Machine::IsModified_NetworkAdapters);
     886        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    887887        mlock.release();
    888888
    889889        /* No change in CFGM logic => changeAdapter=FALSE. */
    890         mParent->onNetworkAdapterChange(this, FALSE);
     890        mParent->i_onNetworkAdapterChange(this, FALSE);
    891891    }
    892892
     
    930930
    931931        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
    932         mParent->setModified(Machine::IsModified_NetworkAdapters);
     932        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    933933        mlock.release();
    934934
    935935        /* No change in CFGM logic => changeAdapter=FALSE. */
    936         mParent->onNetworkAdapterChange(this, FALSE);
     936        mParent->i_onNetworkAdapterChange(this, FALSE);
    937937    }
    938938
     
    981981
    982982        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
    983         mParent->setModified(Machine::IsModified_NetworkAdapters);
     983        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    984984        mlock.release();
    985985
     
    988988        adep.release();
    989989
    990         mParent->onNetworkAdapterChange(this, fGenericChange);
     990        mParent->i_onNetworkAdapterChange(this, fGenericChange);
    991991    }
    992992
     
    13031303    {
    13041304        ComObjPtr<BandwidthGroup> pBwGroup;
    1305         hrc = mParent->getBandwidthGroup(mData->mBandwidthGroup, pBwGroup, true /* fSetError */);
     1305        hrc = mParent->i_getBandwidthGroup(mData->mBandwidthGroup, pBwGroup, true /* fSetError */);
    13061306
    13071307        Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence
     
    13351335        if (!strBwGroup.isEmpty())
    13361336        {
    1337             HRESULT hrc = mParent->getBandwidthGroup(strBwGroup, pBwGroup, false /* fSetError */);
     1337            HRESULT hrc = mParent->i_getBandwidthGroup(strBwGroup, pBwGroup, false /* fSetError */);
    13381338            NOREF(hrc);
    13391339            Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence
     
    13481348
    13491349        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
    1350         mParent->setModified(Machine::IsModified_NetworkAdapters);
     1350        mParent->i_setModified(Machine::IsModified_NetworkAdapters);
    13511351        mlock.release();
    13521352
    13531353        /* TODO: changeAdapter=???. */
    1354         mParent->onNetworkAdapterChange(this, FALSE);
     1354        mParent->i_onNetworkAdapterChange(this, FALSE);
    13551355    }
    13561356
     
    13671367    if (!mData->mBandwidthGroup.isEmpty())
    13681368        {
    1369             HRESULT hrc = mParent->getBandwidthGroup(mData->mBandwidthGroup, pOldBwGroup, false /* fSetError */);
     1369            HRESULT hrc = mParent->i_getBandwidthGroup(mData->mBandwidthGroup, pOldBwGroup, false /* fSetError */);
    13701370            NOREF(hrc);
    13711371            Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of
     
    14051405        hrc = mParent->COMGETTER(Name)(bstrName.asOutParam());
    14061406        LogRel(("VM '%ls' stops using NAT network '%s'\n", bstrName.raw(), networkName.c_str()));
    1407         int natCount = mParent->getVirtualBox()->i_natNetworkRefDec(Bstr(networkName).raw());
     1407        int natCount = mParent->i_getVirtualBox()->i_natNetworkRefDec(Bstr(networkName).raw());
    14081408        if (natCount == -1)
    14091409            return E_INVALIDARG; /* no such network */
     
    14281428        hrc = mParent->COMGETTER(Name)(bstrName.asOutParam());
    14291429        LogRel(("VM '%ls' starts using NAT network '%s'\n", bstrName.raw(), aNatNetworkName.c_str()));
    1430         int natCount = mParent->getVirtualBox()->i_natNetworkRefInc(Bstr(aNatNetworkName).raw());
     1430        int natCount = mParent->i_getVirtualBox()->i_natNetworkRefInc(Bstr(aNatNetworkName).raw());
    14311431        if (natCount == -1)
    14321432            return E_INVALIDARG; /* not found */
  • trunk/src/VBox/Main/src-server/ParallelPortImpl.cpp

    r49871 r51498  
    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
     
    229229
    230230        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    231         m->pMachine->setModified(Machine::IsModified_ParallelPorts);
     231        m->pMachine->i_setModified(Machine::IsModified_ParallelPorts);
    232232        mlock.release();
    233233
    234         m->pMachine->onParallelPortChange(this);
     234        m->pMachine->i_onParallelPortChange(this);
    235235    }
    236236
     
    281281
    282282        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    283         m->pMachine->setModified(Machine::IsModified_ParallelPorts);
     283        m->pMachine->i_setModified(Machine::IsModified_ParallelPorts);
    284284        mlock.release();
    285285
    286         m->pMachine->onParallelPortChange(this);
     286        m->pMachine->i_onParallelPortChange(this);
    287287    }
    288288
     
    324324
    325325        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    326         m->pMachine->setModified(Machine::IsModified_ParallelPorts);
     326        m->pMachine->i_setModified(Machine::IsModified_ParallelPorts);
    327327        mlock.release();
    328328
    329         m->pMachine->onParallelPortChange(this);
     329        m->pMachine->i_onParallelPortChange(this);
    330330    }
    331331
     
    364364
    365365        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    366         m->pMachine->setModified(Machine::IsModified_ParallelPorts);
     366        m->pMachine->i_setModified(Machine::IsModified_ParallelPorts);
    367367        mlock.release();
    368368
    369         return m->pMachine->onParallelPortChange(this);
     369        return m->pMachine->i_onParallelPortChange(this);
    370370    }
    371371
  • trunk/src/VBox/Main/src-server/Performance.cpp

    r51092 r51498  
    55
    66/*
    7  * Copyright (C) 2008-2013 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    260260        ComPtr<IInternalSessionControl> directControl;
    261261
    262         ret = mMachine->getDirectControl(&directControl);
     262        ret = mMachine->i_getDirectControl(&directControl);
    263263        if (ret != S_OK)
    264264            return ret;
     
    302302        if (FAILED(autoCaller.rc())) return autoCaller.rc();
    303303
    304         mMachineName = mMachine->getName();
     304        mMachineName = mMachine->i_getName();
    305305
    306306        ComPtr<IInternalSessionControl> directControl;
    307307
    308         ret = mMachine->getDirectControl(&directControl);
     308        ret = mMachine->i_getDirectControl(&directControl);
    309309        if (ret != S_OK)
    310310            return ret;
  • trunk/src/VBox/Main/src-server/SerialPortImpl.cpp

    r49806 r51498  
    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
     
    206206
    207207        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    208         m->pMachine->setModified(Machine::IsModified_SerialPorts);
     208        m->pMachine->i_setModified(Machine::IsModified_SerialPorts);
    209209        mlock.release();
    210210
    211         m->pMachine->onSerialPortChange(this);
     211        m->pMachine->i_onSerialPortChange(this);
    212212    }
    213213
     
    270270
    271271        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    272         m->pMachine->setModified(Machine::IsModified_SerialPorts);
     272        m->pMachine->i_setModified(Machine::IsModified_SerialPorts);
    273273        mlock.release();
    274274
    275         m->pMachine->onSerialPortChange(this);
     275        m->pMachine->i_onSerialPortChange(this);
    276276    }
    277277
     
    324324
    325325        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    326         m->pMachine->setModified(Machine::IsModified_SerialPorts);
     326        m->pMachine->i_setModified(Machine::IsModified_SerialPorts);
    327327        mlock.release();
    328328
    329         m->pMachine->onSerialPortChange(this);
     329        m->pMachine->i_onSerialPortChange(this);
    330330    }
    331331
     
    373373
    374374        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    375         m->pMachine->setModified(Machine::IsModified_SerialPorts);
     375        m->pMachine->i_setModified(Machine::IsModified_SerialPorts);
    376376        mlock.release();
    377377
    378         m->pMachine->onSerialPortChange(this);
     378        m->pMachine->i_onSerialPortChange(this);
    379379    }
    380380
     
    413413
    414414        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    415         m->pMachine->setModified(Machine::IsModified_SerialPorts);
     415        m->pMachine->i_setModified(Machine::IsModified_SerialPorts);
    416416        mlock.release();
    417417
    418         m->pMachine->onSerialPortChange(this);
     418        m->pMachine->i_onSerialPortChange(this);
    419419    }
    420420
     
    449449
    450450        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    451         m->pMachine->setModified(Machine::IsModified_SerialPorts);
     451        m->pMachine->i_setModified(Machine::IsModified_SerialPorts);
    452452        mlock.release();
    453453
    454         m->pMachine->onSerialPortChange(this);
     454        m->pMachine->i_onSerialPortChange(this);
    455455    }
    456456
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r50899 r51498  
    66
    77/*
    8  * Copyright (C) 2006-2013 Oracle Corporation
     8 * Copyright (C) 2006-2014 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    329329        m->strName = aName;
    330330        alock.release(); /* Important! (child->parent locks are forbidden) */
    331         rc = m->pMachine->onSnapshotChange(this);
     331        rc = m->pMachine->i_onSnapshotChange(this);
    332332    }
    333333
     
    351351        m->strDescription = aDescription;
    352352        alock.release(); /* Important! (child->parent locks are forbidden) */
    353         rc = m->pMachine->onSnapshotChange(this);
     353        rc = m->pMachine->i_onSnapshotChange(this);
    354354    }
    355355
     
    746746    // state file (only if this snapshot is online)
    747747    if (i_getStateFilePath().isNotEmpty())
    748         m->pMachine->copyPathRelativeToMachine(i_getStateFilePath(), data.strStateFile);
     748        m->pMachine->i_copyPathRelativeToMachine(i_getStateFilePath(), data.strStateFile);
    749749    else
    750750        data.strStateFile.setNull();
    751751
    752     HRESULT rc = m->pMachine->saveHardware(data.hardware, &data.debugging, &data.autostart);
     752    HRESULT rc = m->pMachine->i_saveHardware(data.hardware, &data.debugging, &data.autostart);
    753753    if (FAILED(rc)) return rc;
    754754
    755     rc = m->pMachine->saveStorageControllers(data.storage);
     755    rc = m->pMachine->i_saveStorageControllers(data.storage);
    756756    if (FAILED(rc)) return rc;
    757757
     
    858858
    859859    // now call detachAllMedia on the snapshot machine
    860     rc = m->pMachine->detachAllMedia(writeLock,
    861                                      this /* pSnapshot */,
    862                                      cleanupMode,
    863                                      llMedia);
     860    rc = m->pMachine->i_detachAllMedia(writeLock,
     861                                       this /* pSnapshot */,
     862                                       cleanupMode,
     863                                       llMedia);
    864864    if (FAILED(rc))
    865865        return rc;
     
    11681168    /* load hardware and harddisk settings */
    11691169
    1170     HRESULT rc = loadHardware(hardware, pDbg, pAutostart);
     1170    HRESULT rc = i_loadHardware(hardware, pDbg, pAutostart);
    11711171    if (SUCCEEDED(rc))
    1172         rc = loadStorageControllers(storage,
    1173                                     NULL, /* puuidRegistry */
    1174                                     &mSnapshotId);
     1172        rc = i_loadStorageControllers(storage,
     1173                                      NULL, /* puuidRegistry */
     1174                                      &mSnapshotId);
    11751175
    11761176    if (SUCCEEDED(rc))
    11771177        /* commit all changes made during the initialization */
    1178         commit();   /// @todo r=dj why do we need a commit in init?!? this is very expensive
     1178        i_commit();   /// @todo r=dj why do we need a commit in init?!? this is very expensive
    11791179        /// @todo r=klaus for some reason the settings loading logic backs up
    11801180        // the settings, and therefore a commit is needed. Should probably be changed.
     
    12341234 *  @warning Caller must hold no locks when calling this.
    12351235 */
    1236 HRESULT SnapshotMachine::onSnapshotChange(Snapshot *aSnapshot)
     1236HRESULT SnapshotMachine::i_onSnapshotChange(Snapshot *aSnapshot)
    12371237{
    12381238    AutoMultiWriteLock2 mlock(this, aSnapshot COMMA_LOCKVAL_SRC_POS);
     
    12441244     * modification of the current state flag, cause this snapshot data isn't
    12451245     * related to the current state. */
    1246     mMachine->setModified(Machine::IsModified_Snapshots, false /* fAllowStateModification */);
    1247     HRESULT rc = mMachine->saveSettings(&fNeedsGlobalSaveSettings,
    1248                                         SaveS_Force);        // we know we need saving, no need to check
     1246    mMachine->i_setModified(Machine::IsModified_Snapshots, false /* fAllowStateModification */);
     1247    HRESULT rc = mMachine->i_saveSettings(&fNeedsGlobalSaveSettings,
     1248                                          SaveS_Force);        // we know we need saving, no need to check
    12491249    mlock.release();
    12501250
     
    13121312    void handler()
    13131313    {
    1314         pMachine->restoreSnapshotHandler(*this);
     1314        pMachine->i_restoreSnapshotHandler(*this);
    13151315    }
    13161316};
     
    13301330    void handler()
    13311331    {
    1332         pMachine->deleteSnapshotHandler(*this);
     1332        pMachine->i_deleteSnapshotHandler(*this);
    13331333    }
    13341334
     
    14341434        /* save all current settings to ensure current changes are committed and
    14351435         * hard disks are fixed up */
    1436         HRESULT rc = saveSettings(NULL);
     1436        HRESULT rc = i_saveSettings(NULL);
    14371437                // no need to check for whether VirtualBox.xml needs changing since
    14381438                // we can't have a machine XML rename pending at this point
     
    14541454        {
    14551455            // creating a new online snapshot: we need a fresh saved state file
    1456             composeSavedStateFilename(strStateFilePath);
     1456            i_composeSavedStateFilename(strStateFilePath);
    14571457        }
    14581458    }
     
    15021502        // backup the media data so we can recover if things goes wrong along the day;
    15031503        // the matching commit() is in fixupMedia() during endSnapshot()
    1504         setModified(IsModified_Storage);
     1504        i_setModified(IsModified_Storage);
    15051505        mMediaData.backup();
    15061506
    15071507        /* Console::fntTakeSnapshotWorker and friends expects this. */
    15081508        if (mConsoleTaskData.mLastState == MachineState_Running)
    1509             setMachineState(MachineState_LiveSnapshotting);
     1509            i_setMachineState(MachineState_LiveSnapshotting);
    15101510        else
    1511             setMachineState(MachineState_Saving); /** @todo Confusing! Saving is used for both online and offline snapshots. */
     1511            i_setMachineState(MachineState_Saving); /** @todo Confusing! Saving is used for both online and offline snapshots. */
    15121512
    15131513        alock.release();
    15141514        /* create new differencing hard disks and attach them to this machine */
    1515         rc = createImplicitDiffs(aConsoleProgress,
    1516                                  1,            // operation weight; must be the same as in Console::TakeSnapshot()
    1517                                  !!fTakingSnapshotOnline);
     1515        rc = i_createImplicitDiffs(aConsoleProgress,
     1516                                   1,            // operation weight; must be the same as in Console::TakeSnapshot()
     1517                                   !!fTakingSnapshotOnline);
    15181518        if (FAILED(rc))
    15191519            throw rc;
     
    15311531                  : mData->mMachineState == MachineState_Saving)
    15321532           )
    1533             setMachineState(mConsoleTaskData.mLastState);
     1533               i_setMachineState(mConsoleTaskData.mLastState);
    15341534
    15351535        pSnapshot->uninit();
     
    15921592         && mConsoleTaskData.mLastState != MachineState_Running
    15931593       )
    1594         setMachineState(mConsoleTaskData.mLastState);
     1594           i_setMachineState(mConsoleTaskData.mLastState);
    15951595
    15961596    ComObjPtr<Snapshot> pOldFirstSnap = mData->mFirstSnapshot;
     
    16171617            flSaveSettings |= SaveS_ResetCurStateModified;
    16181618
    1619         rc = saveSettings(NULL, flSaveSettings);
     1619        rc = i_saveSettings(NULL, flSaveSettings);
    16201620    }
    16211621
     
    16231623    {
    16241624        /* associate old hard disks with the snapshot and do locking/unlocking*/
    1625         commitMedia(fOnline);
     1625        i_commitMedia(fOnline);
    16261626
    16271627        /* inform callbacks */
     
    16361636        machineLock.release();
    16371637
    1638         rollbackMedia();
     1638        i_rollbackMedia();
    16391639
    16401640        mData->mFirstSnapshot = pOldFirstSnap;      // might have been changed above
     
    17661766
    17671767    /* set the proper machine state (note: after creating a Task instance) */
    1768     setMachineState(MachineState_RestoringSnapshot);
     1768    i_setMachineState(MachineState_RestoringSnapshot);
    17691769
    17701770    /* return the progress to the caller */
     
    17911791 * @param aTask Task data.
    17921792 */
    1793 void SessionMachine::restoreSnapshotHandler(RestoreSnapshotTask &aTask)
     1793void SessionMachine::i_restoreSnapshotHandler(RestoreSnapshotTask &aTask)
    17941794{
    17951795    LogFlowThisFuncEnter();
     
    18231823         * the direct session. */
    18241824        if (mData->flModifications)
    1825             rollback(false /* aNotify */);
     1825            i_rollback(false /* aNotify */);
    18261826
    18271827        /* Delete the saved state file if the machine was Saved prior to this
     
    18351835            Utf8Str strStateFile(mSSData->strStateFilePath);
    18361836            mSSData->strStateFilePath.setNull();
    1837             releaseSavedStateFile(strStateFile, NULL /* pSnapshotToIgnore */ );
     1837            i_releaseSavedStateFile(strStateFile, NULL /* pSnapshotToIgnore */ );
    18381838
    18391839            aTask.modifyBackedUpState(MachineState_PoweredOff);
    18401840
    1841             rc = saveStateSettings(SaveSTS_StateFilePath);
     1841            rc = i_saveStateSettings(SaveSTS_StateFilePath);
    18421842            if (FAILED(rc))
    18431843                throw rc;
     
    18561856
    18571857            /* copy all hardware data from the snapshot */
    1858             copyFrom(pSnapshotMachine);
     1858            i_copyFrom(pSnapshotMachine);
    18591859
    18601860            LogFlowThisFunc(("Restoring hard disks from the snapshot...\n"));
    18611861
    18621862            // restore the attachments from the snapshot
    1863             setModified(IsModified_Storage);
     1863            i_setModified(IsModified_Storage);
    18641864            mMediaData.backup();
    18651865            mMediaData->mAttachments.clear();
     
    18781878            alock.release();
    18791879
    1880             rc = createImplicitDiffs(aTask.pProgress,
    1881                                      1,
    1882                                      false /* aOnline */);
     1880            rc = i_createImplicitDiffs(aTask.pProgress,
     1881                                       1,
     1882                                       false /* aOnline */);
    18831883            if (FAILED(rc))
    18841884                throw rc;
     
    19341934         * state accordingly no matter of the delete snapshot result */
    19351935        if (mSSData->strStateFilePath.isNotEmpty())
    1936             setMachineState(MachineState_Saved);
     1936            i_setMachineState(MachineState_Saved);
    19371937        else
    1938             setMachineState(MachineState_PoweredOff);
    1939 
    1940         updateMachineStateOnClient();
     1938            i_setMachineState(MachineState_PoweredOff);
     1939
     1940        i_updateMachineStateOnClient();
    19411941        stateRestored = true;
    19421942
     
    19861986        // save machine settings, reset the modified flag and commit;
    19871987        bool fNeedsGlobalSaveSettings = false;
    1988         rc = saveSettings(&fNeedsGlobalSaveSettings,
    1989                           SaveS_ResetCurStateModified);
     1988        rc = i_saveSettings(&fNeedsGlobalSaveSettings,
     1989                            SaveS_ResetCurStateModified);
    19901990        if (FAILED(rc))
    19911991            throw rc;
     
    20252025
    20262026        /* undo all changes on failure */
    2027         rollback(false /* aNotify */);
     2027        i_rollback(false /* aNotify */);
    20282028
    20292029        if (!stateRestored)
    20302030        {
    20312031            /* restore the machine state */
    2032             setMachineState(aTask.machineStateBackup);
    2033             updateMachineStateOnClient();
     2032            i_setMachineState(aTask.machineStateBackup);
     2033            i_updateMachineStateOnClient();
    20342034        }
    20352035    }
     
    21082108
    21092109    ComObjPtr<Snapshot> pSnapshot;
    2110     HRESULT rc = findSnapshotById(startId, pSnapshot, true /* aSetError */);
     2110    HRESULT rc = i_findSnapshotById(startId, pSnapshot, true /* aSetError */);
    21112111    if (FAILED(rc)) return rc;
    21122112
     
    21352135        if (mData->flModifications)
    21362136        {
    2137             rc = saveSettings(NULL);
     2137            rc = i_saveSettings(NULL);
    21382138                // no need to change for whether VirtualBox.xml needs saving since
    21392139                // we can't have a machine XML rename pending at this point
     
    22192219    // set the proper machine state here now (note: after creating a Task instance)
    22202220    if (mData->mMachineState == MachineState_Running)
    2221         setMachineState(MachineState_DeletingSnapshotOnline);
     2221        i_setMachineState(MachineState_DeletingSnapshotOnline);
    22222222    else if (mData->mMachineState == MachineState_Paused)
    2223         setMachineState(MachineState_DeletingSnapshotPaused);
     2223        i_setMachineState(MachineState_DeletingSnapshotPaused);
    22242224    else
    2225         setMachineState(MachineState_DeletingSnapshot);
     2225        i_setMachineState(MachineState_DeletingSnapshot);
    22262226
    22272227    /* return the progress to the caller */
     
    23322332 */
    23332333
    2334 void SessionMachine::deleteSnapshotHandler(DeleteSnapshotTask &aTask)
     2334void SessionMachine::i_deleteSnapshotHandler(DeleteSnapshotTask &aTask)
    23352335{
    23362336    LogFlowThisFuncEnter();
     
    23692369        ComObjPtr<SnapshotMachine> pSnapMachine = aTask.pSnapshot->i_getSnapshotMachine();
    23702370        // no need to lock the snapshot machine since it is const by definition
    2371         Guid machineId = pSnapMachine->getId();
     2371        Guid machineId = pSnapMachine->i_getId();
    23722372
    23732373        // save the snapshot ID (for callbacks)
     
    24292429                // prevent online merging in general.
    24302430                pOnlineMediumAttachment =
    2431                     findAttachment(mMediaData->mAttachments,
    2432                                    pAttach->i_getControllerName().raw(),
    2433                                    pAttach->i_getPort(),
    2434                                    pAttach->i_getDevice());
     2431                    i_findAttachment(mMediaData->mAttachments,
     2432                                     pAttach->i_getControllerName().raw(),
     2433                                     pAttach->i_getPort(),
     2434                                     pAttach->i_getDevice());
    24352435                if (pOnlineMediumAttachment)
    24362436                {
     
    24482448
    24492449            treeLock.release();
    2450             rc = prepareDeleteSnapshotMedium(pHD, machineId, snapshotId,
    2451                                              fOnlineMergePossible,
    2452                                              pVMMALockList, pSource, pTarget,
    2453                                              fMergeForward, pParentForTarget,
    2454                                              pChildrenToReparent,
    2455                                              fNeedsOnlineMerge,
    2456                                              pMediumLockList,
    2457                                              pHDLockToken);
     2450            rc = i_prepareDeleteSnapshotMedium(pHD, machineId, snapshotId,
     2451                                               fOnlineMergePossible,
     2452                                               pVMMALockList, pSource, pTarget,
     2453                                               fMergeForward, pParentForTarget,
     2454                                               pChildrenToReparent,
     2455                                               fNeedsOnlineMerge,
     2456                                               pMediumLockList,
     2457                                               pHDLockToken);
    24582458            treeLock.acquire();
    24592459            if (FAILED(rc))
     
    26602660                                                  1);        // weight
    26612661
    2662                 releaseSavedStateFile(stateFilePath, aTask.pSnapshot /* pSnapshotToIgnore */);
     2662                i_releaseSavedStateFile(stateFilePath, aTask.pSnapshot /* pSnapshotToIgnore */);
    26632663
    26642664                // machine will need saving now
    26652665                machineLock.release();
    2666                 mParent->i_markRegistryModified(getId());
     2666                mParent->i_markRegistryModified(i_getId());
    26672667            }
    26682668        }
     
    27302730                    mConsoleTaskData.mDeleteSnapshotInfo = (void *)&(*it);
    27312731                    // online medium merge, in the direction decided earlier
    2732                     rc = onlineMergeMedium(it->mpOnlineMediumAttachment,
    2733                                            it->mpSource,
    2734                                            it->mpTarget,
    2735                                            it->mfMergeForward,
    2736                                            it->mpParentForTarget,
    2737                                            it->mpChildrenToReparent,
    2738                                            it->mpMediumLockList,
    2739                                            aTask.pProgress,
    2740                                            &fNeedsSave);
     2732                    rc = i_onlineMergeMedium(it->mpOnlineMediumAttachment,
     2733                                             it->mpSource,
     2734                                             it->mpTarget,
     2735                                             it->mfMergeForward,
     2736                                             it->mpParentForTarget,
     2737                                             it->mpChildrenToReparent,
     2738                                             it->mpMediumLockList,
     2739                                             aTask.pProgress,
     2740                                             &fNeedsSave);
    27412741                    mConsoleTaskData.mDeleteSnapshotInfo = NULL;
    27422742                }
     
    27992799            if (fReparentTarget)
    28002800            {
    2801                 pAtt = findAttachment(pSnapMachine->mMediaData->mAttachments,
    2802                                       it->mpTarget);
     2801                pAtt = i_findAttachment(pSnapMachine->mMediaData->mAttachments,
     2802                                        it->mpTarget);
    28032803                it->mpTarget->i_removeBackReference(machineId, snapshotId);
    28042804            }
    28052805            else
    2806                 pAtt = findAttachment(pSnapMachine->mMediaData->mAttachments,
    2807                                       it->mpSource);
     2806                pAtt = i_findAttachment(pSnapMachine->mMediaData->mAttachments,
     2807                                        it->mpSource);
    28082808            pSnapMachine->mMediaData->mAttachments.remove(pAtt);
    28092809
     
    28202820                    childSnapshotId = pChildSnapshot->i_getId();
    28212821                }
    2822                 pAtt = findAttachment(pMachine->mMediaData->mAttachments, it->mpSource);
     2822                pAtt = i_findAttachment(pMachine->mMediaData->mAttachments, it->mpSource);
    28232823                if (pAtt)
    28242824                {
     
    28432843
    28442844            // One attachment is merged, must save the settings
    2845             mParent->i_markRegistryModified(getId());
     2845            mParent->i_markRegistryModified(i_getId());
    28462846
    28472847            // prevent calling cancelDeleteSnapshotMedium() for this attachment
     
    28632863
    28642864            machineLock.release();
    2865             mParent->i_markRegistryModified(getId());
     2865            mParent->i_markRegistryModified(i_getId());
    28662866        }
    28672867    }
     
    28842884             it != toDelete.end();
    28852885             ++it)
    2886         {
    2887             cancelDeleteSnapshotMedium(it->mpHD, it->mpSource,
    2888                                        it->mpChildrenToReparent,
    2889                                        it->mfNeedsOnlineMerge,
    2890                                        it->mpMediumLockList, it->mpHDLockToken,
    2891                                        it->mMachineId, it->mSnapshotId);
    2892         }
     2886            i_cancelDeleteSnapshotMedium(it->mpHD, it->mpSource,
     2887                                         it->mpChildrenToReparent,
     2888                                         it->mfNeedsOnlineMerge,
     2889                                         it->mpMediumLockList, it->mpHDLockToken,
     2890                                         it->mMachineId, it->mSnapshotId);
    28932891    }
    28942892
     
    29022900        // restore the machine state that was saved when the
    29032901        // task was started
    2904         setMachineState(aTask.machineStateBackup);
    2905         updateMachineStateOnClient();
     2902        i_setMachineState(aTask.machineStateBackup);
     2903        i_updateMachineStateOnClient();
    29062904
    29072905        mParent->i_saveModifiedRegistries();
     
    29542952 *       and every medium object on the merge chain for writing.
    29552953 */
    2956 HRESULT SessionMachine::prepareDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
    2957                                                     const Guid &aMachineId,
    2958                                                     const Guid &aSnapshotId,
    2959                                                     bool fOnlineMergePossible,
    2960                                                     MediumLockList *aVMMALockList,
    2961                                                     ComObjPtr<Medium> &aSource,
    2962                                                     ComObjPtr<Medium> &aTarget,
    2963                                                     bool &aMergeForward,
    2964                                                     ComObjPtr<Medium> &aParentForTarget,
    2965                                                     MediumLockList * &aChildrenToReparent,
    2966                                                     bool &fNeedsOnlineMerge,
    2967                                                     MediumLockList * &aMediumLockList,
    2968                                                     ComPtr<IToken> &aHDLockToken)
     2954HRESULT SessionMachine::i_prepareDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
     2955                                                      const Guid &aMachineId,
     2956                                                      const Guid &aSnapshotId,
     2957                                                      bool fOnlineMergePossible,
     2958                                                      MediumLockList *aVMMALockList,
     2959                                                      ComObjPtr<Medium> &aSource,
     2960                                                      ComObjPtr<Medium> &aTarget,
     2961                                                      bool &aMergeForward,
     2962                                                      ComObjPtr<Medium> &aParentForTarget,
     2963                                                      MediumLockList * &aChildrenToReparent,
     2964                                                      bool &fNeedsOnlineMerge,
     2965                                                      MediumLockList * &aMediumLockList,
     2966                                                      ComPtr<IToken> &aHDLockToken)
    29692967{
    29702968    Assert(!mParent->i_getMediaTreeLockHandle().isWriteLockOnCurrentThread());
     
    32473245 * @note Locks the medium tree and the hard disks in the chain for writing.
    32483246 */
    3249 void SessionMachine::cancelDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
    3250                                                 const ComObjPtr<Medium> &aSource,
    3251                                                 MediumLockList *aChildrenToReparent,
    3252                                                 bool fNeedsOnlineMerge,
    3253                                                 MediumLockList *aMediumLockList,
    3254                                                 const ComPtr<IToken> &aHDLockToken,
    3255                                                 const Guid &aMachineId,
    3256                                                 const Guid &aSnapshotId)
     3247void SessionMachine::i_cancelDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
     3248                                                  const ComObjPtr<Medium> &aSource,
     3249                                                  MediumLockList *aChildrenToReparent,
     3250                                                  bool fNeedsOnlineMerge,
     3251                                                  MediumLockList *aMediumLockList,
     3252                                                  const ComPtr<IToken> &aHDLockToken,
     3253                                                  const Guid &aMachineId,
     3254                                                  const Guid &aSnapshotId)
    32573255{
    32583256    if (aMediumLockList == NULL)
     
    33433341 * @param pfNeedsMachineSaveSettings Whether the VM settings need to be saved (out).
    33443342 */
    3345 HRESULT SessionMachine::onlineMergeMedium(const ComObjPtr<MediumAttachment> &aMediumAttachment,
    3346                                           const ComObjPtr<Medium> &aSource,
    3347                                           const ComObjPtr<Medium> &aTarget,
    3348                                           bool fMergeForward,
    3349                                           const ComObjPtr<Medium> &aParentForTarget,
    3350                                           MediumLockList *aChildrenToReparent,
    3351                                           MediumLockList *aMediumLockList,
    3352                                           ComObjPtr<Progress> &aProgress,
    3353                                           bool *pfNeedsMachineSaveSettings)
     3343HRESULT SessionMachine::i_onlineMergeMedium(const ComObjPtr<MediumAttachment> &aMediumAttachment,
     3344                                            const ComObjPtr<Medium> &aSource,
     3345                                            const ComObjPtr<Medium> &aTarget,
     3346                                            bool fMergeForward,
     3347                                            const ComObjPtr<Medium> &aParentForTarget,
     3348                                            MediumLockList *aChildrenToReparent,
     3349                                            MediumLockList *aMediumLockList,
     3350                                            ComObjPtr<Progress> &aProgress,
     3351                                            bool *pfNeedsMachineSaveSettings)
    33543352{
    33553353    AssertReturn(aSource != NULL, E_FAIL);
  • trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp

    r50355 r51498  
    77
    88/*
    9  * Copyright (C) 2008-2013 Oracle Corporation
     9 * Copyright (C) 2008-2014 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9090          pParent(aMachine)
    9191    {
    92         unconst(pVirtualBox) = aMachine->getVirtualBox();
     92        unconst(pVirtualBox) = aMachine->i_getVirtualBox();
    9393        unconst(pSystemProperties) = pVirtualBox->i_getSystemProperties();
    9494    }
     
    147147    if (FAILED(rc))
    148148        return rc;
    149     rc = aParent->getVirtualBox()->i_getSystemProperties()->GetMaxInstancesOfStorageBus(chipsetType, aStorageBus, &maxInstances);
     149    rc = aParent->i_getVirtualBox()->i_getSystemProperties()->
     150        GetMaxInstancesOfStorageBus(chipsetType, aStorageBus, &maxInstances);
    150151    if (FAILED(rc))
    151152        return rc;
     
    544545        alock.release();
    545546        AutoWriteLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS);        // m->pParent is const, needs no locking
    546         m->pParent->setModified(Machine::IsModified_Storage);
     547        m->pParent->i_setModified(Machine::IsModified_Storage);
    547548        mlock.release();
    548549
    549         m->pParent->onStorageControllerChange();
     550        m->pParent->i_onStorageControllerChange();
    550551    }
    551552
     
    601602        alock.release();
    602603        AutoWriteLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS);        // m->pParent is const, needs no locking
    603         m->pParent->setModified(Machine::IsModified_Storage);
     604        m->pParent->i_setModified(Machine::IsModified_Storage);
    604605        mlock.release();
    605606
    606         m->pParent->onStorageControllerChange();
     607        m->pParent->i_onStorageControllerChange();
    607608    }
    608609
  • trunk/src/VBox/Main/src-server/USBDeviceFilterImpl.cpp

    r51092 r51498  
    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
     
    471471
    472472        AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    473         pMachine->setModified(Machine::IsModified_USB);
     473        pMachine->i_setModified(Machine::IsModified_USB);
    474474        mlock.release();
    475475
     
    509509
    510510        AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    511         pMachine->setModified(Machine::IsModified_USB);
     511        pMachine->i_setModified(Machine::IsModified_USB);
    512512        mlock.release();
    513513
     
    625625
    626626        AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    627         pMachine->setModified(Machine::IsModified_USB);
     627        pMachine->i_setModified(Machine::IsModified_USB);
    628628        mlock.release();
    629629
     
    662662
    663663        AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    664         pMachine->setModified(Machine::IsModified_USB);
     664        pMachine->i_setModified(Machine::IsModified_USB);
    665665        mlock.release();
    666666
     
    814814
    815815        AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    816         pMachine->setModified(Machine::IsModified_USB);
     816        pMachine->i_setModified(Machine::IsModified_USB);
    817817        mlock.release();
    818818
     
    987987 * to be our parent.
    988988 */
    989 RWLockHandle *HostUSBDeviceFilter::i_lockHandle() const
     989RWLockHandle *HostUSBDeviceFilter::lockHandle() const
    990990{
    991991    return mParent->lockHandle();
  • trunk/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp

    r50355 r51498  
    55
    66/*
    7  * Copyright (C) 2005-2013 Oracle Corporation
     7 * Copyright (C) 2005-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5151    Data(Machine *pMachine)
    5252        : pParent(pMachine),
    53           pHost(pMachine->getVirtualBox()->i_host())
     53          pHost(pMachine->i_getVirtualBox()->i_host())
    5454    { }
    5555
     
    389389    alock.release();
    390390    AutoWriteLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS);
    391     m->pParent->setModified(Machine::IsModified_USB);
     391    m->pParent->i_setModified(Machine::IsModified_USB);
    392392    mlock.release();
    393393
     
    456456    alock.release();
    457457    AutoWriteLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS);
    458     m->pParent->setModified(Machine::IsModified_USB);
     458    m->pParent->i_setModified(Machine::IsModified_USB);
    459459    mlock.release();
    460460
     
    826826
    827827    if (    aFilter->mInList
    828          && m->pParent->isRegistered())
     828         && m->pParent->i_isRegistered())
    829829    {
    830830        USBProxyService *pProxySvc = m->pHost->i_usbProxyService();
     
    881881
    882882    /* It is not possible to work with USB device if there is no USB controller present. */
    883     if (!m->pParent->isUSBControllerPresent())
     883    if (!m->pParent->i_isUSBControllerPresent())
    884884        return false;
    885885
     
    922922
    923923    /* It is not possible to work with USB device if there is no USB controller present. */
    924     if (!m->pParent->isUSBControllerPresent())
     924    if (!m->pParent->i_isUSBControllerPresent())
    925925        return false;
    926926
  • trunk/src/VBox/Main/src-server/USBProxyService.cpp

    r51441 r51498  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    211211    LogFlowThisFunc(("aMachine=%p{%s} aId={%RTuuid} aDone=%RTbool\n",
    212212                     aMachine,
    213                      aMachine->getName().c_str(),
     213                     aMachine->i_getName().c_str(),
    214214                     Guid(aId).raw(),
    215215                     aDone));
     
    274274    LogFlowThisFunc(("aMachine=%p{%s}\n",
    275275                     aMachine,
    276                      aMachine->getName().c_str()));
     276                     aMachine->i_getName().c_str()));
    277277
    278278    /*
     
    524524     */
    525525    ULONG ulMaskedIfs;
    526     if (aMachine->hasMatchingUSBFilter(aDevice, &ulMaskedIfs))
     526    if (aMachine->i_hasMatchingUSBFilter(aDevice, &ulMaskedIfs))
    527527    {
    528528        /* try to capture the device */
  • trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp

    r50914 r51498  
    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
     
    274274
    275275        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, needs no locking
    276         mParent->setModified(Machine::IsModified_VRDEServer);
     276        mParent->i_setModified(Machine::IsModified_VRDEServer);
    277277        mlock.release();
    278278
    279         /* Avoid deadlock when onVRDEServerChange eventually calls SetExtraData. */
     279        /* Avoid deadlock when i_onVRDEServerChange eventually calls SetExtraData. */
    280280        adep.release();
    281281
    282         rc = mParent->onVRDEServerChange(/* aRestart */ TRUE);
     282        rc = mParent->i_onVRDEServerChange(/* aRestart */ TRUE);
    283283    }
    284284
     
    404404
    405405            AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, needs no locking
    406             mParent->setModified(Machine::IsModified_VRDEServer);
     406            mParent->i_setModified(Machine::IsModified_VRDEServer);
    407407            mlock.release();
    408408
    409             /* Avoid deadlock when onVRDEServerChange eventually calls SetExtraData. */
     409            /* Avoid deadlock when i_onVRDEServerChange eventually calls SetExtraData. */
    410410            adep.release();
    411411
    412             mParent->onVRDEServerChange(/* aRestart */ TRUE);
     412            mParent->i_onVRDEServerChange(/* aRestart */ TRUE);
    413413        }
    414414    }
     
    435435
    436436            AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
    437             mParent->setModified(Machine::IsModified_VRDEServer);
     437            mParent->i_setModified(Machine::IsModified_VRDEServer);
    438438            mlock.release();
    439439
    440             /* Avoid deadlock when onVRDEServerChange eventually calls SetExtraData. */
     440            /* Avoid deadlock when i_onVRDEServerChange eventually calls SetExtraData. */
    441441            adep.release();
    442442
    443             mParent->onVRDEServerChange(/* aRestart */ TRUE);
     443            mParent->i_onVRDEServerChange(/* aRestart */ TRUE);
    444444        }
    445445    }
     
    536536    {
    537537#ifdef VBOX_WITH_EXTPACK
    538         VirtualBox *pVirtualBox = mParent->getVirtualBox();
     538        VirtualBox *pVirtualBox = mParent->i_getVirtualBox();
    539539        ExtPackManager *pExtPackMgr = pVirtualBox->i_getExtPackManager();
    540540        vrc = pExtPackMgr->i_getVrdeLibraryPathForExtPack(&strExtPack, &strVrdeLibrary);
     
    618618
    619619        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, needs no locking
    620         mParent->setModified(Machine::IsModified_VRDEServer);
     620        mParent->i_setModified(Machine::IsModified_VRDEServer);
    621621        mlock.release();
    622622
    623         mParent->onVRDEServerChange(/* aRestart */ TRUE);
     623        mParent->i_onVRDEServerChange(/* aRestart */ TRUE);
    624624    }
    625625
     
    654654
    655655        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, needs no locking
    656         mParent->setModified(Machine::IsModified_VRDEServer);
     656        mParent->i_setModified(Machine::IsModified_VRDEServer);
    657657        mlock.release();
    658658
     
    677677        /* Get the global setting. */
    678678        ComPtr<ISystemProperties> systemProperties;
    679         HRESULT hrc = mParent->getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
     679        HRESULT hrc = mParent->i_getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    680680        if (SUCCEEDED(hrc))
    681681        {
     
    711711
    712712        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
    713         mParent->setModified(Machine::IsModified_VRDEServer);
     713        mParent->i_setModified(Machine::IsModified_VRDEServer);
    714714        mlock.release();
    715715
    716         mParent->onVRDEServerChange(/* aRestart */ TRUE);
     716        mParent->i_onVRDEServerChange(/* aRestart */ TRUE);
    717717    }
    718718
     
    748748
    749749        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, needs no locking
    750         mParent->setModified(Machine::IsModified_VRDEServer);
     750        mParent->i_setModified(Machine::IsModified_VRDEServer);
    751751        mlock.release();
    752752
    753         mParent->onVRDEServerChange(/* aRestart */ TRUE); // @todo does it need a restart?
     753        mParent->i_onVRDEServerChange(/* aRestart */ TRUE); // @todo does it need a restart?
    754754    }
    755755
     
    783783
    784784        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, needs no locking
    785         mParent->setModified(Machine::IsModified_VRDEServer);
     785        mParent->i_setModified(Machine::IsModified_VRDEServer);
    786786        mlock.release();
    787787
    788         mParent->onVRDEServerChange(/* aRestart */ TRUE); // @todo needs a restart?
     788        mParent->i_onVRDEServerChange(/* aRestart */ TRUE); // @todo needs a restart?
    789789    }
    790790
     
    806806        {
    807807#ifdef VBOX_WITH_EXTPACK
    808             ExtPackManager *pExtPackMgr = mParent->getVirtualBox()->i_getExtPackManager();
     808            ExtPackManager *pExtPackMgr = mParent->i_getVirtualBox()->i_getExtPackManager();
    809809            hrc = pExtPackMgr->i_checkVrdeExtPack(&strExtPack);
    810810#else
     
    819819        /* Get the global setting. */
    820820        ComPtr<ISystemProperties> systemProperties;
    821         hrc = mParent->getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
     821        hrc = mParent->i_getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    822822        if (SUCCEEDED(hrc))
    823823        {
     
    851851            {
    852852#ifdef VBOX_WITH_EXTPACK
    853                 ExtPackManager *pExtPackMgr = mParent->getVirtualBox()->i_getExtPackManager();
     853                ExtPackManager *pExtPackMgr = mParent->i_getVirtualBox()->i_getExtPackManager();
    854854                hrc = pExtPackMgr->i_checkVrdeExtPack(&aExtPack);
    855855#else
     
    874874
    875875                AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
    876                 mParent->setModified(Machine::IsModified_VRDEServer);
     876                mParent->i_setModified(Machine::IsModified_VRDEServer);
    877877                mlock.release();
    878878
    879                 mParent->onVRDEServerChange(/* aRestart */ TRUE);
     879                mParent->i_onVRDEServerChange(/* aRestart */ TRUE);
    880880            }
    881881        }
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r51441 r51498  
    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
     
    921921        AutoReadLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    922922
    923         if (pMachine->isAccessible())
    924         {
    925             const StringsList &thisGroups = pMachine->getGroups();
     923        if (pMachine->i_isAccessible())
     924        {
     925            const StringsList &thisGroups = pMachine->i_getGroups();
    926926            for (StringsList::const_iterator it2 = thisGroups.begin();
    927927                 it2 != thisGroups.end(); ++it2)
     
    10911091        AutoReadLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    10921092
    1093         if (pMachine->isAccessible())
    1094         {
    1095             uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->getChipsetType());
     1093        if (pMachine->i_isAccessible())
     1094        {
     1095            uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->i_getChipsetType());
    10961096            for (ULONG i = 0; i < cNetworkAdapters; i++)
    10971097            {
     
    11421142        AutoReadLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    11431143
    1144         if (pMachine->isAccessible())
    1145         {
    1146             uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->getChipsetType());
     1144        if (pMachine->i_isAccessible())
     1145        {
     1146            uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->i_getChipsetType());
    11471147            for (ULONG i = 0; i < cNetworkAdapters; i++)
    11481148            {
     
    16101610    /* fire an event */
    16111611    if (SUCCEEDED(rc))
    1612         i_onMachineRegistered(pMachine->getId(), TRUE);
     1612        i_onMachineRegistered(pMachine->i_getId(), TRUE);
    16131613
    16141614    return rc;
     
    16801680        AutoReadLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    16811681
    1682         if (pMachine->isAccessible())
    1683         {
    1684             const StringsList &thisGroups = pMachine->getGroups();
     1682        if (pMachine->i_isAccessible())
     1683        {
     1684            const StringsList &thisGroups = pMachine->i_getGroups();
    16851685            for (StringsList::const_iterator it2 = thisGroups.begin();
    16861686                 it2 != thisGroups.end();
     
    29862986        ComObjPtr<SessionMachine> sm;
    29872987        ComPtr<IInternalSessionControl> ctl;
    2988         if ((*it)->isSessionOpen(sm, &ctl))
     2988        if ((*it)->i_isSessionOpen(sm, &ctl))
    29892989        {
    29902990            aMachines.push_back(sm);
     
    30463046            }
    30473047
    3048             if (pMachine->getId() == aId)
     3048            if (pMachine->i_getId() == aId)
    30493049            {
    30503050                rc = S_OK;
     
    30903090
    30913091        AutoReadLock machLock(pMachine COMMA_LOCKVAL_SRC_POS);
    3092         if (pMachine->getName() == aName)
     3092        if (pMachine->i_getName() == aName)
    30933093        {
    30943094            rc = S_OK;
     
    30973097            break;
    30983098        }
    3099         if (!RTPathCompare(pMachine->getSettingsFileFull().c_str(), aName.c_str()))
     3099        if (!RTPathCompare(pMachine->i_getSettingsFileFull().c_str(), aName.c_str()))
    31003100        {
    31013101            rc = S_OK;
     
    40054005                // save actual machine registry entry
    40064006                settings::MachineRegistryEntry mre;
    4007                 rc = pMachine->saveRegistryEntry(mre);
     4007                rc = pMachine->i_saveRegistryEntry(mre);
    40084008                m->pMainConfigFile->llMachines.push_back(mre);
    40094009            }
     
    40984098    {
    40994099        ComObjPtr<Machine> pMachine;
    4100         rc = i_findMachine(aMachine->getId(),
     4100        rc = i_findMachine(aMachine->i_getId(),
    41014101                           true /* fPermitInaccessible */,
    41024102                           false /* aDoSetError */,
     
    41104110            return setError(E_INVALIDARG,
    41114111                            tr("Registered machine with UUID {%RTuuid} ('%s') already exists"),
    4112                             aMachine->getId().raw(),
    4113                             pMachine->getSettingsFileFull().c_str());
     4112                            aMachine->i_getId().raw(),
     4113                            pMachine->i_getSettingsFileFull().c_str());
    41144114        }
    41154115
     
    41204120    if (autoCaller.state() != InInit)
    41214121    {
    4122         rc = aMachine->prepareRegister();
     4122        rc = aMachine->i_prepareRegister();
    41234123        if (FAILED(rc)) return rc;
    41244124    }
     
    45124512                    continue;
    45134513                AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS);
    4514                 rc = pMachine->saveSettings(&fNeedsGlobalSettings,
    4515                                             Machine::SaveS_Force);           // caller said save, so stop arguing
     4514                rc = pMachine->i_saveSettings(&fNeedsGlobalSettings,
     4515                                              Machine::SaveS_Force);           // caller said save, so stop arguing
    45164516            }
    45174517        }
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r50919 r51498  
    105105
    106106/* implement nsISupports parts of our objects with support for nsIClassInfo */
    107 NS_DECL_CLASSINFO(Machine)
    108 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Machine, IMachine)
    109 
    110107NS_DECL_CLASSINFO(SessionMachine)
    111108NS_IMPL_THREADSAFE_ISUPPORTS2_CI(SessionMachine, IMachine, IInternalMachineControl)
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