- Timestamp:
- Sep 13, 2009 10:17:34 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 52261
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/ISCSIHDDCore.cpp
r22584 r22982 2704 2704 2705 2705 /** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */ 2706 static int iscsiCheckIfValid(const char *pszFilename )2706 static int iscsiCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk) 2707 2707 { 2708 2708 LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename)); -
trunk/src/VBox/Devices/Storage/ParallelsHDDCore.cpp
r22966 r22982 409 409 410 410 /** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */ 411 static int parallelsCheckIfValid(const char *pszFilename )411 static int parallelsCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk) 412 412 { 413 413 RTFILE File; -
trunk/src/VBox/Devices/Storage/RawHDDCore.cpp
r22966 r22982 464 464 465 465 /** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */ 466 static int rawCheckIfValid(const char *pszFilename )466 static int rawCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk) 467 467 { 468 468 LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename)); -
trunk/src/VBox/Devices/Storage/VBoxHDD-Internal.h
r19176 r22982 81 81 * @returns VBox status code. 82 82 * @param pszFilename Name of the image file. 83 */ 84 DECLR3CALLBACKMEMBER(int, pfnCheckIfValid, (const char *pszFilename)); 83 * @param pVDIfsDisk Pointer to the per-disk VD interface list. 84 */ 85 DECLR3CALLBACKMEMBER(int, pfnCheckIfValid, (const char *pszFilename, PVDINTERFACE pVDIfsDisk)); 85 86 86 87 /** -
trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
r22966 r22982 1106 1106 * ppszFormat contains the string which can be used as backend name. 1107 1107 * VERR_NOT_SUPPORTED if no backend was found. 1108 * @param pVDIfsDisk Pointer to the per-disk VD interface list. 1108 1109 * @param pszFilename Name of the image file for which the backend is queried. 1109 1110 * @param ppszFormat Receives pointer of the UTF-8 string which contains the format name. 1110 1111 * The returned pointer must be freed using RTStrFree(). 1111 1112 */ 1112 VBOXDDU_DECL(int) VDGetFormat( const char *pszFilename, char **ppszFormat)1113 VBOXDDU_DECL(int) VDGetFormat(PVDINTERFACE pVDIfsDisk, const char *pszFilename, char **ppszFormat) 1113 1114 { 1114 1115 int rc = VERR_NOT_SUPPORTED; 1116 PVDINTERFACE pVDIfAsyncIO; 1117 VDINTERFACEASYNCIO VDIAsyncIOCallbacks; 1118 VDINTERFACE VDIAsyncIO; 1115 1119 1116 1120 LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename)); … … 1126 1130 VDInit(); 1127 1131 1132 /* Use the fallback async I/O interface if the caller doesn't provide one. */ 1133 pVDIfAsyncIO = VDInterfaceGet(pVDIfsDisk, VDINTERFACETYPE_ASYNCIO); 1134 if (!pVDIfAsyncIO) 1135 { 1136 VDIAsyncIOCallbacks.cbSize = sizeof(VDINTERFACEASYNCIO); 1137 VDIAsyncIOCallbacks.enmInterface = VDINTERFACETYPE_ASYNCIO; 1138 VDIAsyncIOCallbacks.pfnOpen = vdAsyncIOOpen; 1139 VDIAsyncIOCallbacks.pfnClose = vdAsyncIOClose; 1140 VDIAsyncIOCallbacks.pfnGetSize = vdAsyncIOGetSize; 1141 VDIAsyncIOCallbacks.pfnSetSize = vdAsyncIOSetSize; 1142 VDIAsyncIOCallbacks.pfnReadSync = vdAsyncIOReadSync; 1143 VDIAsyncIOCallbacks.pfnWriteSync = vdAsyncIOWriteSync; 1144 VDIAsyncIOCallbacks.pfnFlushSync = vdAsyncIOFlushSync; 1145 VDIAsyncIOCallbacks.pfnReadAsync = vdAsyncIOReadAsync; 1146 VDIAsyncIOCallbacks.pfnWriteAsync = vdAsyncIOWriteAsync; 1147 VDIAsyncIOCallbacks.pfnFlushAsync = vdAsyncIOFlushAsync; 1148 rc = VDInterfaceAdd(&VDIAsyncIO, "VD_AsyncIO", VDINTERFACETYPE_ASYNCIO, 1149 &VDIAsyncIOCallbacks, NULL, &pVDIfsDisk); 1150 AssertRC(rc); 1151 } 1152 1128 1153 /* Find the backend supporting this file format. */ 1129 1154 for (unsigned i = 0; i < g_cBackends; i++) … … 1131 1156 if (g_apBackends[i]->pfnCheckIfValid) 1132 1157 { 1133 rc = g_apBackends[i]->pfnCheckIfValid(pszFilename );1158 rc = g_apBackends[i]->pfnCheckIfValid(pszFilename, pVDIfsDisk); 1134 1159 if ( RT_SUCCESS(rc) 1135 1160 /* The correct backend has been found, but there is a small -
trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
r22978 r22982 914 914 915 915 /** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */ 916 static int vdiCheckIfValid(const char *pszFilename )916 static int vdiCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk) 917 917 { 918 918 LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename)); … … 940 940 #endif 941 941 pImage->paBlocks = NULL; 942 pImage->pVDIfsDisk = NULL;942 pImage->pVDIfsDisk = pVDIfsDisk; 943 943 944 944 rc = vdiOpenImage(pImage, VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_READONLY); -
trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp
r22966 r22982 767 767 } 768 768 769 static int vhdCheckIfValid(const char *pszFilename )769 static int vhdCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk) 770 770 { 771 771 int rc = VINF_SUCCESS; -
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r22966 r22982 4390 4390 4391 4391 /** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */ 4392 static int vmdkCheckIfValid(const char *pszFilename )4392 static int vmdkCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk) 4393 4393 { 4394 4394 LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename)); … … 4416 4416 pImage->pGTCache = NULL; 4417 4417 pImage->pDescData = NULL; 4418 pImage->pVDIfsDisk = NULL;4418 pImage->pVDIfsDisk = pVDIfsDisk; 4419 4419 /** @todo speed up this test open (VD_OPEN_FLAGS_INFO) by skipping as 4420 4420 * much as possible in vmdkOpenImage. */ -
trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp
r17970 r22982 539 539 { 540 540 RTFileClose(File); 541 rc = VDGetFormat( pszBaseFilename, &pszFormat);541 rc = VDGetFormat(NULL, pszBaseFilename, &pszFormat); 542 542 RTPrintf("VDGetFormat() pszFormat=%s rc=%Rrc\n", pszFormat, rc); 543 543 if (RT_SUCCESS(rc) && strcmp(pszFormat, pszBackend)) -
trunk/src/VBox/Devices/Storage/testcase/tstVDCopy.cpp
r20417 r22982 101 101 AssertRC(rc); 102 102 103 rc = VDGetFormat( argv[1], &pszVD1);103 rc = VDGetFormat(NULL, argv[1], &pszVD1); 104 104 CHECK("VDGetFormat() hdd1"); 105 105 106 rc = VDGetFormat( argv[2], &pszVD2);106 rc = VDGetFormat(NULL, argv[2], &pszVD2); 107 107 CHECK("VDGetFormat() hdd2"); 108 108 -
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r22173 r22982 510 510 /* just try it */ 511 511 char *pszFormat = NULL; 512 int rc = VDGetFormat( argv[0], &pszFormat);512 int rc = VDGetFormat(NULL, argv[0], &pszFormat); 513 513 if (RT_FAILURE(rc)) 514 514 { … … 578 578 /* just try it */ 579 579 char *pszFormat = NULL; 580 int rc = VDGetFormat( argv[0], &pszFormat);580 int rc = VDGetFormat(NULL, argv[0], &pszFormat); 581 581 if (RT_FAILURE(rc)) 582 582 { … … 1519 1519 { 1520 1520 char *pszFormat = NULL; 1521 vrc = VDGetFormat( Utf8Str(src).raw(), &pszFormat);1521 vrc = VDGetFormat(NULL, Utf8Str(src).raw(), &pszFormat); 1522 1522 if (RT_FAILURE(vrc)) 1523 1523 { … … 1666 1666 { 1667 1667 char *pszFormat = NULL; 1668 vrc = VDGetFormat( Utf8Str(src).raw(), &pszFormat);1668 vrc = VDGetFormat(NULL, Utf8Str(src).raw(), &pszFormat); 1669 1669 if (RT_FAILURE(vrc)) 1670 1670 { -
trunk/src/VBox/Main/HardDiskImpl.cpp
r22779 r22982 3008 3008 if (RT_SUCCESS(vrc)) 3009 3009 { 3010 vrc = VDGetFormat( locationFull.c_str(), &backendName);3010 vrc = VDGetFormat(NULL, locationFull.c_str(), &backendName); 3011 3011 } 3012 3012 else if (vrc != VERR_FILE_NOT_FOUND && vrc != VERR_PATH_NOT_FOUND) … … 3014 3014 /* assume it's not a file, restore the original location */ 3015 3015 location = locationFull = aLocation; 3016 vrc = VDGetFormat( locationFull.c_str(), &backendName);3016 vrc = VDGetFormat(NULL, locationFull.c_str(), &backendName); 3017 3017 } 3018 3018
Note:
See TracChangeset
for help on using the changeset viewer.