Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 24272)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 24273)
@@ -1501,5 +1501,5 @@
     if (!mData->mCurrentSnapshot.isNull())
         return setError(E_FAIL,
-                        tr("The snapshot folder of a machine with snapshots cannot be changed (please discard all snapshots first)"));
+                        tr("The snapshot folder of a machine with snapshots cannot be changed (please delete all snapshots first)"));
 
     Utf8Str snapshotFolder = aSnapshotFolder;
@@ -2155,5 +2155,5 @@
             AutoReadLock mediumLock(pMedium);
             return setError(VBOX_E_OBJECT_IN_USE,
-                            tr("Medium '%ls' is already attached to device slot %d on port %d of controller '%ls' of this virtual machine"),
+                            tr("Medium '%s' is already attached to device slot %d on port %d of controller '%ls' of this virtual machine"),
                             pMedium->locationFull().raw(), aDevice, aControllerPort, aControllerName);
         }
@@ -2256,5 +2256,5 @@
     {
         return setError(VBOX_E_OBJECT_IN_USE,
-                        tr("Medium '%ls' is already attached to this virtual machine"),
+                        tr("Medium '%s' is already attached to this virtual machine"),
                         medium->locationFull().raw());
     }
@@ -5655,9 +5655,8 @@
                         for (size_t i = 0; i < drivevec.size(); ++i)
                         {
-                            Bstr hostDriveSrc(dev.strHostDriveSrc);
                             /// @todo eliminate this conversion
                             ComObjPtr<Medium> med = (Medium *)drivevec[i];
-                            if (    hostDriveSrc == med->name()
-                                ||  hostDriveSrc == med->location())
+                            if (    dev.strHostDriveSrc == med->name()
+                                ||  dev.strHostDriveSrc == med->location())
                             {
                                 medium = med;
@@ -5708,5 +5707,5 @@
                     if (mType == IsSnapshotMachine)
                         return setError(E_FAIL,
-                                        tr("Immutable hard disk '%ls' with UUID {%RTuuid} cannot be directly attached to snapshot with UUID {%RTuuid} "
+                                        tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to snapshot with UUID {%RTuuid} "
                                            "of the virtual machine '%ls' ('%s')"),
                                         medium->locationFull().raw(),
@@ -5717,5 +5716,5 @@
 
                     return setError(E_FAIL,
-                                    tr("Immutable hard disk '%ls' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%ls' ('%s')"),
+                                    tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%ls' ('%s')"),
                                     medium->locationFull().raw(),
                                     dev.uuid.raw(),
@@ -5728,5 +5727,5 @@
                    )
                     return setError(E_FAIL,
-                                    tr("Hard disk '%ls' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%ls' ('%s') "
+                                    tr("Hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%ls' ('%s') "
                                        "because it has %d differencing child hard disks"),
                                     medium->locationFull().raw(),
@@ -5739,5 +5738,5 @@
                                    medium))
                     return setError(E_FAIL,
-                                    tr("Hard disk '%ls' with UUID {%RTuuid} is already attached to the virtual machine '%ls' ('%s')"),
+                                    tr("Hard disk '%s' with UUID {%RTuuid} is already attached to the virtual machine '%ls' ('%s')"),
                                     medium->locationFull().raw(),
                                     dev.uuid.raw(),
@@ -5750,5 +5749,5 @@
             default:
                 return setError(E_FAIL,
-                                tr("Device with unknown type is attached to the virtual machine '%ls' ('%s')"),
+                                tr("Device with unknown type is attached to the virtual machine '%s' ('%s')"),
                                 medium->locationFull().raw(),
                                 mUserData->mName.raw(),
@@ -6533,6 +6532,4 @@
                                     settings::StorageController &data)
 {
-    using namespace settings;
-
     MediaData::AttachmentList atts;
 
@@ -6547,18 +6544,21 @@
         settings::AttachedDevice dev;
 
-        dev.deviceType = (*it)->type();
-        dev.lPort = (*it)->port();
-        dev.lDevice = (*it)->device();
-        if (!(*it)->medium().isNull())
+        MediumAttachment *pAttach = *it;
+        Medium *pMedium = pAttach->medium();
+
+        dev.deviceType = pAttach->type();
+        dev.lPort = pAttach->port();
+        dev.lDevice = pAttach->device();
+        if (pMedium)
         {
             BOOL fHostDrive = false;
-            rc = (*it)->medium()->COMGETTER(HostDrive)(&fHostDrive);
+            rc = pMedium->COMGETTER(HostDrive)(&fHostDrive);
             if (FAILED(rc))
                 return rc;
             if (fHostDrive)
-                dev.strHostDriveSrc = (*it)->medium()->location();
+                dev.strHostDriveSrc = pMedium->location();
             else
-                dev.uuid = (*it)->medium()->id();
-            dev.fPassThrough = (*it)->passthrough();
+                dev.uuid = pMedium->id();
+            dev.fPassThrough = pAttach->passthrough();
         }
 
@@ -8933,10 +8933,10 @@
             // if we can't access the file here, then we'll be doomed later also, so fail right away
             setError(E_FAIL, tr("Cannot access state file '%s', runtime error, %Rra"), pSnapshot->stateFilePath().c_str(), irc);
-        if (ullSize == 0)
-            ullSize = 1;
+        if (ullSize == 0) // avoid division by zero
+            ullSize = _1M;
 
         ulStateFileSizeMB = (ULONG)(ullSize / _1M);
         LogFlowThisFunc(("op %d: saved state file '%s' has %RI64 bytes (%d MB)\n",
-                        ulOpCount, pSnapshot->stateFilePath().raw(), ullSize, ulStateFileSizeMB));
+                         ulOpCount, pSnapshot->stateFilePath().raw(), ullSize, ulStateFileSizeMB));
 
         ulTotalWeight += ulStateFileSizeMB;
@@ -9623,4 +9623,5 @@
     if (aSuccess)
     {
+        // new snapshot becomes the current one
         mData->mCurrentSnapshot = mSnapshotData.mSnapshot;
 
Index: /trunk/src/VBox/Main/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumImpl.cpp	(revision 24272)
+++ /trunk/src/VBox/Main/MediumImpl.cpp	(revision 24273)
@@ -109,10 +109,10 @@
 
     const Guid id;
-    Bstr description;
+    Utf8Str strDescription;
     MediumState_T state;
-    Bstr location;
-    Bstr locationFull;
+    Utf8Str strLocation;
+    Utf8Str strLocationFull;
     uint64_t size;
-    Bstr lastAccessError;
+    Utf8Str strLastAccessError;
 
     BackRefList backRefs;
@@ -124,5 +124,5 @@
     bool queryInfoRunning : 1;
 
-    const Bstr format;
+    const Utf8Str strFormat;
     ComObjPtr<MediumFormat> formatObj;
 
@@ -553,6 +553,6 @@
             {
                 return setError(E_FAIL,
-                                tr("Medium '%ls' involved in the merge operation has more than one child medium (%d)"),
-                                aMedium->m->locationFull.raw(),
+                                tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"),
+                                aMedium->m->strLocationFull.raw(),
                                 aMedium->children().size());
             }
@@ -563,6 +563,6 @@
             if (aMedium->m->backRefs.size() != 0)
                 return setError(E_FAIL,
-                                tr("Medium '%ls' is attached to %d virtual machines"),
-                                aMedium->m->locationFull.raw(),
+                                tr("Medium '%s' is attached to %d virtual machines"),
+                                aMedium->m->strLocationFull.raw(),
                                 aMedium->m->backRefs.size());
         }
@@ -572,6 +572,6 @@
             if (aMedium->m->type == MediumType_Immutable)
                 return setError(E_FAIL,
-                                tr("Medium '%ls' is immutable"),
-                                aMedium->m->locationFull.raw());
+                                tr("Medium '%s' is immutable"),
+                                aMedium->m->strLocationFull.raw());
         }
 
@@ -1030,6 +1030,6 @@
         if (m->state == MediumState_Inaccessible)
         {
-            Assert(!m->lastAccessError.isEmpty());
-            rc = setError(E_FAIL, Utf8Str(m->lastAccessError));
+            Assert(!m->strLastAccessError.isEmpty());
+            rc = setError(E_FAIL, m->strLastAccessError);
         }
         else
@@ -1038,5 +1038,5 @@
 
             /* storage format must be detected by queryInfo() if the medium is accessible */
-            AssertReturn(!m->format.isNull(), E_FAIL);
+            AssertReturn(!m->strFormat.isEmpty(), E_FAIL);
         }
     }
