Skip to content

Add qemu-img checksum command using blkhash

Nir Soffer qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 8 repliesIn review
  2. v13 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- Move IO_BUF_SIZE to top of the file
- Extend TestFinder to support format or cache specific out files
- Improve online help (note about optimization and lint to blkhash project)
- Guard blkhash.h include with CONFIG_BLKHASH
- Using user_creatable_process_cmdline() instead of user_creatable_add_from_str()
- Rename ret to exit_code
- Add static assert to ensure that read buffer is algined to block size
- Drop unneeded pnum variable
- Change test to work like other tests; use iotest.imgfmt and iotest.cachemode
- Simplify test to test only raw and qcow2 format using file protocol
- Fix code style issues (multi-line comments, missing braces)
- Make error checking more clear (checksum_block_status(s) < 0)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5qemu-img.c: Move IO_BUF_SIZE to the top of the fileqemu-img.c+1 -21 reply
2/5Support format or cache specific out filetests/qemu-iotests/findtests.py+8 -24 replies
3/5qemu-img: Add checksum commanddocs/tools/qemu-img.rst meson.build meson_options.txt +2 more+226 -11 reply
4/5iotests: Test qemu-img checksumtests/qemu-iotests/tests/qemu-img-checksum tests/qemu-iotests/tests/qemu-img-checksum.out.qcow2 tests/qemu-iotests/tests/qemu-img-checksum.out.raw+84 -01 reply
5/5qemu-img: Speed up checksumqemu-img.c+277 -731 reply

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchHanna Reitz
1/5R-b
2/5
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] Add qemu-img checksum command using blkhash

Since blkhash is available only via copr now, the new command is added as optional feature, built only if blkhash-devel package is installed.

Changes since v1 (Hanna):
- Move IO_BUF_SIZE to top of the file
- Extend TestFinder to support format or cache specific out files
- Improve online help (note about optimization and lint to blkhash project)
- Guard blkhash.h include with CONFIG_BLKHASH
- Using user_creatable_process_cmdline() instead of user_creatable_add_from_str()
- Rename ret to exit_code
- Add static assert to ensure that read buffer is algined to block size
- Drop unneeded pnum variable
- Change test to work like other tests; use iotest.imgfmt and iotest.cachemode
- Simplify test to test only raw and qcow2 format using file protocol
- Fix code style issues (multi-line comments, missing braces)
- Make error checking more clear (checksum_block_status(s) < 0)

v1:
https://lists.nongnu.org/archive/html/qemu-block/2022-09/msg00021.html

v1 discussion:
- https://lists.nongnu.org/archive/html/qemu-block/2022-10/msg00602.html
- https://lists.nongnu.org/archive/html/qemu-block/2022-10/msg00603.html
- https://lists.nongnu.org/archive/html/qemu-block/2022-10/msg00604.html
- https://lists.nongnu.org/archive/html/qemu-block/2022-11/msg00171.html
- https://lists.nongnu.org/archive/html/qemu-block/2022-11/msg00173.html

Nir Soffer (5):
qemu-img.c: Move IO_BUF_SIZE to the top of the file Support format or cache specific out file
qemu-img: Add checksum command
iotests: Test qemu-img checksum
qemu-img: Speed up checksum

 docs/tools/qemu-img.rst                       |  24 ++
 meson.build                                   |  10 +-
 meson_options.txt                             |   2 +
 qemu-img-cmds.hx                              |   8 +
 qemu-img.c                                    | 390 +++++++++++++++++-
 tests/qemu-iotests/findtests.py               |  10 +-
 tests/qemu-iotests/tests/qemu-img-checksum    |  63 +++
 .../tests/qemu-img-checksum.out.qcow2         |  11 +
 .../tests/qemu-img-checksum.out.raw           |  10 +
 9 files changed, 523 insertions(+), 5 deletions(-)
 create mode 100755 tests/qemu-iotests/tests/qemu-img-checksum
 create mode 100644 tests/qemu-iotests/tests/qemu-img-checksum.out.qcow2
 create mode 100644 tests/qemu-iotests/tests/qemu-img-checksum.out.raw
Signature · 1 line
2.38.1