Index: trunk/src/VBox/Main/AudioAdapterImpl.cpp
===================================================================
--- trunk/src/VBox/Main/AudioAdapterImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/AudioAdapterImpl.cpp	(revision 26171)
@@ -429,23 +429,13 @@
  *  @note Locks this object for writing.
  */
-bool AudioAdapter::rollback()
+void AudioAdapter::rollback()
 {
     /* sanity */
     AutoCaller autoCaller(this);
-    AssertComRCReturn (autoCaller.rc(), false);
+    AssertComRCReturnVoid(autoCaller.rc());
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    bool changed = false;
-
-    if (mData.isBackedUp())
-    {
-        /* we need to check all data to see whether anything will be changed
-         * after rollback */
-        changed = mData.hasActualChanges();
-        mData.rollback();
-    }
-
-    return changed;
+    mData.rollback();
 }
 
Index: trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- trunk/src/VBox/Main/MachineImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/MachineImpl.cpp	(revision 26171)
@@ -198,81 +198,4 @@
 }
 
-bool Machine::HWData::operator==(const HWData &that) const
-{
-    if (this == &that)
-        return true;
-
-    if (mHWVersion != that.mHWVersion ||
-        mHardwareUUID != that.mHardwareUUID ||
-        mMemorySize != that.mMemorySize ||
-        mMemoryBalloonSize != that.mMemoryBalloonSize ||
-        mStatisticsUpdateInterval != that.mStatisticsUpdateInterval ||
-        mVRAMSize != that.mVRAMSize ||
-        mFirmwareType != that.mFirmwareType ||
-        mAccelerate3DEnabled != that.mAccelerate3DEnabled ||
-        mAccelerate2DVideoEnabled != that.mAccelerate2DVideoEnabled ||
-        mMonitorCount != that.mMonitorCount ||
-        mHWVirtExEnabled != that.mHWVirtExEnabled ||
-        mHWVirtExNestedPagingEnabled != that.mHWVirtExNestedPagingEnabled ||
-        mHWVirtExVPIDEnabled != that.mHWVirtExVPIDEnabled ||
-        mHWVirtExExclusive != that.mHWVirtExExclusive ||
-        mPAEEnabled != that.mPAEEnabled ||
-        mSyntheticCpu != that.mSyntheticCpu ||
-        mCPUCount != that.mCPUCount ||
-        mCPUHotPlugEnabled != that.mCPUHotPlugEnabled ||
-        mClipboardMode != that.mClipboardMode)
-        return false;
-
-    for (size_t i = 0; i < RT_ELEMENTS (mBootOrder); ++i)
-        if (mBootOrder [i] != that.mBootOrder [i])
-            return false;
-
-
-    for (size_t i = 0; i < RT_ELEMENTS(mCPUAttached); i++)
-    {
-        if (mCPUAttached[i] != that.mCPUAttached[i])
-            return false;
-    }
-
-    if (mSharedFolders.size() != that.mSharedFolders.size())
-        return false;
-
-    if (mSharedFolders.size() == 0)
-        return true;
-
-    /* Make copies to speed up comparison */
-    SharedFolderList folders = mSharedFolders;
-    SharedFolderList thatFolders = that.mSharedFolders;
-
-    SharedFolderList::iterator it = folders.begin();
-    while (it != folders.end())
-    {
-        bool found = false;
-        SharedFolderList::iterator thatIt = thatFolders.begin();
-        while (thatIt != thatFolders.end())
-        {
-            if (    (*it)->getName() == (*thatIt)->getName()
-                 && RTPathCompare(Utf8Str((*it)->getHostPath()).c_str(),
-                                  Utf8Str((*thatIt)->getHostPath()).c_str()
-                                 ) == 0)
-            {
-                thatFolders.erase (thatIt);
-                found = true;
-                break;
-            }
-            else
-                ++thatIt;
-        }
-        if (found)
-            it = folders.erase (it);
-        else
-            return false;
-    }
-
-    Assert (folders.size() == 0 && thatFolders.size() == 0);
-
-    return true;
-}
-
 /////////////////////////////////////////////////////////////////////////////
 // Machine::HDData structure
