Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 76297)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 76298)
@@ -23725,5 +23725,4 @@
       The given medium was registered or unregistered
       within this VirtualBox installation.
-      <note>This event is not yet implemented.</note>
     </desc>
 
@@ -23752,5 +23751,4 @@
       The configuration of the given medium was changed (location, properties,
       child/parent or anything else).
-      <note>This event is not yet implemented.</note>
     </desc>
 
@@ -24144,5 +24142,4 @@
       <link to="IMachine::mediumAttachments">medium attachment</link>
       changes.
-      <note>This event is not yet implemented.</note>
     </desc>
     <attribute name="mediumAttachment" type="IMediumAttachment" readonly="yes">
Index: /trunk/src/VBox/Main/include/MediumImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MediumImpl.h	(revision 76297)
+++ /trunk/src/VBox/Main/include/MediumImpl.h	(revision 76298)
@@ -169,5 +169,6 @@
                                 MediumLockList *pMediumLockList,
                                 ComObjPtr<Progress> *aProgress,
-                                bool aWait);
+                                bool aWait,
+                                bool aNotify);
     Utf8Str i_getPreferredDiffFormat();
     MediumVariant_T i_getPreferredDiffVariant();
@@ -176,5 +177,5 @@
     HRESULT i_unlockRead(MediumState_T *aState);
     HRESULT i_unlockWrite(MediumState_T *aState);
-    HRESULT i_deleteStorage(ComObjPtr<Progress> *aProgress, bool aWait);
+    HRESULT i_deleteStorage(ComObjPtr<Progress> *aProgress, bool aWait, bool aNotify);
     HRESULT i_markForDeletion();
     HRESULT i_unmarkForDeletion();
@@ -199,5 +200,6 @@
                       MediumLockList *aMediumLockList,
                       ComObjPtr<Progress> *aProgress,
-                      bool aWait);
+                      bool aWait,
+                      bool aNotify);
     void i_cancelMergeTo(MediumLockList *aChildrenToReparent,
                        MediumLockList *aMediumLockList);
@@ -206,5 +208,6 @@
                      MediumLockList *aMediumLockList,
                      ComObjPtr<Progress> *aProgress,
-                     bool aWait);
+                     bool aWait,
+                     bool aNotify);
 
     HRESULT i_fixParentUuidOfChildren(MediumLockList *pChildrenToReparent);
@@ -220,13 +223,14 @@
                          const ComObjPtr<Progress> &aProgress);
     HRESULT i_importFile(const char *aFilename,
-                        const ComObjPtr<MediumFormat> &aFormat,
-                        MediumVariant_T aVariant,
-                        RTVFSIOSTREAM hVfsIosSrc,
-                        const ComObjPtr<Medium> &aParent,
-                        const ComObjPtr<Progress> &aProgress);
+                         const ComObjPtr<MediumFormat> &aFormat,
+                         MediumVariant_T aVariant,
+                         RTVFSIOSTREAM hVfsIosSrc,
+                         const ComObjPtr<Medium> &aParent,
+                         const ComObjPtr<Progress> &aProgress,
+                         bool aNotify);
 
     HRESULT i_cloneToEx(const ComObjPtr<Medium> &aTarget, MediumVariant_T aVariant,
                         const ComObjPtr<Medium> &aParent, IProgress **aProgress,
-                        uint32_t idxSrcImageSame, uint32_t idxDstImageSame);
+                        uint32_t idxSrcImageSame, uint32_t idxDstImageSame, bool aNotify);
 
     const Utf8Str& i_getKeyId();
Index: /trunk/src/VBox/Main/include/VirtualBoxImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/VirtualBoxImpl.h	(revision 76297)
+++ /trunk/src/VBox/Main/include/VirtualBoxImpl.h	(revision 76298)
@@ -150,4 +150,8 @@
     int i_unloadVDPlugin(const char *pszPluginLibrary);
 
+    void i_onMediumRegistered(const Guid &aMediumId, const DeviceType_T aDevType, const BOOL aRegistered);
+    void i_onMediumConfigChanged(IMedium *aMedium);
+    void i_onMediumChanged(IMediumAttachment* aMediumAttachment);
+    void i_onStorageDeviceChanged(IMediumAttachment* aStorageDevice, const BOOL fRemoved, const BOOL fSilent);
     void i_onMachineStateChange(const Guid &aId, MachineState_T aState);
     void i_onMachineDataChange(const Guid &aId, BOOL aTemporary = FALSE);
Index: /trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp	(revision 76297)
+++ /trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp	(revision 76298)
@@ -2641,5 +2641,6 @@
                                                      hVfsIosReadAhead,
                                                      nullParent,
-                                                     pProgressImportTmp);
+                                                     pProgressImportTmp,
+                                                     true /* aNotify */);
                     RTVfsIoStrmRelease(hVfsIosReadAhead);
                     hVfsIosSrc = NIL_RTVFSIOSTREAM;
Index: /trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 76297)
+++ /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 76298)
@@ -4037,5 +4037,6 @@
                                                  pMediumLockList,
                                                  NULL /* aProgress */,
-                                                 true /* aWait */);
+                                                 true /* aWait */,
+                                                 false /* aNotify */);
 
                 alock.acquire();
@@ -4145,4 +4146,6 @@
     mParent->i_saveModifiedRegistries();
 
+    if (aM)
+        mParent->i_onMediumConfigChanged(aM);
     return rc;
 }
@@ -10819,5 +10822,6 @@
                                               pMediumLockList,
                                               NULL /* aProgress */,
-                                              true /* aWait */);
+                                              true /* aWait */,
+                                              false /* aNotify */);
             alock.acquire();
             if (FAILED(rc)) throw rc;
@@ -11055,5 +11059,5 @@
                 Assert(pMedium);
 
-                rc = pMedium->i_deleteStorage(NULL /*aProgress*/, true /*aWait*/);
+                rc = pMedium->i_deleteStorage(NULL /*aProgress*/, true /*aWait*/, false /*aNotify*/);
                 // continue on delete failure, just collect error messages
                 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt->i_getLogName(),
@@ -11223,5 +11227,6 @@
 
         HRESULT rc = oldmedium->i_deleteStorage(NULL /*aProgress*/,
-                                                true /*aWait*/);
+                                                true /*aWait*/,
+                                                false /*aNotify*/);
 
         writeLock.acquire();
@@ -14023,4 +14028,6 @@
     }
 
+    mParent->i_onMediumChanged(aAttachment);
+
     /* ignore notifications sent after #OnSessionEnd() is called */
     if (!directControl)
@@ -14259,4 +14266,6 @@
             directControl = mData->mSession.mDirectControl;
     }
+
+    mParent->i_onStorageDeviceChanged(aAttachment, aRemove, aSilent);
 
     /* ignore notifications sent after #OnSessionEnd() is called */
Index: /trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp	(revision 76297)
+++ /trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp	(revision 76298)
@@ -16,4 +16,6 @@
  */
 
+#include <set>
+#include <map>
 #include "MachineImplCloneVM.h"
 
@@ -730,5 +732,6 @@
                                           pMediumLockList,
                                           NULL /* aProgress */,
-                                          true /* aWait */);
+                                          true /* aWait */,
+                                          false /* aNotify */);
         delete pMediumLockList;
         if (FAILED(rc)) throw rc;
@@ -1016,4 +1019,6 @@
     RTCList<ComObjPtr<Medium> > newMedia;   /* All created images */
     RTCList<Utf8Str> newFiles;              /* All extra created files (save states, ...) */
+    std::set<ComObjPtr<Medium> > pMediumsForNotify;
+    std::map<Guid, DeviceType_T> uIdsForNotify;
     try
     {
@@ -1153,4 +1158,6 @@
                         /* diff image has to be used... */
                         pNewParent = pDiff;
+                        pMediumsForNotify.insert(pDiff->i_getParent());
+                        uIdsForNotify[pDiff->i_getId()] = pDiff->i_getDeviceType();
                     }
                     else
@@ -1284,5 +1291,6 @@
                                                    progress2.asOutParam(),
                                                    uSrcParentIdx,
-                                                   uTrgParentIdx);
+                                                   uTrgParentIdx,
+                                                   false /* aNotify */);
                         srcLock.acquire();
                         if (FAILED(rc)) throw rc;
@@ -1318,4 +1326,5 @@
                          * chain. */
                         pNewParent = pTarget;
+                        uIdsForNotify[pTarget->i_getId()] = pTarget->i_getDeviceType();
                     }
                 }
@@ -1356,4 +1365,6 @@
                     /* diff image has to be used... */
                     pNewParent = pDiff;
+                    pMediumsForNotify.insert(pDiff->i_getParent());
+                    uIdsForNotify[pDiff->i_getId()] = pDiff->i_getDeviceType();
                 }
                 else
@@ -1534,5 +1545,6 @@
             const ComObjPtr<Medium> &pMedium = newMedia.at(i - 1);
             mrc = pMedium->i_deleteStorage(NULL /* aProgress */,
-                                           true /* aWait */);
+                                           true /* aWait */,
+                                           false /* aNotify */);
             pMedium->Close();
         }
@@ -1546,4 +1558,20 @@
         p->mParent->i_saveModifiedRegistries();
     }
+    else
+    {
+        for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();
+             it != uIdsForNotify.end();
+             ++it)
+        {
+            p->mParent->i_onMediumRegistered(it->first, it->second, TRUE);
+        }
+        for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();
+             it != pMediumsForNotify.end();
+             ++it)
+        {
+            if (it->isNotNull())
+                p->mParent->i_onMediumConfigChanged(*it);
+        }
+    }
 
     return mrc;
Index: /trunk/src/VBox/Main/src-server/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 76297)
+++ /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 76298)
@@ -46,4 +46,6 @@
 #include <algorithm>
 #include <list>
+#include <set>
+#include <map>
 
 
@@ -222,5 +224,5 @@
 {
 public:
-    Task(Medium *aMedium, Progress *aProgress)
+    Task(Medium *aMedium, Progress *aProgress, bool fNotifyAboutChanges = true)
         : ThreadTask("Medium::Task"),
           mVDOperationIfaces(NULL),
@@ -228,5 +230,6 @@
           mMediumCaller(aMedium),
           mProgress(aProgress),
-          mVirtualBoxCaller(NULL)
+          mVirtualBoxCaller(NULL),
+          mNotifyAboutChanges(fNotifyAboutChanges)
     {
         AssertReturnVoidStmt(aMedium, mRC = E_FAIL);
@@ -271,4 +274,5 @@
     HRESULT rc() const { return mRC; }
     bool isOk() const { return SUCCEEDED(rc()); }
+    bool NotifyAboutChanges() const { return mNotifyAboutChanges; }
 
     const ComPtr<Progress>& GetProgressObject() const {return mProgress;}
@@ -331,4 +335,5 @@
     ComObjPtr<VirtualBox> mVirtualBox;
     AutoCaller mVirtualBoxCaller;
+    bool mNotifyAboutChanges;
 };
 
@@ -344,6 +349,7 @@
                    Progress *aProgress,
                    uint64_t aSize,
-                   MediumVariant_T aVariant)
-        : Medium::Task(aMedium, aProgress),
+                   MediumVariant_T aVariant,
+                   bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mSize(aSize),
           mVariant(aVariant)
@@ -367,6 +373,7 @@
                    MediumVariant_T aVariant,
                    MediumLockList *aMediumLockList,
-                   bool fKeepMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+                   bool fKeepMediumLockList = false,
+                   bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mpMediumLockList(aMediumLockList),
           mTarget(aTarget),
@@ -412,6 +419,7 @@
               MediumLockList *aTargetMediumLockList,
               bool fKeepSourceMediumLockList = false,
-              bool fKeepTargetMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+              bool fKeepTargetMediumLockList = false,
+              bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mTarget(aTarget),
           mParent(aParent),
