VirtualBox

Changeset 36653 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 12, 2011 12:27:10 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
71125
Message:

Main/Medium: only create the target path if the destination is file based

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r36243 r36653  
    55
    66/*
    7  * Copyright (C) 2008-2010 Oracle Corporation
     7 * Copyright (C) 2008-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    61886188        {
    61896189            /* ensure the directory exists */
    6190             rc = VirtualBox::ensureFilePathExists(location);
    6191             if (FAILED(rc))
    6192                 throw rc;
     6190            if (capabilities & VD_CAP_FILE)
     6191            {
     6192                rc = VirtualBox::ensureFilePathExists(location);
     6193                if (FAILED(rc))
     6194                    throw rc;
     6195            }
    61936196
    61946197            VDGEOMETRY geo = { 0, 0, 0 }; /* auto-detect */
     
    63526355
    63536356            /* ensure the target directory exists */
    6354             rc = VirtualBox::ensureFilePathExists(targetLocation);
    6355             if (FAILED(rc))
    6356                 throw rc;
     6357            if (capabilities & VD_CAP_FILE)
     6358            {
     6359                rc = VirtualBox::ensureFilePathExists(targetLocation);
     6360                if (FAILED(rc))
     6361                    throw rc;
     6362            }
    63576363
    63586364            vrc = VDCreateDiff(hdd,
     
    68336839            Utf8Str targetFormat(pTarget->m->strFormat);
    68346840            Utf8Str targetLocation(pTarget->m->strLocationFull);
     6841            uint64_t capabilities = pTarget->m->formatObj->getCapabilities();
    68356842
    68366843            Assert(   pTarget->m->state == MediumState_Creating
     
    68446851
    68456852            /* ensure the target directory exists */
    6846             rc = VirtualBox::ensureFilePathExists(targetLocation);
    6847             if (FAILED(rc))
    6848                 throw rc;
     6853            if (capabilities & VD_CAP_FILE)
     6854            {
     6855                rc = VirtualBox::ensureFilePathExists(targetLocation);
     6856                if (FAILED(rc))
     6857                    throw rc;
     6858            }
    68496859
    68506860            PVBOXHDD targetHdd;
     
    74727482            Utf8Str targetFormat(task.mFormat->getId());
    74737483            Utf8Str targetLocation(task.mFilename);
     7484            uint64_t capabilities = task.mFormat->getCapabilities();
    74747485
    74757486            Assert(m->state == MediumState_LockedRead);
     
    74797490
    74807491            /* ensure the target directory exists */
    7481             rc = VirtualBox::ensureFilePathExists(targetLocation);
    7482             if (FAILED(rc))
    7483                 throw rc;
     7492            if (capabilities & VD_CAP_FILE)
     7493            {
     7494                rc = VirtualBox::ensureFilePathExists(targetLocation);
     7495                if (FAILED(rc))
     7496                    throw rc;
     7497            }
    74847498
    74857499            PVBOXHDD targetHdd;
     
    75907604            Utf8Str targetFormat(m->strFormat);
    75917605            Utf8Str targetLocation(m->strLocationFull);
     7606            uint64_t capabilities = task.mFormat->getCapabilities();
    75927607
    75937608            Assert(   m->state == MediumState_Creating
     
    76007615
    76017616            /* ensure the target directory exists */
    7602             rc = VirtualBox::ensureFilePathExists(targetLocation);
    7603             if (FAILED(rc))
    7604                 throw rc;
     7617            if (capabilities & VD_CAP_FILE)
     7618            {
     7619                rc = VirtualBox::ensureFilePathExists(targetLocation);
     7620                if (FAILED(rc))
     7621                    throw rc;
     7622            }
    76057623
    76067624            PVBOXHDD targetHdd;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette