Continuation of my v4 patches which started here: https://listman.redhat.com/archives/libguestfs/2023-July/032077.html
and compared to my v3 patches here: https://listman.redhat.com/archives/libguestfs/2023-May/031617.html Most of the differences from the earlier version is in the front end: Laszlo had some good suggestions about reworking how 64-bit server replies are handled without doing an in-place widening or narrowing, and without introducing a callback shim. I also split up the OCaml patches to focus on one language binding at a time, instead of all at once. Many of the later patches are unchanged because the API addition is still the same, all that differs was how it was implemented internally. Also new at the end is an additional strictness flag that can be cleared to intentionally send or omit the PAYLOAD_LEN flag for the purposes of server integration testing. 001/25:[down] 'block_status: Add some sanity checking of server lengths' 002/25:[down] 'generator: Add Extent64 arg type for upcoming use' 003/25:[down] 'generator: Support Extent64 arg in C code' 004/25:[down] 'generator: Support Extent64 arg in Python code' 005/25:[down] 'golang: Change logic of copy_uint32_array' 006/25:[down] 'generator: Support Extent64 arg in Go code' 007/25:[down] 'generator: Support Extent64 arg in OCaml code' 008/25:[0214] [FC] 'block_status: Accept 64-bit extents during block status' 009/25:[down] 'generator: Prepare for extent64 callback' 010/25:[0387] [FC] 'api: Add [aio_]nbd_block_status_64' 011/25:[down] 'api: Add tests for [aio_]nbd_block_status_64' 012/25:[----] [--] 'api: Add several functions for controlling extended headers' 013/25:[----] [--] 'copy: Update nbdcopy to use 64-bit block status' 014/25:[----] [--] 'dump: Update nbddump to use 64-bit block status' 015/25:[down] 'info: Add --has alias for --can' 016/25:[0016] [FC] 'info: Expose extended-headers support through nbdinfo' 017/25:[----] [--] 'info: Update nbdinfo --map to use 64-bit block status' 018/25:[----] [--] 'examples: Update copy-libev to use 64-bit block status' 019/25:[----] [--] 'ocaml: Add example for 64-bit extents' 020/25:[----] [--] 'generator: Actually request extended headers' 021/25:[----] [--] 'api: Add nbd_[aio_]opt_extended_headers()' 022/25:[0012] [FC] 'interop: Add test of 64-bit block status' 023/25:[0040] [FC] 'api: Add nbd_can_block_status_payload()' 024/25:[0010] [FC] 'api: Add nbd_[aio_]block_status_filter()' 025/25:[down] 'api: Add LIBNBD_STRICT_AUTO_FLAG control to nbd_set_strict' Eric Blake (25): block_status: Add some sanity checking of server lengths generator: Add Extent64 arg type for upcoming use generator: Support Extent64 arg in C code generator: Support Extent64 arg in Python code golang: Change logic of copy_uint32_array generator: Support Extent64 arg in Go code generator: Support Extent64 arg in OCaml code block_status: Accept 64-bit extents during block status generator: Prepare for extent64 callback api: Add [aio_]nbd_block_status_64 api: Add tests for [aio_]nbd_block_status_64 api: Add several functions for controlling extended headers copy: Update nbdcopy to use 64-bit block status dump: Update nbddump to use 64-bit block status info: Add --has alias for --can info: Expose extended-headers support through nbdinfo info: Update nbdinfo --map to use 64-bit block status examples: Update copy-libev to use 64-bit block status ocaml: Add example for 64-bit extents generator: Actually request extended headers api: Add nbd_[aio_]opt_extended_headers() interop: Add test of 64-bit block status api: Add nbd_can_block_status_payload() api: Add nbd_[aio_]block_status_filter() api: Add LIBNBD_STRICT_AUTO_FLAG control to nbd_set_strict docs/libnbd.pod | 18 +- info/nbdinfo.pod | 46 +- sh/nbdsh.pod | 2 +- lib/internal.h | 26 +- lib/nbd-protocol.h | 7 + generator/API.mli | 1 + generator/API.ml | 542 +++++++++++++++--- generator/state_machine.ml | 41 ++ generator/states-newstyle.c | 3 + .../states-newstyle-opt-extended-headers.c | 110 ++++ generator/states-newstyle-opt-starttls.c | 7 +- .../states-newstyle-opt-structured-reply.c | 3 +- generator/states-issue-command.c | 4 +- generator/states-reply-chunk.c | 213 +++++-- generator/C.ml | 19 + generator/GoLang.ml | 40 +- generator/Makefile.am | 1 + generator/OCaml.ml | 20 +- generator/Python.ml | 23 +- lib/aio.c | 12 +- lib/flags.c | 12 + lib/handle.c | 26 +- lib/opt.c | 44 ++ lib/rw.c | 240 +++++++- python/t/110-defaults.py | 1 + python/t/120-set-non-defaults.py | 2 + python/t/465-block-status-64.py | 56 ++ ocaml/examples/Makefile.am | 1 + ocaml/examples/extents64.ml | 42 ++ ocaml/helpers.c | 21 + ocaml/nbd-c.h | 1 + ocaml/tests/Makefile.am | 1 + ocaml/tests/test_110_defaults.ml | 2 + ocaml/tests/test_120_set_non_defaults.ml | 3 + ocaml/tests/test_465_block_status_64.ml | 58 ++ tests/meta-base-allocation.c | 104 +++- examples/copy-libev.c | 21 +- examples/server-flags.c | 7 +- interop/Makefile.am | 18 + interop/block-status-64.c | 186 ++++++ interop/block-status-64.sh | 49 ++ interop/block-status-payload.c | 241 ++++++++ interop/block-status-payload.sh | 80 +++ interop/opt-extended-headers.c | 153 +++++ interop/opt-extended-headers.sh | 29 + .gitignore | 3 + copy/nbd-ops.c | 22 +- dump/dump.c | 27 +- fuzzing/libnbd-fuzz-wrapper.c | 20 +- golang/Makefile.am | 1 + golang/handle.go | 6 + golang/libnbd_110_defaults_test.go | 8 + golang/libnbd_120_set_non_defaults_test.go | 12 + golang/libnbd_465_block_status_64_test.go | 119 ++++ info/can.c | 16 +- info/info-can.sh | 36 +- info/info-packets.sh | 17 +- info/main.c | 11 +- info/map.c | 65 ++- info/show.c | 9 +- 60 files changed, 2632 insertions(+), 276 deletions(-) create mode 100644 generator/states-newstyle-opt-extended-headers.c create mode 100644 python/t/465-block-status-64.py create mode 100644 ocaml/examples/extents64.ml create mode 100644 ocaml/tests/test_465_block_status_64.ml create mode 100644 interop/block-status-64.c create mode 100755 interop/block-status-64.sh create mode 100644 interop/block-status-payload.c create mode 100755 interop/block-status-payload.sh create mode 100644 interop/opt-extended-headers.c create mode 100755 interop/opt-extended-headers.sh create mode 100644 golang/libnbd_465_block_status_64_test.go base-commit: 70329e9585297bc42cf3db3bf508263137dade8d -- 2.41.0 _______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs