Index: /trunk/src/VBox/Main/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumImpl.cpp	(revision 26200)
+++ /trunk/src/VBox/Main/MediumImpl.cpp	(revision 26201)
@@ -3170,5 +3170,6 @@
 /**
  * Checks that this hard disk may be discarded and performs necessary state
- * changes.
+ * changes. Must not be called for writethrough disks because there is nothing
+ * to discard then.
  *
  * This method is to be called prior to calling the #discard() to perform
@@ -3196,5 +3197,7 @@
     Assert(m->pVirtualBox->getMediaTreeLockHandle().isWriteLockOnCurrentThread());
 
-    AssertReturn(m->type == MediumType_Normal, E_FAIL);
+    // Medium must not be writethrough at this point
+    AssertReturn(   m->type == MediumType_Normal
+                 || m->type == MediumType_Immutable, E_FAIL);
 
     if (getChildren().size() == 0)
Index: /trunk/src/VBox/Main/SnapshotImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 26200)
+++ /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 26201)
@@ -2014,6 +2014,9 @@
             Assert(pHD);
             AutoReadLock mlock(pHD COMMA_LOCKVAL_SRC_POS);
-            if (pHD->getType() == MediumType_Normal)
+
+            MediumType_T type = pHD->getType();
+            if (type != MediumType_Writethrough) // writethrough images are unaffected by snapshots, so do nothing for them
             {
+                // normal or immutable: then this will need to be discarded
                 ++ulOpCount;
                 ulTotalWeight += (ULONG)(pHD->getSize() / _1M);
@@ -2179,5 +2182,16 @@
                 Assert(pAttach->getMedium());
                 ComObjPtr<Medium> pHD = pAttach->getMedium();
-                        // do not lock, prepareDiscared() has a write lock which will hang otherwise
+
+                {
+                    // writethrough images are unaffected by snapshots, so do nothing for them
+                    AutoReadLock medlock(pHD COMMA_LOCKVAL_SRC_POS);
+                    MediumType_T type = pHD->getType();
+                    if (type == MediumType_Writethrough)
+                        continue;
+                }
+
+                // image is normal or immutable: then this will need to be discarded
+
+                // do not lock medium now, prepareDiscard() has a write lock which will hang otherwise
 
 #ifdef DEBUG
