~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Devices/Storage/DrvHostBase.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: DrvHostBase.cpp $ */
 
1
/* $Id: DrvHostBase.cpp 35560 2011-01-14 13:37:32Z vboxsync $ */
2
2
/** @file
3
3
 * DrvHostBase - Host base drive access driver.
4
4
 */
111
111
# error "Unsupported Platform."
112
112
#endif
113
113
 
114
 
#include <VBox/pdmdrv.h>
 
114
#include <VBox/vmm/pdmdrv.h>
115
115
#include <iprt/assert.h>
116
116
#include <iprt/file.h>
117
117
#include <iprt/path.h>
477
477
 
478
478
 
479
479
/** @copydoc PDMIMOUNT::pfnUnmount */
480
 
static DECLCALLBACK(int) drvHostBaseUnmount(PPDMIMOUNT pInterface, bool fForce)
 
480
static DECLCALLBACK(int) drvHostBaseUnmount(PPDMIMOUNT pInterface, bool fForce, bool fEject)
481
481
{
482
482
     LogFlow(("drvHostBaseUnmount: returns VERR_NOT_SUPPORTED\n"));
483
483
     return VERR_NOT_SUPPORTED;
591
591
 * @return  VINF_SUCCESS if found, VERR_FILE_NOT_FOUND otherwise.
592
592
 * @param   Entry       The current I/O registry entry reference.
593
593
 * @param   pszName     Where to store the name. 128 bytes.
594
 
 * @param   cRecursions Number of recursions. This is used as an precation
 
594
 * @param   cRecursions Number of recursions. This is used as an precaution
595
595
 *                      just to limit the depth and avoid blowing the stack
596
596
 *                      should we hit a bug or something.
597
597
 */
808
808
         * Get the properties we use to identify the DVD drive.
809
809
         *
810
810
         * While there is a (weird 12 byte) GUID, it isn't persistent
811
 
         * accross boots. So, we have to use a combination of the
 
811
         * across boots. So, we have to use a combination of the
812
812
         * vendor name and product name properties with an optional
813
813
         * sequence number for identification.
814
814
         */
969
969
        char *pszPassthroughDevice = NULL;
970
970
        rc = RTStrAPrintf(&pszPassthroughDevice, "/dev/%s%u",
971
971
                          DeviceCCB.cgdl.periph_name, DeviceCCB.cgdl.unit_number);
972
 
        if (RT_SUCCESS(rc))
 
972
        if (rc >= 0)
973
973
        {
974
974
            RTFILE PassthroughDevice;
975
975
 
1012
1012
                    RTFileClose(PassthroughDevice);
1013
1013
            }
1014
1014
        }
 
1015
        else
 
1016
            rc = VERR_NO_STR_MEMORY;
1015
1017
    }
1016
1018
    else
1017
1019
        rc = RTErrConvertFromErrno(errno);
1030
1032
 * Solaris wrapper for RTFileOpen.
1031
1033
 *
1032
1034
 * Solaris has to deal with two filehandles, a block and a raw one. Rather than messing
1033
 
 * with drvHostBaseOpen's function signature & body, having a seperate one is better.
 
1035
 * with drvHostBaseOpen's function signature & body, having a separate one is better.
1034
1036
 *
1035
1037
 * @returns VBox status code.
1036
1038
 */
1195
1197
    }
1196
1198
 
1197
1199
    /* convert nt status code to VBox status code. */
1198
 
    /** @todo Make convertion function!. */
 
1200
    /** @todo Make conversion function!. */
1199
1201
    int rc = VERR_GENERAL_FAILURE;
1200
1202
    switch (rcNt)
1201
1203
    {
1742
1744
 
1743
1745
#ifdef RT_OS_DARWIN
1744
1746
    /*
1745
 
     * The unclaiming doesn't seem to mean much, the DVD is actaully
 
1747
     * The unclaiming doesn't seem to mean much, the DVD is actually
1746
1748
     * remounted when we release exclusive access. I'm not quite sure
1747
1749
     * if I should put the unclaim first or not...
1748
1750
     *
1822
1824
    pThis->pDrvMountNotify = NULL;
1823
1825
 
1824
1826
    /* Leave the instance operational if this is just a cleanup of the state
1825
 
     * after an attach error happened. So don't destry the critsect then. */
 
1827
     * after an attach error happened. So don't destroy the critsect then. */
1826
1828
    if (!pThis->fKeepInstance && RTCritSectIsInitialized(&pThis->CritSect))
1827
1829
        RTCritSectDelete(&pThis->CritSect);
1828
1830
    LogFlow(("%s-%d: drvHostBaseDestruct completed\n", pDrvIns->pReg->szName, pDrvIns->iInstance));