@@ -470,6 +478,7 @@
               MediumVariant_T aVariant,
               MediumLockList *aMediumLockList,
-              bool fKeepMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+              bool fKeepMediumLockList = false,
+              bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mpMediumLockList(aMediumLockList),
           mVariant(aVariant),
@@ -500,6 +509,7 @@
                 Progress *aProgress,
                 MediumLockList *aMediumLockList,
-                bool fKeepMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+                bool fKeepMediumLockList = false,
+                bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mpMediumLockList(aMediumLockList),
           mfKeepMediumLockList(fKeepMediumLockList)
@@ -529,6 +539,7 @@
                Progress *aProgress,
                MediumLockList *aMediumLockList,
-               bool fKeepMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+               bool fKeepMediumLockList = false,
+               bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mSize(aSize),
           mpMediumLockList(aMediumLockList),
@@ -559,6 +570,7 @@
               Progress *aProgress,
               MediumLockList *aMediumLockList,
-              bool fKeepMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+              bool fKeepMediumLockList = false,
+              bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mpMediumLockList(aMediumLockList),
           mfKeepMediumLockList(fKeepMediumLockList)
@@ -586,6 +598,7 @@
                Progress *aProgress,
                MediumLockList *aMediumLockList,
-               bool fKeepMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+               bool fKeepMediumLockList = false,
+               bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mpMediumLockList(aMediumLockList),
           mfKeepMediumLockList(fKeepMediumLockList)
@@ -617,6 +630,7 @@
               Progress *aProgress,
               MediumLockList *aMediumLockList,
-              bool fKeepMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+              bool fKeepMediumLockList = false,
+              bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mTarget(aTarget),
           mfMergeForward(fMergeForward),
@@ -666,6 +680,7 @@
                Medium *aParent,
                MediumLockList *aTargetMediumLockList,
-               bool fKeepTargetMediumLockList = false)
-        : Medium::Task(aMedium, aProgress),
+               bool fKeepTargetMediumLockList = false,
+               bool fNotifyAboutChanges = true)
+        : Medium::Task(aMedium, aProgress, fNotifyAboutChanges),
           mFilename(aFilename),
           mFormat(aFormat),
@@ -730,5 +745,5 @@
                 Progress *aProgress,
                 MediumLockList *aMediumLockList)
-        : Medium::Task(aMedium, aProgress),
+        : Medium::Task(aMedium, aProgress, false),
           mstrNewPassword(strNewPassword),
           mstrCurrentPassword(strCurrentPassword),
@@ -1644,4 +1659,5 @@
         i_markRegistriesModified();
         m->pVirtualBox->i_saveModifiedRegistries();
+        m->pVirtualBox->i_onMediumConfigChanged(this);
     }
     catch (HRESULT aRC) { rc = aRC; }
@@ -1879,4 +1895,5 @@
     i_markRegistriesModified();
     m->pVirtualBox->i_saveModifiedRegistries();
+    m->pVirtualBox->i_onMediumConfigChanged(this);
 
     return S_OK;
@@ -1990,4 +2007,5 @@
         i_markRegistriesModified();
         m->pVirtualBox->i_saveModifiedRegistries();
+        m->pVirtualBox->i_onMediumConfigChanged(this);
     }
 
@@ -2056,5 +2074,7 @@
     }
 
+    const Guid uPrevImage = m->uuidImage;
     unconst(m->uuidImage) = imageId;
+    ComObjPtr<Medium> pPrevParent = i_getParent();
     unconst(m->uuidParentImage) = parentId;
 
@@ -2065,4 +2085,22 @@
                              !!aSetParentId /* fSetParentId */,
                              autoCaller);
+
+    AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS);
+    const Guid uCurrImage = m->uuidImage;
+    ComObjPtr<Medium> pCurrParent = i_getParent();
+    arlock.release();
+
+    if (SUCCEEDED(rc))
+    {
+        if (uCurrImage != uPrevImage)
+            m->pVirtualBox->i_onMediumConfigChanged(this);
+        if (pPrevParent != pCurrParent)
+        {
+            if (pPrevParent)
+                m->pVirtualBox->i_onMediumConfigChanged(pPrevParent);
+            if (pCurrParent)
+                m->pVirtualBox->i_onMediumConfigChanged(pCurrParent);
+        }
+    }
 
     return rc;
@@ -2358,7 +2396,13 @@
     ComObjPtr<VirtualBox> pVirtualBox(m->pVirtualBox);
 
+    Guid uId = i_getId();
+    DeviceType_T devType = i_getDeviceType();
+    bool wasCreated = m->state != MediumState_NotCreated;
     MultiResult mrc = i_close(aAutoCaller);
 
     pVirtualBox->i_saveModifiedRegistries();
+
+    if (SUCCEEDED(mrc) && wasCreated)
+        pVirtualBox->i_onMediumRegistered(uId, devType, FALSE);
 
     return mrc;
@@ -2430,4 +2474,5 @@
     i_markRegistriesModified();
     m->pVirtualBox->i_saveModifiedRegistries();
+    m->pVirtualBox->i_onMediumConfigChanged(this);
 
     return S_OK;
@@ -2509,7 +2554,9 @@
     i_markRegistriesModified();
     m->pVirtualBox->i_saveModifiedRegistries();
+    m->pVirtualBox->i_onMediumConfigChanged(this);
 
     return S_OK;
 }
+
 HRESULT Medium::createBaseStorage(LONG64 aLogicalSize,
                                   const std::vector<MediumVariant_T> &aVariant,
@@ -2597,5 +2644,6 @@
 
     MultiResult mrc = i_deleteStorage(&pProgress,
-                                      false /* aWait */);
+                                      false /* aWait */,
+                                      true /* aNotify */);
     /* Must save the registries in any case, since an entry was removed. */
     m->pVirtualBox->i_saveModifiedRegistries();
@@ -2716,5 +2764,5 @@
 
     rc = i_createDiffStorage(diff, (MediumVariant_T)mediumVariantFlags, pMediumLockList,
-                             &pProgress, false /* aWait */);
+                             &pProgress, false /* aWait */, true /* aNotify */);
     if (FAILED(rc))
         delete pMediumLockList;
