VirtualBox

source: vbox/trunk/src/VBox/Main/include/ConsoleImpl.h@ 65164

Last change on this file since 65164 was 65164, checked in by vboxsync, 8 years ago

Main/VRDE: Got rid of Doppelmoppel i_getAudioVRDE() functions and use VBOX_WITH_VRDE_AUDIO where needed.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 43.6 KB
Line 
1/* $Id: ConsoleImpl.h 65164 2017-01-05 17:45:12Z vboxsync $ */
2/** @file
3 * VBox Console COM Class definition
4 */
5
6/*
7 * Copyright (C) 2005-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_CONSOLEIMPL
19#define ____H_CONSOLEIMPL
20
21#include "VirtualBoxBase.h"
22#include "VBox/com/array.h"
23#include "EventImpl.h"
24#include "SecretKeyStore.h"
25#include "ConsoleWrap.h"
26
27class Guest;
28class Keyboard;
29class Mouse;
30class Display;
31class MachineDebugger;
32class TeleporterStateSrc;
33class OUSBDevice;
34class RemoteUSBDevice;
35class SharedFolder;
36class VRDEServerInfo;
37class EmulatedUSB;
38class AudioVRDE;
39#ifdef VBOX_WITH_AUDIO_VIDEOREC
40class AudioVideoRec;
41#endif
42class Nvram;
43#ifdef VBOX_WITH_USB_CARDREADER
44class UsbCardReader;
45#endif
46class ConsoleVRDPServer;
47class VMMDev;
48class Progress;
49class BusAssignmentManager;
50COM_STRUCT_OR_CLASS(IEventListener);
51#ifdef VBOX_WITH_EXTPACK
52class ExtPackManager;
53#endif
54class VMMDevMouseInterface;
55class DisplayMouseInterface;
56class VMPowerUpTask;
57class VMPowerDownTask;
58
59#include <iprt/uuid.h>
60#include <iprt/memsafer.h>
61#include <VBox/RemoteDesktop/VRDE.h>
62#include <VBox/vmm/pdmdrv.h>
63#ifdef VBOX_WITH_GUEST_PROPS
64# include <VBox/HostServices/GuestPropertySvc.h> /* For the property notification callback */
65#endif
66
67struct VUSBIRHCONFIG;
68typedef struct VUSBIRHCONFIG *PVUSBIRHCONFIG;
69
70#include <list>
71#include <vector>
72
73// defines
74///////////////////////////////////////////////////////////////////////////////
75
76/**
77 * Checks the availability of the underlying VM device driver corresponding
78 * to the COM interface (IKeyboard, IMouse, IDisplay, etc.). When the driver is
79 * not available (NULL), sets error info and returns returns E_ACCESSDENIED.
80 * The translatable error message is defined in null context.
81 *
82 * Intended to used only within Console children (i.e. Keyboard, Mouse,
83 * Display, etc.).
84 *
85 * @param drv driver pointer to check (compare it with NULL)
86 */
87#define CHECK_CONSOLE_DRV(drv) \
88 do { \
89 if (!(drv)) \
90 return setError(E_ACCESSDENIED, tr("The console is not powered up")); \
91 } while (0)
92
93// Console
94///////////////////////////////////////////////////////////////////////////////
95
96class ConsoleMouseInterface
97{
98public:
99 virtual VMMDevMouseInterface *i_getVMMDevMouseInterface(){return NULL;}
100 virtual DisplayMouseInterface *i_getDisplayMouseInterface(){return NULL;}
101 virtual void i_onMouseCapabilityChange(BOOL supportsAbsolute,
102 BOOL supportsRelative,
103 BOOL supportsMT,
104 BOOL needsHostCursor){NOREF(supportsAbsolute); NOREF(supportsRelative); NOREF(supportsMT); NOREF(needsHostCursor);}
105};
106
107/** IConsole implementation class */
108class ATL_NO_VTABLE Console :
109 public ConsoleWrap,
110 public ConsoleMouseInterface
111{
112
113public:
114
115 DECLARE_EMPTY_CTOR_DTOR(Console)
116
117 HRESULT FinalConstruct();
118 void FinalRelease();
119
120 // public initializers/uninitializers for internal purposes only
121 HRESULT init(IMachine *aMachine, IInternalMachineControl *aControl, LockType_T aLockType);
122 void uninit();
123
124
125 // public methods for internal purposes only
126
127 /*
128 * Note: the following methods do not increase refcount. intended to be
129 * called only by the VM execution thread.
130 */
131
132 Guest *i_getGuest() const { return mGuest; }
133 Keyboard *i_getKeyboard() const { return mKeyboard; }
134 Mouse *i_getMouse() const { return mMouse; }
135 Display *i_getDisplay() const { return mDisplay; }
136 MachineDebugger *i_getMachineDebugger() const { return mDebugger; }
137#ifdef VBOX_WITH_VRDE_AUDIO
138 AudioVRDE *i_getAudioVRDE() const { return mAudioVRDE; }
139#endif
140#ifdef VBOX_WITH_AUDIO_VIDEOREC
141 AudioVideoRec *getAudioVideoRec() const { return mAudioVideoRec; }
142#endif
143
144 const ComPtr<IMachine> &i_machine() const { return mMachine; }
145 const Bstr &i_getId() const { return mstrUuid; }
146
147 bool i_useHostClipboard() { return mfUseHostClipboard; }
148
149 /** Method is called only from ConsoleVRDPServer */
150 IVRDEServer *i_getVRDEServer() const { return mVRDEServer; }
151
152 ConsoleVRDPServer *i_consoleVRDPServer() const { return mConsoleVRDPServer; }
153
154 HRESULT i_updateMachineState(MachineState_T aMachineState);
155 HRESULT i_getNominalState(MachineState_T &aNominalState);
156
157 // events from IInternalSessionControl
158 HRESULT i_onNetworkAdapterChange(INetworkAdapter *aNetworkAdapter, BOOL changeAdapter);
159 HRESULT i_onSerialPortChange(ISerialPort *aSerialPort);
160 HRESULT i_onParallelPortChange(IParallelPort *aParallelPort);
161 HRESULT i_onStorageControllerChange();
162 HRESULT i_onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
163 HRESULT i_onCPUChange(ULONG aCPU, BOOL aRemove);
164 HRESULT i_onCPUExecutionCapChange(ULONG aExecutionCap);
165 HRESULT i_onClipboardModeChange(ClipboardMode_T aClipboardMode);
166 HRESULT i_onDnDModeChange(DnDMode_T aDnDMode);
167 HRESULT i_onVRDEServerChange(BOOL aRestart);
168 HRESULT i_onVideoCaptureChange();
169 HRESULT i_onUSBControllerChange();
170 HRESULT i_onSharedFolderChange(BOOL aGlobal);
171 HRESULT i_onUSBDeviceAttach(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs,
172 const Utf8Str &aCaptureFilename);
173 HRESULT i_onUSBDeviceDetach(IN_BSTR aId, IVirtualBoxErrorInfo *aError);
174 HRESULT i_onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup);
175 HRESULT i_onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent);
176 HRESULT i_onExtraDataChange(IN_BSTR aMachineId, IN_BSTR aKey, IN_BSTR aVal);
177
178 HRESULT i_getGuestProperty(const Utf8Str &aName, Utf8Str *aValue, LONG64 *aTimestamp, Utf8Str *aFlags);
179 HRESULT i_setGuestProperty(const Utf8Str &aName, const Utf8Str &aValue, const Utf8Str &aFlags);
180 HRESULT i_deleteGuestProperty(const Utf8Str &aName);
181 HRESULT i_enumerateGuestProperties(const Utf8Str &aPatterns,
182 std::vector<Utf8Str> &aNames,
183 std::vector<Utf8Str> &aValues,
184 std::vector<LONG64> &aTimestamps,
185 std::vector<Utf8Str> &aFlags);
186 HRESULT i_onlineMergeMedium(IMediumAttachment *aMediumAttachment,
187 ULONG aSourceIdx, ULONG aTargetIdx,
188 IProgress *aProgress);
189 HRESULT i_reconfigureMediumAttachments(const std::vector<ComPtr<IMediumAttachment> > &aAttachments);
190 int i_hgcmLoadService(const char *pszServiceLibrary, const char *pszServiceName);
191 VMMDev *i_getVMMDev() { return m_pVMMDev; }
192
193#ifdef VBOX_WITH_EXTPACK
194 ExtPackManager *i_getExtPackManager();
195#endif
196 EventSource *i_getEventSource() { return mEventSource; }
197#ifdef VBOX_WITH_USB_CARDREADER
198 UsbCardReader *i_getUsbCardReader() { return mUsbCardReader; }
199#endif
200
201 int i_VRDPClientLogon(uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
202 void i_VRDPClientStatusChange(uint32_t u32ClientId, const char *pszStatus);
203 void i_VRDPClientConnect(uint32_t u32ClientId);
204 void i_VRDPClientDisconnect(uint32_t u32ClientId, uint32_t fu32Intercepted);
205 void i_VRDPInterceptAudio(uint32_t u32ClientId);
206 void i_VRDPInterceptUSB(uint32_t u32ClientId, void **ppvIntercept);
207 void i_VRDPInterceptClipboard(uint32_t u32ClientId);
208
209 void i_processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList, bool fDescExt);
210 void i_reportVmStatistics(ULONG aValidStats, ULONG aCpuUser,
211 ULONG aCpuKernel, ULONG aCpuIdle,
212 ULONG aMemTotal, ULONG aMemFree,
213 ULONG aMemBalloon, ULONG aMemShared,
214 ULONG aMemCache, ULONG aPageTotal,
215 ULONG aAllocVMM, ULONG aFreeVMM,
216 ULONG aBalloonedVMM, ULONG aSharedVMM,
217 ULONG aVmNetRx, ULONG aVmNetTx)
218 {
219 mControl->ReportVmStatistics(aValidStats, aCpuUser, aCpuKernel, aCpuIdle,
220 aMemTotal, aMemFree, aMemBalloon, aMemShared,
221 aMemCache, aPageTotal, aAllocVMM, aFreeVMM,
222 aBalloonedVMM, aSharedVMM, aVmNetRx, aVmNetTx);
223 }
224 void i_enableVMMStatistics(BOOL aEnable);
225
226 HRESULT i_pause(Reason_T aReason);
227 HRESULT i_resume(Reason_T aReason, AutoWriteLock &alock);
228 HRESULT i_saveState(Reason_T aReason, const ComPtr<IProgress> &aProgress, const Utf8Str &aStateFilePath, bool fPauseVM, bool &fLeftPaused);
229 HRESULT i_cancelSaveState();
230
231 // callback callers (partly; for some events console callbacks are notified
232 // directly from IInternalSessionControl event handlers declared above)
233 void i_onMousePointerShapeChange(bool fVisible, bool fAlpha,
234 uint32_t xHot, uint32_t yHot,
235 uint32_t width, uint32_t height,
236 const uint8_t *pu8Shape,
237 uint32_t cbShape);
238 void i_onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative,
239 BOOL supportsMT, BOOL needsHostCursor);
240 void i_onStateChange(MachineState_T aMachineState);
241 void i_onAdditionsStateChange();
242 void i_onAdditionsOutdated();
243 void i_onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
244 void i_onUSBDeviceStateChange(IUSBDevice *aDevice, bool aAttached,
245 IVirtualBoxErrorInfo *aError);
246 void i_onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage);
247 HRESULT i_onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId);
248 void i_onVRDEServerInfoChange();
249 HRESULT i_sendACPIMonitorHotPlugEvent();
250
251 static const PDMDRVREG DrvStatusReg;
252
253 static HRESULT i_setErrorStatic(HRESULT aResultCode, const char *pcsz, ...);
254 HRESULT i_setInvalidMachineStateError();
255
256 static const char *i_convertControllerTypeToDev(StorageControllerType_T enmCtrlType);
257 static HRESULT i_convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun);
258 // Called from event listener
259 HRESULT i_onNATRedirectRuleChange(ULONG ulInstance, BOOL aNatRuleRemove,
260 NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort, IN_BSTR aGuestIp, LONG aGuestPort);
261 HRESULT i_onNATDnsChanged();
262
263 // Mouse interface
264 VMMDevMouseInterface *i_getVMMDevMouseInterface();
265 DisplayMouseInterface *i_getDisplayMouseInterface();
266
267 EmulatedUSB *i_getEmulatedUSB(void) { return mEmulatedUSB; }
268
269 /**
270 * Sets the disk encryption keys.
271 *
272 * @returns COM status code.
273 * @þaram strCfg The config for the disks.
274 *
275 * @note: One line in the config string contains all required data for one disk.
276 * The format for one disk is some sort of comma separated value using
277 * key=value pairs.
278 * There are two keys defined at the moment:
279 * - uuid: The uuid of the base image the key is for (with or without)
280 * the curly braces.
281 * - dek: The data encryption key in base64 encoding
282 */
283 HRESULT i_setDiskEncryptionKeys(const Utf8Str &strCfg);
284
285private:
286
287 // wraped IConsole properties
288 HRESULT getMachine(ComPtr<IMachine> &aMachine);
289 HRESULT getState(MachineState_T *aState);
290 HRESULT getGuest(ComPtr<IGuest> &aGuest);
291 HRESULT getKeyboard(ComPtr<IKeyboard> &aKeyboard);
292 HRESULT getMouse(ComPtr<IMouse> &aMouse);
293 HRESULT getDisplay(ComPtr<IDisplay> &aDisplay);
294 HRESULT getDebugger(ComPtr<IMachineDebugger> &aDebugger);
295 HRESULT getUSBDevices(std::vector<ComPtr<IUSBDevice> > &aUSBDevices);
296 HRESULT getRemoteUSBDevices(std::vector<ComPtr<IHostUSBDevice> > &aRemoteUSBDevices);
297 HRESULT getSharedFolders(std::vector<ComPtr<ISharedFolder> > &aSharedFolders);
298 HRESULT getVRDEServerInfo(ComPtr<IVRDEServerInfo> &aVRDEServerInfo);
299 HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
300 HRESULT getAttachedPCIDevices(std::vector<ComPtr<IPCIDeviceAttachment> > &aAttachedPCIDevices);
301 HRESULT getUseHostClipboard(BOOL *aUseHostClipboard);
302 HRESULT setUseHostClipboard(BOOL aUseHostClipboard);
303 HRESULT getEmulatedUSB(ComPtr<IEmulatedUSB> &aEmulatedUSB);
304
305 // wraped IConsole methods
306 HRESULT powerUp(ComPtr<IProgress> &aProgress);
307 HRESULT powerUpPaused(ComPtr<IProgress> &aProgress);
308 HRESULT powerDown(ComPtr<IProgress> &aProgress);
309 HRESULT reset();
310 HRESULT pause();
311 HRESULT resume();
312 HRESULT powerButton();
313 HRESULT sleepButton();
314 HRESULT getPowerButtonHandled(BOOL *aHandled);
315 HRESULT getGuestEnteredACPIMode(BOOL *aEntered);
316 HRESULT getDeviceActivity(const std::vector<DeviceType_T> &aType,
317 std::vector<DeviceActivity_T> &aActivity);
318 HRESULT attachUSBDevice(const com::Guid &aId, const com::Utf8Str &aCaptureFilename);
319 HRESULT detachUSBDevice(const com::Guid &aId,
320 ComPtr<IUSBDevice> &aDevice);
321 HRESULT findUSBDeviceByAddress(const com::Utf8Str &aName,
322 ComPtr<IUSBDevice> &aDevice);
323 HRESULT findUSBDeviceById(const com::Guid &aId,
324 ComPtr<IUSBDevice> &aDevice);
325 HRESULT createSharedFolder(const com::Utf8Str &aName,
326 const com::Utf8Str &aHostPath,
327 BOOL aWritable,
328 BOOL aAutomount);
329 HRESULT removeSharedFolder(const com::Utf8Str &aName);
330 HRESULT teleport(const com::Utf8Str &aHostname,
331 ULONG aTcpport,
332 const com::Utf8Str &aPassword,
333 ULONG aMaxDowntime,
334 ComPtr<IProgress> &aProgress);
335 HRESULT addDiskEncryptionPassword(const com::Utf8Str &aId, const com::Utf8Str &aPassword,
336 BOOL aClearOnSuspend);
337 HRESULT addDiskEncryptionPasswords(const std::vector<com::Utf8Str> &aIds, const std::vector<com::Utf8Str> &aPasswords,
338 BOOL aClearOnSuspend);
339 HRESULT removeDiskEncryptionPassword(const com::Utf8Str &aId);
340 HRESULT clearAllDiskEncryptionPasswords();
341
342 void notifyNatDnsChange(PUVM pUVM, const char *pszDevice, ULONG ulInstanceMax);
343 Utf8Str VRDPServerErrorToMsg(int vrc);
344
345 /**
346 * Base template for AutoVMCaller and SafeVMPtr. Template arguments
347 * have the same meaning as arguments of Console::addVMCaller().
348 */
349 template <bool taQuiet = false, bool taAllowNullVM = false>
350 class AutoVMCallerBase
351 {
352 public:
353 AutoVMCallerBase(Console *aThat) : mThat(aThat), mRC(E_FAIL)
354 {
355 Assert(aThat);
356 mRC = aThat->i_addVMCaller(taQuiet, taAllowNullVM);
357 }
358 ~AutoVMCallerBase()
359 {
360 doRelease();
361 }
362 /** Decreases the number of callers before the instance is destroyed. */
363 void releaseCaller()
364 {
365 Assert(SUCCEEDED(mRC));
366 doRelease();
367 }
368 /** Restores the number of callers after by #release(). #rc() must be
369 * rechecked to ensure the operation succeeded. */
370 void addYY()
371 {
372 AssertReturnVoid(!SUCCEEDED(mRC));
373 mRC = mThat->i_addVMCaller(taQuiet, taAllowNullVM);
374 }
375 /** Returns the result of Console::addVMCaller() */
376 HRESULT rc() const { return mRC; }
377 /** Shortcut to SUCCEEDED(rc()) */
378 bool isOk() const { return SUCCEEDED(mRC); }
379 protected:
380 Console *mThat;
381 void doRelease()
382 {
383 if (SUCCEEDED(mRC))
384 {
385 mThat->i_releaseVMCaller();
386 mRC = E_FAIL;
387 }
388 }
389 private:
390 HRESULT mRC; /* Whether the caller was added. */
391 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoVMCallerBase);
392 };
393
394#if 0
395 /**
396 * Helper class that protects sections of code using the mpUVM pointer by
397 * automatically calling addVMCaller() on construction and
398 * releaseVMCaller() on destruction. Intended for Console methods dealing
399 * with mpUVM. The usage pattern is:
400 * <code>
401 * AutoVMCaller autoVMCaller(this);
402 * if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
403 * ...
404 * VMR3ReqCall (mpUVM, ...
405 * </code>
406 *
407 * @note Temporarily locks the argument for writing.
408 *
409 * @sa SafeVMPtr, SafeVMPtrQuiet
410 * @note Obsolete, use SafeVMPtr
411 */
412 typedef AutoVMCallerBase<false, false> AutoVMCaller;
413#endif
414
415 /**
416 * Same as AutoVMCaller but doesn't set extended error info on failure.
417 *
418 * @note Temporarily locks the argument for writing.
419 * @note Obsolete, use SafeVMPtrQuiet
420 */
421 typedef AutoVMCallerBase<true, false> AutoVMCallerQuiet;
422
423 /**
424 * Same as AutoVMCaller but allows a null VM pointer (to trigger an error
425 * instead of assertion).
426 *
427 * @note Temporarily locks the argument for writing.
428 * @note Obsolete, use SafeVMPtr
429 */
430 typedef AutoVMCallerBase<false, true> AutoVMCallerWeak;
431
432 /**
433 * Same as AutoVMCaller but doesn't set extended error info on failure
434 * and allows a null VM pointer (to trigger an error instead of
435 * assertion).
436 *
437 * @note Temporarily locks the argument for writing.
438 * @note Obsolete, use SafeVMPtrQuiet
439 */
440 typedef AutoVMCallerBase<true, true> AutoVMCallerQuietWeak;
441
442 /**
443 * Base template for SafeVMPtr and SafeVMPtrQuiet.
444 */
445 template<bool taQuiet = false>
446 class SafeVMPtrBase : public AutoVMCallerBase<taQuiet, true>
447 {
448 typedef AutoVMCallerBase<taQuiet, true> Base;
449 public:
450 SafeVMPtrBase(Console *aThat) : Base(aThat), mRC(E_FAIL), mpUVM(NULL)
451 {
452 if (Base::isOk())
453 mRC = aThat->i_safeVMPtrRetainer(&mpUVM, taQuiet);
454 }
455 ~SafeVMPtrBase()
456 {
457 doRelease();
458 }
459 /** Direct PUVM access. */
460 PUVM rawUVM() const { return mpUVM; }
461 /** Release the handles. */
462 void release()
463 {
464 Assert(SUCCEEDED(mRC));
465 doRelease();
466 }
467
468 /** The combined result of Console::addVMCaller() and Console::safeVMPtrRetainer */
469 HRESULT rc() const { return Base::isOk()? mRC: Base::rc(); }
470 /** Shortcut to SUCCEEDED(rc()) */
471 bool isOk() const { return SUCCEEDED(mRC) && Base::isOk(); }
472
473 private:
474 void doRelease()
475 {
476 if (SUCCEEDED(mRC))
477 {
478 Base::mThat->i_safeVMPtrReleaser(&mpUVM);
479 mRC = E_FAIL;
480 }
481 Base::doRelease();
482 }
483 HRESULT mRC; /* Whether the VM ptr was retained. */
484 PUVM mpUVM;
485 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(SafeVMPtrBase);
486 };
487
488public:
489
490 /*
491 * Helper class that safely manages the Console::mpUVM pointer
492 * by calling addVMCaller() on construction and releaseVMCaller() on
493 * destruction. Intended for Console children. The usage pattern is:
494 * <code>
495 * Console::SafeVMPtr ptrVM(mParent);
496 * if (!ptrVM.isOk())
497 * return ptrVM.rc();
498 * ...
499 * VMR3ReqCall(ptrVM.rawUVM(), ...
500 * ...
501 * printf("%p\n", ptrVM.rawUVM());
502 * </code>
503 *
504 * @note Temporarily locks the argument for writing.
505 *
506 * @sa SafeVMPtrQuiet, AutoVMCaller
507 */
508 typedef SafeVMPtrBase<false> SafeVMPtr;
509
510 /**
511 * A deviation of SafeVMPtr that doesn't set the error info on failure.
512 * Intended for pieces of code that don't need to return the VM access
513 * failure to the caller. The usage pattern is:
514 * <code>
515 * Console::SafeVMPtrQuiet pVM(mParent);
516 * if (pVM.rc())
517 * VMR3ReqCall(pVM, ...
518 * return S_OK;
519 * </code>
520 *
521 * @note Temporarily locks the argument for writing.
522 *
523 * @sa SafeVMPtr, AutoVMCaller
524 */
525 typedef SafeVMPtrBase<true> SafeVMPtrQuiet;
526
527 class SharedFolderData
528 {
529 public:
530 SharedFolderData()
531 { }
532
533 SharedFolderData(const Utf8Str &aHostPath,
534 bool aWritable,
535 bool aAutoMount)
536 : m_strHostPath(aHostPath),
537 m_fWritable(aWritable),
538 m_fAutoMount(aAutoMount)
539 { }
540
541 // copy constructor
542 SharedFolderData(const SharedFolderData& aThat)
543 : m_strHostPath(aThat.m_strHostPath),
544 m_fWritable(aThat.m_fWritable),
545 m_fAutoMount(aThat.m_fAutoMount)
546 { }
547
548 Utf8Str m_strHostPath;
549 bool m_fWritable;
550 bool m_fAutoMount;
551 };
552
553 /**
554 * Class for managing emulated USB MSDs.
555 */
556 class USBStorageDevice
557 {
558 public:
559 USBStorageDevice()
560 { }
561 /** The UUID associated with the USB device. */
562 RTUUID mUuid;
563 /** Port of the storage device. */
564 LONG iPort;
565 };
566
567 typedef std::map<Utf8Str, ComObjPtr<SharedFolder> > SharedFolderMap;
568 typedef std::map<Utf8Str, SharedFolderData> SharedFolderDataMap;
569 typedef std::map<Utf8Str, ComPtr<IMediumAttachment> > MediumAttachmentMap;
570 typedef std::list <USBStorageDevice> USBStorageDeviceList;
571
572 static void i_powerUpThreadTask(VMPowerUpTask *pTask);
573 static void i_powerDownThreadTask(VMPowerDownTask *pTask);
574
575private:
576
577 typedef std::list <ComObjPtr<OUSBDevice> > USBDeviceList;
578 typedef std::list <ComObjPtr<RemoteUSBDevice> > RemoteUSBDeviceList;
579
580 HRESULT i_addVMCaller(bool aQuiet = false, bool aAllowNullVM = false);
581 void i_releaseVMCaller();
582 HRESULT i_safeVMPtrRetainer(PUVM *a_ppUVM, bool aQuiet);
583 void i_safeVMPtrReleaser(PUVM *a_ppUVM);
584
585 HRESULT i_consoleInitReleaseLog(const ComPtr<IMachine> aMachine);
586
587 HRESULT i_powerUp(IProgress **aProgress, bool aPaused);
588 HRESULT i_powerDown(IProgress *aProgress = NULL);
589
590/* Note: FreeBSD needs this whether netflt is used or not. */
591#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
592 HRESULT i_attachToTapInterface(INetworkAdapter *networkAdapter);
593 HRESULT i_detachFromTapInterface(INetworkAdapter *networkAdapter);
594#endif
595 HRESULT i_powerDownHostInterfaces();
596
597 HRESULT i_setMachineState(MachineState_T aMachineState, bool aUpdateServer = true);
598 HRESULT i_setMachineStateLocally(MachineState_T aMachineState)
599 {
600 return i_setMachineState(aMachineState, false /* aUpdateServer */);
601 }
602
603 HRESULT i_findSharedFolder(const Utf8Str &strName,
604 ComObjPtr<SharedFolder> &aSharedFolder,
605 bool aSetError = false);
606
607 HRESULT i_fetchSharedFolders(BOOL aGlobal);
608 bool i_findOtherSharedFolder(const Utf8Str &straName,
609 SharedFolderDataMap::const_iterator &aIt);
610
611 HRESULT i_createSharedFolder(const Utf8Str &strName, const SharedFolderData &aData);
612 HRESULT i_removeSharedFolder(const Utf8Str &strName);
613
614 HRESULT i_suspendBeforeConfigChange(PUVM pUVM, AutoWriteLock *pAlock, bool *pfResume);
615 void i_resumeAfterConfigChange(PUVM pUVM);
616
617 static DECLCALLBACK(int) i_configConstructor(PUVM pUVM, PVM pVM, void *pvConsole);
618 int i_configConstructorInner(PUVM pUVM, PVM pVM, AutoWriteLock *pAlock);
619 int i_configCfgmOverlay(PCFGMNODE pRoot, IVirtualBox *pVirtualBox, IMachine *pMachine);
620 int i_configDumpAPISettingsTweaks(IVirtualBox *pVirtualBox, IMachine *pMachine);
621
622 int i_configGraphicsController(PCFGMNODE pDevices,
623 const GraphicsControllerType_T graphicsController,
624 BusAssignmentManager *pBusMgr,
625 const ComPtr<IMachine> &ptrMachine,
626 const ComPtr<IBIOSSettings> &ptrBiosSettings,
627 bool fHMEnabled);
628 int i_checkMediumLocation(IMedium *pMedium, bool *pfUseHostIOCache);
629 int i_unmountMediumFromGuest(PUVM pUVM, StorageBus_T enmBus, DeviceType_T enmDevType,
630 const char *pcszDevice, unsigned uInstance, unsigned uLUN,
631 bool fForceUnmount);
632 int i_removeMediumDriverFromVm(PCFGMNODE pCtlInst,
633 const char *pcszDevice,
634 unsigned uInstance,
635 unsigned uLUN,
636 StorageBus_T enmBus,
637 bool fAttachDetach,
638 bool fHotplug,
639 bool fForceUnmount,
640 PUVM pUVM,
641 DeviceType_T enmDevType,
642 PCFGMNODE *ppLunL0);
643 int i_configMediumAttachment(const char *pcszDevice,
644 unsigned uInstance,
645 StorageBus_T enmBus,
646 bool fUseHostIOCache,
647 bool fBuiltinIoCache,
648 bool fSetupMerge,
649 unsigned uMergeSource,
650 unsigned uMergeTarget,
651 IMediumAttachment *pMediumAtt,
652 MachineState_T aMachineState,
653 HRESULT *phrc,
654 bool fAttachDetach,
655 bool fForceUnmount,
656 bool fHotplug,
657 PUVM pUVM,
658 DeviceType_T *paLedDevType,
659 PCFGMNODE *ppLunL0);
660 int i_configMedium(PCFGMNODE pLunL0,
661 bool fPassthrough,
662 DeviceType_T enmType,
663 bool fUseHostIOCache,
664 bool fBuiltinIoCache,
665 bool fSetupMerge,
666 unsigned uMergeSource,
667 unsigned uMergeTarget,
668 const char *pcszBwGroup,
669 bool fDiscard,
670 bool fNonRotational,
671 IMedium *pMedium,
672 MachineState_T aMachineState,
673 HRESULT *phrc);
674 int i_configMediumProperties(PCFGMNODE pCur, IMedium *pMedium, bool *pfHostIP, bool *pfEncrypted);
675 static DECLCALLBACK(int) i_reconfigureMediumAttachment(Console *pThis,
676 PUVM pUVM,
677 const char *pcszDevice,
678 unsigned uInstance,
679 StorageBus_T enmBus,
680 bool fUseHostIOCache,
681 bool fBuiltinIoCache,
682 bool fSetupMerge,
683 unsigned uMergeSource,
684 unsigned uMergeTarget,
685 IMediumAttachment *aMediumAtt,
686 MachineState_T aMachineState,
687 HRESULT *phrc);
688 static DECLCALLBACK(int) i_changeRemovableMedium(Console *pThis,
689 PUVM pUVM,
690 const char *pcszDevice,
691 unsigned uInstance,
692 StorageBus_T enmBus,
693 bool fUseHostIOCache,
694 IMediumAttachment *aMediumAtt,
695 bool fForce);
696
697 HRESULT i_attachRawPCIDevices(PUVM pUVM, BusAssignmentManager *BusMgr, PCFGMNODE pDevices);
698 void i_attachStatusDriver(PCFGMNODE pCtlInst, PPDMLED *papLeds,
699 uint64_t uFirst, uint64_t uLast,
700 Console::MediumAttachmentMap *pmapMediumAttachments,
701 const char *pcszDevice, unsigned uInstance);
702
703 int i_configNetwork(const char *pszDevice, unsigned uInstance, unsigned uLun,
704 INetworkAdapter *aNetworkAdapter, PCFGMNODE pCfg,
705 PCFGMNODE pLunL0, PCFGMNODE pInst,
706 bool fAttachDetach, bool fIgnoreConnectFailure);
707
708 static DECLCALLBACK(int) i_configGuestProperties(void *pvConsole, PUVM pUVM);
709 static DECLCALLBACK(int) i_configGuestControl(void *pvConsole);
710 static DECLCALLBACK(void) i_vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
711 static DECLCALLBACK(int) i_unplugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
712 static DECLCALLBACK(int) i_plugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
713 HRESULT i_doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce, PUVM pUVM);
714 HRESULT i_doCPURemove(ULONG aCpu, PUVM pUVM);
715 HRESULT i_doCPUAdd(ULONG aCpu, PUVM pUVM);
716
717 HRESULT i_doNetworkAdapterChange(PUVM pUVM, const char *pszDevice, unsigned uInstance,
718 unsigned uLun, INetworkAdapter *aNetworkAdapter);
719 static DECLCALLBACK(int) i_changeNetworkAttachment(Console *pThis, PUVM pUVM, const char *pszDevice,
720 unsigned uInstance, unsigned uLun,
721 INetworkAdapter *aNetworkAdapter);
722
723 void i_changeClipboardMode(ClipboardMode_T aClipboardMode);
724 int i_changeDnDMode(DnDMode_T aDnDMode);
725
726#ifdef VBOX_WITH_USB
727 HRESULT i_attachUSBDevice(IUSBDevice *aHostDevice, ULONG aMaskedIfs, const Utf8Str &aCaptureFilename);
728 HRESULT i_detachUSBDevice(const ComObjPtr<OUSBDevice> &aHostDevice);
729
730 static DECLCALLBACK(int) i_usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid,
731 const char *aBackend, const char *aAddress, void *pvRemoteBackend,
732 USHORT aPortVersion, ULONG aMaskedIfs, const char *pszCaptureFilename);
733 static DECLCALLBACK(int) i_usbDetachCallback(Console *that, PUVM pUVM, PCRTUUID aUuid);
734#endif
735
736 static DECLCALLBACK(int) i_attachStorageDevice(Console *pThis,
737 PUVM pUVM,
738 const char *pcszDevice,
739 unsigned uInstance,
740 StorageBus_T enmBus,
741 bool fUseHostIOCache,
742 IMediumAttachment *aMediumAtt,
743 bool fSilent);
744 static DECLCALLBACK(int) i_detachStorageDevice(Console *pThis,
745 PUVM pUVM,
746 const char *pcszDevice,
747 unsigned uInstance,
748 StorageBus_T enmBus,
749 IMediumAttachment *aMediumAtt,
750 bool fSilent);
751 HRESULT i_doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent);
752 HRESULT i_doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent);
753
754 static DECLCALLBACK(int) i_stateProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser);
755
756 static DECLCALLBACK(void) i_genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL,
757 const char *pszErrorFmt, va_list va);
758
759 void i_atVMRuntimeErrorCallbackF(uint32_t fFatal, const char *pszErrorId, const char *pszFormat, ...);
760 static DECLCALLBACK(void) i_atVMRuntimeErrorCallback(PUVM pUVM, void *pvUser, uint32_t fFatal,
761 const char *pszErrorId, const char *pszFormat, va_list va);
762
763 HRESULT i_captureUSBDevices(PUVM pUVM);
764 void i_detachAllUSBDevices(bool aDone);
765
766
767 static DECLCALLBACK(int) i_vmm2User_SaveState(PCVMM2USERMETHODS pThis, PUVM pUVM);
768 static DECLCALLBACK(void) i_vmm2User_NotifyEmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu);
769 static DECLCALLBACK(void) i_vmm2User_NotifyEmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu);
770 static DECLCALLBACK(void) i_vmm2User_NotifyPdmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM);
771 static DECLCALLBACK(void) i_vmm2User_NotifyPdmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM);
772 static DECLCALLBACK(void) i_vmm2User_NotifyResetTurnedIntoPowerOff(PCVMM2USERMETHODS pThis, PUVM pUVM);
773
774 static DECLCALLBACK(void *) i_drvStatus_QueryInterface(PPDMIBASE pInterface, const char *pszIID);
775 static DECLCALLBACK(void) i_drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN);
776 static DECLCALLBACK(int) i_drvStatus_MediumEjected(PPDMIMEDIANOTIFY pInterface, unsigned iLUN);
777 static DECLCALLBACK(void) i_drvStatus_Destruct(PPDMDRVINS pDrvIns);
778 static DECLCALLBACK(int) i_drvStatus_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
779
780 static DECLCALLBACK(int) i_pdmIfSecKey_KeyRetain(PPDMISECKEY pInterface, const char *pszId, const uint8_t **ppbKey,
781 size_t *pcbKey);
782 static DECLCALLBACK(int) i_pdmIfSecKey_KeyRelease(PPDMISECKEY pInterface, const char *pszId);
783 static DECLCALLBACK(int) i_pdmIfSecKey_PasswordRetain(PPDMISECKEY pInterface, const char *pszId, const char **ppszPassword);
784 static DECLCALLBACK(int) i_pdmIfSecKey_PasswordRelease(PPDMISECKEY pInterface, const char *pszId);
785
786 static DECLCALLBACK(int) i_pdmIfSecKeyHlp_KeyMissingNotify(PPDMISECKEYHLP pInterface);
787
788 int mcAudioRefs;
789 volatile uint32_t mcVRDPClients;
790 uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */
791 volatile bool mcGuestCredentialsProvided;
792
793 static const char *sSSMConsoleUnit;
794 static uint32_t sSSMConsoleVer;
795
796 HRESULT i_loadDataFromSavedState();
797 int i_loadStateFileExecInternal(PSSMHANDLE pSSM, uint32_t u32Version);
798
799 static DECLCALLBACK(void) i_saveStateFileExec(PSSMHANDLE pSSM, void *pvUser);
800 static DECLCALLBACK(int) i_loadStateFileExec(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
801
802#ifdef VBOX_WITH_GUEST_PROPS
803 static DECLCALLBACK(int) i_doGuestPropNotification(void *pvExtension, uint32_t, void *pvParms, uint32_t cbParms);
804 HRESULT i_doEnumerateGuestProperties(const Utf8Str &aPatterns,
805 std::vector<Utf8Str> &aNames,
806 std::vector<Utf8Str> &aValues,
807 std::vector<LONG64> &aTimestamps,
808 std::vector<Utf8Str> &aFlags);
809
810 void i_guestPropertiesHandleVMReset(void);
811 bool i_guestPropertiesVRDPEnabled(void);
812 void i_guestPropertiesVRDPUpdateLogon(uint32_t u32ClientId, const char *pszUser, const char *pszDomain);
813 void i_guestPropertiesVRDPUpdateActiveClient(uint32_t u32ClientId);
814 void i_guestPropertiesVRDPUpdateClientAttach(uint32_t u32ClientId, bool fAttached);
815 void i_guestPropertiesVRDPUpdateNameChange(uint32_t u32ClientId, const char *pszName);
816 void i_guestPropertiesVRDPUpdateIPAddrChange(uint32_t u32ClientId, const char *pszIPAddr);
817 void i_guestPropertiesVRDPUpdateLocationChange(uint32_t u32ClientId, const char *pszLocation);
818 void i_guestPropertiesVRDPUpdateOtherInfoChange(uint32_t u32ClientId, const char *pszOtherInfo);
819 void i_guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId);
820#endif
821
822 bool i_isResetTurnedIntoPowerOff(void);
823
824 /** @name Disk encryption support
825 * @{ */
826 HRESULT i_consoleParseDiskEncryption(const char *psz, const char **ppszEnd);
827 HRESULT i_configureEncryptionForDisk(const Utf8Str &strId, unsigned *pcDisksConfigured);
828 HRESULT i_clearDiskEncryptionKeysOnAllAttachmentsWithKeyId(const Utf8Str &strId);
829 HRESULT i_initSecretKeyIfOnAllAttachments(void);
830 int i_consoleParseKeyValue(const char *psz, const char **ppszEnd,
831 char **ppszKey, char **ppszVal);
832 void i_removeSecretKeysOnSuspend();
833 /** @} */
834
835 /** @name Teleporter support
836 * @{ */
837 static DECLCALLBACK(int) i_teleporterSrcThreadWrapper(RTTHREAD hThreadSelf, void *pvUser);
838 HRESULT i_teleporterSrc(TeleporterStateSrc *pState);
839 HRESULT i_teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich, const char *pszNAckMsg = NULL);
840 HRESULT i_teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand, bool fWaitForAck = true);
841 HRESULT i_teleporterTrg(PUVM pUVM, IMachine *pMachine, Utf8Str *pErrorMsg, bool fStartPaused,
842 Progress *pProgress, bool *pfPowerOffOnFailure);
843 static DECLCALLBACK(int) i_teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser);
844 /** @} */
845
846 bool mSavedStateDataLoaded : 1;
847
848 const ComPtr<IMachine> mMachine;
849 const ComPtr<IInternalMachineControl> mControl;
850
851 const ComPtr<IVRDEServer> mVRDEServer;
852
853 ConsoleVRDPServer * const mConsoleVRDPServer;
854 bool mfVRDEChangeInProcess;
855 bool mfVRDEChangePending;
856 const ComObjPtr<Guest> mGuest;
857 const ComObjPtr<Keyboard> mKeyboard;
858 const ComObjPtr<Mouse> mMouse;
859 const ComObjPtr<Display> mDisplay;
860 const ComObjPtr<MachineDebugger> mDebugger;
861 const ComObjPtr<VRDEServerInfo> mVRDEServerInfo;
862 /** This can safely be used without holding any locks.
863 * An AutoCaller suffices to prevent it being destroy while in use and
864 * internally there is a lock providing the necessary serialization. */
865 const ComObjPtr<EventSource> mEventSource;
866#ifdef VBOX_WITH_EXTPACK
867 const ComObjPtr<ExtPackManager> mptrExtPackManager;
868#endif
869 const ComObjPtr<EmulatedUSB> mEmulatedUSB;
870
871 USBDeviceList mUSBDevices;
872 RemoteUSBDeviceList mRemoteUSBDevices;
873
874 SharedFolderDataMap m_mapGlobalSharedFolders;
875 SharedFolderDataMap m_mapMachineSharedFolders;
876 SharedFolderMap m_mapSharedFolders; // the console instances
877
878 /** The user mode VM handle. */
879 PUVM mpUVM;
880 /** Holds the number of "readonly" mpUVM callers (users). */
881 uint32_t mVMCallers;
882 /** Semaphore posted when the number of mpUVM callers drops to zero. */
883 RTSEMEVENT mVMZeroCallersSem;
884 /** true when Console has entered the mpUVM destruction phase. */
885 bool mVMDestroying : 1;
886 /** true when power down is initiated by vmstateChangeCallback (EMT). */
887 bool mVMPoweredOff : 1;
888 /** true when vmstateChangeCallback shouldn't initiate a power down. */
889 bool mVMIsAlreadyPoweringOff : 1;
890 /** true if we already showed the snapshot folder size warning. */
891 bool mfSnapshotFolderSizeWarningShown : 1;
892 /** true if we already showed the snapshot folder ext4/xfs bug warning. */
893 bool mfSnapshotFolderExt4WarningShown : 1;
894 /** true if we already listed the disk type of the snapshot folder. */
895 bool mfSnapshotFolderDiskTypeShown : 1;
896 /** true if a USB controller is available (i.e. USB devices can be attached). */
897 bool mfVMHasUsbController : 1;
898 /** true if the VM power off was caused by reset. */
899 bool mfPowerOffCausedByReset : 1;
900
901 /** Pointer to the VMM -> User (that's us) callbacks. */
902 struct MYVMM2USERMETHODS : public VMM2USERMETHODS
903 {
904 Console *pConsole;
905 } *mpVmm2UserMethods;
906
907 /** The current network attachment type in the VM.
908 * This doesn't have to match the network attachment type maintained in the
909 * NetworkAdapter. This is needed to change the network attachment
910 * dynamically.
911 */
912 typedef std::vector<NetworkAttachmentType_T> NetworkAttachmentTypeVector;
913 NetworkAttachmentTypeVector meAttachmentType;
914
915 VMMDev * m_pVMMDev;
916 AudioVRDE * const mAudioVRDE;
917#ifdef VBOX_WITH_AUDIO_VIDEOREC
918 /** The video recording audio backend. */
919 AudioVideoRec * const mAudioVideoRec;
920#endif
921 Nvram * const mNvram;
922#ifdef VBOX_WITH_USB_CARDREADER
923 UsbCardReader * const mUsbCardReader;
924#endif
925 BusAssignmentManager* mBusMgr;
926
927 enum
928 {
929 iLedFloppy = 0,
930 cLedFloppy = 2,
931 iLedIde = iLedFloppy + cLedFloppy,
932 cLedIde = 4,
933 iLedSata = iLedIde + cLedIde,
934 cLedSata = 30,
935 iLedScsi = iLedSata + cLedSata,
936 cLedScsi = 16,
937 iLedSas = iLedScsi + cLedScsi,
938 cLedSas = 8,
939 iLedUsb = iLedSas + cLedSas,
940 cLedUsb = 8,
941 iLedNvme = iLedUsb + cLedUsb,
942 cLedNvme = 30,
943 cLedStorage = cLedFloppy + cLedIde + cLedSata + cLedScsi + cLedSas + cLedUsb + cLedNvme
944 };
945 DeviceType_T maStorageDevType[cLedStorage];
946 PPDMLED mapStorageLeds[cLedStorage];
947 PPDMLED mapNetworkLeds[36]; /**< @todo adapt this to the maximum network card count */
948 PPDMLED mapSharedFolderLed;
949 PPDMLED mapUSBLed[2];
950 PPDMLED mapCrOglLed;
951
952 MediumAttachmentMap mapMediumAttachments;
953
954 /** List of attached USB storage devices. */
955 USBStorageDeviceList mUSBStorageDevices;
956
957 /** Store for secret keys. */
958 SecretKeyStore * const m_pKeyStore;
959 /** Number of disks configured for encryption. */
960 unsigned m_cDisksEncrypted;
961 /** Number of disks which have the key in the map. */
962 unsigned m_cDisksPwProvided;
963
964 /** Pointer to the key consumer -> provider (that's us) callbacks. */
965 struct MYPDMISECKEY : public PDMISECKEY
966 {
967 Console *pConsole;
968 } *mpIfSecKey;
969
970 /** Pointer to the key helpers -> provider (that's us) callbacks. */
971 struct MYPDMISECKEYHLP : public PDMISECKEYHLP
972 {
973 Console *pConsole;
974 } *mpIfSecKeyHlp;
975
976/* Note: FreeBSD needs this whether netflt is used or not. */
977#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
978 Utf8Str maTAPDeviceName[8];
979 RTFILE maTapFD[8];
980#endif
981
982 bool mVMStateChangeCallbackDisabled;
983
984 bool mfUseHostClipboard;
985
986 /** Local machine state value. */
987 MachineState_T mMachineState;
988
989 /** Machine uuid string. */
990 Bstr mstrUuid;
991
992 /** Pointer to the progress object of a live cancelable task.
993 *
994 * This is currently only used by Console::Teleport(), but is intended to later
995 * be used by the live snapshot code path as well. Actions like
996 * Console::PowerDown, which automatically cancels out the running snapshot /
997 * teleportation operation, will cancel the teleportation / live snapshot
998 * operation before starting. */
999 ComPtr<IProgress> mptrCancelableProgress;
1000
1001 ComPtr<IEventListener> mVmListener;
1002
1003 friend class VMTask;
1004 friend class ConsoleVRDPServer;
1005};
1006
1007#endif // !____H_CONSOLEIMPL
1008/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette