HardDiskAttachmentImpl.cpp revision 32529464ff2d4288a3c949ab8042126b0fa903de
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2007 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 "HardDiskAttachmentImpl.h"
#include "Logging.h"
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void HardDiskAttachment::FinalRelease()
{
uninit();
}
// public initializer/uninitializer for internal purposes only
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the hard disk attachment object.
*
* @param aHD Hard disk object.
* @param aController Controller the hard disk is attached to.
* @param aPort Port number.
* @param aDevice Device number on the port.
* @param aImplicit Wether the attachment contains an implicitly created diff.
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
/* Confirm a successful initialization when it's the case */
return S_OK;
}
/**
* Uninitializes the instance.
* Called from FinalRelease().
*/
void HardDiskAttachment::uninit()
{
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan(this);
if (autoUninitSpan.uninitDone())
return;
}
// IHardDiskAttachment properties
/////////////////////////////////////////////////////////////////////////////
{
AutoCaller autoCaller(this);
AutoReadLock alock(this);
return S_OK;
}
{
AutoCaller autoCaller(this);
/* m.controller is constant during life time, no need to lock */
return S_OK;
}
{
AutoCaller autoCaller(this);
/* m.port is constant during life time, no need to lock */
return S_OK;
}
{
AutoCaller autoCaller(this);
/* m.device is constant during life time, no need to lock */
return S_OK;
}
/* vi: set tabstop=4 shiftwidth=4 expandtab: */