Index: /trunk/src/VBox/Main/include/MediumFormatImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MediumFormatImpl.h	(revision 37585)
+++ /trunk/src/VBox/Main/include/MediumFormatImpl.h	(revision 37586)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2008-2010 Oracle Corporation
+ * Copyright (C) 2008-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -65,5 +65,5 @@
         const StrList        llFileExtensions;
         const DeviceTypeList llDeviceTypes;
-        const uint64_t       capabilities;
+        const MediumFormatCapabilities_T capabilities;
         const PropertyList   llProperties;
     };
@@ -112,5 +112,5 @@
     const StrList& getFileExtensions() const { return m.llFileExtensions; }
     /** Const, no need to lock */
-    uint64_t getCapabilities() const { return m.capabilities; }
+    MediumFormatCapabilities_T getCapabilities() const { return m.capabilities; }
     /** Const, no need to lock */
     const PropertyList& getProperties() const { return m.llProperties; }
Index: /trunk/src/VBox/Main/src-server/MediumFormatImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MediumFormatImpl.cpp	(revision 37585)
+++ /trunk/src/VBox/Main/src-server/MediumFormatImpl.cpp	(revision 37586)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2008-2010 Oracle Corporation
+ * Copyright (C) 2008-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -66,5 +66,5 @@
      * name/description field. */
     unconst(m.strName) = aVDInfo->pszBackend;
-    /* The capabilities of the backend */
+    /* The capabilities of the backend. Assumes 1:1 mapping! */
     unconst(m.capabilities) = aVDInfo->uBackendCaps;
     /* Save the supported file extensions in a list */
Index: /trunk/src/VBox/Main/src-server/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 37585)
+++ /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 37586)
@@ -923,6 +923,6 @@
  * file.
  *
- * For hard disks that don't have the VD_CAP_CREATE_FIXED or
- * VD_CAP_CREATE_DYNAMIC capability (and therefore cannot be created or deleted
+ * For hard disks that don't have the MediumFormatCapabilities_CreateFixed or
+ * MediumFormatCapabilities_CreateDynamic capability (and therefore cannot be created or deleted
  * with the means of VirtualBox) the associated storage unit is assumed to be
  * ready for use so the state of the hard disk object will be set to Created.
@@ -1185,22 +1185,27 @@
     }
 
-    // compose full path of the medium, if it's not fully qualified...
-    // slightly convoluted logic here. If the caller has given us a
-    // machine folder, then a relative path will be relative to that:
     Utf8Str strFull;
-    if (    !strMachineFolder.isEmpty()
-         && !RTPathStartsWithRoot(data.strLocation.c_str())
-       )
-    {
-        strFull = strMachineFolder;
-        strFull += RTPATH_SLASH;
-        strFull += data.strLocation;
+    if (m->formatObj->getCapabilities() & MediumFormatCapabilities_File)
+    {
+        // compose full path of the medium, if it's not fully qualified...
+        // slightly convoluted logic here. If the caller has given us a
+        // machine folder, then a relative path will be relative to that:
+        if (    !strMachineFolder.isEmpty()
+             && !RTPathStartsWithRoot(data.strLocation.c_str())
+           )
+        {
+            strFull = strMachineFolder;
+            strFull += RTPATH_SLASH;
+            strFull += data.strLocation;
+        }
+        else
+        {
+            // Otherwise use the old VirtualBox "make absolute path" logic:
+            rc = m->pVirtualBox->calculateFullPath(data.strLocation, strFull);
+            if (FAILED(rc)) return rc;
+        }
     }
     else
-    {
-        // Otherwise use the old VirtualBox "make absolute path" logic:
-        rc = m->pVirtualBox->calculateFullPath(data.strLocation, strFull);
-        if (FAILED(rc)) return rc;
-    }
+        strFull = data.strLocation;
 
     rc = setLocation(strFull);
@@ -5678,6 +5683,7 @@
         }
 
-        // we must always have full paths now
-        if (!RTPathStartsWithRoot(locationFull.c_str()))
+        // we must always have full paths now (if it refers to a file)
+        if (   (m->formatObj->getCapabilities() & MediumFormatCapabilities_File)
+            && !RTPathStartsWithRoot(locationFull.c_str()))
             return setError(VBOX_E_FILE_ERROR,
                             tr("The given path '%s' is not fully qualified"),
@@ -6198,6 +6204,6 @@
         Utf8Str location(m->strLocationFull);
         uint64_t capabilities = m->formatObj->getCapabilities();
-        ComAssertThrow(capabilities & (  VD_CAP_CREATE_FIXED
-                                       | VD_CAP_CREATE_DYNAMIC), E_FAIL);
+        ComAssertThrow(capabilities & (  MediumFormatCapabilities_CreateFixed
+                                       | MediumFormatCapabilities_CreateDynamic), E_FAIL);
         Assert(m->state == MediumState_Creating);
 
@@ -6212,5 +6218,5 @@
         {
             /* ensure the directory exists */
-            if (capabilities & VD_CAP_FILE)
+            if (capabilities & MediumFormatCapabilities_File)
             {
                 rc = VirtualBox::ensureFilePathExists(location);
@@ -6329,5 +6335,5 @@
         Utf8Str targetLocation(pTarget->m->strLocationFull);
         uint64_t capabilities = pTarget->m->formatObj->getCapabilities();
-        ComAssertThrow(capabilities & VD_CAP_CREATE_DYNAMIC, E_FAIL);
+        ComAssertThrow(capabilities & MediumFormatCapabilities_CreateDynamic, E_FAIL);
 
         Assert(pTarget->m->state == MediumState_Creating);
@@ -6379,5 +6385,5 @@
 
             /* ensure the target directory exists */
-            if (capabilities & VD_CAP_FILE)
+            if (capabilities & MediumFormatCapabilities_File)
             {
                 HRESULT rc = VirtualBox::ensureFilePathExists(targetLocation);
@@ -6882,5 +6888,5 @@
 
             /* ensure the target directory exists */
-            if (capabilities & VD_CAP_FILE)
+            if (capabilities & MediumFormatCapabilities_File)
             {
                 HRESULT rc = VirtualBox::ensureFilePathExists(targetLocation);
@@ -7531,5 +7537,5 @@
 
             /* ensure the target directory exists */
-            if (capabilities & VD_CAP_FILE)
+            if (capabilities & MediumFormatCapabilities_File)
             {
                 rc = VirtualBox::ensureFilePathExists(targetLocation);
@@ -7656,5 +7662,5 @@
 
             /* ensure the target directory exists */
-            if (capabilities & VD_CAP_FILE)
+            if (capabilities & MediumFormatCapabilities_File)
             {
                 HRESULT rc = VirtualBox::ensureFilePathExists(targetLocation);