@@ -285,51 +208,4 @@
 Machine::MediaData::~MediaData()
 {
-}
-
-bool Machine::MediaData::operator==(const MediaData &that) const
-{
-    if (this == &that)
-        return true;
-
-    if (mAttachments.size() != that.mAttachments.size())
-        return false;
-
-    if (mAttachments.size() == 0)
-        return true;
-
-    /* Make copies to speed up comparison */
-    AttachmentList atts = mAttachments;
-    AttachmentList thatAtts = that.mAttachments;
-
-    AttachmentList::iterator it = atts.begin();
-    while (it != atts.end())
-    {
-        bool found = false;
-        AttachmentList::iterator thatIt = thatAtts.begin();
-        while (thatIt != thatAtts.end())
-        {
-            if (    (*it)->matches((*thatIt)->getControllerName(),
-                                   (*thatIt)->getPort(),
-                                   (*thatIt)->getDevice())
-                 && (*it)->getPassthrough() == (*thatIt)->getPassthrough()
-                 && (*it)->getMedium().equalsTo((*thatIt)->getMedium())
-               )
-            {
-                thatAtts.erase(thatIt);
-                found = true;
-                break;
-            }
-            else
-                ++thatIt;
-        }
-        if (found)
-            it = atts.erase (it);
-        else
-            return false;
-    }
-
-    Assert (atts.size() == 0 && thatAtts.size() == 0);
-
-    return true;
 }
 
@@ -8333,19 +8209,28 @@
     if (m_flModifications & IsModified_NetworkAdapters)
         for (ULONG slot = 0; slot < RT_ELEMENTS(mNetworkAdapters); slot++)
-            if (mNetworkAdapters[slot])
-                if (mNetworkAdapters[slot]->rollback())
-                    networkAdapters[slot] = mNetworkAdapters[slot];
+            if (    mNetworkAdapters[slot]
+                 && mNetworkAdapters[slot]->isModified())
+            {
+                mNetworkAdapters[slot]->rollback();
+                networkAdapters[slot] = mNetworkAdapters[slot];
+            }
 
     if (m_flModifications & IsModified_SerialPorts)
         for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
-            if (mSerialPorts[slot])
-                if (mSerialPorts[slot]->rollback())
-                    serialPorts[slot] = mSerialPorts[slot];
+            if (    mSerialPorts[slot]
+                 && mSerialPorts[slot]->isModified())
+            {
+                mSerialPorts[slot]->rollback();
+                serialPorts[slot] = mSerialPorts[slot];
+            }
 
     if (m_flModifications & IsModified_ParallelPorts)
         for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
-            if (mParallelPorts[slot])
-                if (mParallelPorts[slot]->rollback())
-                    parallelPorts[slot] = mParallelPorts[slot];
+            if (    mParallelPorts[slot]
+                 && mParallelPorts[slot]->isModified())
+            {
+                mParallelPorts[slot]->rollback();
+                parallelPorts[slot] = mParallelPorts[slot];
+            }
 
     if (aNotify)
Index: trunk/src/VBox/Main/MediumAttachmentImpl.cpp
===================================================================
--- trunk/src/VBox/Main/MediumAttachmentImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/MediumAttachmentImpl.cpp	(revision 26171)
@@ -44,10 +44,4 @@
     { }
 
-    bool operator==(const BackupableMediumAttachmentData &that) const
-    {
-        return    this == &that
-               || (fPassthrough == that.fPassthrough);
-    }
-
     ComObjPtr<Medium>   pMedium;
     /* Since MediumAttachment is not a first class citizen when it
@@ -282,5 +276,5 @@
  *  @note Locks this object for writing.
  */
-bool MediumAttachment::rollback()
+void MediumAttachment::rollback()
 {
     LogFlowThisFunc(("ENTER - %s\n", getLogName()));
@@ -288,20 +282,11 @@
     /* sanity */
     AutoCaller autoCaller(this);
-    AssertComRCReturn (autoCaller.rc(), false);
+    AssertComRCReturnVoid(autoCaller.rc());
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    bool changed = false;
-
-    if (m->bd.isBackedUp())
-    {
-        /* we need to check all data to see whether anything will be changed
-         * after rollback */
-        changed = m->bd.hasActualChanges();
-        m->bd.rollback();
-    }
-
-    LogFlowThisFunc(("LEAVE - %s - returning %RTbool\n", getLogName(), changed));
-    return changed;
+    m->bd.rollback();
+
+    LogFlowThisFunc(("LEAVE - %s\n", getLogName()));
 }
 
Index: trunk/src/VBox/Main/NetworkAdapterImpl.cpp
===================================================================
--- trunk/src/VBox/Main/NetworkAdapterImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/NetworkAdapterImpl.cpp	(revision 26171)
@@ -1126,25 +1126,25 @@
 
 /**
+ * Returns true if any setter method has modified settings of this instance.
+ * @return
+ */
+bool NetworkAdapter::isModified()
+{
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
+    return m_fModified;
+}
+
+/**
  *  @note Locks this object for writing.
  */
