GuestImpl.cpp revision 13d7da5a8024cf0b129e07b522d434287013a0d9
/* $Id$ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2008 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include "GuestImpl.h"
#include "Global.h"
#include "ConsoleImpl.h"
#include "VMMDev.h"
#include "Logging.h"
#include <iprt/cpputils.h>
// defines
/////////////////////////////////////////////////////////////////////////////
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void Guest::FinalRelease()
{
uninit ();
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the guest object.
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
/* mData.mAdditionsActive is FALSE */
/* Confirm a successful initialization when it's the case */
else
mMemoryBalloonSize = 0; /* Default is no ballooning */
else
mStatUpdateInterval = 0; /* Default is not to report guest statistics at all */
/* invalidate all stats */
for (int i=0;i<GuestStatisticType_MaxVal;i++)
/* start with sample 0 */
return S_OK;
}
/**
* Uninitializes the instance and sets the ready flag to FALSE.
* Called either from FinalRelease() or by the parent when it gets destroyed.
*/
{
LogFlowThisFunc(("\n"));
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan(this);
if (autoUninitSpan.uninitDone())
return;
}
// IGuest properties
/////////////////////////////////////////////////////////////////////////////
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
// redirect the call to IMachine if no additions are installed
return S_OK;
}
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
return S_OK;
}
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
return S_OK;
}
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
return S_OK;
}
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
return S_OK;
}
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
return S_OK;
}
{
AutoCaller autoCaller(this);
AutoWriteLock alock(this);
{
/* forward the information to the VMM device */
if (vmmDev)
}
return ret;
}
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
return S_OK;
}
{
AutoCaller autoCaller(this);
AutoWriteLock alock(this);
{
/* forward the information to the VMM device */
if (vmmDev)
}
return ret;
}
{
AutoCaller autoCaller(this);
/* forward the information to the VMM device */
if (vmmDev)
{
if (!aAllowInteractiveLogon)
return S_OK;
}
return setError (VBOX_E_VM_ERROR,
tr ("VMM device is not available (is the VM running?)"));
}
{
/* Not available or not yet reported? In that case, just return with a proper error
* but don't use setError(). */
return E_INVALIDARG;
return S_OK;
}
{
/* internal method assumes that the caller knows what he's doing (no boundary checks) */
return S_OK;
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
{
AutoCaller autoCaller(this);
AutoWriteLock alock(this);
}
{
AutoCaller autoCaller(this);
AutoWriteLock alock(this);
}
{
AutoCaller autoCaller(this);
AutoWriteLock alock(this);
}
/* vi: set tabstop=4 shiftwidth=4 expandtab: */