ConsoleImpl.h revision 85ec4409e76bf34043dafc8e379966c4c67e77a8
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync * VBox Console COM Class definition
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Copyright (C) 2006-2010 Oracle Corporation
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * available from http://www.virtualbox.org. This file is free software;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * General Public License (GPL) as published by the Free Software
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync# include <VBox/HostServices/GuestPropertySvc.h> /* For the property notification callback */
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync///////////////////////////////////////////////////////////////////////////////
0c94a8282c9042b02f022302a3d987746140eab9vboxsync * Checks the availability of the underlying VM device driver corresponding
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * to the COM interface (IKeyboard, IMouse, IDisplay, etc.). When the driver is
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * not available (NULL), sets error info and returns returns E_ACCESSDENIED.
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * The translatable error message is defined in null context.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Intended to used only within Console children (i.e. Keyboard, Mouse,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Display, etc.).
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync * @param drv driver pointer to check (compare it with NULL)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync return setError(E_ACCESSDENIED, tr("The console is not powered up")); \
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync } while (0)
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync///////////////////////////////////////////////////////////////////////////////
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync/** IConsole implementation class */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Console, IConsole)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // public initializers/uninitializers for internal purposes only
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync HRESULT init(IMachine *aMachine, IInternalMachineControl *aControl);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync // IConsole properties
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(Machine))(IMachine **aMachine);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(State))(MachineState_T *aMachineState);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Keyboard))(IKeyboard **aKeyboard);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Display))(IDisplay **aDisplay);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Debugger))(IMachineDebugger **aDebugger);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(USBDevices))(ComSafeArrayOut(IUSBDevice *, aUSBDevices));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(RemoteUSBDevices))(ComSafeArrayOut(IHostUSBDevice *, aRemoteUSBDevices));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(RemoteDisplayInfo))(IRemoteDisplayInfo **aRemoteDisplayInfo);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // IConsole methods
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(GetGuestEnteredACPIMode)(BOOL *aEntered);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(GetDeviceActivity)(DeviceType_T aDeviceType,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(DetachUSBDevice)(IN_BSTR aId, IUSBDevice **aDevice);
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync STDMETHOD(FindUSBDeviceByAddress)(IN_BSTR aAddress, IUSBDevice **aDevice);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(FindUSBDeviceById)(IN_BSTR aId, IUSBDevice **aDevice);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(TakeSnapshot)(IN_BSTR aName, IN_BSTR aDescription,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(DeleteSnapshot)(IN_BSTR aId, IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(RestoreSnapshot)(ISnapshot *aSnapshot, IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(Teleport)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, ULONG aMaxDowntime, IProgress **aProgress);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync // public methods for internal purposes only
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Note: the following methods do not increase refcount. intended to be
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * called only by the VM execution thread.
44372afb953dc9f1f1ec71943f5f561a607c0307vboxsync Keyboard *getKeyboard() const { return mKeyboard; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync MachineDebugger *getMachineDebugger() const { return mDebugger; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync const ComPtr<IMachine> &machine() const { return mMachine; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync /** Method is called only from ConsoleVRDPServer */
0c94a8282c9042b02f022302a3d987746140eab9vboxsync IVRDPServer *getVRDPServer() const { return mVRDPServer; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ConsoleVRDPServer *consoleVRDPServer() const { return mConsoleVRDPServer; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT updateMachineState(MachineState_T aMachineState);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync // events from IInternalSessionControl
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onNetworkAdapterChange(INetworkAdapter *aNetworkAdapter, BOOL changeAdapter);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onSerialPortChange(ISerialPort *aSerialPort);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onParallelPortChange(IParallelPort *aParallelPort);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onUSBDeviceAttach(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onUSBDeviceDetach(IN_BSTR aId, IVirtualBoxErrorInfo *aError);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT getGuestProperty(IN_BSTR aKey, BSTR *aValue, LONG64 *aTimestamp, BSTR *aFlags);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT setGuestProperty(IN_BSTR aKey, IN_BSTR aValue, IN_BSTR aFlags);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT enumerateGuestProperties(IN_BSTR aPatterns,
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onlineMergeMedium(IMediumAttachment *aMediumAttachment,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync AudioSniffer *getAudioSniffer() { return mAudioSniffer; }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync int VRDPClientLogon(uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void VRDPClientDisconnect(uint32_t u32ClientId, uint32_t fu32Intercepted);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void VRDPInterceptUSB(uint32_t u32ClientId, void **ppvIntercept);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync void processRemoteUSBDevices(uint32_t u32ClientId, VRDPUSBDEVICEDESC *pDevList, uint32_t cbDevList);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync // callback callers (partly; for some events console callbacks are notified
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync // directly from IInternalSessionControl event handlers declared above)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync void onMousePointerShapeChange(bool fVisible, bool fAlpha,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, BOOL needsHostCursor);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onUSBDeviceStateChange(IUSBDevice *aDevice, bool aAttached,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static HRESULT setErrorStatic(HRESULT aResultCode, const char *pcsz, ...);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static HRESULT handleUnexpectedExceptions(RT_SRC_POS_DECL);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static const char *convertControllerTypeToDev(StorageControllerType_T enmCtrlType);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static HRESULT convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Base template for AutoVMCaller and SaveVMPtr. Template arguments
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * have the same meaning as arguments of Console::addVMCaller().
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync template <bool taQuiet = false, bool taAllowNullVM = false>
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync AutoVMCallerBase(Console *aThat) : mThat(aThat), mRC(S_OK)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Decreases the number of callers before the instance is destroyed. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Restores the number of callers after by #release(). #rc() must be
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * rechecked to ensure the operation succeeded. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Returns the result of Console::addVMCaller() */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Shortcut to SUCCEEDED(rc()) */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoVMCallerBase)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Helper class that protects sections of code using the mpVM pointer by
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * automatically calling addVMCaller() on construction and
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * releaseVMCaller() on destruction. Intended for Console methods dealing
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * with mpVM. The usage pattern is:
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * AutoVMCaller autoVMCaller(this);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * VMR3ReqCall (mpVM, ...
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @note Temporarily locks the argument for writing.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @sa SafeVMPtr, SafeVMPtrQuiet
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <false, false> AutoVMCaller;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Same as AutoVMCaller but doesn't set extended error info on failure.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * @note Temporarily locks the argument for writing.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <true, false> AutoVMCallerQuiet;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Same as AutoVMCaller but allows a null VM pointer (to trigger an error
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * instead of assertion).
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * @note Temporarily locks the argument for writing.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <false, true> AutoVMCallerWeak;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Same as AutoVMCaller but doesn't set extended error info on failure
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * and allows a null VM pointer (to trigger an error instead of
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * assertion).
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * @note Temporarily locks the argument for writing.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <true, true> AutoVMCallerQuietWeak;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Base template for SaveVMPtr and SaveVMPtrQuiet.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync class SafeVMPtrBase : public AutoVMCallerBase <taQuiet, true>
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync SafeVMPtrBase(Console *aThat) : Base(aThat), mpVM(NULL)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** Smart SaveVMPtr to PVM cast operator */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** Direct PVM access for printf()-like functions */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * Helper class that safely manages the Console::mpVM pointer
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * by calling addVMCaller() on construction and releaseVMCaller() on
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * destruction. Intended for Console children. The usage pattern is:
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * Console::SaveVMPtr pVM(mParent);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * if (FAILED(pVM.rc())) return pVM.rc();
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * VMR3ReqCall(pVM, ...
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * printf("%p\n", pVM.raw());
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @note Temporarily locks the argument for writing.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @sa SafeVMPtrQuiet, AutoVMCaller
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * A deviation of SaveVMPtr that doesn't set the error info on failure.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * Intended for pieces of code that don't need to return the VM access
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * failure to the caller. The usage pattern is:
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * Console::SaveVMPtrQuiet pVM(mParent);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * if (pVM.rc())
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * VMR3ReqCall(pVM, ...
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * return S_OK;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * @note Temporarily locks the argument for writing.
0c94a8282c9042b02f022302a3d987746140eab9vboxsync * @sa SafeVMPtr, AutoVMCaller
0c94a8282c9042b02f022302a3d987746140eab9vboxsync SharedFolderData(Bstr aHostPath, BOOL aWritable, BOOL aAutoMount)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync typedef std::map <Bstr, ComObjPtr<SharedFolder> > SharedFolderMap;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync typedef std::map <Bstr, SharedFolderData> SharedFolderDataMap;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync typedef std::list <ComObjPtr<OUSBDevice> > USBDeviceList;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef std::list <ComObjPtr<RemoteUSBDevice> > RemoteUSBDeviceList;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync HRESULT addVMCaller(bool aQuiet = false, bool aAllowNullVM = false);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync HRESULT consoleInitReleaseLog(const ComPtr<IMachine> aMachine);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync HRESULT powerUp(IProgress **aProgress, bool aPaused);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT callTapSetupApplication(bool isStatic, RTFILE tapFD, Bstr &tapDevice,
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT attachToTapInterface(INetworkAdapter *networkAdapter);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT detachFromTapInterface(INetworkAdapter *networkAdapter);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT setMachineState(MachineState_T aMachineState, bool aUpdateServer = true);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT setMachineStateLocally(MachineState_T aMachineState)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync return setMachineState(aMachineState, false /* aUpdateServer */);
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync bool aSetError = false);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync HRESULT createSharedFolder(CBSTR aName, SharedFolderData aData);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) configConstructor(PVM pVM, void *pvConsole);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) reconfigureMediumAttachment(Console *pConsole,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) changeRemovableMedium(Console *pThis,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync int configNetwork(const char *pszDevice, unsigned uInstance, unsigned uLun,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync PCFGMNODE pLunL0, PCFGMNODE pInst, bool fAttachDetach);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) configGuestProperties(void *pvConsole);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) configGuestControl(void *pvConsole);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(void) vmstateChangeCallback(PVM aVM, VMSTATE aState,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) unplugCpu(Console *pThis, unsigned uCpu);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) plugCpu(Console *pThis, unsigned uCpu);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync HRESULT doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT doNetworkAdapterChange(const char *pszDevice, unsigned uInstance,
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync static DECLCALLBACK(int) changeNetworkAttachment(Console *pThis, const char *pszDevice,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#endif /* VBOX_DYNAMIC_NET_ATTACH */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT attachUSBDevice(IUSBDevice *aHostDevice, ULONG aMaskedIfs);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT detachUSBDevice(USBDeviceList::iterator &aIt);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) usbAttachCallback(Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool aRemote, const char *aAddress, ULONG aMaskedIfs);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) usbDetachCallback(Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) stateProgressCallback(PVM pVM, unsigned uPercent, void *pvUser);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(void) genericVMSetErrorCallback(PVM pVM, void *pvUser, int rc, RT_SRC_POS_DECL,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static DECLCALLBACK(void) setVMRuntimeErrorCallbackF(PVM pVM, void *pvUser, uint32_t fFatal,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const char *pszFormat, ...);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(void) setVMRuntimeErrorCallback(PVM pVM, void *pvUser, uint32_t fFatal,
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(int) powerUpThread(RTTHREAD Thread, void *pvUser);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static DECLCALLBACK(int) saveStateThread(RTTHREAD Thread, void *pvUser);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(int) powerDownThread(RTTHREAD Thread, void *pvUser);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(int) vmm2User_SaveState(PCVMM2USERMETHODS pThis, PVM pVM);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(void *) drvStatus_QueryInterface(PPDMIBASE pInterface, const char *pszIID);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(void) drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(void) drvStatus_Destruct(PPDMDRVINS pDrvIns);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) drvStatus_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static const char *sSSMConsoleUnit;
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync int loadStateFileExecInternal(PSSMHANDLE pSSM, uint32_t u32Version);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static DECLCALLBACK(void) saveStateFileExec(PSSMHANDLE pSSM, void *pvUser);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync static DECLCALLBACK(int) loadStateFileExec(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) doGuestPropNotification(void *pvExtension, uint32_t, void *pvParms, uint32_t cbParms);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT doEnumerateGuestProperties(CBSTR aPatterns,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void updateGuestPropertiesVRDPLogon(uint32_t u32ClientId, const char *pszUser, const char *pszDomain);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void updateGuestPropertiesVRDPDisconnect(uint32_t u32ClientId);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** @name Teleporter support
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) teleporterSrcThreadWrapper(RTTHREAD hThread, void *pvUser);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich, const char *pszNAckMsg = NULL);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand, bool fWaitForAck = true);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT teleporterTrg(PVM pVM, IMachine *pMachine, Utf8Str *pErrorMsg, bool fStartPaused,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<RemoteDisplayInfo> mRemoteDisplayInfo;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** The VM instance handle. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** Holds the number of "readonly" mpVM callers (users) */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Semaphore posted when the number of mpVM callers drops to zero */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** true when Console has entered the mpVM destruction phase */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** true when power down is initiated by vmstateChangeCallback (EMT) */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** true when vmstateChangeCallback shouldn't initiate a power down. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** true if we already showed the snapshot folder size warning. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** true if we already showed the snapshot folder ext4/xfs bug warning. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** Pointer to the VMM -> User (that's us) callbacks.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * This structure is followed by a pointer to the Console object. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** The current network attachment type in the VM.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * This doesn't have to match the network attachment type maintained in the
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * NetworkAdapter. This is needed to change the network attachment
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * dynamically.
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync NetworkAttachmentType_T meAttachmentType[SchemaDefs::NetworkAdapterCount];
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync cLedStorage = cLedFloppy + cLedIde + cLedSata + cLedScsi + cLedSas
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync PPDMLED mapNetworkLeds[SchemaDefs::NetworkAdapterCount];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Local machine state value. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Pointer to the progress object of a live cancelable task.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * This is currently only used by Console::Teleport(), but is intended to later
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * be used by the live snapshot code path as well. Actions like
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * Console::PowerDown, which automatically cancels out the running snapshot /
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * teleportion operation, will cancel the teleportation / live snapshot
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * operation before starting. */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** OnMousePointerShapeChange() cache */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** OnMouseCapabilityChange() cache */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** OnKeyboardLedsChange() cache */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /* We cannot do memset() on mpsc to avoid cleaning shape's vtable */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync#endif // !____H_CONSOLEIMPL
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */