VirtualBox

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

Last change on this file since 55184 was 55184, checked in by vboxsync, 10 years ago

Missing files

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