MachineImpl.h revision 06398ee271c11340c98025f50078c73ae813bad7
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * Implementation of IMachine in VBoxSVC - Header.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * Copyright (C) 2006-2012 Oracle Corporation
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * available from http://www.virtualbox.org. This file is free software;
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * you can redistribute it and/or modify it under the terms of the GNU
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * General Public License (GPL) as published by the Free Software
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync#include "StorageControllerImpl.h" // required for MachineImpl.h to compile on Windows
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync#endif /* VBOX_WITH_RESOURCE_USAGE_API */
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync// generated header
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync////////////////////////////////////////////////////////////////////////////////
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync// helper declarations
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync////////////////////////////////////////////////////////////////////////////////
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync// Machine class
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync////////////////////////////////////////////////////////////////////////////////
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * Internal machine data.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * Only one instance of this data exists per every machine -- it is shared
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync * by the Machine, SessionMachine and all SnapshotMachine instances
struct Data
struct Session
Data();
~Data();
struct SSData
struct UserData
struct HWData
struct GuestProperty {
HWData();
~HWData();
struct MediaData
MediaData();
~MediaData();
void FinalRelease();
// public initializer/uninitializer for internal purposes only:
bool fForceOverwrite);
void uninit();
#ifdef VBOX_WITH_RESOURCE_USAGE_API
void uninitDataAndChildObjects();
STDMETHOD(COMGETTER(StorageControllers))(ComSafeArrayOut(IStorageController *, aStorageControllers));
STDMETHOD(LaunchVMProcess)(ISession *aSession, IN_BSTR aType, IN_BSTR aEnvironment, IProgress **aProgress);
STDMETHOD(PassthroughDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aPassthrough);
STDMETHOD(TemporaryEjectDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aTempEject);
STDMETHOD(NonRotationalDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aNonRotational);
STDMETHOD(SetAutoDiscardForDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aDiscard);
STDMETHOD(Export)(IAppliance *aAppliance, IN_BSTR location, IVirtualSystemDescription **aDescription);
STDMETHOD(EnumerateGuestProperties)(IN_BSTR aPattern, ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(LONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags));
STDMETHOD(GetMediumAttachmentsOfController)(IN_BSTR aName, ComSafeArrayOut(IMediumAttachment *, aAttachments));
STDMETHOD(GetMediumAttachment)(IN_BSTR aConstrollerName, LONG aControllerPort, LONG aDevice, IMediumAttachment **aAttachment);
STDMETHOD(AddStorageController)(IN_BSTR aName, StorageBus_T aConnectionType, IStorageController **controller);
STDMETHOD(QuerySavedGuestScreenInfo)(ULONG uScreenId, ULONG *puOriginX, ULONG *puOriginY, ULONG *puWidth, ULONG *puHeight, BOOL *pfEnabled);
STDMETHOD(ReadSavedThumbnailToArray)(ULONG aScreenId, BOOL aBGR, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
STDMETHOD(ReadSavedThumbnailPNGToArray)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
STDMETHOD(QuerySavedScreenshotPNGSize)(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight);
STDMETHOD(ReadSavedScreenshotPNGToArray)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
STDMETHOD(CloneTo(IMachine *pTarget, CloneMode_T mode, ComSafeArrayIn(CloneOptions_T, options), IProgress **pProgress));
return LOCKCLASS_MACHINEOBJECT;
virtual HRESULT onNetworkAdapterChange(INetworkAdapter * /* networkAdapter */, BOOL /* changeAdapter */) { return S_OK; }
NATProtocol_T /* protocol */, IN_BSTR /* host ip */, LONG /* host port */, IN_BSTR /* guest port */, LONG /* guest port */ ) { return S_OK; }
virtual HRESULT onMediumChange(IMediumAttachment * /* mediumAttachment */, BOOL /* force */) { return S_OK; }
virtual HRESULT onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */) { return S_OK; }
if (!*directControl)
return rc;
#if defined(RT_OS_WINDOWS)
bool aAllowClosing = false);
bool isSessionSpawning();
bool checkForSpawnFailure();
bool aSetError = false)
void releaseStateDependency();
bool fSetError = false)
void ensureNoStateDependencies();
bool aSetError = false);
bool aSetError = false);
bool aSetError = false);
bool aSetError = false);
bool aOnline);
void rollbackMedia();
void commit();
struct DeleteTask;
#ifdef VBOX_WITH_GUEST_PROPS
#ifdef VBOX_WITH_RESOURCE_USAGE_API
void FinalRelease();
// public initializer/uninitializer for internal purposes only
bool checkForDeath();
struct ConsoleTaskData
struct Uninit
struct SnapshotTask;
struct DeleteSnapshotTask;
struct RestoreSnapshotTask;
bool fOnlineMergePossible,
bool &fMergeForward,
bool &fNeedOnlineMerge,
bool fNeedsOnlineMerge,
bool fMergeForward,
bool *pfNeedsMachineSaveSettings);
void unlockMedia();
#if defined(RT_OS_WINDOWS)
int mIPCSem;
# ifdef VBOX_WITH_NEW_SYS_V_KEYGEN
void FinalRelease();
// public initializer/uninitializer for internal purposes only
void uninit();
return (isSnapshotMachine())