forked from kubevirt/containerized-data-importer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VDDK: Fix NBD status coalescing for large blocks. (kubevirt#3242)
* Mock NBD functions in VDDK unit tests. Also add some example tests for GetBlockStatus. Signed-off-by: Matthew Arnold <[email protected]> * Avoid infinite loop by returning whole block. Also add a unit test to trigger this code. Without the fix, this spins "No new block status data" messages forever, as reported in the bug. With the fix, this continues the data transfer without zero-range or hole-punch optimizations. Signed-off-by: Matthew Arnold <[email protected]> * Correctly extend merged block length. Bring in the previously proposed fix to make sure merged blocks have correct lengths, avoiding the initial issue. Signed-off-by: Matthew Arnold <[email protected]> * Add two more GetBlockStatus unit tests. Hopefully this makes it more obvious what GetBlockStatus actually does. Signed-off-by: Matthew Arnold <[email protected]> * Add unit tests for larger block sizes. The first test intentionally overflows the result block's length field and causes an infinite loop in GetBlockStatus, as pointed out in the problem report. This will be fixed in the next commit. Signed-off-by: Matthew Arnold <[email protected]> * Avoid integer overflow and sort out casts. Increase the size of BlockStatusData.Length to an int64, to avoid overflow in GetBlockStatus. Also change BlockStatusData.Offset to an int64 and remove a handful of unnerving integer conversions. Favor int64 over uint64 to match system libraries, and add a few necessary conversions mostly isolated to libnbd interfaces. Signed-off-by: Matthew Arnold <[email protected]> * Fix alignment for multi-stage VDDK documentation. Signed-off-by: Matthew Arnold <[email protected]> --------- Signed-off-by: Matthew Arnold <[email protected]>
- Loading branch information
Showing
3 changed files
with
311 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.