@@ -2748,5 +2796,5 @@
 
     rc = i_mergeTo(pTarget, fMergeForward, pParentForTarget, pChildrenToReparent,
-                   pMediumLockList, &pProgress, false /* aWait */);
+                   pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */);
     if (FAILED(rc))
         i_cancelMergeTo(pChildrenToReparent, pMediumLockList);
@@ -3299,4 +3347,5 @@
         MediumState_T mediumState;
         refreshState(autoCaller, &mediumState);
+        m->pVirtualBox->i_onMediumConfigChanged(this);
     }
     catch (HRESULT aRC) { rc = aRC; }
@@ -3426,5 +3475,5 @@
 
     if (SUCCEEDED(rc))
-        rc = i_resize(aLogicalSize, pMediumLockList, &pProgress, false /* aWait */);
+        rc = i_resize(aLogicalSize, pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */);
 
     if (SUCCEEDED(rc))
@@ -4479,4 +4528,6 @@
         unconst(m->strLocationFull) = newPath;
 
+        m->pVirtualBox->i_onMediumConfigChanged(this);
+
         LogFlowThisFunc(("locationFull.after='%s'\n", m->strLocationFull.c_str()));
         // we changed something
@@ -4625,5 +4676,5 @@
 
 /**
- * Internal method to return the medium's size. Must have caller + locking!
+ * Internal method to update the medium's id. Must have caller + locking!
  * @return
  */
@@ -4871,4 +4922,6 @@
  * @param aWait             @c true if this method should block instead of
  *                          creating an asynchronous thread.
+ * @param aNotify           Notify about mediums which metadatÐ° are changed
+ *                          during execution of the function.
  *
  * @note Locks this object and @a aTarget for writing.
@@ -4878,5 +4931,6 @@
                                     MediumLockList *aMediumLockList,
                                     ComObjPtr<Progress> *aProgress,
-                                    bool aWait)
+                                    bool aWait,
+                                    bool aNotify)
 {
     AssertReturn(!aTarget.isNull(), E_FAIL);
@@ -4953,5 +5007,6 @@
         pTask = new Medium::CreateDiffTask(this, pProgress, aTarget, aVariant,
                                            aMediumLockList,
-                                           aWait /* fKeepMediumLockList */);
+                                           aWait /* fKeepMediumLockList */,
+                                           aNotify);
         rc = pTask->rc();
         AssertComRC(rc);
@@ -5133,4 +5188,6 @@
  * @param aWait         @c true if this method should block instead of creating
  *                      an asynchronous thread.
+ * @param aNotify       Notify about mediums which metadatÐ° are changed
+ *                      during execution of the function.
  *
  * @note Locks mVirtualBox and this object for writing. Locks medium tree for
@@ -5138,5 +5195,5 @@
  */
 HRESULT Medium::i_deleteStorage(ComObjPtr<Progress> *aProgress,
-                              bool aWait)
+                              bool aWait, bool aNotify)
 {
     AssertReturn(aProgress != NULL || aWait == true, E_FAIL);
@@ -5309,5 +5366,5 @@
 
         /* setup task object to carry out the operation sync/async */
-        pTask = new Medium::DeleteTask(this, pProgress, pMediumLockList);
+        pTask = new Medium::DeleteTask(this, pProgress, pMediumLockList, false, aNotify);
         rc = pTask->rc();
         AssertComRC(rc);
@@ -5954,4 +6011,6 @@
  * @param aWait         @c true if this method should block instead of creating
  *                      an asynchronous thread.
+ * @param aNotify       Notify about mediums which metadatÐ° are changed
+ *                      during execution of the function.
  *
  * @note Locks the tree lock for writing. Locks the media from the chain
@@ -5964,5 +6023,5 @@
                           MediumLockList *aMediumLockList,
                           ComObjPtr<Progress> *aProgress,
-                          bool aWait)
+                          bool aWait, bool aNotify)
 {
     AssertReturn(pTarget != NULL, E_FAIL);
@@ -6019,5 +6078,6 @@
                                       pParentForTarget, aChildrenToReparent,
                                       pProgress, aMediumLockList,
-                                      aWait /* fKeepMediumLockList */);
+                                      aWait /* fKeepMediumLockList */,
+                                      aNotify);
         rc = pTask->rc();
         AssertComRC(rc);
@@ -6134,4 +6194,6 @@
  * @param aWait         @c true if this method should block instead of creating
  *                      an asynchronous thread.
+ * @param aNotify       Notify about mediums which metadatÐ° are changed
+ *                      during execution of the function.
  *
  * @note Locks the media from the chain for writing.
@@ -6141,5 +6203,6 @@
                          MediumLockList *aMediumLockList,
                          ComObjPtr<Progress> *aProgress,
-                         bool aWait)
+                         bool aWait,
+                         bool aNotify)
 {
     AssertReturn(aMediumLockList != NULL, E_FAIL);
@@ -6180,5 +6243,6 @@
                                        pProgress,
                                        aMediumLockList,
-                                       aWait /* fKeepMediumLockList */);
+                                       aWait /* fKeepMediumLockList */,
+                                       aNotify);
         rc = pTask->rc();
         AssertComRC(rc);
@@ -6483,4 +6547,6 @@
  * @param aParent               Parent medium. May be NULL.
  * @param aProgress             Progress object to use.
+ * @param aNotify               Notify about mediums which metadatÐ° are changed
+ *                              during execution of the function.
  * @return
  * @note The destination format is defined by the Medium instance.
@@ -6496,5 +6562,6 @@
                              RTVFSIOSTREAM aVfsIosSrc,
                              const ComObjPtr<Medium> &aParent,