@@ -1094,5 +1094,5 @@
      * as inaccessible for now */
     m->state = MediumState_Inaccessible;
-    m->lastAccessError = tr("Accessibility check was not yet performed");
+    m->strLastAccessError = tr("Accessibility check was not yet performed");
 
     /* required */
@@ -1103,5 +1103,5 @@
 
     /* optional */
-    m->description = data.strDescription;
+    m->strDescription = data.strDescription;
 
     /* required */
@@ -1157,6 +1157,6 @@
     m->devType = aDeviceType;
 
-    LogFlowThisFunc(("m->locationFull='%ls', m->format=%ls, m->id={%RTuuid}\n",
-                     m->locationFull.raw(), m->format.raw(), m->id.raw()));
+    LogFlowThisFunc(("m->locationFull='%s', m->format=%s, m->id={%RTuuid}\n",
+                     m->strLocationFull.raw(), m->strFormat.raw(), m->id.raw()));
 
     /* Don't call queryInfo() for registered media to prevent the calling
@@ -1247,5 +1247,5 @@
     rc = setLocation(aLocation);
     CheckComRCReturnRC(rc);
-    m->description = aDescription;
+    m->strDescription = aDescription;
 
 /// @todo generate uuid (similarly to host network interface uuid) from location and device type
@@ -1340,8 +1340,8 @@
     AutoReadLock alock(this);
 
-    if (m->description.isEmpty())
+    if (m->strDescription.isEmpty())
         Bstr("").cloneTo(aDescription);
     else
-        m->description.cloneTo(aDescription);
+        m->strDescription.cloneTo(aDescription);
 
     return S_OK;
@@ -1387,5 +1387,5 @@
     AutoReadLock alock(this);
 
-    m->locationFull.cloneTo(aLocation);
+    m->strLocationFull.cloneTo(aLocation);
 
     return S_OK;
@@ -1478,5 +1478,5 @@
 
     /* no need to lock, m->format is const */
-    m->format.cloneTo(aFormat);
+    m->strFormat.cloneTo(aFormat);
 
     return S_OK;
@@ -1527,12 +1527,12 @@
     if (!mParent.isNull())
         return setError(E_FAIL,
-                        tr("Hard disk '%ls' is a differencing hard disk"),
-                m->locationFull.raw());
+                        tr("Hard disk '%s' is a differencing hard disk"),
+                        m->strLocationFull.raw());
 
     /* cannot change the type of a hard disk being in use */
     if (m->backRefs.size() != 0)
         return setError(E_FAIL,
-                        tr("Hard disk '%ls' is attached to %d virtual machines"),
-                        m->locationFull.raw(), m->backRefs.size());
+                        tr("Hard disk '%s' is attached to %d virtual machines"),
+                        m->strLocationFull.raw(), m->backRefs.size());
 
     switch (aType)
@@ -1683,6 +1683,6 @@
     if (mParent.isNull())
         return setError(VBOX_E_NOT_SUPPORTED,
-                        tr("Hard disk '%ls' is not differencing"),
-                        m->locationFull.raw());
+                        tr("Hard disk '%s' is not differencing"),
+                        m->strLocationFull.raw());
 
     if (m->autoReset != aAutoReset)
@@ -1704,8 +1704,8 @@
     AutoReadLock alock(this);
 
-    if (m->lastAccessError.isEmpty())
+    if (m->strLastAccessError.isEmpty())
         Bstr("").cloneTo(aLastAccessError);
     else
-        m->lastAccessError.cloneTo(aLastAccessError);
+        m->strLastAccessError.cloneTo(aLastAccessError);
 
     return S_OK;
@@ -1908,6 +1908,6 @@
             LogFlowThisFunc(("Failing - state=%d\n", m->state));
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr ("Medium '%ls' is not locked for reading"),
-                          m->locationFull.raw());
+                          tr ("Medium '%s' is not locked for reading"),
+                          m->strLocationFull.raw());
             break;
         }
@@ -1993,6 +1993,6 @@
             LogFlowThisFunc(("Failing - state=%d\n", m->state));
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr ("Medium '%ls' is not locked for writing"),
-                          m->locationFull.raw());
+                          tr ("Medium '%s' is not locked for writing"),
+                          m->strLocationFull.raw());
             break;
         }
@@ -2039,6 +2039,6 @@
     if (m->backRefs.size() != 0)
         return setError(VBOX_E_OBJECT_IN_USE,
-                        tr("Medium '%ls' is attached to %d virtual machines"),
-                        m->locationFull.raw(), m->backRefs.size());
+                        tr("Medium '%s' is attached to %d virtual machines"),
+                        m->strLocationFull.raw(), m->backRefs.size());
 
     /* perform extra media-dependent close checks */
@@ -2215,11 +2215,11 @@
         &&  !(m->formatObj->capabilities() & MediumFormatCapabilities_CreateDynamic))
         return setError(VBOX_E_NOT_SUPPORTED,
-                        tr("Hard disk format '%ls' does not support dynamic storage creation"),
-                        m->format.raw());
+                        tr("Hard disk format '%s' does not support dynamic storage creation"),
+                        m->strFormat.raw());
     if (    (aVariant & MediumVariant_Fixed)
         &&  !(m->formatObj->capabilities() & MediumFormatCapabilities_CreateDynamic))
         return setError(VBOX_E_NOT_SUPPORTED,
-                        tr("Hard disk format '%ls' does not support fixed storage creation"),
-                        m->format.raw());
+                        tr("Hard disk format '%s' does not support fixed storage creation"),
+                        m->strFormat.raw());
 
     switch (m->state)
@@ -2236,6 +2236,6 @@
     HRESULT rc = progress->init(mVirtualBox, static_cast<IMedium*>(this),
         (aVariant & MediumVariant_Fixed)
-          ? BstrFmt(tr("Creating fixed hard disk storage unit '%ls'"), m->locationFull.raw())
-          : BstrFmt(tr("Creating dynamic hard disk storage unit '%ls'"), m->locationFull.raw()),
+          ? BstrFmt(tr("Creating fixed hard disk storage unit '%s'"), m->strLocationFull.raw())
+          : BstrFmt(tr("Creating dynamic hard disk storage unit '%s'"), m->strLocationFull.raw()),
         TRUE /* aCancelable */);
     CheckComRCReturnRC(rc);
@@ -2302,6 +2302,6 @@
     if (m->type == MediumType_Writethrough)
         return setError(E_FAIL,
-                        tr("Hard disk '%ls' is Writethrough"),
-                        m->locationFull.raw());
+                        tr("Hard disk '%s' is Writethrough"),
+                        m->strLocationFull.raw());
 
     /* We want to be locked for reading as long as our diff child is being
@@ -2413,6 +2413,6 @@
         progress.createObject();
         rc = progress->init(mVirtualBox, static_cast <IMedium *>(this),
-            BstrFmt(tr("Creating clone hard disk '%ls'"),
-                    target->m->locationFull.raw()),
+            BstrFmt(tr("Creating clone hard disk '%s'"),
+                    target->m->strLocationFull.raw()),
             TRUE /* aCancelable */);
         CheckComRCThrowRC(rc);
@@ -2488,5 +2488,5 @@
         progress.createObject();
         rc = progress->init(mVirtualBox, static_cast <IMedium *>(this),
-             BstrFmt(tr("Compacting hard disk '%ls'"), m->locationFull.raw()),
+             BstrFmt(tr("Compacting hard disk '%s'"), m->strLocationFull.raw()),
              TRUE /* aCancelable */);
         CheckComRCThrowRC(rc);
@@ -2543,6 +2543,6 @@
     if (mParent.isNull())
         return setError(VBOX_E_NOT_SUPPORTED,
-                        tr ("Hard disk '%ls' is not differencing"),
-                        m->locationFull.raw());
+                        tr ("Hard disk '%s' is not differencing"),
+                        m->strLocationFull.raw());
 
     HRESULT rc = canClose();
@@ -2558,6 +2558,6 @@
         progress.createObject();
         rc = progress->init(mVirtualBox, static_cast <IMedium *>(this),
-            BstrFmt(tr("Resetting differencing hard disk '%ls'"),
-                     m->locationFull.raw()),
+            BstrFmt(tr("Resetting differencing hard disk '%s'"),
+                     m->strLocationFull.raw()),
             FALSE /* aCancelable */);
         CheckComRCThrowRC(rc);
@@ -2620,7 +2620,7 @@
     AutoWriteLock alock(this);
 
-    LogFlowThisFunc(("locationFull.before='%s'\n", m->locationFull.raw()));
-
-    Utf8Str path = m->locationFull;
+    LogFlowThisFunc(("locationFull.before='%s'\n", m->strLocationFull.raw()));
+
+    Utf8Str path = m->strLocationFull;
 
     if (RTPathStartsWith(path.c_str(), aOldPath))
@@ -2632,8 +2632,8 @@
         mVirtualBox->calculateRelativePath(path, path);
 
-        unconst(m->locationFull) = newPath;
-        unconst(m->location) = path;
-
-        LogFlowThisFunc(("locationFull.after='%s'\n", m->locationFull.raw()));
+        unconst(m->strLocationFull) = newPath;
+        unconst(m->strLocation) = path;
+
+        LogFlowThisFunc(("locationFull.after='%s'\n", m->strLocationFull.raw()));
     }
 
@@ -2672,6 +2672,6 @@
     if (m->numCreateDiffTasks > 0)
         return setError(E_FAIL,
-                        tr("One or more differencing child hard disks are being created for the hard disk '%ls' (%u)"),
-                        m->locationFull.raw(), m->numCreateDiffTasks);
+                        tr("One or more differencing child hard disks are being created for the hard disk '%s' (%u)"),
+                        m->strLocationFull.raw(), m->numCreateDiffTasks);
 
     BackRefList::iterator it =
@@ -2772,7 +2772,7 @@
  * @return
  */
-const Bstr& Medium::location() const
-{
-    return m->location;
+const Utf8Str& Medium::location() const
+{
+    return m->strLocation;
 }
 
@@ -2781,7 +2781,7 @@
  * @return
  */
-const Bstr& Medium::locationFull() const
-{
-    return m->locationFull;
+const Utf8Str& Medium::locationFull() const
+{
+    return m->strLocationFull;
 }
 
@@ -2973,6 +2973,6 @@
 
     data.uuid = m->id;
-    data.strLocation = m->location;
-    data.strFormat = m->format;
+    data.strLocation = m->strLocation;
+    data.strFormat = m->strFormat;
 
     /* optional, only for diffs, default is false */
@@ -2983,5 +2983,5 @@
 
     /* optional */
-    data.strDescription = m->description;
+    data.strDescription = m->strDescription;
 
     /* optional properties */
@@ -3037,5 +3037,5 @@
     AutoReadLock alock(this);
 
-    Utf8Str locationFull(m->locationFull);
+    Utf8Str locationFull(m->strLocationFull);
 
     /// @todo NEWMEDIA delegate the comparison to the backend?
@@ -3131,6 +3131,6 @@
     if (children().size() > 1)
         return setError(E_FAIL,
-                        tr ("Hard disk '%ls' has more than one child hard disk (%d)"),
-                        m->locationFull.raw(), children().size());
+                        tr ("Hard disk '%s' has more than one child hard disk (%d)"),
+                        m->strLocationFull.raw(), children().size());
 
     /* this is a read-only hard disk with children; it must be associated with
@@ -3329,11 +3329,11 @@
 Bstr Medium::preferredDiffFormat()
 {
-    Bstr format;
+    Utf8Str strFormat;
 
     AutoCaller autoCaller(this);
-    AssertComRCReturn(autoCaller.rc(), format);
+    AssertComRCReturn(autoCaller.rc(), strFormat);
 
     /* m->format is const, no need to lock */
-    format = m->format;
+    strFormat = m->strFormat;
 
     /* check that our own format supports diffs */
@@ -3342,8 +3342,8 @@
         /* use the default format if not */
         AutoReadLock propsLock(mVirtualBox->systemProperties());
-        format = mVirtualBox->getDefaultHardDiskFormat();
-    }
-
-    return format;
+        strFormat = mVirtualBox->getDefaultHardDiskFormat();
+    }
+
+    return strFormat;
 }
 
