xapi-project / vhd-tool

Command-line tools for streaming and manipulating vhd format data
Other
8 stars 26 forks source link

CP-29300: Update get_nbd_extents.py to match latest NBD protocol #76

Closed gaborigloi closed 6 years ago

gaborigloi commented 6 years ago

The protocol has been changed, so that now in the response for NBD_REPLY_TYPE_BLOCK_STATUS, the last extent can extend beyond the requested area. The old code would fail with an assertion error in this case. I've fixed the code to correctly deal with this corner case.

gaborigloi commented 6 years ago

All the quicktests passed with a GFS2 SR

gaborigloi commented 6 years ago

The relevant change in the protocol: https://lists.debian.org/nbd/2018/08/msg00005.html

thomasmck commented 6 years ago

What testing have you done of the change?

gaborigloi commented 6 years ago

I have run the ocaml quicktests that include copying / exporting an empty VDI, a VDI after a random number of random writes, and a VDI filled with random data. These tests verify that the checksum of the result is the same.