-                             const ComObjPtr<Progress> &aProgress)
+                             const ComObjPtr<Progress> &aProgress,
+                             bool aNotify)
 {
     /** @todo r=klaus The code below needs to be double checked with regard
@@ -6557,5 +6624,5 @@
         /* setup task object to carry out the operation asynchronously */
         pTask = new Medium::ImportTask(this, aProgress, aFilename, aFormat, aVariant,
-                                       aVfsIosSrc, aParent, pTargetMediumLockList);
+                                       aVfsIosSrc, aParent, pTargetMediumLockList, false, aNotify);
         rc = pTask->rc();
         AssertComRC(rc);
@@ -6591,9 +6658,11 @@
  *                           same content as the given image in the source chain.
  *                           Use UINT32_MAX to disable this optimization.
+ * @param aNotify            Notify about mediums which metadatÐ° are changed
+ *                           during execution of the function.
  * @return
  */
 HRESULT Medium::i_cloneToEx(const ComObjPtr<Medium> &aTarget, MediumVariant_T aVariant,
                             const ComObjPtr<Medium> &aParent, IProgress **aProgress,
-                            uint32_t idxSrcImageSame, uint32_t idxDstImageSame)
+                            uint32_t idxSrcImageSame, uint32_t idxDstImageSame, bool aNotify)
 {
     /** @todo r=klaus The code below needs to be double checked with regard
@@ -6700,5 +6769,5 @@
                                       aParent, idxSrcImageSame,
                                       idxDstImageSame, pSourceMediumLockList,
-                                      pTargetMediumLockList);
+                                      pTargetMediumLockList, false, false, aNotify);
         rc = pTask->rc();
         AssertComRC(rc);
@@ -7300,5 +7369,6 @@
     pToken.setNull();
 
-    if (FAILED(rc)) return rc;
+    if (FAILED(rc))
+        return rc;
 
     /* If this is a base image which incorrectly has a parent UUID set,
@@ -7308,31 +7378,41 @@
      * with a diff image before the base is registered this would destroy
      * the diff. Not acceptable. */
-    if (fRepairImageZeroParentUuid)
-    {
-        rc = LockWrite(pToken.asOutParam());
-        if (FAILED(rc)) return rc;
-
-        alock.release();
-
-        try
-        {
-            PVDISK hdd;
-            vrc = VDCreate(m->vdDiskIfaces, i_convertDeviceType(), &hdd);
-            ComAssertRCThrow(vrc, E_FAIL);
+    do
+    {
+        if (fRepairImageZeroParentUuid)
+        {
+            rc = LockWrite(pToken.asOutParam());
+            if (FAILED(rc))
+                break;
+
+            alock.release();
 
             try
             {
-                vrc = VDOpen(hdd,
-                             format.c_str(),
-                             location.c_str(),
-                             (uOpenFlags & ~VD_OPEN_FLAGS_READONLY) | m->uOpenFlagsDef,
-                             m->vdImageIfaces);
-                if (RT_FAILURE(vrc))
-                    throw S_OK;
-
-                RTUUID zeroParentUuid;
-                RTUuidClear(&zeroParentUuid);
-                vrc = VDSetParentUuid(hdd, 0, &zeroParentUuid);
+                PVDISK hdd;
+                vrc = VDCreate(m->vdDiskIfaces, i_convertDeviceType(), &hdd);
                 ComAssertRCThrow(vrc, E_FAIL);
+
+                try
+                {
+                    vrc = VDOpen(hdd,
+                                 format.c_str(),
+                                 location.c_str(),
+                                 (uOpenFlags & ~VD_OPEN_FLAGS_READONLY) | m->uOpenFlagsDef,
+                                 m->vdImageIfaces);
+                    if (RT_FAILURE(vrc))
+                        throw S_OK;
+
+                    RTUUID zeroParentUuid;
+                    RTUuidClear(&zeroParentUuid);
+                    vrc = VDSetParentUuid(hdd, 0, &zeroParentUuid);
+                    ComAssertRCThrow(vrc, E_FAIL);
+                }
+                catch (HRESULT aRC)
+                {
+                    rc = aRC;
+                }
+
+                VDDestroy(hdd);
             }
             catch (HRESULT aRC)
@@ -7341,15 +7421,10 @@
             }
 
-            VDDestroy(hdd);
-        }
-        catch (HRESULT aRC)
-        {
-            rc = aRC;
-        }
-
-        pToken->Abandon();
-        pToken.setNull();
-        if (FAILED(rc)) return rc;
-    }
+            pToken->Abandon();
+            pToken.setNull();
+            if (FAILED(rc))
+                break;
+        }
+    } while(0);
 
     return rc;
@@ -8493,4 +8568,6 @@
             m->pVirtualBox->i_saveModifiedRegistries();
         }
+        if (task.NotifyAboutChanges())
+            m->pVirtualBox->i_onMediumRegistered(m->id, m->devType, TRUE);
     }
     else
@@ -8728,4 +8805,10 @@
      * unlock the medium. */
 
+    if (task.NotifyAboutChanges() && SUCCEEDED(mrc))
+    {
+        m->pVirtualBox->i_onMediumRegistered(pTarget->i_getId(), pTarget->i_getDeviceType(), TRUE);
+        m->pVirtualBox->i_onMediumConfigChanged(this);
+    }
+
     return mrc;
 }
@@ -8820,5 +8903,5 @@
 
                 ComObjPtr<Progress> pProgress(task.GetProgressObject());
-                rc = pTarget->i_resize(sourceSize, pMediumLockListForResize, &pProgress, true);
+                rc = pTarget->i_resize(sourceSize, pMediumLockListForResize, &pProgress, true, false);
                 if (FAILED(rc))
                 {
@@ -8986,4 +9069,7 @@
     HRESULT rc2;
 
+    std::set<ComObjPtr<Medium> > pMediumsForNotify;
+    std::map<Guid, DeviceType_T> uIdsForNotify;
+
     if (SUCCEEDED(mrc))
     {
@@ -9005,5 +9091,9 @@
             pTarget->i_setParent(task.mParentForTarget);
             if (task.mParentForTarget)
+            {
                 i_deparent();
+                if (task.NotifyAboutChanges())
+                    pMediumsForNotify.insert(task.mParentForTarget);
+            }
 
             /* then, register again */
@@ -9040,6 +9130,10 @@
                     // no depth check, reduces depth
                     pMedium->i_setParent(pTarget);
+
+                    if (task.NotifyAboutChanges())
+                        pMediumsForNotify.insert(pMedium);
                 }
             }
