vbox的更動 44233 路徑 trunk/src/VBox/Storage/QCOW.cpp
- 時間撮記:
- 2013-1-4 下午08:39:56 (12 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Storage/QCOW.cpp
r44232 r44233 705 705 pL2Entry->offL2Tbl = offL2Tbl; 706 706 rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, offL2Tbl, 707 pL2Entry->paL2Tbl, pImage->cbL2Table , NULL);707 pL2Entry->paL2Tbl, pImage->cbL2Table); 708 708 if (RT_SUCCESS(rc)) 709 709 { … … 757 757 758 758 pL2Entry->offL2Tbl = offL2Tbl; 759 rc = vdIfIoIntFileReadMeta Async(pImage->pIfIo, pImage->pStorage,760 761 762 759 rc = vdIfIoIntFileReadMeta(pImage->pIfIo, pImage->pStorage, 760 offL2Tbl, pL2Entry->paL2Tbl, 761 pImage->cbL2Table, pIoCtx, 762 &pMetaXfer, NULL, NULL); 763 763 if (RT_SUCCESS(rc)) 764 764 { … … 1018 1018 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, 1019 1019 pImage->offL1Table, paL1TblImg, 1020 pImage->cbL1Table , NULL);1020 pImage->cbL1Table); 1021 1021 RTMemFree(paL1TblImg); 1022 1022 } … … 1026 1026 /* Write L1 table directly. */ 1027 1027 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, pImage->offL1Table, 1028 pImage->paL1Table, pImage->cbL1Table , NULL);1028 pImage->paL1Table, pImage->cbL1Table); 1029 1029 #endif 1030 1030 if (RT_SUCCESS(rc)) … … 1034 1034 qcowHdrConvertFromHostEndianess(pImage, &Header, &cbHeader); 1035 1035 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, 0, &Header, 1036 cbHeader , NULL);1036 cbHeader); 1037 1037 if (RT_SUCCESS(rc)) 1038 1038 rc = vdIfIoIntFileFlushSync(pImage->pIfIo, pImage->pStorage); … … 1065 1065 qcowTableConvertFromHostEndianess(paL1TblImg, pImage->paL1Table, 1066 1066 pImage->cL1TableEntries); 1067 rc = vdIfIoIntFileWriteMeta Async(pImage->pIfIo, pImage->pStorage,1068 1069 1067 rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pImage->pStorage, 1068 pImage->offL1Table, paL1TblImg, 1069 pImage->cbL1Table, pIoCtx, NULL, NULL); 1070 1070 RTMemFree(paL1TblImg); 1071 1071 } … … 1074 1074 #else 1075 1075 /* Write L1 table directly. */ 1076 rc = vdIfIoIntFileWriteMeta Async(pImage->pIfIo, pImage->pStorage,1077 1078 1076 rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pImage->pStorage, 1077 pImage->offL1Table, pImage->paL1Table, 1078 pImage->cbL1Table, pIoCtx, NULL, NULL); 1079 1079 #endif 1080 1080 if (RT_SUCCESS(rc) || rc == VERR_VD_ASYNC_IO_IN_PROGRESS) … … 1083 1083 size_t cbHeader = 0; 1084 1084 qcowHdrConvertFromHostEndianess(pImage, &Header, &cbHeader); 1085 rc = vdIfIoIntFileWriteMeta Async(pImage->pIfIo, pImage->pStorage,1086 1087 1085 rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pImage->pStorage, 1086 0, &Header, cbHeader, 1087 pIoCtx, NULL, NULL); 1088 1088 if (RT_SUCCESS(rc) || rc == VERR_VD_ASYNC_IO_IN_PROGRESS) 1089 rc = vdIfIoIntFileFlush Async(pImage->pIfIo, pImage->pStorage,1090 1089 rc = vdIfIoIntFileFlush(pImage->pIfIo, pImage->pStorage, 1090 pIoCtx, NULL, NULL); 1091 1091 } 1092 1092 } … … 1167 1167 if (cbFile > sizeof(Header)) 1168 1168 { 1169 rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, 0, &Header, sizeof(Header) , NULL);1169 rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, 0, &Header, sizeof(Header)); 1170 1170 if ( RT_SUCCESS(rc) 1171 1171 && qcowHdrConvertToHostEndianess(&Header)) … … 1247 1247 rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, 1248 1248 pImage->offBackingFilename, pImage->pszBackingFilename, 1249 pImage->cbBackingFilename , NULL);1249 pImage->cbBackingFilename); 1250 1250 } 1251 1251 else … … 1264 1264 rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, 1265 1265 pImage->offRefcountTable, pImage->paRefcountTable, 1266 pImage->cbRefcountTable , NULL);1266 pImage->cbRefcountTable); 1267 1267 if (RT_SUCCESS(rc)) 1268 1268 qcowTableConvertToHostEndianess(pImage->paRefcountTable, … … 1290 1290 rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, 1291 1291 pImage->offL1Table, pImage->paL1Table, 1292 pImage->cbL1Table , NULL);1292 pImage->cbL1Table); 1293 1293 if (RT_SUCCESS(rc)) 1294 1294 qcowTableConvertToHostEndianess(pImage->paL1Table, pImage->cL1TableEntries); … … 1469 1469 /* Update the link in the on disk L1 table now. */ 1470 1470 pClusterAlloc->enmAllocState = QCOWCLUSTERASYNCALLOCSTATE_L2_LINK; 1471 rc = vdIfIoIntFileWriteMeta Async(pImage->pIfIo, pImage->pStorage,1472 1473 1474 1471 rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pImage->pStorage, 1472 pImage->offL1Table + pClusterAlloc->idxL1*sizeof(uint64_t), 1473 &offUpdateLe, sizeof(uint64_t), pIoCtx, 1474 qcowAsyncClusterAllocUpdate, pClusterAlloc); 1475 1475 if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS) 1476 1476 break; … … 1497 1497 1498 1498 /* Write data. */ 1499 rc = vdIfIoIntFileWriteUser Async(pImage->pIfIo, pImage->pStorage,1500 1501 1499 rc = vdIfIoIntFileWriteUser(pImage->pIfIo, pImage->pStorage, 1500 offData, pIoCtx, pClusterAlloc->cbToWrite, 1501 qcowAsyncClusterAllocUpdate, pClusterAlloc); 1502 1502 if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS) 1503 1503 break; … … 1516 1516 1517 1517 /* Link L2 table and update it. */ 1518 rc = vdIfIoIntFileWriteMeta Async(pImage->pIfIo, pImage->pStorage,1519 1520 1521 1518 rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pImage->pStorage, 1519 pImage->paL1Table[pClusterAlloc->idxL1] + pClusterAlloc->idxL2*sizeof(uint64_t), 1520 &offUpdateLe, sizeof(uint64_t), pIoCtx, 1521 qcowAsyncClusterAllocUpdate, pClusterAlloc); 1522 1522 if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS) 1523 1523 break; … … 1581 1581 QCowHeader Header; 1582 1582 1583 rc = vdIfIoIntFileReadSync(pIfIo, pStorage, 0, &Header, sizeof(Header) , NULL);1583 rc = vdIfIoIntFileReadSync(pIfIo, pStorage, 0, &Header, sizeof(Header)); 1584 1584 if ( RT_SUCCESS(rc) 1585 1585 && qcowHdrConvertToHostEndianess(&Header)) … … 1823 1823 LogFlowFunc(("offFile=%llu\n", offFile)); 1824 1824 rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, offFile, 1825 pvBuf, cbToRead , NULL);1825 pvBuf, cbToRead); 1826 1826 } 1827 1827 … … 1877 1877 if (RT_SUCCESS(rc)) 1878 1878 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, offImage, 1879 pvBuf, cbToWrite , NULL);1879 pvBuf, cbToWrite); 1880 1880 else if (rc == VERR_VD_BLOCK_FREE) 1881 1881 { … … 1915 1915 */ 1916 1916 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, offL2Tbl, 1917 pL2Entry->paL2Tbl, pImage->cbL2Table , NULL);1917 pL2Entry->paL2Tbl, pImage->cbL2Table); 1918 1918 if (RT_FAILURE(rc)) 1919 1919 break; … … 1924 1924 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, 1925 1925 pImage->offL1Table + idxL1*sizeof(uint64_t), 1926 &idxUpdateLe, sizeof(uint64_t) , NULL);1926 &idxUpdateLe, sizeof(uint64_t)); 1927 1927 if (RT_FAILURE(rc)) 1928 1928 break; … … 1938 1938 /* Write data. */ 1939 1939 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, 1940 offData, pvBuf, cbToWrite , NULL);1940 offData, pvBuf, cbToWrite); 1941 1941 if (RT_FAILURE(rc)) 1942 1942 break; … … 1947 1947 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, 1948 1948 pImage->paL1Table[idxL1] + idxL2*sizeof(uint64_t), 1949 &idxUpdateLe, sizeof(uint64_t) , NULL);1949 &idxUpdateLe, sizeof(uint64_t)); 1950 1950 qcowL2TblCacheEntryRelease(pL2Entry); 1951 1951 } … … 2493 2493 pImage->offBackingFilename, 2494 2494 pImage->pszBackingFilename, 2495 strlen(pImage->pszBackingFilename), 2496 NULL); 2495 strlen(pImage->pszBackingFilename)); 2497 2496 } 2498 2497 } … … 2543 2542 &offFile); 2544 2543 if (RT_SUCCESS(rc)) 2545 rc = vdIfIoIntFileReadUser Async(pImage->pIfIo, pImage->pStorage, offFile,2546 2544 rc = vdIfIoIntFileReadUser(pImage->pIfIo, pImage->pStorage, offFile, 2545 pIoCtx, cbToRead); 2547 2546 2548 2547 if ( ( RT_SUCCESS(rc) … … 2605 2604 &offImage); 2606 2605 if (RT_SUCCESS(rc)) 2607 rc = vdIfIoIntFileWriteUser Async(pImage->pIfIo, pImage->pStorage,2608 2606 rc = vdIfIoIntFileWriteUser(pImage->pIfIo, pImage->pStorage, 2607 offImage, pIoCtx, cbToWrite, NULL, NULL); 2609 2608 else if (rc == VERR_VD_BLOCK_FREE) 2610 2609 { … … 2661 2660 * is a leak of some clusters. 2662 2661 */ 2663 rc = vdIfIoIntFileWriteMeta Async(pImage->pIfIo, pImage->pStorage,2664 2665 2662 rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pImage->pStorage, 2663 offL2Tbl, pL2Entry->paL2Tbl, pImage->cbL2Table, pIoCtx, 2664 qcowAsyncClusterAllocUpdate, pL2ClusterAlloc); 2666 2665 if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS) 2667 2666 break; … … 2704 2703 2705 2704 /* Write data. */ 2706 rc = vdIfIoIntFileWriteUser Async(pImage->pIfIo, pImage->pStorage,2707 2708 2705 rc = vdIfIoIntFileWriteUser(pImage->pIfIo, pImage->pStorage, 2706 offData, pIoCtx, cbToWrite, 2707 qcowAsyncClusterAllocUpdate, pDataClusterAlloc); 2709 2708 if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS) 2710 2709 break;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器