VirtualBox

source: vbox/trunk/src/VBox/Main/src-client/GuestImpl.cpp@ 40288

Last change on this file since 40288 was 40288, checked in by vboxsync, 13 years ago

Main/GuestImpl: fix for xtracker 6092

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.3 KB
Line 
1/* $Id: GuestImpl.cpp 40288 2012-02-29 09:11:59Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation: Guest
4 */
5
6/*
7 * Copyright (C) 2006-2012 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#include "GuestImpl.h"
19
20#include "Global.h"
21#include "ConsoleImpl.h"
22#include "ProgressImpl.h"
23#ifdef VBOX_WITH_DRAG_AND_DROP
24# include "GuestDnDImpl.h"
25#endif
26#include "VMMDev.h"
27
28#include "AutoCaller.h"
29#include "Logging.h"
30#include "Performance.h"
31
32#include <VBox/VMMDev.h>
33#ifdef VBOX_WITH_GUEST_CONTROL
34# include <VBox/com/array.h>
35# include <VBox/com/ErrorInfo.h>
36#endif
37#include <iprt/cpp/utils.h>
38#include <iprt/timer.h>
39#include <VBox/vmm/pgm.h>
40#include <VBox/version.h>
41
42// defines
43/////////////////////////////////////////////////////////////////////////////
44
45// constructor / destructor
46/////////////////////////////////////////////////////////////////////////////
47
48DEFINE_EMPTY_CTOR_DTOR (Guest)
49
50HRESULT Guest::FinalConstruct()
51{
52 return BaseFinalConstruct();
53}
54
55void Guest::FinalRelease()
56{
57 uninit ();
58 BaseFinalRelease();
59}
60
61// public methods only for internal purposes
62/////////////////////////////////////////////////////////////////////////////
63
64/**
65 * Initializes the guest object.
66 */
67HRESULT Guest::init(Console *aParent)
68{
69 LogFlowThisFunc(("aParent=%p\n", aParent));
70
71 ComAssertRet(aParent, E_INVALIDARG);
72
73 /* Enclose the state transition NotReady->InInit->Ready */
74 AutoInitSpan autoInitSpan(this);
75 AssertReturn(autoInitSpan.isOk(), E_FAIL);
76
77 unconst(mParent) = aParent;
78
79 /* Confirm a successful initialization when it's the case */
80 autoInitSpan.setSucceeded();
81
82 ULONG aMemoryBalloonSize;
83 HRESULT ret = mParent->machine()->COMGETTER(MemoryBalloonSize)(&aMemoryBalloonSize);
84 if (ret == S_OK)
85 mMemoryBalloonSize = aMemoryBalloonSize;
86 else
87 mMemoryBalloonSize = 0; /* Default is no ballooning */
88
89 BOOL fPageFusionEnabled;
90 ret = mParent->machine()->COMGETTER(PageFusionEnabled)(&fPageFusionEnabled);
91 if (ret == S_OK)
92 mfPageFusionEnabled = fPageFusionEnabled;
93 else
94 mfPageFusionEnabled = false; /* Default is no page fusion*/
95
96 mStatUpdateInterval = 0; /* Default is not to report guest statistics at all */
97 mCollectVMMStats = false;
98
99 /* Clear statistics. */
100 for (unsigned i = 0 ; i < GUESTSTATTYPE_MAX; i++)
101 mCurrentGuestStat[i] = 0;
102 mGuestValidStats = pm::GUESTSTATMASK_NONE;
103
104 mMagic = GUEST_MAGIC;
105 int vrc = RTTimerLRCreate (&mStatTimer, 1000 /* ms */,
106 &Guest::staticUpdateStats, this);
107 AssertMsgRC (vrc, ("Failed to create guest statistics "
108 "update timer(%Rra)\n", vrc));
109
110#ifdef VBOX_WITH_GUEST_CONTROL
111 /* Init the context ID counter at 1000. */
112 mNextContextID = 1000;
113#endif
114
115#ifdef VBOX_WITH_DRAG_AND_DROP
116 m_pGuestDnD = new GuestDnD(this);
117#endif
118
119 return S_OK;
120}
121
122/**
123 * Uninitializes the instance and sets the ready flag to FALSE.
124 * Called either from FinalRelease() or by the parent when it gets destroyed.
125 */
126void Guest::uninit()
127{
128 LogFlowThisFunc(("\n"));
129
130 /* Enclose the state transition Ready->InUninit->NotReady */
131 AutoUninitSpan autoUninitSpan(this);
132 if (autoUninitSpan.uninitDone())
133 return;
134
135#ifdef VBOX_WITH_GUEST_CONTROL
136 /* Scope write lock as much as possible. */
137 {
138 /*
139 * Cleanup must be done *before* AutoUninitSpan to cancel all
140 * all outstanding waits in API functions (which hold AutoCaller
141 * ref counts).
142 */
143 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
144
145 /* Notify left over callbacks that we are about to shutdown ... */
146 CallbackMapIter it;
147 for (it = mCallbackMap.begin(); it != mCallbackMap.end(); it++)
148 {
149 int rc2 = callbackNotifyEx(it->first, VERR_CANCELLED,
150 Guest::tr("VM is shutting down, canceling uncompleted guest requests ..."));
151 AssertRC(rc2);
152 }
153
154 /* Destroy left over callback data. */
155 for (it = mCallbackMap.begin(); it != mCallbackMap.end(); it++)
156 callbackDestroy(it->first);
157
158 /* Clear process map (remove all callbacks). */
159 mGuestProcessMap.clear();
160 }
161#endif
162
163 /* Destroy stat update timer */
164 int vrc = RTTimerLRDestroy (mStatTimer);
165 AssertMsgRC (vrc, ("Failed to create guest statistics "
166 "update timer(%Rra)\n", vrc));
167 mStatTimer = NULL;
168 mMagic = 0;
169
170#ifdef VBOX_WITH_DRAG_AND_DROP
171 delete m_pGuestDnD;
172 m_pGuestDnD = NULL;
173#endif
174
175 unconst(mParent) = NULL;
176}
177
178/* static */
179void Guest::staticUpdateStats(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick)
180{
181 AssertReturnVoid (pvUser != NULL);
182 Guest *guest = static_cast <Guest *> (pvUser);
183 Assert(guest->mMagic == GUEST_MAGIC);
184 if (guest->mMagic == GUEST_MAGIC)
185 guest->updateStats(iTick);
186
187 NOREF (hTimerLR);
188}
189
190void Guest::updateStats(uint64_t iTick)
191{
192 uint64_t uFreeTotal, uAllocTotal, uBalloonedTotal, uSharedTotal;
193 uint64_t uTotalMem, uPrivateMem, uSharedMem, uZeroMem;
194
195 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
196
197 ULONG aGuestStats[GUESTSTATTYPE_MAX];
198 RT_ZERO(aGuestStats);
199 ULONG validStats = mGuestValidStats;
200 /* Check if we have anything to report */
201 if (validStats)
202 {
203 mGuestValidStats = pm::GUESTSTATMASK_NONE;
204 memcpy(aGuestStats, mCurrentGuestStat, sizeof(aGuestStats));
205 }
206 alock.release();
207 /*
208 * Calling SessionMachine may take time as the object resides in VBoxSVC
209 * process. This is why we took a snapshot of currently collected stats
210 * and released the lock.
211 */
212 uFreeTotal = 0;
213 uAllocTotal = 0;
214 uBalloonedTotal = 0;
215 uSharedTotal = 0;
216 uTotalMem = 0;
217 uPrivateMem = 0;
218 uSharedMem = 0;
219 uZeroMem = 0;
220
221 Console::SafeVMPtr pVM (mParent);
222 if (pVM.isOk())
223 {
224 int rc;
225
226 /*
227 * There is no point in collecting VM shared memory if other memory
228 * statistics are not available yet. Or is it?
229 */
230 if (validStats)
231 {
232 /* Query the missing per-VM memory statistics. */
233 rc = PGMR3QueryMemoryStats(pVM.raw(), &uTotalMem, &uPrivateMem, &uSharedMem, &uZeroMem);
234 if (rc == VINF_SUCCESS)
235 {
236 validStats |= pm::GUESTSTATMASK_MEMSHARED;
237 }
238 }
239
240 if (mCollectVMMStats)
241 {
242 rc = PGMR3QueryGlobalMemoryStats(pVM.raw(), &uAllocTotal, &uFreeTotal, &uBalloonedTotal, &uSharedTotal);
243 AssertRC(rc);
244 if (rc == VINF_SUCCESS)
245 {
246 validStats |= pm::GUESTSTATMASK_ALLOCVMM|pm::GUESTSTATMASK_FREEVMM|
247 pm::GUESTSTATMASK_BALOONVMM|pm::GUESTSTATMASK_SHAREDVMM;
248 }
249 }
250
251 }
252
253 mParent->reportGuestStatistics(validStats,
254 aGuestStats[GUESTSTATTYPE_CPUUSER],
255 aGuestStats[GUESTSTATTYPE_CPUKERNEL],
256 aGuestStats[GUESTSTATTYPE_CPUIDLE],
257 /* Convert the units for RAM usage stats: page (4K) -> 1KB units */
258 mCurrentGuestStat[GUESTSTATTYPE_MEMTOTAL] * (_4K/_1K),
259 mCurrentGuestStat[GUESTSTATTYPE_MEMFREE] * (_4K/_1K),
260 mCurrentGuestStat[GUESTSTATTYPE_MEMBALLOON] * (_4K/_1K),
261 (ULONG)(uSharedMem / _1K), /* bytes -> KB */
262 mCurrentGuestStat[GUESTSTATTYPE_MEMCACHE] * (_4K/_1K),
263 mCurrentGuestStat[GUESTSTATTYPE_PAGETOTAL] * (_4K/_1K),
264 (ULONG)(uAllocTotal / _1K), /* bytes -> KB */
265 (ULONG)(uFreeTotal / _1K),
266 (ULONG)(uBalloonedTotal / _1K),
267 (ULONG)(uSharedTotal / _1K));
268}
269
270// IGuest properties
271/////////////////////////////////////////////////////////////////////////////
272
273STDMETHODIMP Guest::COMGETTER(OSTypeId)(BSTR *a_pbstrOSTypeId)
274{
275 CheckComArgOutPointerValid(a_pbstrOSTypeId);
276
277 AutoCaller autoCaller(this);
278 HRESULT hrc = autoCaller.rc();
279 if (SUCCEEDED(hrc))
280 {
281 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
282 if (!mData.mInterfaceVersion.isEmpty())
283 mData.mOSTypeId.cloneTo(a_pbstrOSTypeId);
284 else
285 {
286 /* Redirect the call to IMachine if no additions are installed. */
287 ComPtr<IMachine> ptrMachine(mParent->machine());
288 alock.release();
289 hrc = ptrMachine->COMGETTER(OSTypeId)(a_pbstrOSTypeId);
290 }
291 }
292 return hrc;
293}
294
295STDMETHODIMP Guest::COMGETTER(AdditionsRunLevel) (AdditionsRunLevelType_T *aRunLevel)
296{
297 AutoCaller autoCaller(this);
298 if (FAILED(autoCaller.rc())) return autoCaller.rc();
299
300 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
301
302 *aRunLevel = mData.mAdditionsRunLevel;
303
304 return S_OK;
305}
306
307STDMETHODIMP Guest::COMGETTER(AdditionsVersion)(BSTR *a_pbstrAdditionsVersion)
308{
309 CheckComArgOutPointerValid(a_pbstrAdditionsVersion);
310
311 AutoCaller autoCaller(this);
312 HRESULT hrc = autoCaller.rc();
313 if (SUCCEEDED(hrc))
314 {
315 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
316
317 /*
318 * Return the ReportGuestInfo2 version info if available.
319 */
320 if ( !mData.mAdditionsVersionNew.isEmpty()
321 || mData.mAdditionsRunLevel <= AdditionsRunLevelType_None)
322 mData.mAdditionsVersionNew.cloneTo(a_pbstrAdditionsVersion);
323 else
324 {
325 /*
326 * If we're running older guest additions (< 3.2.0) try get it from
327 * the guest properties. Detected switched around Version and
328 * Revision in early 3.1.x releases (see r57115).
329 */
330 ComPtr<IMachine> ptrMachine = mParent->machine();
331 alock.release(); /* No need to hold this during the IPC fun. */
332
333 Bstr bstr;
334 hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam());
335 if ( SUCCEEDED(hrc)
336 && !bstr.isEmpty())
337 {
338 Utf8Str str(bstr);
339 if (str.count('.') == 0)
340 hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Revision").raw(), bstr.asOutParam());
341 str = bstr;
342 if (str.count('.') != 2)
343 hrc = E_FAIL;
344 }
345
346 if (SUCCEEDED(hrc))
347 bstr.detachTo(a_pbstrAdditionsVersion);
348 else
349 {
350 /* Returning 1.4 is better than nothing. */
351 alock.acquire();
352 mData.mInterfaceVersion.cloneTo(a_pbstrAdditionsVersion);
353 hrc = S_OK;
354 }
355 }
356 }
357 return hrc;
358}
359
360STDMETHODIMP Guest::COMGETTER(AdditionsRevision)(ULONG *a_puAdditionsRevision)
361{
362 CheckComArgOutPointerValid(a_puAdditionsRevision);
363
364 AutoCaller autoCaller(this);
365 HRESULT hrc = autoCaller.rc();
366 if (SUCCEEDED(hrc))
367 {
368 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
369
370 /*
371 * Return the ReportGuestInfo2 version info if available.
372 */
373 if ( !mData.mAdditionsVersionNew.isEmpty()
374 || mData.mAdditionsRunLevel <= AdditionsRunLevelType_None)
375 *a_puAdditionsRevision = mData.mAdditionsRevision;
376 else
377 {
378 /*
379 * If we're running older guest additions (< 3.2.0) try get it from
380 * the guest properties. Detected switched around Version and
381 * Revision in early 3.1.x releases (see r57115).
382 */
383 ComPtr<IMachine> ptrMachine = mParent->machine();
384 alock.release(); /* No need to hold this during the IPC fun. */
385
386 Bstr bstr;
387 hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Revision").raw(), bstr.asOutParam());
388 if (SUCCEEDED(hrc))
389 {
390 Utf8Str str(bstr);
391 uint32_t uRevision;
392 int vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision);
393 if (vrc != VINF_SUCCESS && str.count('.') == 2)
394 {
395 hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam());
396 if (SUCCEEDED(hrc))
397 {
398 str = bstr;
399 vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision);
400 }
401 }
402 if (vrc == VINF_SUCCESS)
403 *a_puAdditionsRevision = uRevision;
404 else
405 hrc = VBOX_E_IPRT_ERROR;
406 }
407 if (FAILED(hrc))
408 {
409 /* Return 0 if we don't know. */
410 *a_puAdditionsRevision = 0;
411 hrc = S_OK;
412 }
413 }
414 }
415 return hrc;
416}
417
418STDMETHODIMP Guest::COMGETTER(Facilities)(ComSafeArrayOut(IAdditionsFacility*, aFacilities))
419{
420 CheckComArgOutSafeArrayPointerValid(aFacilities);
421
422 AutoCaller autoCaller(this);
423 if (FAILED(autoCaller.rc())) return autoCaller.rc();
424
425 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
426
427 SafeIfaceArray<IAdditionsFacility> fac(mData.mFacilityMap);
428 fac.detachTo(ComSafeArrayOutArg(aFacilities));
429
430 return S_OK;
431}
432
433BOOL Guest::isPageFusionEnabled()
434{
435 AutoCaller autoCaller(this);
436 if (FAILED(autoCaller.rc())) return false;
437
438 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
439
440 return mfPageFusionEnabled;
441}
442
443STDMETHODIMP Guest::COMGETTER(MemoryBalloonSize)(ULONG *aMemoryBalloonSize)
444{
445 CheckComArgOutPointerValid(aMemoryBalloonSize);
446
447 AutoCaller autoCaller(this);
448 if (FAILED(autoCaller.rc())) return autoCaller.rc();
449
450 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
451
452 *aMemoryBalloonSize = mMemoryBalloonSize;
453
454 return S_OK;
455}
456
457STDMETHODIMP Guest::COMSETTER(MemoryBalloonSize)(ULONG aMemoryBalloonSize)
458{
459 AutoCaller autoCaller(this);
460 if (FAILED(autoCaller.rc())) return autoCaller.rc();
461
462 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
463
464 /* We must be 100% sure that IMachine::COMSETTER(MemoryBalloonSize)
465 * does not call us back in any way! */
466 HRESULT ret = mParent->machine()->COMSETTER(MemoryBalloonSize)(aMemoryBalloonSize);
467 if (ret == S_OK)
468 {
469 mMemoryBalloonSize = aMemoryBalloonSize;
470 /* forward the information to the VMM device */
471 VMMDev *pVMMDev = mParent->getVMMDev();
472 /* MUST release all locks before calling VMM device as its critsect
473 * has higher lock order than anything in Main. */
474 alock.release();
475 if (pVMMDev)
476 {
477 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
478 if (pVMMDevPort)
479 pVMMDevPort->pfnSetMemoryBalloon(pVMMDevPort, aMemoryBalloonSize);
480 }
481 }
482
483 return ret;
484}
485
486STDMETHODIMP Guest::COMGETTER(StatisticsUpdateInterval)(ULONG *aUpdateInterval)
487{
488 CheckComArgOutPointerValid(aUpdateInterval);
489
490 AutoCaller autoCaller(this);
491 if (FAILED(autoCaller.rc())) return autoCaller.rc();
492
493 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
494
495 *aUpdateInterval = mStatUpdateInterval;
496 return S_OK;
497}
498
499STDMETHODIMP Guest::COMSETTER(StatisticsUpdateInterval)(ULONG aUpdateInterval)
500{
501 AutoCaller autoCaller(this);
502 if (FAILED(autoCaller.rc())) return autoCaller.rc();
503
504 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
505
506 if (mStatUpdateInterval)
507 if (aUpdateInterval == 0)
508 RTTimerLRStop(mStatTimer);
509 else
510 RTTimerLRChangeInterval(mStatTimer, aUpdateInterval);
511 else
512 if (aUpdateInterval != 0)
513 {
514 RTTimerLRChangeInterval(mStatTimer, aUpdateInterval);
515 RTTimerLRStart(mStatTimer, 0);
516 }
517 mStatUpdateInterval = aUpdateInterval;
518 /* forward the information to the VMM device */
519 VMMDev *pVMMDev = mParent->getVMMDev();
520 /* MUST release all locks before calling VMM device as its critsect
521 * has higher lock order than anything in Main. */
522 alock.release();
523 if (pVMMDev)
524 {
525 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
526 if (pVMMDevPort)
527 pVMMDevPort->pfnSetStatisticsInterval(pVMMDevPort, aUpdateInterval);
528 }
529
530 return S_OK;
531}
532
533STDMETHODIMP Guest::InternalGetStatistics(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,
534 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemShared,
535 ULONG *aMemCache, ULONG *aPageTotal,
536 ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal)
537{
538 CheckComArgOutPointerValid(aCpuUser);
539 CheckComArgOutPointerValid(aCpuKernel);
540 CheckComArgOutPointerValid(aCpuIdle);
541 CheckComArgOutPointerValid(aMemTotal);
542 CheckComArgOutPointerValid(aMemFree);
543 CheckComArgOutPointerValid(aMemBalloon);
544 CheckComArgOutPointerValid(aMemShared);
545 CheckComArgOutPointerValid(aMemCache);
546 CheckComArgOutPointerValid(aPageTotal);
547 CheckComArgOutPointerValid(aMemAllocTotal);
548 CheckComArgOutPointerValid(aMemFreeTotal);
549 CheckComArgOutPointerValid(aMemBalloonTotal);
550 CheckComArgOutPointerValid(aMemSharedTotal);
551
552 AutoCaller autoCaller(this);
553 if (FAILED(autoCaller.rc())) return autoCaller.rc();
554
555 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
556
557 *aCpuUser = mCurrentGuestStat[GUESTSTATTYPE_CPUUSER];
558 *aCpuKernel = mCurrentGuestStat[GUESTSTATTYPE_CPUKERNEL];
559 *aCpuIdle = mCurrentGuestStat[GUESTSTATTYPE_CPUIDLE];
560 *aMemTotal = mCurrentGuestStat[GUESTSTATTYPE_MEMTOTAL] * (_4K/_1K); /* page (4K) -> 1KB units */
561 *aMemFree = mCurrentGuestStat[GUESTSTATTYPE_MEMFREE] * (_4K/_1K); /* page (4K) -> 1KB units */
562 *aMemBalloon = mCurrentGuestStat[GUESTSTATTYPE_MEMBALLOON] * (_4K/_1K); /* page (4K) -> 1KB units */
563 *aMemCache = mCurrentGuestStat[GUESTSTATTYPE_MEMCACHE] * (_4K/_1K); /* page (4K) -> 1KB units */
564 *aPageTotal = mCurrentGuestStat[GUESTSTATTYPE_PAGETOTAL] * (_4K/_1K); /* page (4K) -> 1KB units */
565
566 /* MUST release all locks before calling any PGM statistics queries,
567 * as they are executed by EMT and that might deadlock us by VMM device
568 * activity which waits for the Guest object lock. */
569 alock.release();
570 Console::SafeVMPtr pVM (mParent);
571 if (pVM.isOk())
572 {
573 uint64_t uFreeTotal, uAllocTotal, uBalloonedTotal, uSharedTotal;
574 *aMemFreeTotal = 0;
575 int rc = PGMR3QueryGlobalMemoryStats(pVM.raw(), &uAllocTotal, &uFreeTotal, &uBalloonedTotal, &uSharedTotal);
576 AssertRC(rc);
577 if (rc == VINF_SUCCESS)
578 {
579 *aMemAllocTotal = (ULONG)(uAllocTotal / _1K); /* bytes -> KB */
580 *aMemFreeTotal = (ULONG)(uFreeTotal / _1K);
581 *aMemBalloonTotal = (ULONG)(uBalloonedTotal / _1K);
582 *aMemSharedTotal = (ULONG)(uSharedTotal / _1K);
583 }
584 else
585 return E_FAIL;
586
587 /* Query the missing per-VM memory statistics. */
588 *aMemShared = 0;
589 uint64_t uTotalMem, uPrivateMem, uSharedMem, uZeroMem;
590 rc = PGMR3QueryMemoryStats(pVM.raw(), &uTotalMem, &uPrivateMem, &uSharedMem, &uZeroMem);
591 if (rc == VINF_SUCCESS)
592 {
593 *aMemShared = (ULONG)(uSharedMem / _1K);
594 }
595 else
596 return E_FAIL;
597 }
598 else
599 {
600 *aMemAllocTotal = 0;
601 *aMemFreeTotal = 0;
602 *aMemBalloonTotal = 0;
603 *aMemSharedTotal = 0;
604 *aMemShared = 0;
605 return E_FAIL;
606 }
607
608 return S_OK;
609}
610
611HRESULT Guest::setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal)
612{
613 static ULONG indexToPerfMask[] =
614 {
615 pm::GUESTSTATMASK_CPUUSER,
616 pm::GUESTSTATMASK_CPUKERNEL,
617 pm::GUESTSTATMASK_CPUIDLE,
618 pm::GUESTSTATMASK_MEMTOTAL,
619 pm::GUESTSTATMASK_MEMFREE,
620 pm::GUESTSTATMASK_MEMBALLOON,
621 pm::GUESTSTATMASK_MEMCACHE,
622 pm::GUESTSTATMASK_PAGETOTAL,
623 pm::GUESTSTATMASK_NONE
624 };
625 AutoCaller autoCaller(this);
626 if (FAILED(autoCaller.rc())) return autoCaller.rc();
627
628 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
629
630 if (enmType >= GUESTSTATTYPE_MAX)
631 return E_INVALIDARG;
632
633 mCurrentGuestStat[enmType] = aVal;
634 mGuestValidStats |= indexToPerfMask[enmType];
635 return S_OK;
636}
637
638/**
639 * Returns the status of a specified Guest Additions facility.
640 *
641 * @return aStatus Current status of specified facility.
642 * @param aType Facility to get the status from.
643 * @param aTimestamp Timestamp of last facility status update in ms (optional).
644 */
645STDMETHODIMP Guest::GetFacilityStatus(AdditionsFacilityType_T aType, LONG64 *aTimestamp, AdditionsFacilityStatus_T *aStatus)
646{
647 AutoCaller autoCaller(this);
648 if (FAILED(autoCaller.rc())) return autoCaller.rc();
649
650 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
651
652 CheckComArgNotNull(aStatus);
653 /* Not checking for aTimestamp is intentional; it's optional. */
654
655 FacilityMapIterConst it = mData.mFacilityMap.find(aType);
656 if (it != mData.mFacilityMap.end())
657 {
658 AdditionsFacility *pFacility = it->second;
659 ComAssert(pFacility);
660 *aStatus = pFacility->getStatus();
661 if (aTimestamp)
662 *aTimestamp = pFacility->getLastUpdated();
663 }
664 else
665 {
666 /*
667 * Do not fail here -- could be that the facility never has been brought up (yet) but
668 * the host wants to have its status anyway. So just tell we don't know at this point.
669 */
670 *aStatus = AdditionsFacilityStatus_Unknown;
671 if (aTimestamp)
672 *aTimestamp = RTTimeMilliTS();
673 }
674 return S_OK;
675}
676
677STDMETHODIMP Guest::GetAdditionsStatus(AdditionsRunLevelType_T aLevel, BOOL *aActive)
678{
679 AutoCaller autoCaller(this);
680 if (FAILED(autoCaller.rc())) return autoCaller.rc();
681
682 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
683
684 HRESULT rc = S_OK;
685 switch (aLevel)
686 {
687 case AdditionsRunLevelType_System:
688 *aActive = (mData.mAdditionsRunLevel > AdditionsRunLevelType_None);
689 break;
690
691 case AdditionsRunLevelType_Userland:
692 *aActive = (mData.mAdditionsRunLevel >= AdditionsRunLevelType_Userland);
693 break;
694
695 case AdditionsRunLevelType_Desktop:
696 *aActive = (mData.mAdditionsRunLevel >= AdditionsRunLevelType_Desktop);
697 break;
698
699 default:
700 rc = setError(VBOX_E_NOT_SUPPORTED,
701 tr("Invalid status level defined: %u"), aLevel);
702 break;
703 }
704
705 return rc;
706}
707
708STDMETHODIMP Guest::SetCredentials(IN_BSTR aUserName, IN_BSTR aPassword,
709 IN_BSTR aDomain, BOOL aAllowInteractiveLogon)
710{
711 AutoCaller autoCaller(this);
712 if (FAILED(autoCaller.rc())) return autoCaller.rc();
713
714 /* forward the information to the VMM device */
715 VMMDev *pVMMDev = mParent->getVMMDev();
716 if (pVMMDev)
717 {
718 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
719 if (pVMMDevPort)
720 {
721 uint32_t u32Flags = VMMDEV_SETCREDENTIALS_GUESTLOGON;
722 if (!aAllowInteractiveLogon)
723 u32Flags = VMMDEV_SETCREDENTIALS_NOLOCALLOGON;
724
725 pVMMDevPort->pfnSetCredentials(pVMMDevPort,
726 Utf8Str(aUserName).c_str(),
727 Utf8Str(aPassword).c_str(),
728 Utf8Str(aDomain).c_str(),
729 u32Flags);
730 return S_OK;
731 }
732 }
733
734 return setError(VBOX_E_VM_ERROR,
735 tr("VMM device is not available (is the VM running?)"));
736}
737
738STDMETHODIMP Guest::DragHGEnter(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction)
739{
740 /* Input validation */
741 CheckComArgSafeArrayNotNull(allowedActions);
742 CheckComArgSafeArrayNotNull(formats);
743 CheckComArgOutPointerValid(pResultAction);
744
745 AutoCaller autoCaller(this);
746 if (FAILED(autoCaller.rc())) return autoCaller.rc();
747
748#ifdef VBOX_WITH_DRAG_AND_DROP
749 return m_pGuestDnD->dragHGEnter(uScreenId, uX, uY, defaultAction, ComSafeArrayInArg(allowedActions), ComSafeArrayInArg(formats), pResultAction);
750#else /* VBOX_WITH_DRAG_AND_DROP */
751 ReturnComNotImplemented();
752#endif /* !VBOX_WITH_DRAG_AND_DROP */
753}
754
755STDMETHODIMP Guest::DragHGMove(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction)
756{
757 /* Input validation */
758 CheckComArgSafeArrayNotNull(allowedActions);
759 CheckComArgSafeArrayNotNull(formats);
760 CheckComArgOutPointerValid(pResultAction);
761
762 AutoCaller autoCaller(this);
763 if (FAILED(autoCaller.rc())) return autoCaller.rc();
764
765#ifdef VBOX_WITH_DRAG_AND_DROP
766 return m_pGuestDnD->dragHGMove(uScreenId, uX, uY, defaultAction, ComSafeArrayInArg(allowedActions), ComSafeArrayInArg(formats), pResultAction);
767#else /* VBOX_WITH_DRAG_AND_DROP */
768 ReturnComNotImplemented();
769#endif /* !VBOX_WITH_DRAG_AND_DROP */
770}
771
772STDMETHODIMP Guest::DragHGLeave(ULONG uScreenId)
773{
774 AutoCaller autoCaller(this);
775 if (FAILED(autoCaller.rc())) return autoCaller.rc();
776
777#ifdef VBOX_WITH_DRAG_AND_DROP
778 return m_pGuestDnD->dragHGLeave(uScreenId);
779#else /* VBOX_WITH_DRAG_AND_DROP */
780 ReturnComNotImplemented();
781#endif /* !VBOX_WITH_DRAG_AND_DROP */
782}
783
784STDMETHODIMP Guest::DragHGDrop(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), BSTR *pstrFormat, DragAndDropAction_T *pResultAction)
785{
786 /* Input validation */
787 CheckComArgSafeArrayNotNull(allowedActions);
788 CheckComArgSafeArrayNotNull(formats);
789 CheckComArgOutPointerValid(pstrFormat);
790 CheckComArgOutPointerValid(pResultAction);
791
792 AutoCaller autoCaller(this);
793 if (FAILED(autoCaller.rc())) return autoCaller.rc();
794
795#ifdef VBOX_WITH_DRAG_AND_DROP
796 return m_pGuestDnD->dragHGDrop(uScreenId, uX, uY, defaultAction, ComSafeArrayInArg(allowedActions), ComSafeArrayInArg(formats), pstrFormat, pResultAction);
797#else /* VBOX_WITH_DRAG_AND_DROP */
798 ReturnComNotImplemented();
799#endif /* !VBOX_WITH_DRAG_AND_DROP */
800}
801
802STDMETHODIMP Guest::DragHGPutData(ULONG uScreenId, IN_BSTR bstrFormat, ComSafeArrayIn(BYTE, data), IProgress **ppProgress)
803{
804 /* Input validation */
805 CheckComArgStrNotEmptyOrNull(bstrFormat);
806 CheckComArgSafeArrayNotNull(data);
807 CheckComArgOutPointerValid(ppProgress);
808
809 AutoCaller autoCaller(this);
810 if (FAILED(autoCaller.rc())) return autoCaller.rc();
811
812#ifdef VBOX_WITH_DRAG_AND_DROP
813 return m_pGuestDnD->dragHGPutData(uScreenId, bstrFormat, ComSafeArrayInArg(data), ppProgress);
814#else /* VBOX_WITH_DRAG_AND_DROP */
815 ReturnComNotImplemented();
816#endif /* !VBOX_WITH_DRAG_AND_DROP */
817}
818
819STDMETHODIMP Guest::DragGHPending(ULONG uScreenId, ComSafeArrayOut(BSTR, formats), ComSafeArrayOut(DragAndDropAction_T, allowedActions), DragAndDropAction_T *pDefaultAction)
820{
821 /* Input validation */
822 CheckComArgSafeArrayNotNull(formats);
823 CheckComArgSafeArrayNotNull(allowedActions);
824 CheckComArgOutPointerValid(pDefaultAction);
825
826 AutoCaller autoCaller(this);
827 if (FAILED(autoCaller.rc())) return autoCaller.rc();
828
829#ifdef VBOX_WITH_DRAG_AND_DROP
830 return m_pGuestDnD->dragGHPending(uScreenId, ComSafeArrayOutArg(formats), ComSafeArrayOutArg(allowedActions), pDefaultAction);
831#else /* VBOX_WITH_DRAG_AND_DROP */
832 ReturnComNotImplemented();
833#endif /* !VBOX_WITH_DRAG_AND_DROP */
834}
835
836STDMETHODIMP Guest::DragGHDropped(IN_BSTR bstrFormat, DragAndDropAction_T action, IProgress **ppProgress)
837{
838 /* Input validation */
839 CheckComArgStrNotEmptyOrNull(bstrFormat);
840 CheckComArgOutPointerValid(ppProgress);
841
842 AutoCaller autoCaller(this);
843 if (FAILED(autoCaller.rc())) return autoCaller.rc();
844
845#ifdef VBOX_WITH_DRAG_AND_DROP
846 return m_pGuestDnD->dragGHDropped(bstrFormat, action, ppProgress);
847#else /* VBOX_WITH_DRAG_AND_DROP */
848 ReturnComNotImplemented();
849#endif /* !VBOX_WITH_DRAG_AND_DROP */
850}
851
852STDMETHODIMP Guest::DragGHGetData(ComSafeArrayOut(BYTE, data))
853{
854 /* Input validation */
855 CheckComArgSafeArrayNotNull(data);
856
857 AutoCaller autoCaller(this);
858 if (FAILED(autoCaller.rc())) return autoCaller.rc();
859
860#ifdef VBOX_WITH_DRAG_AND_DROP
861 return m_pGuestDnD->dragGHGetData(ComSafeArrayOutArg(data));
862#else /* VBOX_WITH_DRAG_AND_DROP */
863 ReturnComNotImplemented();
864#endif /* !VBOX_WITH_DRAG_AND_DROP */
865}
866
867// public methods only for internal purposes
868/////////////////////////////////////////////////////////////////////////////
869
870/**
871 * Sets the general Guest Additions information like
872 * API (interface) version and OS type. Gets called by
873 * vmmdevUpdateGuestInfo.
874 *
875 * @param aInterfaceVersion
876 * @param aOsType
877 */
878void Guest::setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType)
879{
880 RTTIMESPEC TimeSpecTS;
881 RTTimeNow(&TimeSpecTS);
882
883 AutoCaller autoCaller(this);
884 AssertComRCReturnVoid(autoCaller.rc());
885
886 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
887
888
889 /*
890 * Note: The Guest Additions API (interface) version is deprecated
891 * and will not be used anymore! We might need it to at least report
892 * something as version number if *really* ancient Guest Additions are
893 * installed (without the guest version + revision properties having set).
894 */
895 mData.mInterfaceVersion = aInterfaceVersion;
896
897 /*
898 * Older Additions rely on the Additions API version whether they
899 * are assumed to be active or not. Since newer Additions do report
900 * the Additions version *before* calling this function (by calling
901 * VMMDevReportGuestInfo2, VMMDevReportGuestStatus, VMMDevReportGuestInfo,
902 * in that order) we can tell apart old and new Additions here. Old
903 * Additions never would set VMMDevReportGuestInfo2 (which set mData.mAdditionsVersion)
904 * so they just rely on the aInterfaceVersion string (which gets set by
905 * VMMDevReportGuestInfo).
906 *
907 * So only mark the Additions as being active (run level = system) when we
908 * don't have the Additions version set.
909 */
910 if (mData.mAdditionsVersionNew.isEmpty())
911 {
912 if (aInterfaceVersion.isEmpty())
913 mData.mAdditionsRunLevel = AdditionsRunLevelType_None;
914 else
915 {
916 mData.mAdditionsRunLevel = AdditionsRunLevelType_System;
917
918 /*
919 * To keep it compatible with the old Guest Additions behavior we need to set the
920 * "graphics" (feature) facility to active as soon as we got the Guest Additions
921 * interface version.
922 */
923 facilityUpdate(VBoxGuestFacilityType_Graphics, VBoxGuestFacilityStatus_Active, 0 /*fFlags*/, &TimeSpecTS);
924 }
925 }
926
927 /*
928 * Older Additions didn't have this finer grained capability bit,
929 * so enable it by default. Newer Additions will not enable this here
930 * and use the setSupportedFeatures function instead.
931 */
932 /** @todo r=bird: I don't get the above comment nor the code below...
933 * One talks about capability bits, the one always does something to a facility.
934 * Then there is the comment below it all, which is placed like it addresses the
935 * mOSTypeId, but talks about something which doesn't remotely like mOSTypeId...
936 *
937 * Andy, could you please try clarify and make the comments shorter and more
938 * coherent! Also, explain why this is important and what depends on it.
939 *
940 * PS. There is the VMMDEV_GUEST_SUPPORTS_GRAPHICS capability* report... It
941 * should come in pretty quickly after this update, normally.
942 */
943 facilityUpdate(VBoxGuestFacilityType_Graphics,
944 facilityIsActive(VBoxGuestFacilityType_VBoxGuestDriver)
945 ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
946 0 /*fFlags*/, &TimeSpecTS); /** @todo the timestamp isn't gonna be right here on saved state restore. */
947
948 /*
949 * Note! There is a race going on between setting mAdditionsRunLevel and
950 * mSupportsGraphics here and disabling/enabling it later according to
951 * its real status when using new(er) Guest Additions.
952 */
953 mData.mOSTypeId = Global::OSTypeId(aOsType);
954}
955
956/**
957 * Sets the Guest Additions version information details.
958 *
959 * Gets called by vmmdevUpdateGuestInfo2 and vmmdevUpdateGuestInfo (to clear the
960 * state).
961 *
962 * @param a_uFullVersion VBoxGuestInfo2::additionsMajor,
963 * VBoxGuestInfo2::additionsMinor and
964 * VBoxGuestInfo2::additionsBuild combined into
965 * one value by VBOX_FULL_VERSION_MAKE.
966 *
967 * When this is 0, it's vmmdevUpdateGuestInfo
968 * calling to reset the state.
969 *
970 * @param a_pszName Build type tag and/or publisher tag, empty
971 * string if neiter of those are present.
972 * @param a_uRevision See VBoxGuestInfo2::additionsRevision.
973 * @param a_fFeatures See VBoxGuestInfo2::additionsFeatures.
974 */
975void Guest::setAdditionsInfo2(uint32_t a_uFullVersion, const char *a_pszName, uint32_t a_uRevision, uint32_t a_fFeatures)
976{
977 AutoCaller autoCaller(this);
978 AssertComRCReturnVoid(autoCaller.rc());
979
980 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
981
982 if (a_uFullVersion)
983 {
984 mData.mAdditionsVersionNew = BstrFmt(*a_pszName ? "%u.%u.%u_%s" : "%u.%u.%u",
985 VBOX_FULL_VERSION_GET_MAJOR(a_uFullVersion),
986 VBOX_FULL_VERSION_GET_MINOR(a_uFullVersion),
987 VBOX_FULL_VERSION_GET_BUILD(a_uFullVersion),
988 a_pszName);
989 mData.mAdditionsVersionFull = a_uFullVersion;
990 mData.mAdditionsRevision = a_uRevision;
991 mData.mAdditionsFeatures = a_fFeatures;
992 }
993 else
994 {
995 Assert(!a_fFeatures && !a_uRevision && !*a_pszName);
996 mData.mAdditionsVersionNew.setNull();
997 mData.mAdditionsVersionFull = 0;
998 mData.mAdditionsRevision = 0;
999 mData.mAdditionsFeatures = 0;
1000 }
1001}
1002
1003bool Guest::facilityIsActive(VBoxGuestFacilityType enmFacility)
1004{
1005 Assert(enmFacility < INT32_MAX);
1006 FacilityMapIterConst it = mData.mFacilityMap.find((AdditionsFacilityType_T)enmFacility);
1007 if (it != mData.mFacilityMap.end())
1008 {
1009 AdditionsFacility *pFac = it->second;
1010 return (pFac->getStatus() == AdditionsFacilityStatus_Active);
1011 }
1012 return false;
1013}
1014
1015void Guest::facilityUpdate(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
1016 uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
1017{
1018 AssertReturnVoid( a_enmFacility < VBoxGuestFacilityType_All
1019 && a_enmFacility > VBoxGuestFacilityType_Unknown);
1020
1021 FacilityMapIter it = mData.mFacilityMap.find((AdditionsFacilityType_T)a_enmFacility);
1022 if (it != mData.mFacilityMap.end())
1023 {
1024 AdditionsFacility *pFac = it->second;
1025 pFac->update((AdditionsFacilityStatus_T)a_enmStatus, a_fFlags, a_pTimeSpecTS);
1026 }
1027 else
1028 {
1029 if (mData.mFacilityMap.size() > 64)
1030 {
1031 /* The easy way out for now. We could automatically destroy
1032 inactive facilities like VMMDev does if we like... */
1033 AssertFailedReturnVoid();
1034 }
1035
1036 ComObjPtr<AdditionsFacility> ptrFac;
1037 ptrFac.createObject();
1038 AssertReturnVoid(!ptrFac.isNull());
1039
1040 HRESULT hrc = ptrFac->init(this, (AdditionsFacilityType_T)a_enmFacility, (AdditionsFacilityStatus_T)a_enmStatus,
1041 a_fFlags, a_pTimeSpecTS);
1042 if (SUCCEEDED(hrc))
1043 mData.mFacilityMap.insert(std::make_pair((AdditionsFacilityType_T)a_enmFacility, ptrFac));
1044 }
1045}
1046
1047/**
1048 * Sets the status of a certain Guest Additions facility.
1049 *
1050 * Gets called by vmmdevUpdateGuestStatus, which just passes the report along.
1051 *
1052 * @param a_pInterface Pointer to this interface.
1053 * @param a_enmFacility The facility.
1054 * @param a_enmStatus The status.
1055 * @param a_fFlags Flags assoicated with the update. Currently
1056 * reserved and should be ignored.
1057 * @param a_pTimeSpecTS Pointer to the timestamp of this report.
1058 * @sa PDMIVMMDEVCONNECTOR::pfnUpdateGuestStatus, vmmdevUpdateGuestStatus
1059 * @thread The emulation thread.
1060 */
1061void Guest::setAdditionsStatus(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
1062 uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
1063{
1064 Assert( a_enmFacility > VBoxGuestFacilityType_Unknown
1065 && a_enmFacility <= VBoxGuestFacilityType_All); /* Paranoia, VMMDev checks for this. */
1066
1067 AutoCaller autoCaller(this);
1068 AssertComRCReturnVoid(autoCaller.rc());
1069
1070 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
1071
1072 /*
1073 * Set a specific facility status.
1074 */
1075 if (a_enmFacility == VBoxGuestFacilityType_All)
1076 for (FacilityMapIter it = mData.mFacilityMap.begin(); it != mData.mFacilityMap.end(); ++it)
1077 facilityUpdate((VBoxGuestFacilityType)it->first, a_enmStatus, a_fFlags, a_pTimeSpecTS);
1078 else /* Update one facility only. */
1079 facilityUpdate(a_enmFacility, a_enmStatus, a_fFlags, a_pTimeSpecTS);
1080
1081 /*
1082 * Recalc the runlevel.
1083 */
1084 if (facilityIsActive(VBoxGuestFacilityType_VBoxTrayClient))
1085 mData.mAdditionsRunLevel = AdditionsRunLevelType_Desktop;
1086 else if (facilityIsActive(VBoxGuestFacilityType_VBoxService))
1087 mData.mAdditionsRunLevel = AdditionsRunLevelType_Userland;
1088 else if (facilityIsActive(VBoxGuestFacilityType_VBoxGuestDriver))
1089 mData.mAdditionsRunLevel = AdditionsRunLevelType_System;
1090 else
1091 mData.mAdditionsRunLevel = AdditionsRunLevelType_None;
1092}
1093
1094/**
1095 * Sets the supported features (and whether they are active or not).
1096 *
1097 * @param fCaps Guest capability bit mask (VMMDEV_GUEST_SUPPORTS_XXX).
1098 */
1099void Guest::setSupportedFeatures(uint32_t aCaps)
1100{
1101 AutoCaller autoCaller(this);
1102 AssertComRCReturnVoid(autoCaller.rc());
1103
1104 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
1105
1106 /** @todo A nit: The timestamp is wrong on saved state restore. Would be better
1107 * to move the graphics and seamless capability -> facility translation to
1108 * VMMDev so this could be saved. */
1109 RTTIMESPEC TimeSpecTS;
1110 RTTimeNow(&TimeSpecTS);
1111
1112 facilityUpdate(VBoxGuestFacilityType_Seamless,
1113 aCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
1114 0 /*fFlags*/, &TimeSpecTS);
1115 /** @todo Add VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING */
1116 facilityUpdate(VBoxGuestFacilityType_Graphics,
1117 aCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
1118 0 /*fFlags*/, &TimeSpecTS);
1119}
1120/* 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