+            pMediumsForNotify.insert(pTarget);
         }
 
@@ -9066,4 +9160,5 @@
             }
 
+            uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType();
             rc2 = pMedium->m->pVirtualBox->i_unregisterMedium(pMedium);
             AssertComRC(rc2);
@@ -9126,4 +9221,20 @@
         if (task.isAsync())
             i_cancelMergeTo(task.mpChildrenToReparent, task.mpMediumLockList);
+    }
+    else if (task.NotifyAboutChanges())
+    {
+        for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();
+             it != pMediumsForNotify.end();
+             ++it)
+        {
+            if (it->isNotNull())
+                m->pVirtualBox->i_onMediumConfigChanged(*it);
+        }
+        for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();
+             it != uIdsForNotify.end();
+             ++it)
+        {
+            m->pVirtualBox->i_onMediumRegistered(it->first, it->second, FALSE);
+        }
     }
 
@@ -9446,4 +9557,19 @@
                 m->pVirtualBox->i_saveModifiedRegistries();
                 eik.fetch();
+
+                if (task.NotifyAboutChanges())
+                {
+                    if (!fCreatingTarget)
+                    {
+                        if (!aFilterPropNames.empty())
+                            m->pVirtualBox->i_onMediumConfigChanged(pTargetBase);
+                        if (pParent)
+                            m->pVirtualBox->i_onMediumConfigChanged(pParent);
+                    }
+                    else
+                    {
+                        m->pVirtualBox->i_onMediumRegistered(pTarget->i_getId(), pTarget->i_getDeviceType(), TRUE);
+                    }
+                }
             }
         }
@@ -9621,4 +9747,6 @@
     task.mpMediumLockList->Clear();
 
+    if (task.NotifyAboutChanges() && SUCCEEDED(mrc))
+        m->pVirtualBox->i_onMediumConfigChanged(this);
     return mrc;
 }
@@ -9688,4 +9816,7 @@
     /* Reset UUID to prevent Create* from reusing it again */
     unconst(m->id).clear();
+
+    if (task.NotifyAboutChanges() && SUCCEEDED(rc) && m->pParent.isNotNull())
+        m->pVirtualBox->i_onMediumConfigChanged(m->pParent);
 
     return rc;
@@ -9831,4 +9962,7 @@
     m->logicalSize = logicalSize;
     m->variant = variant;
+
+    if (task.NotifyAboutChanges() && SUCCEEDED(rc))
+        m->pVirtualBox->i_onMediumConfigChanged(this);
 
     /* Everything is explicitly unlocked when the task exits,
@@ -9928,4 +10062,7 @@
     }
     catch (HRESULT aRC) { rc = aRC; }
+
+    if (task.NotifyAboutChanges() && SUCCEEDED(rc))
+        m->pVirtualBox->i_onMediumConfigChanged(this);
 
     /* Everything is explicitly unlocked when the task exits,
@@ -10044,4 +10181,7 @@
         m->size = size;
         m->logicalSize = logicalSize;
+
+        if (task.NotifyAboutChanges())
+            m->pVirtualBox->i_onMediumConfigChanged(this);
     }
 
@@ -10312,4 +10452,14 @@
     task.mpTargetMediumLockList->Clear();
 
+    if (task.NotifyAboutChanges() && SUCCEEDED(mrc))
+    {
+        if (pParent)
+            m->pVirtualBox->i_onMediumConfigChanged(pParent);
+        if (fCreatingTarget)
+            m->pVirtualBox->i_onMediumConfigChanged(this);
+        else
+            m->pVirtualBox->i_onMediumRegistered(m->id, m->devType, TRUE);
+    }
+
     return mrc;
 }
Index: /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp	(revision 76297)
+++ /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp	(revision 76298)
@@ -15,4 +15,7 @@
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
+
+#include <set>
+#include <map>
 
 #include "Logging.h"
@@ -1637,4 +1640,7 @@
     BOOL fSuspendedBySave     = FALSE;
 
+    std::set<ComObjPtr<Medium> > pMediumsForNotify;
+    std::map<Guid, DeviceType_T> uIdsForNotify;
+
     try
     {
@@ -1773,4 +1779,39 @@
             if (FAILED(rc))
                 throw rc;
+        }
+
+        // store parent of newly created diffs before commit for notify
+        {
+            MediumAttachmentList &oldAtts = *mMediumAttachments.backedUpData();
+            for (MediumAttachmentList::const_iterator
+                 it = mMediumAttachments->begin();
+                 it != mMediumAttachments->end();
+                 ++it)
+            {
+                MediumAttachment *pAttach = *it;
+                Medium *pMedium = pAttach->i_getMedium();
+                if (!pMedium)
+                    continue;
+
+                bool fFound = false;
+                /* was this medium attached before? */
+                for (MediumAttachmentList::iterator
+                     oldIt = oldAtts.begin();
+                     oldIt != oldAtts.end();
+                     ++oldIt)
+                {
+                    MediumAttachment *pOldAttach = *oldIt;
+                    if (pOldAttach->i_getMedium() == pMedium)
+                    {
+                        fFound = true;
+                        break;
+                    }
+                }
+                if (!fFound)
+                {
+                    pMediumsForNotify.insert(pMedium->i_getParent());
+                    uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType();
+                }
+            }
         }
 
@@ -1876,4 +1917,22 @@
     if (SUCCEEDED(rc))
         mParent->i_onSnapshotTaken(mData->mUuid, task.m_uuidSnapshot);
+
+    if (SUCCEEDED(rc))
+    {
+        for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();
+             it != uIdsForNotify.end();
+             ++it)
+        {
+            mParent->i_onMediumRegistered(it->first, it->second, TRUE);
+        }
+
+        for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();
+             it != pMediumsForNotify.end();
+             ++it)
+        {
+            if (it->isNotNull())
+                mParent->i_onMediumConfigChanged(*it);
+        }
+    }
     LogFlowThisFuncLeave();
 }
@@ -2120,4 +2179,6 @@
     HRESULT rc = S_OK;
     Guid snapshotId;
+    std::set<ComObjPtr<Medium> > pMediumsForNotify;
+    std::map<Guid, DeviceType_T> uIdsForNotify;
 
     try
@@ -2214,4 +2275,39 @@
             /* make the snapshot we restored from the current snapshot */
             mData->mCurrentSnapshot = task.m_pSnapshot;
+        }
+
+        // store parent of newly created diffs for notify
+        {
+            MediumAttachmentList &oldAtts = *mMediumAttachments.backedUpData();
+            for (MediumAttachmentList::const_iterator
+                 it = mMediumAttachments->begin();
+                 it != mMediumAttachments->end();
+                 ++it)
+            {
+                MediumAttachment *pAttach = *it;
+                Medium *pMedium = pAttach->i_getMedium();
+                if (!pMedium)
+                    continue;
+
+                bool fFound = false;
+                /* was this medium attached before? */
+                for (MediumAttachmentList::iterator
+                     oldIt = oldAtts.begin();
+                     oldIt != oldAtts.end();
+                     ++oldIt)
+                {
+                    MediumAttachment *pOldAttach = *oldIt;
+                    if (pOldAttach->i_getMedium() == pMedium)
+                    {
+                        fFound = true;
+                        break;
+                    }
+                }
+                if (!fFound)
+                {
+                    pMediumsForNotify.insert(pMedium->i_getParent());
+                    uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType();
+                }
+            }
         }
 
@@ -2314,9 +2410,14 @@
             LogFlowThisFunc(("Deleting old current state in differencing image '%s'\n", pMedium->i_getName().c_str()));
 
+            ComObjPtr<Medium> pParent = pMedium->i_getParent();
             HRESULT rc2 = pMedium->i_deleteStorage(NULL /* aProgress */,
-                                                   true /* aWait */);
+                                                   true /* aWait */,
+                                                   false /* aNotify */);
             // ignore errors here because we cannot roll back after i_saveSettings() above
             if (SUCCEEDED(rc2))
+            {
+                pMediumsForNotify.insert(pParent);
                 pMedium->uninit();
+            }
         }
     }
@@ -2345,5 +2446,20 @@
 
     if (SUCCEEDED(rc))
+    {
         mParent->i_onSnapshotRestored(mData->mUuid, snapshotId);
+        for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();
+             it != uIdsForNotify.end();
+             ++it)
+        {
+            mParent->i_onMediumRegistered(it->first, it->second, TRUE);
+        }
+        for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();
+             it != pMediumsForNotify.end();
+             ++it)
+        {
+            if (it->isNotNull())
+                mParent->i_onMediumConfigChanged(*it);
+        }
+    }
 
     LogFlowThisFunc(("Done restoring snapshot (rc=%08X)\n", rc));
@@ -2696,4 +2812,6 @@
     MediumDeleteRecList toDelete;
     Guid snapshotId;
+    std::set<ComObjPtr<Medium> > pMediumsForNotify;
+    std::map<Guid,DeviceType_T> uIdsForNotify;
 
     try
@@ -3070,8 +3188,15 @@
                     /* No need to hold the lock any longer. */
                     mLock.release();
+                    ComObjPtr<Medium> pParent = pMedium->i_getParent();
+                    Guid uMedium = pMedium->i_getId();
+                    DeviceType_T uMediumType = pMedium->i_getDeviceType();
                     rc = pMedium->i_deleteStorage(&task.m_pProgress,
-                                                  true /* aWait */);
+                                                  true /* aWait */,
+                                                  false /* aNotify */);
                     if (FAILED(rc))
                         throw rc;
+
+                    pMediumsForNotify.insert(pParent);
+                    uIdsForNotify[uMedium] = uMediumType;
 
                     // need to uninit the deleted medium
@@ -3081,4 +3206,40 @@
             else
             {
+                {
+                    //store ids before merging for notify
+                    pMediumsForNotify.insert(it->mpTarget);
+                    if (it->mfMergeForward)
+                        pMediumsForNotify.insert(it->mpSource->i_getParent());
+                    else
+                    {
+                        //children which will be reparented to target
+                        for (MediaList::const_iterator iit = it->mpSource->i_getChildren().begin();
+                             iit != it->mpSource->i_getChildren().end();
+                             ++iit)
+                        {
+                            pMediumsForNotify.insert(*iit);
+                        }
+                    }
+                    if (it->mfMergeForward)
+                    {
+                        for (ComObjPtr<Medium> pTmpMedium = it->mpTarget->i_getParent();
+                             pTmpMedium && pTmpMedium != it->mpSource;
+                             pTmpMedium = pTmpMedium->i_getParent())
+                        {
+                            uIdsForNotify[pTmpMedium->i_getId()] = pTmpMedium->i_getDeviceType();
+                        }
+                        uIdsForNotify[it->mpSource->i_getId()] = it->mpSource->i_getDeviceType();
+                    }
+                    else
+                    {
+                        for (ComObjPtr<Medium> pTmpMedium = it->mpSource->i_getParent();
+                             pTmpMedium && pTmpMedium != it->mpTarget;
+                             pTmpMedium = pTmpMedium->i_getParent())
+                        {
+                            uIdsForNotify[pTmpMedium->i_getId()] = pTmpMedium->i_getDeviceType();
+                        }
+                    }
+                }
+
                 bool fNeedsSave = false;
                 if (it->mfNeedsOnlineMerge)
@@ -3111,5 +3272,6 @@
                                                  it->mpMediumLockList,
                                                  &task.m_pProgress,
-                                                 true /* aWait */);
+                                                 true /* aWait */,
+                                                 false /* aNotify */);
                 }
 
@@ -3278,5 +3440,20 @@
 
     if (SUCCEEDED(mrc))
+    {
         mParent->i_onSnapshotDeleted(mData->mUuid, snapshotId);
+        for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();
+             it != uIdsForNotify.end();
+             ++it)
+        {
+            mParent->i_onMediumRegistered(it->first, it->second, FALSE);
+        }
+        for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();
+             it != pMediumsForNotify.end();
+             ++it)
+        {
+            if (it->isNotNull())
+                mParent->i_onMediumConfigChanged(*it);
+        }
+    }
 
     LogFlowThisFunc(("Done deleting snapshot (rc=%08X)\n", (HRESULT)mrc));
@@ -3972,3 +4149,2 @@
     return S_OK;
 }
-
Index: /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 76297)
+++ /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 76298)
@@ -1963,5 +1963,8 @@
 
     if (SUCCEEDED(rc))
+    {
         medium.queryInterfaceTo(aMedium.asOutParam());
+        i_onMediumRegistered(medium->i_getId(), medium->i_getDeviceType(), TRUE);
+    }
 
     return rc;
@@ -2014,4 +2017,5 @@
     }
 
+    bool fMediumRegistered = false;
     if (pMedium.isNull())
     {
@@ -2040,4 +2044,8 @@
                 rc = VBOX_E_OBJECT_NOT_FOUND;
             }
+            else
+            {
+                fMediumRegistered = true;
+            }
         }
         else
@@ -2049,5 +2057,9 @@
 
     if (SUCCEEDED(rc))
+    {
         pMedium.queryInterfaceTo(aMedium.asOutParam());
+        if (fMediumRegistered)
+            i_onMediumRegistered(pMedium->i_getId(), pMedium->i_getDeviceType() ,TRUE);
+    }
 
     return rc;
@@ -2252,4 +2264,13 @@
         if (RT_FAILURE(vrc))
             fFailure = true;
+    }
+    if (!fFailure)
+    {
+        for (MediaList::const_iterator mt = m->allHardDisks.begin();
+             mt != m->allHardDisks.end();
+             ++mt)
+        {
+            i_onMediumConfigChanged(*mt);
+        }
     }
     return fFailure ? VERR_INVALID_PARAMETER : VINF_SUCCESS;
@@ -2917,4 +2938,98 @@
 }
 
+
+/** Event for onMediumRegistered() */
+struct MediumRegisteredEventStruct : public VirtualBox::CallbackEvent
+{
+    MediumRegisteredEventStruct(VirtualBox *aVB, const Guid &aMediumId,
+                          const DeviceType_T aDevType, const BOOL aRegistered)
+        : CallbackEvent(aVB, VBoxEventType_OnMediumRegistered)
+        , mMediumId(aMediumId.toUtf16()), mDevType(aDevType), mRegistered(aRegistered)
+    {}
+
+    virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)
+    {
+        return aEvDesc.init(aSource, VBoxEventType_OnMediumRegistered, mMediumId.raw(), mDevType, mRegistered);
+    }
+
+    Bstr mMediumId;
+    DeviceType_T mDevType;
+    BOOL mRegistered;
+};
+
+/**
+ *  @note Doesn't lock any object.
+ */
+void VirtualBox::i_onMediumRegistered(const Guid &aMediumId, const DeviceType_T aDevType, const BOOL aRegistered)
+{
+    i_postEvent(new MediumRegisteredEventStruct(this, aMediumId, aDevType, aRegistered));
+}
+
+/** Event for onMediumConfigChanged() */
+struct MediumConfigChangedEventStruct : public VirtualBox::CallbackEvent
+{
+    MediumConfigChangedEventStruct(VirtualBox *aVB, IMedium *aMedium)
+        : CallbackEvent(aVB, VBoxEventType_OnMediumConfigChanged)
+        , mMedium(aMedium)
+    {}
+
+    virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)
+    {
+        return aEvDesc.init(aSource, VBoxEventType_OnMediumConfigChanged, mMedium);
+    }
+
+    IMedium* mMedium;
+};
+
+void VirtualBox::i_onMediumConfigChanged(IMedium *aMedium)
+{
+    i_postEvent(new MediumConfigChangedEventStruct(this, aMedium));
+}
+
+/** Event for onMediumChanged() */
+struct MediumChangedEventStruct : public VirtualBox::CallbackEvent
+{
+    MediumChangedEventStruct(VirtualBox *aVB, IMediumAttachment *aMediumAttachment)
+        : CallbackEvent(aVB, VBoxEventType_OnMediumChanged)
+        , mMediumAttachment(aMediumAttachment)
+    {}
+
+    virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)
+    {
+        return aEvDesc.init(aSource, VBoxEventType_OnMediumChanged, mMediumAttachment);
+    }
+
+    IMediumAttachment* mMediumAttachment;
+};
+
+void VirtualBox::i_onMediumChanged(IMediumAttachment *aMediumAttachment)
+{
+    i_postEvent(new MediumChangedEventStruct(this, aMediumAttachment));
+}
+
+/** Event for onStorageDeviceChanged() */
+struct StorageDeviceChangedEventStruct : public VirtualBox::CallbackEvent
+{
+    StorageDeviceChangedEventStruct(VirtualBox *aVB, IMediumAttachment *aStorageDevice, BOOL fRemoved, BOOL fSilent)
+        : CallbackEvent(aVB, VBoxEventType_OnStorageDeviceChanged)
+        , mStorageDevice(aStorageDevice)
+        , mRemoved(fRemoved)
+        , mSilent(fSilent)
+    {}
+
+    virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)
+    {
+        return aEvDesc.init(aSource, VBoxEventType_OnStorageDeviceChanged, mStorageDevice, mRemoved, mSilent);
+    }
+
+    IMediumAttachment* mStorageDevice;
+    BOOL mRemoved;
+    BOOL mSilent;
+};
+
+void VirtualBox::i_onStorageDeviceChanged(IMediumAttachment *aStorageDevice, const BOOL fRemoved, const BOOL fSilent)
+{
+    i_postEvent(new StorageDeviceChangedEventStruct(this, aStorageDevice, fRemoved, fSilent));
+}
 
 /**
