VirtualBox

Changeset 14960 in vbox for trunk/src


Ignore:
Timestamp:
Dec 3, 2008 9:26:46 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40321
Message:

backed out r40315 as it breaks the tinderboxes

Location:
trunk/src/VBox/Devices/Storage
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/RawHDDCore.cpp

    r14954 r14960  
    11671167    rawAsyncRead,
    11681168    /* pfnAsyncWrite */
    1169     rawAsyncWrite,
    1170     /* pfnComposeLocation */
    1171     genericFileComposeLocation,
    1172     /* pfnComposeName */
    1173     genericFileComposeName
     1169    rawAsyncWrite
    11741170};
    11751171
  • trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp

    r14954 r14960  
    761761    }
    762762
    763     for (unsigned i = 0; i < g_cBackends; i++)
    764     {
    765         pEntries[i].pszBackend = g_apBackends[i]->pszBackendName;
    766         pEntries[i].uBackendCaps = g_apBackends[i]->uBackendCaps;
    767         pEntries[i].papszFileExtensions = g_apBackends[i]->papszFileExtensions;
    768         pEntries[i].pfnComposeLocation = g_apBackends[i]->pfnComposeLocation;
    769         pEntries[i].pfnComposeName = g_apBackends[i]->pfnComposeName;
    770     }
     763     for (unsigned i = 0; i < g_cBackends; i++)
     764     {
     765         pEntries[i].pszBackend = g_apBackends[i]->pszBackendName;
     766         pEntries[i].uBackendCaps = g_apBackends[i]->uBackendCaps;
     767         pEntries[i].papszFileExtensions = g_apBackends[i]->papszFileExtensions;
     768         pEntries[i].paConfigInfo = g_apBackends[i]->paConfigInfo;
     769     }
    771770
    772771    LogFlowFunc(("returns %Rrc *pcEntriesUsed=%u\n", rc, cEntries));
     
    35533552}
    35543553
    3555 #if 0
    3556 /** @copydoc VBOXHDDBACKEND::pfnComposeLocation */
    3557 int genericFileComposeLocation(PVDINTERFACE pConfig, char **pszLocation)
    3558 {
    3559     return NULL;
    3560 }
    3561 
    3562 
    3563 /** @copydoc VBOXHDDBACKEND::pfnComposeName */
    3564 int genericFileComposeName(PVDINTERFACE pConfig, char **pszName)
    3565 {
    3566     return NULL;
    3567 }
    3568 #endif
  • trunk/src/VBox/Devices/Storage/VBoxHDD-newInternal.h

    r14954 r14960  
    494494                                              PPDMDATASEG paSeg, unsigned cSeg, void *pvUser));
    495495
    496     /** Returns a human readable hard disk location string given a
    497      *  set of hard disk configuration keys. The returned string is an
    498      *  equivalent of the full file path for image-based hard disks.
    499      *  Mandatory for backends with no VD_CAP_FILE and NULL otherwise. */
    500     DECLR3CALLBACKMEMBER(int, pfnComposeLocation, (PVDINTERFACE pConfig, char **pszLocation));
    501 
    502     /** Returns a human readable hard disk name string given a
    503      *  set of hard disk configuration keys. The returned string is an
    504      *  equivalent of the file name part in the full file path for
    505      *  image-based hard disks. Mandatory for backends with no
    506      *  VD_CAP_FILE and NULL otherwise. */
    507     DECLR3CALLBACKMEMBER(int, pfnComposeName, (PVDINTERFACE pConfig, char **pszName));
    508 
    509496} VBOXHDDBACKEND;
    510497
     
    514501/** Constant pointer to VD backend. */
    515502typedef const VBOXHDDBACKEND *PCVBOXHDDBACKEND;
    516 
    517 /** @copydoc VBOXHDDBACKEND::pfnComposeLocation */
    518 DECLINLINE(int) genericFileComposeLocation(PVDINTERFACE pConfig, char **pszLocation)
    519 {
    520     *pszLocation = NULL;
    521     return VINF_SUCCESS;
    522 }
    523 /** @copydoc VBOXHDDBACKEND::pfnComposeName */
    524 DECLINLINE(int) genericFileComposeName(PVDINTERFACE pConfig, char **pszName)
    525 {
    526     *pszName = NULL;
    527     return VINF_SUCCESS;
    528 }
    529503
    530504/** Initialization entry point. */
  • trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp

    r14954 r14960  
    19461946    vdiAsyncRead,
    19471947    /* pfnAsyncWrite */
    1948     vdiAsyncWrite,
    1949     /* pfnComposeLocation */
    1950     genericFileComposeLocation,
    1951     /* pfnComposeName */
    1952     genericFileComposeName
     1948    vdiAsyncWrite
    19531949};
    19541950
  • trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp

    r14954 r14960  
    19521952    vhdAsyncRead,
    19531953    /* pfnAsyncWrite */
    1954     vhdAsyncWrite,
    1955     /* pfnComposeLocation */
    1956     genericFileComposeLocation,
    1957     /* pfnComposeName */
    1958     genericFileComposeName
     1954    vhdAsyncWrite
    19591955};
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r14954 r14960  
    53945394    vmdkAsyncRead,
    53955395    /* pfnAsyncWrite */
    5396     vmdkAsyncWrite,
    5397     /* pfnComposeLocation */
    5398     genericFileComposeLocation,
    5399     /* pfnComposeName */
    5400     genericFileComposeName
     5396    vmdkAsyncWrite
    54015397};
  • trunk/src/VBox/Devices/Storage/testcase/tstVD-2.cpp

    r14954 r14960  
    3737unsigned g_cErrors = 0;
    3838
    39 static struct KeyValuePair {
    40     const char *key;
    41     const char *value;
    42 } aCfgNode[] = {
    43     { "TargetName", "test" },
    44     { "LUN", "1" },
    45     { "TargetAddress", "address" },
    46     { NULL, NULL }
    47 };
    48 
    49 static bool tstAreKeysValid(void *pvUser, const char *pszzValid)
    50 {
    51     return true;
    52 }
    53 
    54 static const char *tstGetValueByKey(const char *pszKey)
    55 {
    56     for (int i = 0; aCfgNode[i].key; i++)
    57         if (!strcmp(aCfgNode[i].key, pszKey))
    58             return aCfgNode[i].value;
    59     return NULL;
    60 }
    61 
    62 static int tstQuerySize(void *pvUser, const char *pszName, size_t *pcbValue)
    63 {
    64     const char *pszValue = tstGetValueByKey(pszName);
    65     if (!pszValue)
    66         return VERR_CFGM_VALUE_NOT_FOUND;
    67     *pcbValue = strlen(pszValue) + 1;
    68     return VINF_SUCCESS;
    69 }
    70 
    71 static int tstQuery(void *pvUser, const char *pszName, char *pszValue, size_t cchValue)
    72 {
    73     const char *pszTmp = tstGetValueByKey(pszName);
    74     if (!pszValue)
    75         return VERR_CFGM_VALUE_NOT_FOUND;
    76     size_t cchTmp = strlen(pszTmp) + 1;
    77     if (cchValue < cchTmp)
    78         return VERR_CFGM_NOT_ENOUGH_SPACE;
    79     memcpy(pszValue, pszTmp, cchTmp);
    80     return VINF_SUCCESS;
    81 }
    82 
    83 
    84 VDINTERFACECONFIG icc = {
    85     sizeof(VDINTERFACECONFIG),
    86     VDINTERFACETYPE_CONFIG,
    87     tstAreKeysValid,
    88     tstQuerySize,
    89     tstQuery
    90 };
    9139
    9240static int tstVDBackendInfo(void)
     
    181129            RTPrintf("<NONE>");
    182130        RTPrintf("\n");
    183 
    184         VDINTERFACE ic;
    185         ic.cbSize = sizeof(ic);
    186         ic.enmInterface = VDINTERFACETYPE_CONFIG;
    187         ic.pCallbacks = &icc;
    188         char *pszLocation, *pszName;
    189         rc = aVDInfo[i].pfnComposeLocation(&ic, &pszLocation);
    190         CHECK("pfnComposeLocation()");
    191         if (pszLocation)
    192         {
    193             RTMemFree(pszLocation);
    194             if (aVDInfo[i].uBackendCaps & VD_CAP_FILE)
    195             {
    196                 RTPrintf("Non-NULL location returned for file-based backend!\n");
    197                 return VERR_INTERNAL_ERROR;
    198             }
    199         }
    200         rc = aVDInfo[i].pfnComposeName(&ic, &pszName);
    201         CHECK("pfnComposeName()");
    202         if (pszName)
    203         {
    204             RTMemFree(pszName);
    205             if (aVDInfo[i].uBackendCaps & VD_CAP_FILE)
    206             {
    207                 RTPrintf("Non-NULL name returned for file-based backend!\n");
    208                 return VERR_INTERNAL_ERROR;
    209             }
    210         }
    211131    }
    212132
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