@@ -3384,5 +3384,5 @@
 Utf8Str Medium::name()
 {
-    Utf8Str location(m->locationFull);
+    Utf8Str location(m->strLocationFull);
 
     Utf8Str name = RTPathFilename(location.c_str());
@@ -3391,5 +3391,5 @@
 
 /**
- * Sets the value of m->location and calculates the value of m->locationFull.
+ * Sets the value of m->strLocation and calculates the value of m->strLocationFull.
  *
  * Treats non-FS-path locations specially, and prepends the default hard disk
@@ -3420,13 +3420,15 @@
     /* formatObj may be null only when initializing from an existing path and
      * no format is known yet */
-    AssertReturn((!m->format.isNull() && !m->formatObj.isNull()) ||
-                 (autoCaller.state() == InInit &&
-                  m->state != MediumState_NotCreated && m->id.isEmpty() &&
-                  m->format.isNull() && m->formatObj.isNull()),
+    AssertReturn(    (!m->strFormat.isEmpty() && !m->formatObj.isNull())
+                  || (    autoCaller.state() == InInit
+                       && m->state != MediumState_NotCreated
+                       && m->id.isEmpty()
+                       && m->strFormat.isEmpty()
+                       && m->formatObj.isNull()),
                  E_FAIL);
 
     /* are we dealing with a new medium constructed using the existing
      * location? */
-    bool isImport = m->format.isNull();
+    bool isImport = m->strFormat.isEmpty();
 
     if (   isImport
@@ -3537,6 +3539,6 @@
         if (m->formatObj->capabilities() & MediumFormatCapabilities_File)
         {
-            m->location = location;
-            m->locationFull = locationFull;
+            m->strLocation = location;
+            m->strLocationFull = locationFull;
 
             if (m->state == MediumState_NotCreated)
@@ -3551,12 +3553,12 @@
         else
         {
-            m->location = locationFull;
-            m->locationFull = locationFull;
+            m->strLocation = locationFull;
+            m->strLocationFull = locationFull;
         }
     }
     else
     {
-        m->location = aLocation;
-        m->locationFull = aLocation;
+        m->strLocation = aLocation;
+        m->strLocationFull = aLocation;
     }
 
@@ -3637,6 +3639,6 @@
      * you do with the contents of this medium object, as you will
      * create races if there are concurrent changes. */
-    Utf8Str format(m->format);
-    Utf8Str location(m->locationFull);
+    Utf8Str format(m->strFormat);
+    Utf8Str location(m->strLocationFull);
     ComObjPtr<MediumFormat> formatObj = m->formatObj;
 
@@ -3722,7 +3724,9 @@
                     {
                         lastAccessError = Utf8StrFmt(
-                            tr("UUID {%RTuuid} of the medium '%s' does not match the value {%RTuuid} stored in the media registry ('%ls')"),
-                            &uuid, location.c_str(), mediumId.raw(),
-                            mVirtualBox->settingsFilePath().raw());
+                            tr("UUID {%RTuuid} of the medium '%s' does not match the value {%RTuuid} stored in the media registry ('%s')"),
+                            &uuid,
+                            location.c_str(),
+                            mediumId.raw(),
+                            mVirtualBox->settingsFilePath().c_str());
                         throw S_OK;
                     }
@@ -3772,7 +3776,7 @@
                     {
                         lastAccessError = Utf8StrFmt(
-                            tr("Parent hard disk with UUID {%RTuuid} of the hard disk '%s' is not found in the media registry ('%ls')"),
+                            tr("Parent hard disk with UUID {%RTuuid} of the hard disk '%s' is not found in the media registry ('%s')"),
                             &parentId, location.c_str(),
-                            mVirtualBox->settingsFilePath().raw());
+                            mVirtualBox->settingsFilePath().c_str());
                         throw S_OK;
                     }
@@ -3801,7 +3805,7 @@
                     {
                         lastAccessError = Utf8StrFmt(
-                            tr("Hard disk '%s' is differencing but it is not associated with any parent hard disk in the media registry ('%ls')"),
+                            tr("Hard disk '%s' is differencing but it is not associated with any parent hard disk in the media registry ('%s')"),
                             location.c_str(),
-                            mVirtualBox->settingsFilePath().raw());
+                            mVirtualBox->settingsFilePath().c_str());
                         throw S_OK;
                     }
@@ -3812,8 +3816,8 @@
                     {
                         lastAccessError = Utf8StrFmt(
-                            tr ("Parent UUID {%RTuuid} of the hard disk '%s' does not match UUID {%RTuuid} of its parent hard disk stored in the media registry ('%ls')"),
+                            tr ("Parent UUID {%RTuuid} of the hard disk '%s' does not match UUID {%RTuuid} of its parent hard disk stored in the media registry ('%s')"),
                             &parentId, location.c_str(),
                             mParent->id().raw(),
-                            mVirtualBox->settingsFilePath().raw());
+                            mVirtualBox->settingsFilePath().c_str());
                         throw S_OK;
                     }
@@ -3852,11 +3856,11 @@
         m->size = mediumSize;
         m->logicalSize = mediumLogicalSize;
-        m->lastAccessError.setNull();
+        m->strLastAccessError.setNull();
     }
     else
     {
-        m->lastAccessError = lastAccessError;
-        LogWarningFunc(("'%s' is not accessible (error='%ls', rc=%Rhrc, vrc=%Rrc)\n",
-                         location.c_str(), m->lastAccessError.raw(),
+        m->strLastAccessError = lastAccessError;
+        LogWarningFunc(("'%s' is not accessible (error='%s', rc=%Rhrc, vrc=%Rrc)\n",
+                         location.c_str(), m->strLastAccessError.c_str(),
                          rc, vrc));
     }
@@ -3895,6 +3899,6 @@
         {
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr("Storage for the medium '%ls' is not created"),
-                          m->locationFull.raw());
+                          tr("Storage for the medium '%s' is not created"),
+                          m->strLocationFull.raw());
             break;
         }
@@ -3902,6 +3906,6 @@
         {
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr("Storage for the medium '%ls' is already created"),
-                          m->locationFull.raw());
+                          tr("Storage for the medium '%s' is already created"),
+                          m->strLocationFull.raw());
             break;
         }
@@ -3909,6 +3913,6 @@
         {
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr("Medium '%ls' is locked for reading by another task"),
-                          m->locationFull.raw());
+                          tr("Medium '%s' is locked for reading by another task"),
+                          m->strLocationFull.raw());
             break;
         }
@@ -3916,22 +3920,19 @@
         {
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr("Medium '%ls' is locked for writing by another task"),
-                          m->locationFull.raw());
+                          tr("Medium '%s' is locked for writing by another task"),
+                          m->strLocationFull.raw());
             break;
         }
         case MediumState_Inaccessible:
         {
-            AssertMsg(!m->lastAccessError.isEmpty(),
-                      ("There must always be a reason for Inaccessible"));
-
             /* be in sync with Console::powerUpThread() */
-            if (!m->lastAccessError.isEmpty())
+            if (!m->strLastAccessError.isEmpty())
                 rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                              tr("Medium '%ls' is not accessible. %ls"),
-                              m->locationFull.raw(), m->lastAccessError.raw());
+                              tr("Medium '%s' is not accessible. %s"),
+                              m->strLocationFull.raw(), m->strLastAccessError.c_str());
             else
                 rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                              tr("Medium '%ls' is not accessible"),
-                              m->locationFull.raw());
+                              tr("Medium '%s' is not accessible"),
+                              m->strLocationFull.raw());
             break;
         }
@@ -3939,6 +3940,6 @@
         {
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr("Storage for the medium '%ls' is being created"),
-                          m->locationFull.raw(), m->lastAccessError.raw());
+                          tr("Storage for the medium '%s' is being created"),
+                          m->strLocationFull.raw());
             break;
         }
@@ -3946,6 +3947,6 @@
         {
             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
-                          tr("Storage for the medium '%ls' is being deleted"),
-                          m->locationFull.raw(), m->lastAccessError.raw());
+                          tr("Storage for the medium '%s' is being deleted"),
+                          m->strLocationFull.raw());
             break;
         }
@@ -3999,6 +4000,6 @@
                                                | MediumFormatCapabilities_CreateFixed)))
         return setError(VBOX_E_NOT_SUPPORTED,
-                        tr("Hard disk format '%ls' does not support storage deletion"),
-                        m->format.raw());
+                        tr("Hard disk format '%s' does not support storage deletion"),
+                        m->strFormat.raw());
 
     /* Note that we are fine with Inaccessible state too: a) for symmetry with
@@ -4020,6 +4021,6 @@
     if (m->backRefs.size() != 0)
         return setError(VBOX_E_OBJECT_IN_USE,
-                        tr("Hard disk '%ls' is attached to %d virtual machines"),
-                        m->locationFull.raw(), m->backRefs.size());
+                        tr("Hard disk '%s' is attached to %d virtual machines"),
+                        m->strLocationFull.raw(), m->backRefs.size());
 
     HRESULT rc = canClose();
@@ -4059,6 +4060,6 @@
             progress.createObject();
             rc = progress->init(mVirtualBox, static_cast<IMedium*>(this),
-                BstrFmt(tr("Deleting hard disk storage unit '%ls'"),
-                         m->locationFull.raw()),
+                BstrFmt(tr("Deleting hard disk storage unit '%s'"),
+                         m->strLocationFull.raw()),
                 FALSE /* aCancelable */);
             CheckComRCReturnRC(rc);
@@ -4177,6 +4178,6 @@
             {
                 return setError(VBOX_E_INVALID_OBJECT_STATE,
-                                tr("Hard disk '%ls' is attached to a virtual machine with UUID {%RTuuid}. No differencing hard disks based on it may be created until it is detached"),
-                                m->locationFull.raw(), it->machineId.raw());
+                                tr("Hard disk '%s' is attached to a virtual machine with UUID {%RTuuid}. No differencing hard disks based on it may be created until it is detached"),
+                                m->strLocationFull.raw(), it->machineId.raw());
             }
 
@@ -4197,6 +4198,6 @@
             progress.createObject();
             rc = progress->init(mVirtualBox, static_cast<IMedium*>(this),
-                BstrFmt(tr("Creating differencing hard disk storage unit '%ls'"),
-                         aTarget->m->locationFull.raw()),
+                BstrFmt(tr("Creating differencing hard disk storage unit '%s'"),
+                         aTarget->m->strLocationFull.raw()),
                 TRUE /* aCancelable */);
             CheckComRCReturnRC(rc);
@@ -4304,5 +4305,5 @@
             else
             {
-                Bstr tgtLoc;
+                Utf8Str tgtLoc;
                 {
                     AutoReadLock alock(this);
@@ -4312,6 +4313,6 @@
                 AutoReadLock alock(this);
                 return setError(E_FAIL,
-                                tr("Hard disks '%ls' and '%ls' are unrelated"),
-                                m->locationFull.raw(), tgtLoc.raw());
+                                tr("Hard disks '%s' and '%s' are unrelated"),
+                                m->strLocationFull.raw(), tgtLoc.raw());
             }
         }
@@ -4545,5 +4546,5 @@
     }
 
-    unconst(m->format) = aFormat;
+    unconst(m->strFormat) = aFormat;
 
     return S_OK;
@@ -4846,6 +4847,6 @@
                 ComAssertRCThrow(vrc, E_FAIL);
 
-                Utf8Str format(that->m->format);
-                Utf8Str location(that->m->locationFull);
+                Utf8Str format(that->m->strFormat);
+                Utf8Str location(that->m->strLocationFull);
                 /* uint64_t capabilities = */ that->m->formatObj->capabilities();
 
@@ -4949,9 +4950,9 @@
 
                 Guid id = that->m->id;
-                Utf8Str format(that->m->format);
-                Utf8Str location(that->m->locationFull);
-
-                Utf8Str targetFormat(target->m->format);
-                Utf8Str targetLocation(target->m->locationFull);
+                Utf8Str format(that->m->strFormat);
+                Utf8Str location(that->m->strLocationFull);
+
+                Utf8Str targetFormat(target->m->strFormat);
+                Utf8Str targetLocation(target->m->strLocationFull);
 
                 Assert(target->m->state == MediumState_Creating);
@@ -5142,6 +5143,6 @@
                         /* open the first image with VDOPEN_FLAGS_INFO because
                          * it's not necessarily the base one */
-                        vrc = VDOpen(hdd, Utf8Str((*it)->m->format).c_str(),
-                                      Utf8Str((*it)->m->locationFull).c_str(),
+                        vrc = VDOpen(hdd, (*it)->m->strFormat.c_str(),
+                                      (*it)->m->strLocationFull.c_str(),
                                       it == chain->begin() ?
                                           VD_OPEN_FLAGS_INFO : 0,
@@ -5150,5 +5151,5 @@
                             throw vrc;
 #if 0
-                        LogFlow(("*** MERGE disk = %ls\n", (*it)->m->locationFull.raw()));
+                        LogFlow(("*** MERGE disk = %s\n", (*it)->m->strLocationFull.raw()));
 #endif
                     }
@@ -5193,6 +5194,6 @@
                             {
                                 /* VD_OPEN_FLAGS_INFO since UUID is wrong yet */
-                                vrc = VDOpen(hdd, Utf8Str((*it)->m->format).c_str(),
-                                             Utf8Str((*it)->m->locationFull).c_str(),
+                                vrc = VDOpen(hdd, (*it)->m->strFormat.c_str(),
+                                             (*it)->m->strLocationFull.c_str(),
                                              VD_OPEN_FLAGS_INFO,
                                              (*it)->m->vdDiskIfaces);
@@ -5216,7 +5217,7 @@
                 {
                     throw setError(E_FAIL,
-                                   tr("Could not merge the hard disk '%ls' to '%ls'%s"),
-                                   chain->source()->m->locationFull.raw(),
-                                   chain->target()->m->locationFull.raw(),
+                                   tr("Could not merge the hard disk '%s' to '%s'%s"),
+                                   chain->source()->m->strLocationFull.raw(),
+                                   chain->target()->m->strLocationFull.raw(),
                                    that->vdError(aVRC).raw());
                 }
@@ -5433,6 +5434,6 @@
 
                         /** Open all images in read-only mode. */
-                        vrc = VDOpen(hdd, Utf8Str((*it)->m->format).c_str(),
-                                     Utf8Str((*it)->m->locationFull).c_str(),
+                        vrc = VDOpen(hdd, (*it)->m->strFormat.c_str(),
+                                     (*it)->m->strLocationFull.c_str(),
                                      VD_OPEN_FLAGS_READONLY,
                                      (*it)->m->vdDiskIfaces);
@@ -5441,5 +5442,5 @@
                             throw setError(E_FAIL,
                                            tr("Could not open the hard disk storage unit '%s'%s"),
-                                           Utf8Str((*it)->m->locationFull).raw(),
+                                           (*it)->m->strLocationFull.raw(),
                                            that->vdError(vrc).raw());
                         }
@@ -5449,6 +5450,6 @@
                     thatLock.leave();
 
-                    Utf8Str targetFormat(target->m->format);
-                    Utf8Str targetLocation(target->m->locationFull);
+                    Utf8Str targetFormat(target->m->strFormat);
+                    Utf8Str targetLocation(target->m->strLocationFull);
 
                     Assert(    target->m->state == MediumState_Creating
@@ -5479,6 +5480,6 @@
 
                             /* Open all images in appropriate mode. */
-                            vrc = VDOpen(targetHdd, Utf8Str((*it)->m->format).c_str(),
-                                         Utf8Str((*it)->m->locationFull).c_str(),
+                            vrc = VDOpen(targetHdd, (*it)->m->strFormat.c_str(),
+                                         (*it)->m->strLocationFull.c_str(),
                                          ((*it)->m->state == MediumState_LockedWrite) ? VD_OPEN_FLAGS_NORMAL : VD_OPEN_FLAGS_READONLY,
                                          (*it)->m->vdDiskIfaces);
@@ -5487,5 +5488,5 @@
                                 throw setError(E_FAIL,
                                                tr("Could not open the hard disk storage unit '%s'%s"),
-                                               Utf8Str((*it)->m->locationFull).raw(),
+                                               (*it)->m->strLocationFull.raw(),
                                                that->vdError(vrc).raw());
                             }
@@ -5608,6 +5609,6 @@
                 ComAssertRCThrow(vrc, E_FAIL);
 
-                Utf8Str format(that->m->format);
-                Utf8Str location(that->m->locationFull);
+                Utf8Str format(that->m->strFormat);
+                Utf8Str location(that->m->strLocationFull);
 
                 /* unlock before the potentially lengthy operation */
@@ -5670,10 +5671,10 @@
 
                 Guid id = that->m->id;
-                Utf8Str format(that->m->format);
-                Utf8Str location(that->m->locationFull);
+                Utf8Str format(that->m->strFormat);
+                Utf8Str location(that->m->strLocationFull);
 
                 Guid parentId = that->mParent->m->id;
-                Utf8Str parentFormat(that->mParent->m->format);
-                Utf8Str parentLocation(that->mParent->m->locationFull);
+                Utf8Str parentFormat(that->mParent->m->strFormat);
+                Utf8Str parentLocation(that->mParent->m->strLocationFull);
 
                 Assert(that->m->state == MediumState_LockedWrite);
@@ -5789,6 +5790,6 @@
 
                         /** Open all images but last in read-only mode. */
-                        vrc = VDOpen(hdd, Utf8Str((*it)->m->format).c_str(),
-                                     Utf8Str((*it)->m->locationFull).c_str(),
+                        vrc = VDOpen(hdd, (*it)->m->strFormat.c_str(),
+                                     (*it)->m->strLocationFull.c_str(),
                                      (it == last) ? VD_OPEN_FLAGS_NORMAL : VD_OPEN_FLAGS_READONLY,
                                      (*it)->m->vdDiskIfaces);
@@ -5797,5 +5798,5 @@
                             throw setError(E_FAIL,
                                            tr("Could not open the hard disk storage unit '%s'%s"),
-                                           Utf8Str((*it)->m->locationFull).raw(),
+                                           (*it)->m->strLocationFull.raw(),
                                            that->vdError(vrc).raw());
                         }
@@ -5818,14 +5819,14 @@
                         if (vrc == VERR_NOT_SUPPORTED)
                             throw setError(VBOX_E_NOT_SUPPORTED,
-                                           tr("Compacting is not supported yet for hard disk '%s'"),
-                                           Utf8Str(that->m->locationFull).raw());
+                                           tr("Compacting is not yet supported for hard disk '%s'"),
+                                           that->m->strLocationFull.raw());
                         else if (vrc == VERR_NOT_IMPLEMENTED)
                             throw setError(E_NOTIMPL,
                                            tr("Compacting is not implemented, hard disk '%s'"),
-                                           Utf8Str(that->m->locationFull).raw());
+                                           that->m->strLocationFull.raw());
                         else
                             throw setError(E_FAIL,
                                            tr("Could not compact hard disk '%s'%s"),
-                                           Utf8Str(that->m->locationFull).raw(),
+                                           that->m->strLocationFull.raw(),
                                            that->vdError(vrc).raw());
                     }
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 24272)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 24273)
@@ -2782,5 +2782,5 @@
                 (aLocation != NULL &&
                  RTPathCompare(location.c_str(),
-                               Utf8Str((*it)->locationFull()).c_str()
+                               (*it)->locationFull().c_str()
                               ) == 0);
         if (found)
