VirtualBox

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

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

NAT: Introduce PDMINETWORKNATCONFIG::pfnNotifyDnsChanged and call it
on IHostNameResolutionConfigurationChangeEvent. This is just the
plumbing so far, there's no actual callback yet.

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

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