-bool NetworkAdapter::rollback()
+void NetworkAdapter::rollback()
 {
     /* sanity */
     AutoCaller autoCaller(this);
-    AssertComRCReturn (autoCaller.rc(), false);
-
-    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
-
-    bool changed = false;
-
-    if (mData.isBackedUp())
-    {
-        /* we need to check all data to see whether anything will be changed
-         * after rollback */
-        changed = mData.hasActualChanges();
-        mData.rollback();
-    }
-
-    return changed;
+    AssertComRCReturnVoid(autoCaller.rc());
+
+    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    mData.rollback();
 }
 
Index: trunk/src/VBox/Main/ParallelPortImpl.cpp
===================================================================
--- trunk/src/VBox/Main/ParallelPortImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/ParallelPortImpl.cpp	(revision 26171)
@@ -462,25 +462,25 @@
 
 /**
+ * Returns true if any setter method has modified settings of this instance.
+ * @return
+ */
+bool ParallelPort::isModified()
+{
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
+    return m->fModified;
+}
+
+/**
  *  @note Locks this object for writing.
  */
-bool ParallelPort::rollback()
+void ParallelPort::rollback()
 {
     /* sanity */
     AutoCaller autoCaller(this);
-    AssertComRCReturn (autoCaller.rc(), false);
+    AssertComRCReturnVoid(autoCaller.rc());
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    bool changed = false;
-
-    if (m->bd.isBackedUp())
-    {
-        /* we need to check all data to see whether anything will be changed
-         * after rollback */
-        changed = m->bd.hasActualChanges();
-        m->bd.rollback();
-    }
-
-    return changed;
+    m->bd.rollback();
 }
 
Index: trunk/src/VBox/Main/SerialPortImpl.cpp
===================================================================
--- trunk/src/VBox/Main/SerialPortImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/SerialPortImpl.cpp	(revision 26171)
@@ -579,25 +579,25 @@
 
 /**
+ * Returns true if any setter method has modified settings of this instance.
+ * @return
+ */
+bool SerialPort::isModified()
+{
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
+    return m->fModified;
+}
+
+/**
  *  @note Locks this object for writing.
  */
-bool SerialPort::rollback()
+void SerialPort::rollback()
 {
     /* sanity */
     AutoCaller autoCaller(this);
-    AssertComRCReturn (autoCaller.rc(), false);
-
-    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
-
-    bool changed = false;
-
-    if (m->bd.isBackedUp())
-    {
-        /* we need to check all data to see whether anything will be changed
-         * after rollback */
-        changed = m->bd.hasActualChanges();
-        m->bd.rollback();
-    }
-
-    return changed;
+    AssertComRCReturnVoid(autoCaller.rc());
+
+    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    m->bd.rollback();
 }
 
Index: trunk/src/VBox/Main/StorageControllerImpl.cpp
===================================================================
--- trunk/src/VBox/Main/StorageControllerImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/StorageControllerImpl.cpp	(revision 26171)
@@ -54,16 +54,4 @@
           mPortIde1Slave(3)
     { }
-
-    bool operator==(const BackupableStorageControllerData &that) const
-    {
-        return    this == &that
-                || (    (mStorageControllerType == that.mStorageControllerType)
-                    && (strName           == that.strName)
-                    && (mPortCount   == that.mPortCount)
-                    && (mPortIde0Master == that.mPortIde0Master)
-                    && (mPortIde0Slave  == that.mPortIde0Slave)
-                    && (mPortIde1Master == that.mPortIde1Master)
-                    && (mPortIde1Slave  == that.mPortIde1Slave));
-    }
 
     /** Unique name of the storage controller. */
@@ -718,22 +706,12 @@
 
 /** @note Locks objects for writing! */