@@ -2858,5 +2858,5 @@
                 (aLocation != NULL &&
                  RTPathCompare(location.c_str(),
-                               Utf8Str((*it)->locationFull()).c_str()
+                               (*it)->locationFull().c_str()
                               ) == 0);
         if (found)
@@ -3048,5 +3048,5 @@
  */
 HRESULT VirtualBox::checkMediaForConflicts2 (const Guid &aId,
-                                             const Bstr &aLocation,
+                                             const Utf8Str &aLocation,
                                              Utf8Str &aConflict)
 {
@@ -3059,7 +3059,9 @@
     HRESULT rc = S_OK;
 
+    Bstr bstrLocation(aLocation);
+
     {
         ComObjPtr<Medium> hardDisk;
-        rc = findHardDisk(&aId, aLocation, false /* aSetError */, &hardDisk);
+        rc = findHardDisk(&aId, bstrLocation, false /* aSetError */, &hardDisk);
         if (SUCCEEDED(rc))
         {
@@ -3067,5 +3069,5 @@
             AutoReadLock mediaLock (hardDisk);
             aConflict = Utf8StrFmt (
-                tr ("hard disk '%ls' with UUID {%RTuuid}"),
+                tr ("hard disk '%s' with UUID {%RTuuid}"),
                 hardDisk->locationFull().raw(), hardDisk->id().raw());
             return S_OK;
@@ -3075,5 +3077,5 @@
     {
         ComObjPtr<Medium> image;
-        rc = findDVDImage (&aId, aLocation, false /* aSetError */, &image);
+        rc = findDVDImage (&aId, bstrLocation, false /* aSetError */, &image);
         if (SUCCEEDED(rc))
         {
@@ -3081,5 +3083,5 @@
             AutoReadLock mediaLock (image);
             aConflict = Utf8StrFmt (
-                tr ("CD/DVD image '%ls' with UUID {%RTuuid}"),
+                tr ("CD/DVD image '%s' with UUID {%RTuuid}"),
                 image->locationFull().raw(), image->id().raw());
             return S_OK;
@@ -3089,5 +3091,5 @@
     {
         ComObjPtr<Medium> image;
-        rc = findFloppyImage(&aId, aLocation, false /* aSetError */, &image);
+        rc = findFloppyImage(&aId, bstrLocation, false /* aSetError */, &image);
         if (SUCCEEDED(rc))
         {
@@ -3095,5 +3097,5 @@
             AutoReadLock mediaLock (image);
             aConflict = Utf8StrFmt (
-                tr ("floppy image '%ls' with UUID {%RTuuid}"),
+                tr ("floppy image '%s' with UUID {%RTuuid}"),
                 image->locationFull().raw(), image->id().raw());
             return S_OK;
Index: /trunk/src/VBox/Main/include/MediumImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MediumImpl.h	(revision 24272)
+++ /trunk/src/VBox/Main/include/MediumImpl.h	(revision 24273)
@@ -165,6 +165,6 @@
     const Guid& id() const;
     MediumState_T state() const;
-    const Bstr& location() const;
-    const Bstr& locationFull() const;
+    const Utf8Str& location() const;
+    const Utf8Str& locationFull() const;
 
     const Guid* getFirstMachineBackrefId() const;
Index: /trunk/src/VBox/Main/include/VirtualBoxImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/VirtualBoxImpl.h	(revision 24272)
+++ /trunk/src/VBox/Main/include/VirtualBoxImpl.h	(revision 24273)
@@ -277,5 +277,5 @@
 private:
 
-    HRESULT checkMediaForConflicts2(const Guid &aId, const Bstr &aLocation,
+    HRESULT checkMediaForConflicts2(const Guid &aId, const Utf8Str &aLocation,
                                     Utf8Str &aConflictType);
 
