VirtualBox

Changeset 51290 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
May 19, 2014 2:50:15 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93761
Message:

VMM/PDMUsb: add PDMR3UsbQueryLun function which is needed very soon for mounting media at run time in virtual USB DVD drives

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp

    r49092 r51290  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    13941394
    13951395    LogFlow(("PDMR3UsbDriverDetach: returns %Rrc\n", rc));
     1396    return rc;
     1397}
     1398
     1399
     1400/**
     1401 * Query the interface of the top level driver on a LUN.
     1402 *
     1403 * @returns VBox status code.
     1404 * @param   pUVM            The user mode VM handle.
     1405 * @param   pszDevice       Device name.
     1406 * @param   iInstance       Device instance.
     1407 * @param   iLun            The Logical Unit to obtain the interface of.
     1408 * @param   ppBase          Where to store the base interface pointer.
     1409 * @remark  We're not doing any locking ATM, so don't try call this at times when the
     1410 *          device chain is known to be updated.
     1411 */
     1412VMMR3DECL(int)  PDMR3UsbQueryLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
     1413{
     1414    LogFlow(("PDMR3UsbQueryLun: pszDevice=%p:{%s} iInstance=%u iLun=%u ppBase=%p\n",
     1415             pszDevice, pszDevice, iInstance, iLun, ppBase));
     1416    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1417    PVM pVM = pUVM->pVM;
     1418    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     1419
     1420    /*
     1421     * Find the LUN.
     1422     */
     1423    PPDMLUN pLun;
     1424    int rc = pdmR3UsbFindLun(pVM, pszDevice, iInstance, iLun, &pLun);
     1425    if (RT_SUCCESS(rc))
     1426    {
     1427        if (pLun->pTop)
     1428        {
     1429            *ppBase = &pLun->pTop->IBase;
     1430            LogFlow(("PDMR3UsbQueryLun: return %Rrc and *ppBase=%p\n", VINF_SUCCESS, *ppBase));
     1431            return VINF_SUCCESS;
     1432        }
     1433        rc = VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN;
     1434    }
     1435    LogFlow(("PDMR3UsbQueryLun: returns %Rrc\n", rc));
    13961436    return rc;
    13971437}
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r49324 r51290  
    44
    55;
    6 ; Copyright (C) 2010-2013 Oracle Corporation
     6; Copyright (C) 2010-2014 Oracle Corporation
    77;
    88; This file is part of VirtualBox Open Source Edition (OSE), as
     
    193193    PDMR3UsbDriverAttach
    194194    PDMR3UsbDriverDetach
     195    PDMR3UsbQueryLun
    195196
    196197    PGMHandlerPhysicalPageTempOff
Note: See TracChangeset for help on using the changeset viewer.

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