MachineImpl.h revision 6d86d195ceaf02539230689a2163bb5e0f8fb6cd
9ad572a3ac0fd3845a9abecfbf41e8db9b3a5cf0vboxsync/* $Id$ */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
adf2bcd2e5d07d5a11553b88e147c1f4b2249bffvboxsync/** @file
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync *
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * VirtualBox COM class implementation
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync */
c58f1213e628a545081c70e26c6b67a841cff880vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/*
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * Copyright (C) 2006-2010 Oracle Corporation
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync *
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * available from http://www.virtualbox.org. This file is free software;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * you can redistribute it and/or modify it under the terms of the GNU
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * General Public License (GPL) as published by the Free Software
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifndef ____H_MACHINEIMPL
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#define ____H_MACHINEIMPL
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
70bb61ea2f96e80150e807529ce5df435607706bvboxsync#include "VirtualBoxBase.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "SnapshotImpl.h"
23179f1443b03947d85eccc81cbc6b5153a4abf3vboxsync#include "VRDPServerImpl.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "MediumAttachmentImpl.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "MediumLock.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "NetworkAdapterImpl.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "AudioAdapterImpl.h"
edefdc20eedaf9ef5b1293e56ba9b8cca7b5c740vboxsync#include "SerialPortImpl.h"
edefdc20eedaf9ef5b1293e56ba9b8cca7b5c740vboxsync#include "ParallelPortImpl.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "BIOSSettingsImpl.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "StorageControllerImpl.h" // required for MachineImpl.h to compile on Windows
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "VBox/settings.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifdef VBOX_WITH_RESOURCE_USAGE_API
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#include "Performance.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "PerformanceImpl.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#endif /* VBOX_WITH_RESOURCE_USAGE_API */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync// generated header
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include "SchemaDefs.h"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include <VBox/types.h>
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include <iprt/file.h>
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#include <iprt/thread.h>
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#include <iprt/time.h>
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#include <list>
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync// defines
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync////////////////////////////////////////////////////////////////////////////////
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
b304856b23107864c9c594a80cebca6006623f31vboxsync// helper declarations
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync////////////////////////////////////////////////////////////////////////////////
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass Progress;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass Keyboard;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass Mouse;
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsyncclass Display;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass MachineDebugger;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass USBController;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass Snapshot;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass SharedFolder;
c33fc49611f2444dade533488bf431e29eb88bcdvboxsyncclass HostUSBDevice;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass StorageController;
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass SessionMachine;
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsyncnamespace settings
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync{
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync class MachineConfigFile;
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync struct Snapshot;
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync struct Hardware;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync struct Storage;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync struct StorageController;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync struct MachineRegistryEntry;
9353e321b583ed6f2b42414257a5212885575b5cvboxsync}
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9353e321b583ed6f2b42414257a5212885575b5cvboxsync// Machine class
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync////////////////////////////////////////////////////////////////////////////////
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncclass ATL_NO_VTABLE Machine :
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync public VirtualBoxBaseWithChildrenNEXT,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync public VirtualBoxSupportErrorInfoImpl<Machine, IMachine>,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync public VirtualBoxSupportTranslation<Machine>,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync VBOX_SCRIPTABLE_IMPL(IMachine)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync{
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync Q_OBJECT
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsyncpublic:
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync enum StateDependency
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync {
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync AnyStateDep = 0, MutableStateDep, MutableOrSavedStateDep
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync };
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync /**
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync * Internal machine data.
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync *
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync * Only one instance of this data exists per every machine -- it is shared
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * by the Machine, SessionMachine and all SnapshotMachine instances
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * associated with the given machine using the util::Shareable template
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync * through the mData variable.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync *
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @note |const| members are persistent during lifetime so can be
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync * accessed without locking.
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync *
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync * @note There is no need to lock anything inside init() or uninit()
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * methods, because they are always serialized (see AutoCaller).
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync struct Data
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync {
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync /**
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * Data structure to hold information about sessions opened for the
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync * given machine.
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync */
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync struct Session
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync {
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync /** Control of the direct session opened by openSession() */
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ComPtr<IInternalSessionControl> mDirectControl;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync typedef std::list<ComPtr<IInternalSessionControl> > RemoteControlList;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync /** list of controls of all opened remote sessions */
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync RemoteControlList mRemoteControls;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
19cb1f8699e352d590c4946caee33863a5157241vboxsync /** openRemoteSession() and OnSessionEnd() progress indicator */
19cb1f8699e352d590c4946caee33863a5157241vboxsync ComObjPtr<Progress> mProgress;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync /**
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync * PID of the session object that must be passed to openSession() to
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync * finalize the openRemoteSession() request (i.e., PID of the
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync * process created by openRemoteSession())
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync RTPROCESS mPid;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync /** Current session state */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync SessionState_T mState;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync /** Session type string (for indirect sessions) */
3933885bc0c2c93436d858a14564c6179ec72872vboxsync Bstr mType;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync /** Session machine object */
3933885bc0c2c93436d858a14564c6179ec72872vboxsync ComObjPtr<SessionMachine> mMachine;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync /** Medium object lock collection. */
3933885bc0c2c93436d858a14564c6179ec72872vboxsync MediumLockListMap mLockedMedia;
cc74f15083bf80fbc96723a89faa06c15d0dead8vboxsync };
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync Data();
3933885bc0c2c93436d858a14564c6179ec72872vboxsync ~Data();
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync const Guid mUuid;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync BOOL mRegistered;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync /** Flag indicating that the config file is read-only. */
9ca017ceee656f9d33f2cb6652e401b5f17fcfb7vboxsync Utf8Str m_strConfigFile;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync Utf8Str m_strConfigFileFull;
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync // machine settings XML file
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync settings::MachineConfigFile *pMachineConfigFile;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync uint32_t flModifications;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOL mAccessible;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync com::ErrorInfo mAccessError;
ad9e5a61fea617d40d07390ff1737277d6aef869vboxsync
23d9dbdaf1b83107abf9882246a4a46933f733efvboxsync MachineState_T mMachineState;
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync RTTIMESPEC mLastStateChange;
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync /* Note: These are guarded by VirtualBoxBase::stateLockHandle() */
dbabc9de5bf52ce5eb77cf82b038e9a6166c5a04vboxsync uint32_t mMachineStateDeps;
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync RTSEMEVENTMULTI mMachineStateDepsSem;
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync uint32_t mMachineStateChangePending;
40dce69ff1c2949a489337922f30f1021d62d864vboxsync
40dce69ff1c2949a489337922f30f1021d62d864vboxsync BOOL mCurrentStateModified;
40dce69ff1c2949a489337922f30f1021d62d864vboxsync /** Guest properties have been modified and need saving since the
40dce69ff1c2949a489337922f30f1021d62d864vboxsync * machine was started, or there are transient properties which need
40dce69ff1c2949a489337922f30f1021d62d864vboxsync * deleting and the machine is being shut down. */
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync BOOL mGuestPropertiesModified;
7a29aa5ce149ccd344a2929d2815b8e212690b92vboxsync
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync Session mSession;
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync ComObjPtr<Snapshot> mFirstSnapshot;
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync ComObjPtr<Snapshot> mCurrentSnapshot;
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync };
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync
7708252d252a55417a6a817041e4356797e34255vboxsync /**
5a41049c24bcf93e3dc63c76bee23db645867e0cvboxsync * Saved state data.
62ab017295981c81484e5a5f93ff8b5f85f7defbvboxsync *
62ab017295981c81484e5a5f93ff8b5f85f7defbvboxsync * It's actually only the state file path string, but it needs to be
7708252d252a55417a6a817041e4356797e34255vboxsync * separate from Data, because Machine and SessionMachine instances
7708252d252a55417a6a817041e4356797e34255vboxsync * share it, while SnapshotMachine does not.
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync *
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync * The data variable is |mSSData|.
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync */
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync struct SSData
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync {
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync Utf8Str mStateFilePath;
f2dbf051efd73ff79892d4cec2b466139f962a40vboxsync };
5d57bcb78f1f3f918bd3daf709b551b8c2d30485vboxsync
cccc6ee5f7156cfcdf13acca545cf65124d9ed44vboxsync /**
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync * User changeable machine data.
904810c4c6668233349b025cc58013cb7c11c701vboxsync *
904810c4c6668233349b025cc58013cb7c11c701vboxsync * This data is common for all machine snapshots, i.e. it is shared
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * by all SnapshotMachine instances associated with the given machine
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * using the util::Backupable template through the |mUserData| variable.
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync *
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * SessionMachine instances can alter this data and discard changes.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync *
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync * @note There is no need to lock anything inside init() or uninit()
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync * methods, because they are always serialized (see AutoCaller).
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync struct UserData
b304856b23107864c9c594a80cebca6006623f31vboxsync {
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync UserData();
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ~UserData();
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync Bstr mName;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync BOOL mNameSync;
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync Bstr mDescription;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync Bstr mOSTypeId;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync Bstr mSnapshotFolder;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync Bstr mSnapshotFolderFull;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync BOOL mTeleporterEnabled;
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync ULONG mTeleporterPort;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync Bstr mTeleporterAddress;
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync Bstr mTeleporterPassword;
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync BOOL mRTCUseUTC;
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync };
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync /**
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync * Hardware data.
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync *
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync * This data is unique for a machine and for every machine snapshot.
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync * Stored using the util::Backupable template in the |mHWData| variable.
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync *
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync * SessionMachine instances can alter this data and discard changes.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync struct HWData
9353e321b583ed6f2b42414257a5212885575b5cvboxsync {
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync /**
9353e321b583ed6f2b42414257a5212885575b5cvboxsync * Data structure to hold information about a guest property.
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync struct GuestProperty {
fc5f879e9508f333e20b37c63db9189a33059308vboxsync /** Property name */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync Utf8Str strName;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync /** Property value */
1c6ec9a3a329da6f61978a372e509cd233f0d9f9vboxsync Utf8Str strValue;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync /** Property timestamp */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG64 mTimestamp;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync /** Property flags */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mFlags;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync };
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync HWData();
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ~HWData();
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync Bstr mHWVersion;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync Guid mHardwareUUID; /**< If Null, use mData.mUuid. */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mMemorySize;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mMemoryBalloonSize;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mVRAMSize;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mMonitorCount;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOL mHWVirtExEnabled;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync BOOL mHWVirtExExclusive;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync BOOL mHWVirtExNestedPagingEnabled;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOL mHWVirtExLargePagesEnabled;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOL mHWVirtExVPIDEnabled;
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync BOOL mAccelerate2DVideoEnabled;
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync BOOL mPAEEnabled;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync BOOL mSyntheticCpu;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mCPUCount;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync BOOL mCPUHotPlugEnabled;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOL mAccelerate3DEnabled;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOL mHpetEnabled;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOL mCPUAttached[SchemaDefs::MaxCPUCount];
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync settings::CpuIdLeaf mCpuIdStdLeafs[10];
95cb8e789c1eed6f2bb3195d0b996feee11d548evboxsync settings::CpuIdLeaf mCpuIdExtLeafs[10];
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync DeviceType_T mBootOrder[SchemaDefs::MaxBootPosition];
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync typedef std::list< ComObjPtr<SharedFolder> > SharedFolderList;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync SharedFolderList mSharedFolders;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ClipboardMode_T mClipboardMode;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync typedef std::list<GuestProperty> GuestPropertyList;
19cb1f8699e352d590c4946caee33863a5157241vboxsync GuestPropertyList mGuestProperties;
19cb1f8699e352d590c4946caee33863a5157241vboxsync Utf8Str mGuestPropertyNotificationPatterns;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync FirmwareType_T mFirmwareType;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync KeyboardHidType_T mKeyboardHidType;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync PointingHidType_T mPointingHidType;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync BOOL mIoCacheEnabled;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mIoCacheSize;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG mIoBandwidthMax;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync };
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
3933885bc0c2c93436d858a14564c6179ec72872vboxsync * Hard disk and other media data.
3933885bc0c2c93436d858a14564c6179ec72872vboxsync *
3933885bc0c2c93436d858a14564c6179ec72872vboxsync * The usage policy is the same as for HWData, but a separate structure
3933885bc0c2c93436d858a14564c6179ec72872vboxsync * is necessary because hard disk data requires different procedures when
3933885bc0c2c93436d858a14564c6179ec72872vboxsync * taking or deleting snapshots, etc.
3933885bc0c2c93436d858a14564c6179ec72872vboxsync *
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsync * The data variable is |mMediaData|.
3933885bc0c2c93436d858a14564c6179ec72872vboxsync */
cc74f15083bf80fbc96723a89faa06c15d0dead8vboxsync struct MediaData
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync {
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync MediaData();
3933885bc0c2c93436d858a14564c6179ec72872vboxsync ~MediaData();
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync typedef std::list< ComObjPtr<MediumAttachment> > AttachmentList;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync AttachmentList mAttachments;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync };
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsync
9ca017ceee656f9d33f2cb6652e401b5f17fcfb7vboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Machine)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync DECLARE_NOT_AGGREGATABLE(Machine)
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
f106b549ead77cab51ff1e2c116060aaabb90d5evboxsync
f106b549ead77cab51ff1e2c116060aaabb90d5evboxsync BEGIN_COM_MAP(Machine)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync COM_INTERFACE_ENTRY(ISupportErrorInfo)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync COM_INTERFACE_ENTRY(IMachine)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync COM_INTERFACE_ENTRY(IDispatch)
23d9dbdaf1b83107abf9882246a4a46933f733efvboxsync END_COM_MAP()
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync DECLARE_EMPTY_CTOR_DTOR(Machine)
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync
ad9e5a61fea617d40d07390ff1737277d6aef869vboxsync HRESULT FinalConstruct();
dbabc9de5bf52ce5eb77cf82b038e9a6166c5a04vboxsync void FinalRelease();
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync // public initializer/uninitializer for internal purposes only:
40dce69ff1c2949a489337922f30f1021d62d864vboxsync
40dce69ff1c2949a489337922f30f1021d62d864vboxsync // initializer for creating a new, empty machine
40dce69ff1c2949a489337922f30f1021d62d864vboxsync HRESULT init(VirtualBox *aParent,
40dce69ff1c2949a489337922f30f1021d62d864vboxsync const Utf8Str &strConfigFile,
40dce69ff1c2949a489337922f30f1021d62d864vboxsync const Utf8Str &strName,
7a29aa5ce149ccd344a2929d2815b8e212690b92vboxsync const Guid &aId,
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync GuestOSType *aOsType = NULL,
f57758f0bcf995d350d64a7c059ac93573144c05vboxsync BOOL aOverride = FALSE,
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync BOOL aNameSync = TRUE);
f57758f0bcf995d350d64a7c059ac93573144c05vboxsync
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync // initializer for loading existing machine XML (either registered or not)
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync HRESULT init(VirtualBox *aParent,
5d57bcb78f1f3f918bd3daf709b551b8c2d30485vboxsync const Utf8Str &strConfigFile,
cccc6ee5f7156cfcdf13acca545cf65124d9ed44vboxsync const Guid *aId);
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync // initializer for machine config in memory (OVF import)
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync HRESULT init(VirtualBox *aParent,
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync const Utf8Str &strName,
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync const settings::MachineConfigFile &config);
505ddd00252720bfb5569fcb17bfda53dc141e3bvboxsync
505ddd00252720bfb5569fcb17bfda53dc141e3bvboxsync void uninit();
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync
5a41049c24bcf93e3dc63c76bee23db645867e0cvboxsyncprotected:
62ab017295981c81484e5a5f93ff8b5f85f7defbvboxsync HRESULT initImpl(VirtualBox *aParent,
62ab017295981c81484e5a5f93ff8b5f85f7defbvboxsync const Utf8Str &strConfigFile);
7708252d252a55417a6a817041e4356797e34255vboxsync HRESULT initDataAndChildObjects();
7708252d252a55417a6a817041e4356797e34255vboxsync HRESULT registeredInit();
7708252d252a55417a6a817041e4356797e34255vboxsync HRESULT tryCreateMachineConfigFile(BOOL aOverride);
904810c4c6668233349b025cc58013cb7c11c701vboxsync void uninitDataAndChildObjects();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncpublic:
3933885bc0c2c93436d858a14564c6179ec72872vboxsync // IMachine properties
3933885bc0c2c93436d858a14564c6179ec72872vboxsync STDMETHOD(COMGETTER(Parent))(IVirtualBox **aParent);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync STDMETHOD(COMGETTER(Accessible))(BOOL *aAccessible);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync STDMETHOD(COMGETTER(AccessError))(IVirtualBoxErrorInfo **aAccessError);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync STDMETHOD(COMGETTER(Name))(BSTR *aName);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(Name))(IN_BSTR aName);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(Description))(BSTR *aDescription);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(Description))(IN_BSTR aDescription);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(Id))(BSTR *aId);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(OSTypeId))(BSTR *aOSTypeId);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(OSTypeId))(IN_BSTR aOSTypeId);
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync STDMETHOD(COMGETTER(HardwareVersion))(BSTR *aVersion);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(HardwareVersion))(IN_BSTR aVersion);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(HardwareUUID))(BSTR *aUUID);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(HardwareUUID))(IN_BSTR aUUID);
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync STDMETHOD(COMGETTER(MemorySize))(ULONG *memorySize);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(MemorySize))(ULONG memorySize);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(CPUCount))(ULONG *cpuCount);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(CPUCount))(ULONG cpuCount);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(CPUHotPlugEnabled))(BOOL *enabled);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(CPUHotPlugEnabled))(BOOL enabled);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(HpetEnabled))(BOOL *enabled);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(HpetEnabled))(BOOL enabled);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(MemoryBalloonSize))(ULONG *memoryBalloonSize);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMSETTER(MemoryBalloonSize))(ULONG memoryBalloonSize);
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync STDMETHOD(COMGETTER(PageFusionEnabled))(BOOL *enabled);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync STDMETHOD(COMSETTER(PageFusionEnabled))(BOOL enabled);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(VRAMSize))(ULONG *memorySize);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMSETTER(VRAMSize))(ULONG memorySize);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(MonitorCount))(ULONG *monitorCount);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMSETTER(MonitorCount))(ULONG monitorCount);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(Accelerate3DEnabled))(BOOL *enabled);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMSETTER(Accelerate3DEnabled))(BOOL enabled);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(Accelerate2DVideoEnabled))(BOOL *enabled);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMSETTER(Accelerate2DVideoEnabled))(BOOL enabled);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(BIOSSettings))(IBIOSSettings **biosSettings);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(SnapshotFolder))(BSTR *aSavedStateFolder);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMSETTER(SnapshotFolder))(IN_BSTR aSavedStateFolder);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(MediumAttachments))(ComSafeArrayOut(IMediumAttachment *, aAttachments));
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(VRDPServer))(IVRDPServer **vrdpServer);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(AudioAdapter))(IAudioAdapter **audioAdapter);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(USBController))(IUSBController * *aUSBController);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(SettingsFilePath))(BSTR *aFilePath);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(SettingsModified))(BOOL *aModified);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(COMGETTER(SessionState))(SessionState_T *aSessionState);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(SessionType))(BSTR *aSessionType);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(SessionPid))(ULONG *aSessionPid);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(State))(MachineState_T *machineState);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(LastStateChange))(LONG64 *aLastStateChange);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(StateFilePath))(BSTR *aStateFilePath);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(LogFolder))(BSTR *aLogFolder);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(CurrentSnapshot))(ISnapshot **aCurrentSnapshot);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(SnapshotCount))(ULONG *aSnapshotCount);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(CurrentStateModified))(BOOL *aCurrentStateModified);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders));
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(ClipboardMode))(ClipboardMode_T *aClipboardMode);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMSETTER(ClipboardMode))(ClipboardMode_T aClipboardMode);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(GuestPropertyNotificationPatterns))(BSTR *aPattern);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMSETTER(GuestPropertyNotificationPatterns))(IN_BSTR aPattern);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(StorageControllers))(ComSafeArrayOut(IStorageController *, aStorageControllers));
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(TeleporterEnabled))(BOOL *aEnabled);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMSETTER(TeleporterEnabled))(BOOL aEnabled);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(TeleporterPort))(ULONG *aPort);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMSETTER(TeleporterPort))(ULONG aPort);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(TeleporterAddress))(BSTR *aAddress);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMSETTER(TeleporterAddress))(IN_BSTR aAddress);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(TeleporterPassword))(BSTR *aPassword);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMSETTER(TeleporterPassword))(IN_BSTR aPassword);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync STDMETHOD(COMGETTER(RTCUseUTC))(BOOL *aEnabled);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMSETTER(RTCUseUTC))(BOOL aEnabled);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMGETTER(FirmwareType)) (FirmwareType_T *aFirmware);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(COMSETTER(FirmwareType)) (FirmwareType_T aFirmware);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMGETTER(KeyboardHidType)) (KeyboardHidType_T *aKeyboardHidType);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMSETTER(KeyboardHidType)) (KeyboardHidType_T aKeyboardHidType);
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync STDMETHOD(COMGETTER(PointingHidType)) (PointingHidType_T *aPointingHidType);
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync STDMETHOD(COMSETTER(PointingHidType)) (PointingHidType_T aPointingHidType);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(COMGETTER(IoCacheEnabled)) (BOOL *aEnabled);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(COMSETTER(IoCacheEnabled)) (BOOL aEnabled);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMGETTER(IoCacheSize)) (ULONG *aIoCacheSize);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMSETTER(IoCacheSize)) (ULONG aIoCacheSize);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMGETTER(IoBandwidthMax)) (ULONG *aIoBandwidthMax);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(COMSETTER(IoBandwidthMax)) (ULONG aIoBandwidthMax);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync // IMachine methods
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(SetBootOrder)(ULONG aPosition, DeviceType_T aDevice);
508452243fd3328f7b9e0405d39fb9dc004e31b8vboxsync STDMETHOD(GetBootOrder)(ULONG aPosition, DeviceType_T *aDevice);
508452243fd3328f7b9e0405d39fb9dc004e31b8vboxsync STDMETHOD(AttachDevice)(IN_BSTR aControllerName, LONG aControllerPort,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LONG aDevice, DeviceType_T aType, IN_BSTR aId);
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsync STDMETHOD(DetachDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice);
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsync STDMETHOD(PassthroughDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aPassthrough);
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsync STDMETHOD(MountMedium)(IN_BSTR aControllerName, LONG aControllerPort,
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsync LONG aDevice, IN_BSTR aId, BOOL aForce);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(GetMedium)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice,
f409459bdd4c15cdb8d7fb6c6d54338cce9ac814vboxsync IMedium **aMedium);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(GetSerialPort)(ULONG slot, ISerialPort **port);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(GetParallelPort)(ULONG slot, IParallelPort **port);
f4e792b5d6ee04e9d93499b747cce21510c3cdb3vboxsync STDMETHOD(GetNetworkAdapter)(ULONG slot, INetworkAdapter **adapter);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(GetExtraDataKeys)(ComSafeArrayOut(BSTR, aKeys));
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(GetExtraData)(IN_BSTR aKey, BSTR *aValue);
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync STDMETHOD(SetExtraData)(IN_BSTR aKey, IN_BSTR aValue);
fb1975a6972d89de9e515bed0248db93f04ec9d8vboxsync STDMETHOD(GetCPUProperty)(CPUPropertyType_T property, BOOL *aVal);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(SetCPUProperty)(CPUPropertyType_T property, BOOL aVal);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(GetCPUIDLeaf)(ULONG id, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx);
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync STDMETHOD(SetCPUIDLeaf)(ULONG id, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(RemoveCPUIDLeaf)(ULONG id);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(RemoveAllCPUIDLeaves)();
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(GetHWVirtExProperty)(HWVirtExPropertyType_T property, BOOL *aVal);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync STDMETHOD(SetHWVirtExProperty)(HWVirtExPropertyType_T property, BOOL aVal);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(SaveSettings)();
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(DiscardSettings)();
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(DeleteSettings)();
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(Export)(IAppliance *aAppliance, IVirtualSystemDescription **aDescription);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(GetSnapshot)(IN_BSTR aId, ISnapshot **aSnapshot);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(FindSnapshot)(IN_BSTR aName, ISnapshot **aSnapshot);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(SetCurrentSnapshot)(IN_BSTR aId);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(RemoveSharedFolder)(IN_BSTR aName);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(CanShowConsoleWindow)(BOOL *aCanShow);
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync STDMETHOD(ShowConsoleWindow)(ULONG64 *aWinId);
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync STDMETHOD(GetGuestProperty)(IN_BSTR aName, BSTR *aValue, ULONG64 *aTimestamp, BSTR *aFlags);
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync STDMETHOD(GetGuestPropertyValue)(IN_BSTR aName, BSTR *aValue);
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync STDMETHOD(GetGuestPropertyTimestamp)(IN_BSTR aName, ULONG64 *aTimestamp);
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync STDMETHOD(SetGuestProperty)(IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags);
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync STDMETHOD(SetGuestPropertyValue)(IN_BSTR aName, IN_BSTR aValue);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync STDMETHOD(EnumerateGuestProperties)(IN_BSTR aPattern, ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(ULONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags));
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(GetMediumAttachmentsOfController)(IN_BSTR aName, ComSafeArrayOut(IMediumAttachment *, aAttachments));
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync STDMETHOD(GetMediumAttachment)(IN_BSTR aConstrollerName, LONG aControllerPort, LONG aDevice, IMediumAttachment **aAttachment);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(AddStorageController)(IN_BSTR aName, StorageBus_T aConnectionType, IStorageController **controller);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(RemoveStorageController(IN_BSTR aName));
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync STDMETHOD(GetStorageControllerByName(IN_BSTR aName, IStorageController **storageController));
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(GetStorageControllerByInstance(ULONG aInstance, IStorageController **storageController));
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(QuerySavedThumbnailSize)(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync STDMETHOD(ReadSavedThumbnailToArray)(ULONG aScreenId, BOOL aBGR, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync STDMETHOD(QuerySavedScreenshotPNGSize)(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync STDMETHOD(ReadSavedScreenshotPNGToArray)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData));
e48239695d41f806ff02d8a60b97dc20d4822d7avboxsync STDMETHOD(HotPlugCPU(ULONG aCpu));
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync STDMETHOD(HotUnplugCPU(ULONG aCpu));
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(GetCPUStatus(ULONG aCpu, BOOL *aCpuAttached));
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(QueryLogFilename(ULONG aIdx, BSTR *aName));
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(ReadLog(ULONG aIdx, ULONG64 aOffset, ULONG64 aSize, ComSafeArrayOut(BYTE, aData)));
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync // public methods only for internal purposes
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync /**
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * Simple run-time type identification without having to enable C++ RTTI.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * The class IDs are defined in VirtualBoxBase.h.
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * @return
b304856b23107864c9c594a80cebca6006623f31vboxsync */
b304856b23107864c9c594a80cebca6006623f31vboxsync virtual VBoxClsID getClassID() const
b304856b23107864c9c594a80cebca6006623f31vboxsync {
b304856b23107864c9c594a80cebca6006623f31vboxsync return clsidMachine;
b304856b23107864c9c594a80cebca6006623f31vboxsync }
b304856b23107864c9c594a80cebca6006623f31vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync /**
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * Override of the default locking class to be used for validating lock
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync * order with the standard member lock handle.
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync virtual VBoxLockingClass getLockingClass() const
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync return LOCKCLASS_MACHINEOBJECT;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync }
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync /// @todo (dmik) add lock and make non-inlined after revising classes
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync // that use it. Note: they should enter Machine lock to keep the returned
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync // information valid!
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync bool isRegistered() { return !!mData->mRegistered; }
3a0bc95d0adf57baefd303e94b8f1b7b31a8f080vboxsync
3a0bc95d0adf57baefd303e94b8f1b7b31a8f080vboxsync // unsafe inline public methods for internal purposes only (ensure there is
3a0bc95d0adf57baefd303e94b8f1b7b31a8f080vboxsync // a caller and a read lock before calling them!)
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync /**
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync * Returns the VirtualBox object this machine belongs to.
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync *
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync * @note This method doesn't check this object's readiness. Intended to be
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync * used by ready Machine children (whose readiness is bound to the parent's
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync * one) or after doing addCaller() manually.
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync VirtualBox* getVirtualBox() const { return mParent; }
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync /**
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync * Returns this machine ID.
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync *
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync * @note This method doesn't check this object's readiness. Intended to be
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync * used by ready Machine children (whose readiness is bound to the parent's
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync * one) or after adding a caller manually.
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const Guid& getId() const { return mData->mUuid; }
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync /**
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * Returns the snapshot ID this machine represents or an empty UUID if this
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * instance is not SnapshotMachine.
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync *
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * @note This method doesn't check this object's readiness. Intended to be
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * used by ready Machine children (whose readiness is bound to the parent's
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * one) or after adding a caller manually.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync inline const Guid& getSnapshotId() const;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync /**
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * Returns this machine's full settings file path.
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync *
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @note This method doesn't lock this object or check its readiness.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * Intended to be used only after doing addCaller() manually and locking it
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync * for reading.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync const Utf8Str& getSettingsFileFull() const { return mData->m_strConfigFileFull; }
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync /**
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync * Returns this machine name.
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync *
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync * @note This method doesn't lock this object or check its readiness.
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync * Intended to be used only after doing addCaller() manually and locking it
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync * for reading.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync */
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync const Bstr& getName() const { return mUserData->mName; }
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync enum
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync {
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync IsModified_MachineData = 0x0001,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync IsModified_Storage = 0x0002,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync IsModified_NetworkAdapters = 0x0008,
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync IsModified_SerialPorts = 0x0010,
ab2292e9c32bd271ec91123ef38699a0284b72cbvboxsync IsModified_ParallelPorts = 0x0020,
ab2292e9c32bd271ec91123ef38699a0284b72cbvboxsync IsModified_VRDPServer = 0x0040,
ab2292e9c32bd271ec91123ef38699a0284b72cbvboxsync IsModified_AudioAdapter = 0x0080,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync IsModified_USB = 0x0100,
ab2292e9c32bd271ec91123ef38699a0284b72cbvboxsync IsModified_BIOS = 0x0200,
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync IsModified_SharedFolders = 0x0400,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync IsModified_Snapshots = 0x0800
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync };
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync void setModified(uint32_t fl);
121568d0a1e932e6f6acd49376827a0e593815favboxsync
121568d0a1e932e6f6acd49376827a0e593815favboxsync // callback handlers
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onNetworkAdapterChange(INetworkAdapter * /* networkAdapter */, BOOL /* changeAdapter */) { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onSerialPortChange(ISerialPort * /* serialPort */) { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onParallelPortChange(IParallelPort * /* parallelPort */) { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onVRDPServerChange(BOOL /* aRestart */) { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onUSBControllerChange() { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onStorageControllerChange() { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onCPUChange(ULONG /* aCPU */, BOOL /* aRemove */) { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onMediumChange(IMediumAttachment * /* mediumAttachment */, BOOL /* force */) { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync virtual HRESULT onSharedFolderChange() { return S_OK; }
121568d0a1e932e6f6acd49376827a0e593815favboxsync
121568d0a1e932e6f6acd49376827a0e593815favboxsync HRESULT saveRegistryEntry(settings::MachineRegistryEntry &data);
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync
121568d0a1e932e6f6acd49376827a0e593815favboxsync int calculateFullPath(const Utf8Str &strPath, Utf8Str &aResult);
121568d0a1e932e6f6acd49376827a0e593815favboxsync void calculateRelativePath(const Utf8Str &strPath, Utf8Str &aResult);
121568d0a1e932e6f6acd49376827a0e593815favboxsync
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync void getLogFolder(Utf8Str &aLogFolder);
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync Utf8Str queryLogFilename(ULONG idx);
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync HRESULT openSession(IInternalSessionControl *aControl);
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync HRESULT openRemoteSession(IInternalSessionControl *aControl,
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync IN_BSTR aType, IN_BSTR aEnvironment,
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync Progress *aProgress);
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync HRESULT openExistingSession(IInternalSessionControl *aControl);
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync HRESULT getDirectControl(ComPtr<IInternalSessionControl> *directControl)
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync {
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync HRESULT rc;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync *directControl = mData->mSession.mDirectControl;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync if (!*directControl)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync rc = E_ACCESSDENIED;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync else
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync rc = S_OK;
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync return rc;
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync }
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync#if defined(RT_OS_WINDOWS)
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ComPtr<IInternalSessionControl> *aControl = NULL,
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync HANDLE *aIPCSem = NULL, bool aAllowClosing = false);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync bool isSessionSpawning(RTPROCESS *aPID = NULL);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync bool isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync ComPtr<IInternalSessionControl> *aControl = NULL,
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync HANDLE *aIPCSem = NULL)
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync { return isSessionOpen(aMachine, aControl, aIPCSem, true /* aAllowClosing */); }
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync#elif defined(RT_OS_OS2)
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ComPtr<IInternalSessionControl> *aControl = NULL,
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync HMTX *aIPCSem = NULL, bool aAllowClosing = false);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync bool isSessionSpawning(RTPROCESS *aPID = NULL);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync bool isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync ComPtr<IInternalSessionControl> *aControl = NULL,
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync HMTX *aIPCSem = NULL)
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync { return isSessionOpen(aMachine, aControl, aIPCSem, true /* aAllowClosing */); }
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync#else
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync ComPtr<IInternalSessionControl> *aControl = NULL,
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync bool aAllowClosing = false);
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync bool isSessionSpawning();
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync bool isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync ComPtr<IInternalSessionControl> *aControl = NULL)
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync { return isSessionOpen(aMachine, aControl, true /* aAllowClosing */); }
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#endif
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync bool checkForSpawnFailure();
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync HRESULT trySetRegistered(BOOL aRegistered);
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync HRESULT getSharedFolder(CBSTR aName,
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync ComObjPtr<SharedFolder> &aSharedFolder,
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync bool aSetError = false)
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync {
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
d6f9950e2cf4ba7fd217c083400d9812ff745374vboxsync return findSharedFolder(aName, aSharedFolder, aSetError);
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync }
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HRESULT addStateDependency(StateDependency aDepType = AnyStateDep,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync MachineState_T *aState = NULL,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync BOOL *aRegistered = NULL);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync void releaseStateDependency();
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync // for VirtualBoxSupportErrorInfoImpl
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync static const wchar_t *getComponentName() { return L"Machine"; }
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsyncprotected:
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HRESULT checkStateDependency(StateDependency aDepType);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync Machine *getMachine();
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync void ensureNoStateDependencies();
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync virtual HRESULT setMachineState(MachineState_T aMachineState);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync HRESULT findSharedFolder(CBSTR aName,
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync ComObjPtr<SharedFolder> &aSharedFolder,
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync bool aSetError = false);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync HRESULT loadSettings(bool aRegistered);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT loadMachineDataFromSettings(const settings::MachineConfigFile &config);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync HRESULT loadSnapshot(const settings::Snapshot &data,
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync const Guid &aCurSnapshotId,
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync Snapshot *aParentSnapshot);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT loadHardware(const settings::Hardware &data);
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync HRESULT loadStorageControllers(const settings::Storage &data,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const Guid *aSnapshotId = NULL);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync HRESULT loadStorageDevices(StorageController *aStorageController,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync const settings::StorageController &data,
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync const Guid *aSnapshotId = NULL);
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync HRESULT findSnapshot(const Guid &aId, ComObjPtr<Snapshot> &aSnapshot,
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync bool aSetError = false);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync HRESULT findSnapshot(IN_BSTR aName, ComObjPtr<Snapshot> &aSnapshot,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync bool aSetError = false);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync HRESULT getStorageControllerByName(const Utf8Str &aName,
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync ComObjPtr<StorageController> &aStorageController,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync bool aSetError = false);
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT getMediumAttachmentsOfController(CBSTR aName,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync MediaData::AttachmentList &aAttachments);
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync enum
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync /* flags for #saveSettings() */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SaveS_ResetCurStateModified = 0x01,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync SaveS_InformCallbacksAnyway = 0x02,
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync SaveS_Force = 0x04,
fc5f879e9508f333e20b37c63db9189a33059308vboxsync /* flags for #saveStateSettings() */
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync SaveSTS_CurStateModified = 0x20,
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync SaveSTS_StateFilePath = 0x40,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SaveSTS_StateTimeStamp = 0x80,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync };
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync HRESULT prepareSaveSettings(bool *pfNeedsGlobalSaveSettings);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT saveSettings(bool *pfNeedsGlobalSaveSettings, int aFlags = 0);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync void copyMachineDataToSettings(settings::MachineConfigFile &config);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync HRESULT saveAllSnapshots(settings::MachineConfigFile &config);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HRESULT saveHardware(settings::Hardware &data);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HRESULT saveStorageControllers(settings::Storage &data);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT saveStorageDevices(ComObjPtr<StorageController> aStorageController,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync settings::StorageController &data);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync HRESULT saveStateSettings(int aFlags);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync HRESULT createImplicitDiffs(const Bstr &aFolder,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync IProgress *aProgress,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG aWeight,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync bool aOnline,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync bool *pfNeedsSaveSettings);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync HRESULT deleteImplicitDiffs(bool *pfNeedsSaveSettings);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync IN_BSTR aControllerName,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync LONG aControllerPort,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync LONG aDevice);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ComObjPtr<Medium> pMedium);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync Guid &id);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync void commitMedia(bool aOnline = false);
1c6ec9a3a329da6f61978a372e509cd233f0d9f9vboxsync void rollbackMedia();
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync bool isInOwnDir(Utf8Str *aSettingsDir = NULL) const;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync void rollback(bool aNotify);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync void commit();
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync void copyFrom(Machine *aThat);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifdef VBOX_WITH_GUEST_PROPS
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT getGuestPropertyFromService(IN_BSTR aName, BSTR *aValue,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG64 *aTimestamp, BSTR *aFlags) const;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HRESULT getGuestPropertyFromVM(IN_BSTR aName, BSTR *aValue,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG64 *aTimestamp, BSTR *aFlags) const;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT setGuestPropertyToService(IN_BSTR aName, IN_BSTR aValue,
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync IN_BSTR aFlags);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT setGuestPropertyToVM(IN_BSTR aName, IN_BSTR aValue,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync IN_BSTR aFlags);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT enumerateGuestPropertiesInService
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames),
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ComSafeArrayOut(BSTR, aValues),
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ComSafeArrayOut(ULONG64, aTimestamps),
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ComSafeArrayOut(BSTR, aFlags));
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync HRESULT enumerateGuestPropertiesOnVM
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames),
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ComSafeArrayOut(BSTR, aValues),
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ComSafeArrayOut(ULONG64, aTimestamps),
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ComSafeArrayOut(BSTR, aFlags));
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif /* VBOX_WITH_GUEST_PROPS */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#ifdef VBOX_WITH_RESOURCE_USAGE_API
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync void registerMetrics(PerformanceCollector *aCollector, Machine *aMachine, RTPROCESS pid);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync void unregisterMetrics(PerformanceCollector *aCollector, Machine *aMachine);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync pm::CollectorGuestHAL *mGuestHAL;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif /* VBOX_WITH_RESOURCE_USAGE_API */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync Machine* const mPeer;
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync VirtualBox* const mParent;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync Shareable<Data> mData;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync Shareable<SSData> mSSData;
7922c4cd397713a387c9e854e74c31a0d5065365vboxsync
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync Backupable<UserData> mUserData;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync Backupable<HWData> mHWData;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync Backupable<MediaData> mMediaData;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync // the following fields need special backup/rollback/commit handling,
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync // so they cannot be a part of HWData
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync const ComObjPtr<VRDPServer> mVRDPServer;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync const ComObjPtr<SerialPort> mSerialPorts[SchemaDefs::SerialPortCount];
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync const ComObjPtr<ParallelPort> mParallelPorts[SchemaDefs::ParallelPortCount];
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync const ComObjPtr<AudioAdapter> mAudioAdapter;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync const ComObjPtr<USBController> mUSBController;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync const ComObjPtr<BIOSSettings> mBIOSSettings;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync const ComObjPtr<NetworkAdapter> mNetworkAdapters[SchemaDefs::NetworkAdapterCount];
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync typedef std::list< ComObjPtr<StorageController> > StorageControllerList;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync Backupable<StorageControllerList> mStorageControllers;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync friend class SessionMachine;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync friend class SnapshotMachine;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync friend class Appliance;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync};
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync// SessionMachine class
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync////////////////////////////////////////////////////////////////////////////////
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync/**
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * @note Notes on locking objects of this class:
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * SessionMachine shares some data with the primary Machine instance (pointed
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * to by the |mPeer| member). In order to provide data consistency it also
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * shares its lock handle. This means that whenever you lock a SessionMachine
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync * instance using Auto[Reader]Lock or AutoMultiLock, the corresponding Machine
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync * instance is also locked in the same lock mode. Keep it in mind.
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync */
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsyncclass ATL_NO_VTABLE SessionMachine :
67e7d53d62514401efcd0e7a34f5faf772a3fe04vboxsync public VirtualBoxSupportTranslation<SessionMachine>,
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync public Machine,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync VBOX_SCRIPTABLE_IMPL(IInternalMachineControl)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync{
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsyncpublic:
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE(SessionMachine)
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync DECLARE_NOT_AGGREGATABLE(SessionMachine)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync BEGIN_COM_MAP(SessionMachine)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync COM_INTERFACE_ENTRY2(IDispatch, IMachine)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync COM_INTERFACE_ENTRY(ISupportErrorInfo)
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync COM_INTERFACE_ENTRY(IMachine)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync COM_INTERFACE_ENTRY(IInternalMachineControl)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync END_COM_MAP()
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync DECLARE_EMPTY_CTOR_DTOR(SessionMachine)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync HRESULT FinalConstruct();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync void FinalRelease();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync // public initializer/uninitializer for internal purposes only
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync HRESULT init(Machine *aMachine);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync void uninit() { uninit(Uninit::Unexpected); }
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync // util::Lockable interface
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync RWLockHandle *lockHandle() const;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync // IInternalMachineControl methods
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(SetRemoveSavedState)(BOOL aRemove);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(UpdateState)(MachineState_T machineState);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(GetIPCId)(BSTR *id);
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync STDMETHOD(SetPowerUpInfo)(IVirtualBoxErrorInfo *aError);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(RunUSBDeviceFilters)(IUSBDevice *aUSBDevice, BOOL *aMatched, ULONG *aMaskedIfs);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(CaptureUSBDevice)(IN_BSTR aId);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(DetachUSBDevice)(IN_BSTR aId, BOOL aDone);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(AutoCaptureUSBDevices)();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(DetachAllUSBDevices)(BOOL aDone);
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync STDMETHOD(OnSessionEnd)(ISession *aSession, IProgress **aProgress);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(BeginSavingState)(IProgress *aProgress, BSTR *aStateFilePath);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(EndSavingState)(BOOL aSuccess);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(BeginTakingSnapshot)(IConsole *aInitiator,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync IN_BSTR aName,
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync IN_BSTR aDescription,
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync IProgress *aConsoleProgress,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync BOOL fTakingSnapshotOnline,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync BSTR *aStateFilePath);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(EndTakingSnapshot)(BOOL aSuccess);
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync STDMETHOD(DeleteSnapshot)(IConsole *aInitiator, IN_BSTR aId,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync MachineState_T *aMachineState, IProgress **aProgress);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync STDMETHOD(FinishOnlineMergeMedium)(IMediumAttachment *aMediumAttachment,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync IMedium *aSource, IMedium *aTarget,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync BOOL fMergeForward,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync IMedium *pParentForTarget,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync ComSafeArrayIn(IMedium *, aChildrenToReparent));
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(RestoreSnapshot)(IConsole *aInitiator,
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ISnapshot *aSnapshot,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync MachineState_T *aMachineState,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync IProgress **aProgress);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync STDMETHOD(PullGuestProperties)(ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues),
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ComSafeArrayOut(ULONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags));
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync STDMETHOD(PushGuestProperty)(IN_BSTR aName, IN_BSTR aValue,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG64 aTimestamp, IN_BSTR aFlags);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync STDMETHOD(LockMedia)() { return lockMedia(); }
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync STDMETHOD(UnlockMedia)() { unlockMedia(); return S_OK; }
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync // public methods only for internal purposes
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync /**
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync * Simple run-time type identification without having to enable C++ RTTI.
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync * The class IDs are defined in VirtualBoxBase.h.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * @return
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync virtual VBoxClsID getClassID() const
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync return clsidSessionMachine;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync }
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync bool checkForDeath();
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync HRESULT onNetworkAdapterChange(INetworkAdapter *networkAdapter, BOOL changeAdapter);
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync HRESULT onStorageControllerChange();
67e7d53d62514401efcd0e7a34f5faf772a3fe04vboxsync HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync HRESULT onSerialPortChange(ISerialPort *serialPort);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT onParallelPortChange(IParallelPort *parallelPort);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HRESULT onCPUChange(ULONG aCPU, BOOL aRemove);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync HRESULT onVRDPServerChange(BOOL aRestart);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync HRESULT onUSBControllerChange();
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync HRESULT onUSBDeviceAttach(IUSBDevice *aDevice,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync IVirtualBoxErrorInfo *aError,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG aMaskedIfs);
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync HRESULT onUSBDeviceDetach(IN_BSTR aId,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync IVirtualBoxErrorInfo *aError);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync HRESULT onSharedFolderChange();
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync bool hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncprivate:
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct SnapshotData
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SnapshotData() : mLastState(MachineState_Null) {}
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync MachineState_T mLastState;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync // used when taking snapshot
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ComObjPtr<Snapshot> mSnapshot;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync // used when saving state
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync Guid mProgressId;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync Utf8Str mStateFilePath;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync };
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync struct Uninit
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync enum Reason { Unexpected, Abnormal, Normal };
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync };
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct SnapshotTask;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync struct DeleteSnapshotTask;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct RestoreSnapshotTask;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync friend struct DeleteSnapshotTask;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync friend struct RestoreSnapshotTask;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync void uninit(Uninit::Reason aReason);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync HRESULT endSavingState(BOOL aSuccess);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync typedef std::map<ComObjPtr<Machine>, MachineState_T> AffectedMachines;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
e214bb78026c1d64078b34ca9504d3f5abbc52efvboxsync void deleteSnapshotHandler(DeleteSnapshotTask &aTask);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync void restoreSnapshotHandler(RestoreSnapshotTask &aTask);
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT prepareDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const Guid &machineId,
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync const Guid &snapshotId,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync bool fOnlineMergePossible,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync MediumLockList *aVMMALockList,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ComObjPtr<Medium> &aSource,
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync ComObjPtr<Medium> &aTarget,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync bool &fMergeForward,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ComObjPtr<Medium> &pParentForTarget,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync MediaList &aChildrenToReparent,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync bool &fNeedOnlineMerge,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync MediumLockList * &aMediumLockList);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync void cancelDeleteSnapshotMedium(const ComObjPtr<Medium> &aHD,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync const ComObjPtr<Medium> &aSource,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync const MediaList &aChildrenToReparent,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync bool fNeedsOnlineMerge,
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync MediumLockList *aMediumLockList,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const Guid &aMediumId,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync const Guid &aSnapshotId);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT onlineMergeMedium(const ComObjPtr<MediumAttachment> &aMediumAttachment,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync const ComObjPtr<Medium> &aSource,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const ComObjPtr<Medium> &aTarget,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync bool fMergeForward,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const ComObjPtr<Medium> &pParentForTarget,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync const MediaList &aChildrenToReparent,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync MediumLockList *aMediumLockList,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ComObjPtr<Progress> &aProgress,
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync bool *pfNeedsSaveSettings);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync HRESULT lockMedia();
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync void unlockMedia();
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT setMachineState(MachineState_T aMachineState);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HRESULT updateMachineStateOnClient();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync HRESULT mRemoveSavedState;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SnapshotData mSnapshotData;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync /** interprocess semaphore handle for this machine */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync#if defined(RT_OS_WINDOWS)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HANDLE mIPCSem;
fc148a6b23d25a87561beaffe0ba06c3ba93bf5avboxsync Bstr mIPCSemName;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync friend bool Machine::isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ComPtr<IInternalSessionControl> *aControl,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HANDLE *aIPCSem, bool aAllowClosing);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#elif defined(RT_OS_OS2)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HMTX mIPCSem;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync Bstr mIPCSemName;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync friend bool Machine::isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync ComPtr<IInternalSessionControl> *aControl,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HMTX *aIPCSem, bool aAllowClosing);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync int mIPCSem;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# ifdef VBOX_WITH_NEW_SYS_V_KEYGEN
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync Bstr mIPCKey;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# endif /*VBOX_WITH_NEW_SYS_V_KEYGEN */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync#else
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# error "Port me!"
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync static DECLCALLBACK(int) taskHandler(RTTHREAD thread, void *pvUser);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync};
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync// SnapshotMachine class
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync////////////////////////////////////////////////////////////////////////////////
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/**
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * @note Notes on locking objects of this class:
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * SnapshotMachine shares some data with the primary Machine instance (pointed
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * to by the |mPeer| member). In order to provide data consistency it also
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * shares its lock handle. This means that whenever you lock a SessionMachine
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * instance using Auto[Reader]Lock or AutoMultiLock, the corresponding Machine
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync * instance is also locked in the same lock mode. Keep it in mind.
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync */
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsyncclass ATL_NO_VTABLE SnapshotMachine :
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync public VirtualBoxSupportTranslation<SnapshotMachine>,
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync public Machine
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncpublic:
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE(SnapshotMachine)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync DECLARE_NOT_AGGREGATABLE(SnapshotMachine)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
d107911787df36a78788a841b73d24da896d02f6vboxsync BEGIN_COM_MAP(SnapshotMachine)
d107911787df36a78788a841b73d24da896d02f6vboxsync COM_INTERFACE_ENTRY2(IDispatch, IMachine)
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync COM_INTERFACE_ENTRY(ISupportErrorInfo)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync COM_INTERFACE_ENTRY(IMachine)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync END_COM_MAP()
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync DECLARE_EMPTY_CTOR_DTOR(SnapshotMachine)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT FinalConstruct();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync void FinalRelease();
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync // public initializer/uninitializer for internal purposes only
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT init(SessionMachine *aSessionMachine,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync IN_GUID aSnapshotId,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync const Utf8Str &aStateFilePath);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT init(Machine *aMachine,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const settings::Hardware &hardware,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const settings::Storage &storage,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync IN_GUID aSnapshotId,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync const Utf8Str &aStateFilePath);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync void uninit();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync // util::Lockable interface
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync RWLockHandle *lockHandle() const;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
1871985cb4854e5bfb2ead8174ee28dbfce74df5vboxsync // public methods only for internal purposes
1871985cb4854e5bfb2ead8174ee28dbfce74df5vboxsync
1871985cb4854e5bfb2ead8174ee28dbfce74df5vboxsync /**
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * Simple run-time type identification without having to enable C++ RTTI.
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * The class IDs are defined in VirtualBoxBase.h.
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync * @return
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync virtual VBoxClsID getClassID() const
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync return clsidSnapshotMachine;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync }
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HRESULT onSnapshotChange(Snapshot *aSnapshot);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync // unsafe inline public methods for internal purposes only (ensure there is
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync // a caller and a read lock before calling them!)
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync const Guid& getSnapshotId() const { return mSnapshotId; }
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
2823fbb1428e982169f04923472d7c94e7ed8385vboxsyncprivate:
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync Guid mSnapshotId;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync friend class Snapshot;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync};
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync// third party methods that depend on SnapshotMachine definiton
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsyncinline const Guid &Machine::getSnapshotId() const
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync{
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync return getClassID() != clsidSnapshotMachine
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync ? Guid::Empty
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync : static_cast<const SnapshotMachine*>(this)->getSnapshotId();
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync}
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif // ____H_MACHINEIMPL
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync