Index: /trunk/src/VBox/Storage/testcase/vbox-img.cpp
===================================================================
--- /trunk/src/VBox/Storage/testcase/vbox-img.cpp	(revision 46720)
+++ /trunk/src/VBox/Storage/testcase/vbox-img.cpp	(revision 46721)
@@ -69,5 +69,7 @@
                  "   repair       --filename <filename>\n"
                  "                [--dry-run]\n"
-                 "                [--format VDI|VMDK|VHD] (default: autodetect)\n",
+                 "                [--format VDI|VMDK|VHD] (default: autodetect)\n"
+                 "\n"
+                 "   clearcomment --filename <filename>\n",
                  g_pszProgName);
 }
@@ -1504,4 +1506,62 @@
 
 
+int handleClearComment(HandlerArg *a)
+{
+    int rc = VINF_SUCCESS;
+    PVBOXHDD pDisk = NULL;
+    const char *pszFilename = NULL;
+    bool fDryRun = false;
+
+    /* Parse the command line. */
+    static const RTGETOPTDEF s_aOptions[] =
+    {
+        { "--filename", 'f', RTGETOPT_REQ_STRING  }
+    };
+    int ch;
+    RTGETOPTUNION ValueUnion;
+    RTGETOPTSTATE GetState;
+    RTGetOptInit(&GetState, a->argc, a->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /* fFlags */);
+    while ((ch = RTGetOpt(&GetState, &ValueUnion)))
+    {
+        switch (ch)
+        {
+            case 'f':   // --filename
+                pszFilename = ValueUnion.psz;
+                break;
+
+            default:
+                ch = RTGetOptPrintError(ch, &ValueUnion);
+                printUsage(g_pStdErr);
+                return ch;
+        }
+    }
+
+    /* Check for mandatory parameters. */
+    if (!pszFilename)
+        return errorSyntax("Mandatory --filename option missing\n");
+
+    /* just try it */
+    char *pszFormat = NULL;
+    VDTYPE enmType = VDTYPE_INVALID;
+    rc = VDGetFormat(NULL, NULL, pszFilename, &pszFormat, &enmType);
+    if (RT_FAILURE(rc))
+        return errorSyntax("Format autodetect failed: %Rrc\n", rc);
+
+    rc = VDCreate(pVDIfs, enmType, &pDisk);
+    if (RT_FAILURE(rc))
+        return errorRuntime("Error while creating the virtual disk container: %Rrc\n", rc);
+
+    /* Open the image */
+    rc = VDOpen(pDisk, pszFormat, pszFilename, VD_OPEN_FLAGS_INFO, NULL);
+    if (RT_FAILURE(rc))
+        return errorRuntime("Error while opening the image: %Rrc\n", rc);
+
+    VDSetComment(pDisk, 0, NULL);
+
+    VDDestroy(pDisk);
+    return rc;
+}
+
+
 int main(int argc, char *argv[])
 {
@@ -1586,11 +1646,12 @@
     } s_commandHandlers[] =
     {
-        { "setuuid",     handleSetUUID     },
-        { "convert",     handleConvert     },
-        { "info",        handleInfo        },
-        { "compact",     handleCompact     },
-        { "createcache", handleCreateCache },
-        { "createbase",  handleCreateBase  },
-        { "repair",      handleRepair      },
+        { "setuuid",      handleSetUUID      },
+        { "convert",      handleConvert      },
+        { "info",         handleInfo         },
+        { "compact",      handleCompact      },
+        { "createcache",  handleCreateCache  },
+        { "createbase",   handleCreateBase   },
+        { "repair",       handleRepair       },
+        { "clearcomment", handleClearComment },
         { NULL,                       NULL }
     };
