Index: /trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/VBoxHDD.cpp	(revision 31257)
+++ /trunk/src/VBox/Devices/Storage/VBoxHDD.cpp	(revision 31258)
@@ -3383,4 +3383,14 @@
             }
         }
+
+        /* Ensure we always get correct diff information, even if the backend
+         * doesn't actually have a stored flag for this. It must not return
+         * bogus information for the parent UUID if it is not a diff image. */
+        RTUUID parentUuid;
+        RTUuidClear(&parentUuid);
+        rc2 = pImage->Backend->pfnGetParentUuid(pImage->pvBackendData, &parentUuid);
+        if (RT_SUCCESS(rc2) && !RTUuidIsNull(&parentUuid))
+            uImageFlags |= VD_IMAGE_FLAGS_DIFF;
+
         pImage->uImageFlags = uImageFlags;
 
@@ -5766,5 +5776,5 @@
         AssertPtrBreakStmt(pImage, rc = VERR_VD_IMAGE_NOT_FOUND);
 
-        *puImageFlags = pImage->Backend->pfnGetImageFlags(pImage->pvBackendData);
+        *puImageFlags = pImage->uImageFlags;
     } while (0);
 
Index: /trunk/src/VBox/Main/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumImpl.cpp	(revision 31257)
+++ /trunk/src/VBox/Main/MediumImpl.cpp	(revision 31258)
@@ -3540,5 +3540,5 @@
         {
             /** @todo This kind of opening of media is assuming that diff
-             * media can be opened as base media. Should be documented if
+             * media can be opened as base media. Should be documented that
              * it must work for all medium format backends. */
             vrc = VDOpen(hdd,
@@ -3618,5 +3618,5 @@
             }
 
-            /* check the type */
+            /* get the medium variant */
             unsigned uImageFlags;
             vrc = VDGetImageFlags(hdd, 0, &uImageFlags);
@@ -3624,4 +3624,5 @@
             m->variant = (MediumVariant_T)uImageFlags;
 
+            /* check/get the parent uuid and update corresponding state */
             if (uImageFlags & VD_IMAGE_FLAGS_DIFF)
             {
@@ -3642,6 +3643,6 @@
                     ComObjPtr<Medium> pParent;
                     rc = m->pVirtualBox->findHardDisk(&id, NULL,
-                                                   false /* aSetError */,
-                                                   &pParent);
+                                                      false /* aSetError */,
+                                                      &pParent);
                     if (FAILED(rc))
                     {
@@ -4599,5 +4600,5 @@
  *
  * Given this medium is SOURCE and the specified medium is TARGET, we will
- * get two varians of the merge operation:
+ * get two variants of the merge operation:
  *
  *                forward merge