-bool StorageController::rollback()
-{
-    AutoCaller autoCaller(this);
-    AssertComRCReturn (autoCaller.rc(), false);
+void StorageController::rollback()
+{
+    AutoCaller autoCaller(this);
+    AssertComRCReturnVoid(autoCaller.rc());
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    bool dataChanged = false;
-
-    if (m->bd.isBackedUp())
-    {
-        /* we need to check all data to see whether anything will be changed
-         * after rollback */
-        dataChanged = m->bd.hasActualChanges();
-        m->bd.rollback();
-    }
-
-    return dataChanged;
+    m->bd.rollback();
 }
 
Index: trunk/src/VBox/Main/USBControllerImpl.cpp
===================================================================
--- trunk/src/VBox/Main/USBControllerImpl.cpp	(revision 26169)
+++ trunk/src/VBox/Main/USBControllerImpl.cpp	(revision 26171)
@@ -55,9 +55,4 @@
           fEnabledEHCI(false)
     { }
-
-    bool operator==(const BackupableUSBData &that) const
-    {
-        return this == &that || (fEnabled == that.fEnabled && fEnabledEHCI == that.fEnabledEHCI);
-    }
 
     BOOL fEnabled;
@@ -727,24 +722,16 @@
 
 /** @note Locks objects for writing! */
-bool USBController::rollback()
-{
-    AutoCaller autoCaller(this);
-    AssertComRCReturn (autoCaller.rc(), false);
+void USBController::rollback()
+{
+    AutoCaller autoCaller(this);
+    AssertComRCReturnVoid(autoCaller.rc());
 
     /* we need the machine state */
     AutoAnyStateDependency adep(m->pParent);
-    AssertComRCReturn (adep.rc(), false);
+    AssertComRCReturnVoid(adep.rc());
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    bool dataChanged = false;
-
-    if (m->bd.isBackedUp())
-    {
-        /* we need to check all data to see whether anything will be changed
-         * after rollback */
-        dataChanged = m->bd.hasActualChanges();
-        m->bd.rollback();
-    }
+    m->bd.rollback();
 
 #ifdef VBOX_WITH_USB
@@ -753,5 +740,5 @@
     {
         USBProxyService *service = m->pParent->getVirtualBox()->host()->usbProxyService();
-        ComAssertRet (service, false);
+        Assert(service);
 
         /* uninitialize all new filters (absent in the backed up list) */
@@ -768,5 +755,5 @@
                 {
                     USBDeviceFilter *filter = *it;
-                    ComAssertRet(filter->getId() != NULL, false);
+                    Assert(filter->getId() != NULL);
                     service->removeFilter(filter->getId());
                     filter->getId() = NULL;
@@ -792,5 +779,5 @@
                     {
                         USBDeviceFilter *flt = *it; /* resolve ambiguity */
-                        ComAssertRet(flt->getId() == NULL, false);
+                        Assert(flt->getId() == NULL);
                         flt->getId() = service->insertFilter(&flt->getData().mUSBFilter);
                     }
@@ -815,12 +802,10 @@
             (*it)->rollback();
             /* call this to notify the USB proxy about changes */
-            onDeviceFilterChange (*it);
+            onDeviceFilterChange(*it);
         }
-        ++ it;
+        ++it;
     }
 
 #endif /* VBOX_WITH_USB */
-
-    return dataChanged;
 }
 
Index: trunk/src/VBox/Main/include/AudioAdapterImpl.h
===================================================================
--- trunk/src/VBox/Main/include/AudioAdapterImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/AudioAdapterImpl.h	(revision 26171)
@@ -44,12 +44,4 @@
         Data();
 
-        bool operator== (const Data &that) const
-        {
-            return this == &that ||
-                   (mEnabled == that.mEnabled &&
-                    mAudioDriver == that.mAudioDriver &&
-                    mAudioController == that.mAudioController);
-        }
-
         BOOL mEnabled;
         AudioDriverType_T mAudioDriver;
@@ -92,5 +84,5 @@
     HRESULT saveSettings(settings::AudioAdapter &data);
 
-    bool rollback();
+    void rollback();
     void commit();
     void copyFrom(AudioAdapter *aThat);
Index: trunk/src/VBox/Main/include/MachineImpl.h
===================================================================
--- trunk/src/VBox/Main/include/MachineImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/MachineImpl.h	(revision 26171)
@@ -225,19 +225,4 @@
         ~UserData();
 
-        bool operator==(const UserData &that) const
-        {
-            return this == &that
-                || (   mName                 == that.mName
-                    && mNameSync             == that.mNameSync
-                    && mDescription          == that.mDescription
-                    && mOSTypeId             == that.mOSTypeId
-                    && mSnapshotFolderFull   == that.mSnapshotFolderFull
-                    && mTeleporterEnabled    == that.mTeleporterEnabled
-                    && mTeleporterPort       == that.mTeleporterPort
-                    && mTeleporterAddress    == that.mTeleporterAddress
-                    && mTeleporterPassword   == that.mTeleporterPassword
-                    && mRTCUseUTC            == that.mRTCUseUTC);
-        }
-
         Bstr    mName;
         BOOL    mNameSync;
@@ -279,6 +264,4 @@
         HWData();
         ~HWData();
-
-        bool operator==(const HWData &that) const;
 
         Bstr           mHWVersion;
@@ -333,6 +316,4 @@
         MediaData();
         ~MediaData();
-
-        bool operator==(const MediaData &that) const;
 
         typedef std::list< ComObjPtr<MediumAttachment> > AttachmentList;
Index: trunk/src/VBox/Main/include/MediumAttachmentImpl.h
===================================================================
--- trunk/src/VBox/Main/include/MediumAttachmentImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/MediumAttachmentImpl.h	(revision 26171)
@@ -68,5 +68,5 @@
 
     // public internal methods
-    bool rollback();
+    void rollback();
     void commit();
 
Index: trunk/src/VBox/Main/include/NetworkAdapterImpl.h
===================================================================
--- trunk/src/VBox/Main/include/NetworkAdapterImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/NetworkAdapterImpl.h	(revision 26171)
@@ -50,19 +50,4 @@
                  mNATNetwork("") /* cannot be null */
         {}
-
-        bool operator== (const Data &that) const
-        {
-            return this == &that ||
-                   (mSlot == that.mSlot &&
-                    mEnabled == that.mEnabled &&
-                    mMACAddress == that.mMACAddress &&
-                    mAttachmentType == that.mAttachmentType &&
-                    mCableConnected == that.mCableConnected &&
-                    mLineSpeed == that.mLineSpeed &&
-                    mTraceEnabled == that.mTraceEnabled &&
-                    mHostInterface == that.mHostInterface &&
-                    mInternalNetwork == that.mInternalNetwork &&
-                    mNATNetwork == that.mNATNetwork);
-        }
 
         NetworkAdapterType_T mAdapterType;
@@ -139,5 +124,6 @@
     HRESULT saveSettings(settings::NetworkAdapter &data);
 
-    bool rollback();
+    bool isModified();
+    void rollback();
     void commit();
     void copyFrom (NetworkAdapter *aThat);
Index: trunk/src/VBox/Main/include/ParallelPortImpl.h
===================================================================
--- trunk/src/VBox/Main/include/ParallelPortImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/ParallelPortImpl.h	(revision 26171)
@@ -78,5 +78,6 @@
     HRESULT saveSettings(settings::ParallelPort &data);
 
-    bool rollback();
+    bool isModified();
+    void rollback();
     void commit();
     void copyFrom(ParallelPort *aThat);
Index: trunk/src/VBox/Main/include/SerialPortImpl.h
===================================================================
--- trunk/src/VBox/Main/include/SerialPortImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/SerialPortImpl.h	(revision 26171)
@@ -84,5 +84,6 @@
     HRESULT saveSettings(settings::SerialPort &data);
 
-    bool rollback();
+    bool isModified();
+    void rollback();
     void commit();
     void copyFrom(SerialPort *aThat);
Index: trunk/src/VBox/Main/include/Shareable.h
===================================================================
--- trunk/src/VBox/Main/include/Shareable.h	(revision 26169)
+++ 	(revision )
@@ -1,414 +1,0 @@
-/** @file
- *
- * Data structure management templates (Shareable and friends)
- */
-
-/*
- * 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;
- * you can redistribute it and/or modify it under the terms of the GNU
- * 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.
- */
-
-/// @todo (dmik) This header is not yet used.
-//  Templates defined here are to replace Shareable and Backupable
-//  defined in VirtualBoxBase.h
-
-#ifndef ____H_SHAREABLE
-#define ____H_SHAREABLE
-
-#include <iprt/asm.h>
-#include <iprt/assert.h>
-
-namespace util
-{
-
-namespace internal
-{
-
-class Dummy
-{
-};
-
-class Shareable_base
-{
-protected:
-
-    class Data
-    {
-    public:
-
-        Data() : mRefCnt (0) {}
-        virtual ~Data() {}
-
-        uint32_t addRef() { return ASMAtomicIncU32 (&mRefCnt); }
-        uint32_t release()
-        {
-            uint32_t refCnt = ASMAtomicDecU32 (&mRefCnt);
-            if (refCnt == 0)
-                delete this;
-            return refCnt;
-        }
-
-    private:
-
-        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (Data)
-
-        uint32_t volatile mRefCnt;
-    };
-};
-
-} /* namespace internal */
-
-/**
- *  Template class to manage allocation/deallocation of data structures on the
- *  heap with the ability to share allocated data among several instances.
- *
- *  Data sharing is implemented using the concept of reference counting.
- *  When an instance allocates the managed data structure from scratch, it sets
- *  the reference counter to one. When it starts sharing the existing data
- *  structure, it simply increments the reference counter by one. When it stops
- *  sharing data, the reference counter is decremented. Once this counter drops
- *  to zero, the managed data structure is automatically deallocated (deleted).
- *
- *  Data managed by instances of this class can be either |NULL| (not allocated
- *  and not shared) or non-|NULL| (either allocated using #create() or shared
- *  with another instance using one of assignment operators or methods), as
- *  indicated by the #isNull() method and by the data pointer returned by
- *  the #data() method. Note that the #operator->() method will fail (hit an
- *  assertion) if the managed data pointer is |NULL|.
- *
- *  The managed data structure (passed as the first argument to the template)
- *  must meet the following requirements:
- *  <ul>
- *      <li>Must have a public default constructor (with no arguments)
- *      <li>Must define a public copy constructor and assignment operation
- *  </ul>
- *
- *  This template class is NOT thread-safe. If you need thread safefy, you can
- *  specify util::Lockable as the second argument to the template. In this
- *  case, you can explicitly lock instances of the template (using the
- *  AutoWriteLock and AutoReadLock classes) before accessing any of its
- *  members, as follows:
- *  <code>
- *      struct Data { ... };
- *      Shareable <Data, util::Lockable> mData;
- *      ...
- *      {
- *          // acquire the lock until the end of the block
- *          AutoWriteLock alock(mData COMMA_LOCKVAL_SRC_POS);
- *          // share with another instance (thatData defined somewhere else)
- *          {
- *              AutoReadLock thatLock(thatData COMMA_LOCKVAL_SRC_POS);
- *              mData = thatData;
- *          }
- *          // access managed data (through #operator->())
- *          mData->mSomeVield = someValue;
- *      }
- *  </code>
- *
- *  Making this class thread-safe usually assumes that the managed data
- *  structure must be also thread-safe and must share its own lock object with
- *  all other Shareable instances referring it (so locking it through one
- *  Shareable instance will prevent another one sharing the same data from
- *  accessing it). This can be done in a similar way by deriving the data
- *  structure to manage from util::Lockable and using the #data() method to
- *  lock it before accessing:
- *  <code>
- *      struct Data : public util::Lockable { ... };
- *      Shareable <Data, util::Lockable> mData;
- *      ...
- *      {
- *          // read-only data access
- *          AutoReadLock lock(mData COMMA_LOCKVAL_SRC_POS); // protect Shareable members (read-only)
- *          AutoReadLock dataLock(mData.data() COMMA_LOCKVAL_SRC_POS); // protect Data members (read-only)
- *          if (mData->mSomeVield) ...
- *      }
- *      ...
- *      {
- *          // data modification
- *          AutoReadLock lock(mData COMMA_LOCKVAL_SRC_POS); // protect Shareable members (still read-only)
- *          AutoWriteLock dataLock(mData.data() COMMA_LOCKVAL_SRC_POS); // protect Data members (exclusive)
- *          mData->mSomeVield = someValue;
- *      }
- *  </code>
- *
- *  Please note that if you want to access managed data through #data() or
- *  #operator->(), you have to enter both locks! If you only need to access
- *  Shareable members themselves (i.e. to assign one Shareable to another or to
- *  call #setNull()) it's enough to enter the Shareable lock only (as it's shown
- *  at the beginning of the first example).
- *
- *  @param D        data structure to manage
- *  @param Extra    extra class the template instantiation will be publicly
- *                  derived from (by default, a dummy empty class)
- */
-template <class D, class Extra = internal::Dummy>
-class Shareable : public internal::Shareable_base, public Extra
-{
-public:
-
-    /** Creates a new instance with managed data set to |NULL|. */
-    Shareable() : mData (NULL) {}
-
-    /** Calls #setNull() and deletes this instance. */
-    virtual ~Shareable() { setNull(); };
-
-    /**
-     *  Allocates the managed data structure on the heap using the default
-     *  constructor. The current data, if not |NULL|, is dereferenced (see
-     *  #setNull()).
-     */
-    void create()
-    {
-        Data data = new Data();
-        AssertReturn (data != NULL, (void) 0);
-        setData (data);
-    }
-
-    /**
-     *  Allocates a copy of the managed data structure represented by the given
-     *  instance using the copy constructor. The current data, if not |NULL|,
-     *  is dereferenced (see #setNull()).
-     *
-     *  @note The newly allocated data is not shared with the given instance
-     *  (they are fully independent of each other).
-     */
-    void createCopy (const Shareable &that)
-    {
-        Data data = NULL;
-        if (that.mData)
-        {
-            data = new Data (*that.mData);
-            AssertReturn (data != NULL, (void) 0);
-        }
-        setData (data);
-    }
-
-    /**
-     *  Starts sharing the managed data structure represented by the given
-     *  instance. The data reference counter is incremented by one.
-     */
-    Shareable &operator= (const Shareable &that)
-    {
-        setData (that->mData);
-        return *this;
-    }
-
-    /**
-     *  Dereferences the managed data (decrements the reference counter) to
-     *  effectively stop sharing and sets the managed data pointer to |NULL|.
-     *  If this instance is the last (the only) one that to refers non-NULL data,
-     *  this data will be deallocated (deleted). Does nothing if data is |NULL|.
-     */
-    virtual void setNull() { setData (NULL); }
-
-    /**
-     *  Returns |true| if the managed data pointer is |NULL| (not allocated and
-     *  not shared).
-     */
-    bool isNull() const { return mData == NULL; }
-    /**
-     *  Converts this instance to |bool| (returns |true| when #isNull() is
-     *  |false|)
-     */
-    operator bool() const { return !isNull(); }
-
-    /**
-     *  Returns a pointer to the managed data structure (|NULL| when #isNull()
-     *  returns |true|).
-     */
-    D *data() { return mData; }
-    /**
-     *  Returns a pointer to the managed data structure (|NULL| when #isNull()
-     *  returns |true|).
-     */
-    const D *data() const { return mData; }
-
-    /**
-     *  A convenience shortcut to #data() (implements direct pointer semantics).
-     *  @note This operator will fail if the managed data pointer is |NULL|.
-     */
-    D *operator->()
-    {
-        AssertMsg (mData != NULL, ("Managed data is NULL\n"));
-        return mData;
-    }
-    /**
-     *  A convenience shortcut to #data() (implements direct pointer semantics).
-     *  @note This operator will fail if the managed data pointer is |NULL|.
-     */
-    const D *operator->() const
-    {
-        AssertMsg (mData != NULL, ("Managed data is NULL\n"));
-        return mData;
-    }
-
-protected:
-
-    typedef internal::Shareable_base::Data BD;
-    class Data : public D, public BD
-    {
-    public:
-        Data() : D(), BD() {}
-        Data (const Data &that) : D (&that), BD() {}
-    private:
-        Data &operator= (const Data &that);
-    };
-
-    void setData (Data *aData)
-    {
-        // beware of self assignment
-        if (aData)
-            aData->addRef();
-        if (mData)
-            mData->release();
-        mData = aData;
-    }
-
-private:
-
-    Data *mData;
-};
-
-WORKAROUND_MSVC7_ERROR_C2593_FOR_BOOL_OP_TPL (Shareable, <class D>, <D>)
-
-/**
- *  Template class that adds support for data backup to the Shareable template.
- *
- *  All thread safety remarks mentioned in the descrition of the Shareable
- *  template are appliable to this class as well. In particular, all new methods
- *  of this template are not implicitly thread-safe, so if you add thread
- *  safety using the util::Lockable class, don't forget to lock the
- *  Backupable instance before doing #backup(), #commit() or #rollback().
- *
- *  The managed data structure (passed as the first argument to the template)
- *  besides requirements mentioned in Shareable, must also provide a comparison
- *  operation (|bool operator== (const D &that) const|).
- *
- *  @param D        data structure to manage
- *  @param Extra    extra class the template instantiation will be publicly
- *                  derived from (by default, a dummy empty class)
- */
-template <class D, class Extra = internal::Dummy>
-class Backupable : public Shareable <D, Extra>
-{
-public:
-
-    /**
-     *  Creates a new instance with both managed data and its backup copy
-     *  set to |NULL|.
-     */
-    Backupable() : mBackupData (NULL) {}
-
-    /**
-     *  Calls #rollback() and then calls Shareable::setNull().
-     */
-    virtual void setNull()
-    {
-        rollback();
-        Shareable::setNull();
-    }
-
-    /**
-     *  Stores the current data pointer in the backup area and allocates a new
-     *  data using the copy constructor. The new data becomes the active one
-     *  (returned by #data() and #operator->()).
-     *  The method does nothing if the managed data is already backed up.
-     *  @note The managed data pointer must not be |NULL|, otherwise this method
-     *  will fail.
-     */
-    void backup()
-    {
-        if (!mBackupData)
-        {
-            AssertMsgReturn (this->mData, ("Managed data must not be NULL\n"),
-                             (void) 0);
-            Data data = new Data (*this->mData);
-            AssertReturn (data != NULL, (void) 0);
-            mBackupData = this->mData;
-            mBackupData->addRef();
-            setData (data);
-        }
-    }
-
-    /**
-     *  Dereferences the new data allocated by #backup() and restores the
-     *  previous data pointer from the backup area, making it active again.
-     *  If this instance is the last (the only) one that refers to the new data,
-     *  this data will be deallocated (deleted).
-     *  @note The managed data must be backed up, otherwise this method will fail.
-     */
-    void rollback()
-    {
-        AssertMsgReturn (this->mData, ("Managed data must not be NULL\n"),
-                         (void) 0);
-        AssertMsgReturn (mBackupData, ("Backed up data must not be NULL\n"),
-                         (void) 0);
-        setData (mBackupData);
-        mBackupData->release();
-        mBackupData = NULL;
-    }
-
-    /**
-     *  Dereferences the data backed up by #backup() (see #setNull()) keeping
-     *  the new data active.
-     *  If this instance is the last (the only) one that refers to the backed up
-     *  data, this data will be deallocated (deleted).
-     *  @note The managed data must be backed up, otherwise this method will fail.
-     */
-    void commit()
-    {
-        AssertMsgReturn (this->mData, ("Managed data must not be NULL\n"),
-                         (void) 0);
-        AssertMsgReturn (mBackupData, ("Backed up data must not be NULL\n"),
-                         (void) 0);
-        mBackupData->release();
-        mBackupData = NULL;
-    }
-
-    /** Returns |true| if the managed data is currently backed up. */
-    bool isBackedUp() const { return mBackupData != NULL; }
-
-    /**
-     *  Returns |true| if the managed data is currently backed up and the backed
-     *  up copy differs from the current data. The comparison is done using
-     *  the comparison operator provided by the managed data structure.
-     *  @note |false| is returned if the data is not currently backed up.
-     */
-    bool hasActualChanges() const
-    {
-        AssertMsgReturn (this->mData, ("Managed data must not be NULL"), false);
-        return mBackupData != NULL &&
-               !(this->mData->D::operator== (*mBackupData));
-    }
-
-    /**
-     *  Returns a pointer to the backed up copy of the managed data structure
-     *  (|NULL| when #isBackedUp() returns |false|).
-     */
-    const D *backupData() const { return mBackupData; }
-
-protected:
-
-    typedef Shareable::Data Data;
-
-private:
-
-    Data *mBackupData;
-};
-
-} /* namespace util */
-
-#endif // ____H_SHAREABLE
-
-/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Index: trunk/src/VBox/Main/include/StorageControllerImpl.h
===================================================================
--- trunk/src/VBox/Main/include/StorageControllerImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/StorageControllerImpl.h	(revision 26171)
@@ -89,5 +89,5 @@
     ULONG getInstance() const;
 
-    bool rollback();
+    void rollback();
     void commit();
 
Index: trunk/src/VBox/Main/include/USBControllerImpl.h
===================================================================
--- trunk/src/VBox/Main/include/USBControllerImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/USBControllerImpl.h	(revision 26171)
@@ -83,5 +83,5 @@
     HRESULT saveSettings(settings::USBController &data);
 
-    bool rollback();
+    void rollback();
     void commit();
     void copyFrom (USBController *aThat);
Index: trunk/src/VBox/Main/include/VRDPServerImpl.h
===================================================================
--- trunk/src/VBox/Main/include/VRDPServerImpl.h	(revision 26169)
+++ trunk/src/VBox/Main/include/VRDPServerImpl.h	(revision 26171)
@@ -44,16 +44,4 @@
     struct Data
     {
-        bool operator== (const Data &that) const
-        {
-            return this == &that ||
-                   (mEnabled == that.mEnabled &&
-                    mVRDPPorts == that.mVRDPPorts &&
-                    mVRDPAddress == that.mVRDPAddress &&
-                    mAuthType == that.mAuthType &&
-                    mAuthTimeout == that.mAuthTimeout &&
-                    mAllowMultiConnection == that.mAllowMultiConnection &&
-                    mReuseSingleConnection == that.mReuseSingleConnection);
-        }
-
         BOOL mEnabled;
         Bstr mVRDPPorts;
@@ -111,5 +99,5 @@
     HRESULT saveSettings(settings::VRDPSettings &data);
 
-    bool rollback();
+    void rollback();
     void commit();
     void copyFrom (VRDPServer *aThat);
Index: trunk/src/VBox/Main/include/VirtualBoxBase.h
===================================================================
--- trunk/src/VBox/Main/include/VirtualBoxBase.h	(revision 26169)
+++ trunk/src/VBox/Main/include/VirtualBoxBase.h	(revision 26171)
@@ -1680,11 +1680,4 @@
     }
 
-    bool hasActualChanges() const
-    {
-        AssertMsg(this->mData, ("data must not be NULL"));
-        return this->mData != NULL && mBackupData != NULL &&
-               !(*this->mData == *mBackupData);
-    }
-
     D *backedUpData() const
     {
