[libnbd PATCH 00/10] Rust bindings
by Tage Johansson
Hello,
This is a, compared to last time, much more complete implementation of
Rust bindings for Libnbd. There is still no documentation and no
examples. And one does still need LLVM to build the bindings due to
[rust-bindgen](https://github.com/rust-lang/rust-bindgen). But the
overall implementation is more or less complete, including integration
tests.
As you can see, there are 10 patches:
- The first is just a small tweek of the generator utils functions.
- The second implements the basic form of the Rust bindings.
- The third and fourth modifies generator/API.ml* a bit to enable some
of the more convenient features of the Rust bindings.
- The 5th and 6th patch implements some of those conveniences.
- The 7th and 8th implements tests for the Rust bindings as
created so far.
- The 9th patch is quite a large extention of the Rust bindings. It
implements another handle-type which makes use of rust's asynchronous
functions and the [Tokio runtime](https://tokio.rs) to make an
ergonomic and rusty asynchronous API for Libnbd.
- And the last patch implements integration tests for those asynchronous
bindings.
Please comment on anything from code to commit messages. The Rust
bindings are of course not complete with these patches. The goal is
still to get rid of the dependency on rust-bindgen and LLVM. And there
needs to be documentation and thoroughly tested examples.
Best regards,
Tage
Tage Johansson (10):
generator: Add copyright argument to `generate_header`
rust: create basic Rust bindings
generator: Add information about asynchronous handle calls
generator: Add information about the lifetime of closures
rust: Use FnOnce for callbacks which only will be used once
rust: Don't enforce 'static lifetimes on some closures
rust: Add a couple of integration tests
rust: Make it possible to run tests with Valgrind
rust: async: Create an async friendly handle type
rust: async: Add a couple of integration tests
.gitignore | 8 +
.ocamlformat | 4 +
Makefile.am | 1 +
configure.ac | 13 +
generator/API.ml | 43 +
generator/API.mli | 24 +
generator/Makefile.am | 2 +
generator/Rust.ml | 835 ++++++++++++++++++
generator/Rust.mli | 22 +
generator/generator.ml | 3 +
generator/utils.ml | 5 +-
generator/utils.mli | 3 +-
rust/Cargo.toml | 55 ++
rust/Makefile.am | 65 ++
rust/libnbd-sys/Cargo.toml | 30 +
rust/libnbd-sys/build.rs | 60 ++
rust/libnbd-sys/src/lib.rs | 24 +
rust/libnbd-sys/wrapper.h | 18 +
rust/run-tests.sh | 30 +
rust/src/async_handle.rs | 222 +++++
rust/src/error.rs | 118 +++
rust/src/handle.rs | 67 ++
rust/src/lib.rs | 32 +
rust/src/types.rs | 20 +
rust/src/utils.rs | 23 +
rust/tests/nbdkit_pattern/mod.rs | 28 +
rust/tests/test_100_handle.rs | 25 +
rust/tests/test_110_defaults.rs | 33 +
rust/tests/test_120_set_non_defaults.rs | 56 ++
rust/tests/test_130_private_data.rs | 28 +
rust/tests/test_140_explicit_close.rs | 31 +
rust/tests/test_200_connect_command.rs | 33 +
rust/tests/test_210_opt_abort.rs | 39 +
rust/tests/test_220_opt_list.rs | 85 ++
rust/tests/test_230_opt_info.rs | 124 +++
rust/tests/test_240_opt_list_meta.rs | 151 ++++
rust/tests/test_245_opt_list_meta_queries.rs | 98 ++
rust/tests/test_250_opt_set_meta.rs | 124 +++
rust/tests/test_255_opt_set_meta_queries.rs | 111 +++
rust/tests/test_300_get_size.rs | 36 +
rust/tests/test_400_pread.rs | 40 +
rust/tests/test_405_pread_structured.rs | 80 ++
rust/tests/test_410_pwrite.rs | 62 ++
rust/tests/test_460_block_status.rs | 96 ++
rust/tests/test_620_stats.rs | 76 ++
rust/tests/test_async_100_handle.rs | 25 +
rust/tests/test_async_200_connect_command.rs | 34 +
rust/tests/test_async_210_opt_abort.rs | 40 +
rust/tests/test_async_220_opt_list.rs | 86 ++
rust/tests/test_async_230_opt_info.rs | 126 +++
rust/tests/test_async_235memleak.rs | 57 ++
rust/tests/test_async_240_opt_list_meta.rs | 151 ++++
.../test_async_245_opt_list_meta_queries.rs | 96 ++
rust/tests/test_async_250_opt_set_meta.rs | 123 +++
.../test_async_255_opt_set_meta_queries.rs | 111 +++
rust/tests/test_async_400_pread.rs | 41 +
rust/tests/test_async_405_pread_structured.rs | 85 ++
rust/tests/test_async_410_pwrite.rs | 63 ++
rust/tests/test_async_460_block_status.rs | 96 ++
rust/tests/test_async_620_stats.rs | 77 ++
rust/tests/test_log/mod.rs | 86 ++
rustfmt.toml | 19 +
62 files changed, 4396 insertions(+), 3 deletions(-)
create mode 100644 .ocamlformat
create mode 100644 generator/Rust.ml
create mode 100644 generator/Rust.mli
create mode 100644 rust/Cargo.toml
create mode 100644 rust/Makefile.am
create mode 100644 rust/libnbd-sys/Cargo.toml
create mode 100644 rust/libnbd-sys/build.rs
create mode 100644 rust/libnbd-sys/src/lib.rs
create mode 100644 rust/libnbd-sys/wrapper.h
create mode 100755 rust/run-tests.sh
create mode 100644 rust/src/async_handle.rs
create mode 100644 rust/src/error.rs
create mode 100644 rust/src/handle.rs
create mode 100644 rust/src/lib.rs
create mode 100644 rust/src/types.rs
create mode 100644 rust/src/utils.rs
create mode 100644 rust/tests/nbdkit_pattern/mod.rs
create mode 100644 rust/tests/test_100_handle.rs
create mode 100644 rust/tests/test_110_defaults.rs
create mode 100644 rust/tests/test_120_set_non_defaults.rs
create mode 100644 rust/tests/test_130_private_data.rs
create mode 100644 rust/tests/test_140_explicit_close.rs
create mode 100644 rust/tests/test_200_connect_command.rs
create mode 100644 rust/tests/test_210_opt_abort.rs
create mode 100644 rust/tests/test_220_opt_list.rs
create mode 100644 rust/tests/test_230_opt_info.rs
create mode 100644 rust/tests/test_240_opt_list_meta.rs
create mode 100644 rust/tests/test_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_250_opt_set_meta.rs
create mode 100644 rust/tests/test_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_300_get_size.rs
create mode 100644 rust/tests/test_400_pread.rs
create mode 100644 rust/tests/test_405_pread_structured.rs
create mode 100644 rust/tests/test_410_pwrite.rs
create mode 100644 rust/tests/test_460_block_status.rs
create mode 100644 rust/tests/test_620_stats.rs
create mode 100644 rust/tests/test_async_100_handle.rs
create mode 100644 rust/tests/test_async_200_connect_command.rs
create mode 100644 rust/tests/test_async_210_opt_abort.rs
create mode 100644 rust/tests/test_async_220_opt_list.rs
create mode 100644 rust/tests/test_async_230_opt_info.rs
create mode 100644 rust/tests/test_async_235memleak.rs
create mode 100644 rust/tests/test_async_240_opt_list_meta.rs
create mode 100644 rust/tests/test_async_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_async_250_opt_set_meta.rs
create mode 100644 rust/tests/test_async_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_async_400_pread.rs
create mode 100644 rust/tests/test_async_405_pread_structured.rs
create mode 100644 rust/tests/test_async_410_pwrite.rs
create mode 100644 rust/tests/test_async_460_block_status.rs
create mode 100644 rust/tests/test_async_620_stats.rs
create mode 100644 rust/tests/test_log/mod.rs
create mode 100644 rustfmt.toml
--
2.41.0
1 year, 2 months
[PATCH v4 00/24] qemu patches for 64-bit NBD extensions
by Eric Blake
v3 was here:
https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg03607.html
Since then, I've incorporated lots of feedback from Vladimir:
- split several patches into smaller pieces
- use an enum to track various negotiation modes
- reorder a few patches
- several new patches (2, 5, 6)
- other cleanups
001/24:[----] [--] 'nbd/client: Use smarter assert'
002/24:[down] 'nbd: Consistent typedef usage in header'
003/24:[0137] [FC] 'nbd/server: Prepare for alternate-size headers'
004/24:[0093] [FC] 'nbd/server: Refactor to pass full request around'
005/24:[down] 'nbd: s/handle/cookie/ to match NBD spec'
006/24:[down] 'nbd/client: Simplify cookie vs. index computation'
007/24:[----] [-C] 'nbd/client: Add safety check on chunk payload length'
008/24:[down] 'nbd: Use enum for various negotiation modes'
009/24:[down] 'nbd: Replace bool structured_reply with mode enum'
010/24:[down] 'nbd/client: Pass mode through to nbd_send_request'
011/24:[0096] [FC] 'nbd: Add types for extended headers'
012/24:[0118] [FC] 'nbd: Prepare for 64-bit request effect lengths'
013/24:[0071] [FC] 'nbd/server: Refactor handling of request payload'
014/24:[down] 'nbd/server: Prepare to receive extended header requests'
015/24:[down] 'nbd/server: Prepare to send extended header replies'
016/24:[0132] [FC] 'nbd/server: Support 64-bit block status'
017/24:[down] 'nbd/server: Enable initial support for extended headers'
018/24:[down] 'nbd/client: Plumb errp through nbd_receive_replies'
019/24:[0066] [FC] 'nbd/client: Initial support for extended headers'
020/24:[0032] [FC] 'nbd/client: Accept 64-bit block status chunks'
021/24:[0058] [FC] 'nbd/client: Request extended headers during negotiation'
022/24:[down] 'nbd/server: Refactor list of negotiated meta contexts'
023/24:[0132] [FC] 'nbd/server: Prepare for per-request filtering of BLOCK_STATUS'
024/24:[0109] [FC] 'nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS'
Eric Blake (24):
nbd/client: Use smarter assert
nbd: Consistent typedef usage in header
nbd/server: Prepare for alternate-size headers
nbd/server: Refactor to pass full request around
nbd: s/handle/cookie/ to match NBD spec
nbd/client: Simplify cookie vs. index computation
nbd/client: Add safety check on chunk payload length
nbd: Use enum for various negotiation modes
nbd: Replace bool structured_reply with mode enum
nbd/client: Pass mode through to nbd_send_request
nbd: Add types for extended headers
nbd: Prepare for 64-bit request effect lengths
nbd/server: Refactor handling of request payload
nbd/server: Prepare to receive extended header requests
nbd/server: Prepare to send extended header replies
nbd/server: Support 64-bit block status
nbd/server: Enable initial support for extended headers
nbd/client: Plumb errp through nbd_receive_replies
nbd/client: Initial support for extended headers
nbd/client: Accept 64-bit block status chunks
nbd/client: Request extended headers during negotiation
nbd/server: Refactor list of negotiated meta contexts
nbd/server: Prepare for per-request filtering of BLOCK_STATUS
nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS
docs/interop/nbd.txt | 1 +
include/block/nbd.h | 201 ++++--
nbd/nbd-internal.h | 8 +-
block/nbd.c | 189 +++--
nbd/client-connection.c | 4 +-
nbd/client.c | 199 ++++--
nbd/common.c | 29 +-
nbd/server.c | 666 ++++++++++++------
qemu-nbd.c | 8 +-
block/trace-events | 1 +
nbd/trace-events | 29 +-
tests/qemu-iotests/223.out | 18 +-
tests/qemu-iotests/233.out | 4 +
tests/qemu-iotests/241.out | 3 +
tests/qemu-iotests/307.out | 15 +-
.../tests/nbd-qemu-allocation.out | 3 +-
16 files changed, 937 insertions(+), 441 deletions(-)
base-commit: 4f65e89f8cf0e079b4ec3ddfede314bbb4e35c76
--
2.40.1
1 year, 3 months
[libnbd PATCH v3 00/22] NBD 64-bit extensions (libnbd portion)
by Eric Blake
v2 was here:
https://listman.redhat.com/archives/libguestfs/2022-November/030292.html
For v3, there are now approved specs to code to:
https://listman.redhat.com/archives/libguestfs/2023-April/031251.html
visible on an upstream branch at
https://github.com/NetworkBlockDevice/nbd/blob/extension-ext-header/doc/p...
(upstream leaves extensions in a branch state until there are multiple
implementations that comply with that extension)
as well as interoperability with counterpart qemu patches:
https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg03607.html
also available at
https://repo.or.cz/qemu/ericb.git/shortlog/refs/tags/exthdr-v3
I'm still working on adding extended header support into nbdkit, which
will involve adding a v3 protocol for plugins; that work is probably
much further out.
Changes since v2:
001/22:[0002] [FC] 'block_status: Refactor array storage'
002/22:[0016] [FC] 'internal: Refactor layout of replies in sbuf'
003/22:[0002] [FC] 'protocol: Add definitions for extended headers'
004/22:[0006] [FC] 'states: Prepare to send 64-bit requests'
005/22:[0013] [FC] 'states: Prepare to receive 64-bit replies'
006/22:[0007] [FC] 'states: Break deadlock if server goofs on extended replies'
007/22:[0021] [FC] 'generator: Add struct nbd_extent in prep for 64-bit extents'
008/22:[----] [-C] 'block_status: Track 64-bit extents internally'
009/22:[0012] [FC] 'block_status: Accept 64-bit extents during block status'
010/22:[0063] [FC] 'api: Add [aio_]nbd_block_status_64'
011/22:[0006] [FC] 'api: Add several functions for controlling extended headers'
012/22:[----] [--] 'copy: Update nbdcopy to use 64-bit block status'
013/22:[0004] [FC] 'dump: Update nbddump to use 64-bit block status'
014/22:[----] [--] 'info: Expose extended-headers support through nbdinfo'
015/22:[0006] [FC] 'info: Update nbdinfo --map to use 64-bit block status'
016/22:[----] [-C] 'examples: Update copy-libev to use 64-bit block status'
017/22:[0002] [FC] 'ocaml: Add example for 64-bit extents'
018/22:[0004] [FC] 'generator: Actually request extended headers'
019/22:[0008] [FC] 'api: Add nbd_[aio_]opt_extended_headers()'
020/22:[0004] [FC] 'interop: Add test of 64-bit block status'
021/22:[0011] [FC] 'api: Add nbd_can_block_status_payload()'
022/22:[0004] [FC] 'api: Add nbd_[aio_]block_status_filter()'
The changes are mostly fallout from rebasing on top of style cleanups
that Laszlo has been working on, but also deal with some changes with
the spec compared to how it was proposed in v2 (for example, upstream
decided that for NBD_CMD_BLOCK_STATUS, the server should always use
64-bit replies, rather than making the client support both 32- and
64-bit replies).
Eric Blake (22):
block_status: Refactor array storage
internal: Refactor layout of replies in sbuf
protocol: Add definitions for extended headers
states: Prepare to send 64-bit requests
states: Prepare to receive 64-bit replies
states: Break deadlock if server goofs on extended replies
generator: Add struct nbd_extent in prep for 64-bit extents
block_status: Track 64-bit extents internally
block_status: Accept 64-bit extents during block status
api: Add [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: 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()
docs/libnbd.pod | 18 +-
info/nbdinfo.pod | 21 +-
sh/nbdsh.pod | 2 +-
lib/internal.h | 41 +-
lib/nbd-protocol.h | 112 +++-
generator/API.mli | 1 +
generator/API.ml | 534 +++++++++++++++---
generator/C.ml | 24 +-
generator/GoLang.ml | 24 +
generator/Makefile.am | 1 +
generator/OCaml.ml | 23 +-
generator/Python.ml | 20 +-
generator/state_machine.ml | 50 +-
generator/states-issue-command.c | 33 +-
.../states-newstyle-opt-extended-headers.c | 110 ++++
generator/states-newstyle-opt-starttls.c | 7 +-
.../states-newstyle-opt-structured-reply.c | 3 +-
generator/states-newstyle.c | 3 +
generator/states-reply-simple.c | 4 +-
generator/states-reply-structured.c | 253 ++++++---
generator/states-reply.c | 69 ++-
lib/aio.c | 7 +-
lib/flags.c | 12 +
lib/handle.c | 25 +-
lib/opt.c | 44 ++
lib/rw.c | 250 +++++++-
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 | 20 +
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/Makefile.am | 4 +
tests/meta-base-allocation.c | 104 +++-
tests/pwrite-extended.c | 112 ++++
examples/copy-libev.c | 21 +-
examples/server-flags.c | 7 +-
interop/Makefile.am | 18 +
interop/block-status-payload.c | 241 ++++++++
interop/block-status-payload.sh | 80 +++
interop/large-status.c | 186 ++++++
interop/large-status.sh | 49 ++
interop/opt-extended-headers.c | 153 +++++
interop/opt-extended-headers.sh | 29 +
.gitignore | 4 +
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 | 14 +
info/info-can.sh | 30 +
info/info-packets.sh | 17 +-
info/main.c | 7 +-
info/map.c | 65 ++-
info/show.c | 9 +-
64 files changed, 2892 insertions(+), 351 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 tests/pwrite-extended.c
create mode 100644 interop/block-status-payload.c
create mode 100755 interop/block-status-payload.sh
create mode 100644 interop/large-status.c
create mode 100755 interop/large-status.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: 17d0bc6a71bbc67f3d7707d129bec4acf7e7a382
--
2.40.1
1 year, 3 months
[libnbd PATCH 0/7] Preliminary GoLang cleanups
by Eric Blake
In Laszlo's review of my 64-bit extensions, he pointed out some
questionable code in the GoLang.ml generated code, including some
inconsistencies on whitespace before '('. Fixing that in turn
inspired me to learn about gofmt, so I attempted to address the issues
it points out. (One perk of being a modern language: you can enforce
everyone to share the same style, rather than having different camps
each defend their years-long but slightly distinct styles...)
We may want to optionally run gofmt as part of the build process (I
know Tage proposed doing similar with rustfmt), and/or write a further
patch to have the const() blocks in GoLang.ml do a two-pass iteration
over lists (first to learn the maximum column width, second to do the
output).
Eric Blake (7):
api: Expose "qemu:" meta-context constants
golang: Export meta-context constants
golang: Simplify RBool return
Revert "generator/Go.ml: Simplify copy_uint32_array"
golang: Use 'gofmt' style recommendations on manual files
golang: Improve whitespace style in generated bindings
golang: Enforce coding style during 'make check'
generator/utils.mli | 1 +
generator/API.ml | 9 +-
generator/C.ml | 22 +-
generator/GoLang.ml | 246 +++++++++---------
generator/OCaml.ml | 4 +-
generator/Python.ml | 3 +-
generator/utils.ml | 5 +
interop/dirty-bitmap.c | 6 +-
golang/Makefile.am | 2 +-
golang/codestyle-tests.sh | 45 ++++
golang/configure/test.go | 14 +-
golang/examples/aio_copy/aio_copy.go | 7 +-
golang/examples/simple_copy/simple_copy.go | 3 +-
golang/libnbd_220_opt_list_test.go | 4 +-
golang/libnbd_230_opt_info_test.go | 24 +-
golang/libnbd_240_opt_list_meta_test.go | 44 ++--
.../libnbd_245_opt_list_meta_queries_test.go | 14 +-
golang/libnbd_250_opt_set_meta_test.go | 20 +-
.../libnbd_255_opt_set_meta_queries_test.go | 14 +-
golang/libnbd_405_pread_structured_test.go | 10 +-
golang/libnbd_460_block_status_test.go | 4 +-
golang/libnbd_590_aio_copy_test.go | 21 +-
golang/libnbd_620_stats_test.go | 12 +-
23 files changed, 307 insertions(+), 227 deletions(-)
create mode 100755 golang/codestyle-tests.sh
base-commit: 5c2fc3cc7e14146d000b65b191e70d9a0585a395
--
2.41.0
1 year, 3 months
[libnbd PATCH v3 00/10] Rust bindings
by Tage Johansson
Hello again,
In patch v2, two tests were not compiling. This update fixes that.
Best regards,
Tage
Tage Johansson (10):
rust: create basic Rust bindings
generator: Add information about asynchronous handle calls
generator: Add information about the lifetime of closures
rust: Use more specific closure traits
rust: Add a couple of integration tests
rust: Make it possible to run tests with Valgrind
rust: async: Create an async friendly handle type
rust: async: Add a couple of integration tests
generator: Add `modifies_fd` flag to the [call] structure
rust: async: Use the `modifies_fd` flag to exclude calls
.gitignore | 8 +
.ocamlformat | 4 +
Makefile.am | 1 +
configure.ac | 13 +
generator/API.ml | 84 ++
generator/API.mli | 35 +
generator/Makefile.am | 2 +
generator/Rust.ml | 814 ++++++++++++++++++
generator/Rust.mli | 22 +
generator/generator.ml | 3 +
rust/Cargo.toml | 55 ++
rust/Makefile.am | 76 ++
rust/libnbd-sys/Cargo.toml | 30 +
rust/libnbd-sys/build.rs | 60 ++
rust/libnbd-sys/src/lib.rs | 24 +
rust/libnbd-sys/wrapper.h | 18 +
rust/run-tests.sh | 30 +
rust/src/async_handle.rs | 222 +++++
rust/src/error.rs | 118 +++
rust/src/handle.rs | 67 ++
rust/src/lib.rs | 32 +
rust/src/types.rs | 20 +
rust/src/utils.rs | 23 +
rust/tests/nbdkit_pattern/mod.rs | 28 +
rust/tests/test_100_handle.rs | 25 +
rust/tests/test_110_defaults.rs | 33 +
rust/tests/test_120_set_non_defaults.rs | 56 ++
rust/tests/test_130_private_data.rs | 28 +
rust/tests/test_140_explicit_close.rs | 31 +
rust/tests/test_200_connect_command.rs | 33 +
rust/tests/test_210_opt_abort.rs | 39 +
rust/tests/test_220_opt_list.rs | 85 ++
rust/tests/test_230_opt_info.rs | 124 +++
rust/tests/test_240_opt_list_meta.rs | 151 ++++
rust/tests/test_245_opt_list_meta_queries.rs | 98 +++
rust/tests/test_250_opt_set_meta.rs | 124 +++
rust/tests/test_255_opt_set_meta_queries.rs | 111 +++
rust/tests/test_300_get_size.rs | 36 +
rust/tests/test_400_pread.rs | 40 +
rust/tests/test_405_pread_structured.rs | 80 ++
rust/tests/test_410_pwrite.rs | 62 ++
rust/tests/test_460_block_status.rs | 96 +++
rust/tests/test_620_stats.rs | 76 ++
rust/tests/test_async_100_handle.rs | 25 +
rust/tests/test_async_200_connect_command.rs | 34 +
rust/tests/test_async_210_opt_abort.rs | 40 +
rust/tests/test_async_220_opt_list.rs | 86 ++
rust/tests/test_async_230_opt_info.rs | 126 +++
rust/tests/test_async_235memleak.rs | 57 ++
rust/tests/test_async_240_opt_list_meta.rs | 151 ++++
.../test_async_245_opt_list_meta_queries.rs | 96 +++
rust/tests/test_async_250_opt_set_meta.rs | 123 +++
.../test_async_255_opt_set_meta_queries.rs | 111 +++
rust/tests/test_async_400_pread.rs | 41 +
rust/tests/test_async_405_pread_structured.rs | 85 ++
rust/tests/test_async_410_pwrite.rs | 63 ++
rust/tests/test_async_460_block_status.rs | 96 +++
rust/tests/test_async_620_stats.rs | 77 ++
rust/tests/test_log/mod.rs | 86 ++
rustfmt.toml | 19 +
60 files changed, 4433 insertions(+)
create mode 100644 .ocamlformat
create mode 100644 generator/Rust.ml
create mode 100644 generator/Rust.mli
create mode 100644 rust/Cargo.toml
create mode 100644 rust/Makefile.am
create mode 100644 rust/libnbd-sys/Cargo.toml
create mode 100644 rust/libnbd-sys/build.rs
create mode 100644 rust/libnbd-sys/src/lib.rs
create mode 100644 rust/libnbd-sys/wrapper.h
create mode 100755 rust/run-tests.sh
create mode 100644 rust/src/async_handle.rs
create mode 100644 rust/src/error.rs
create mode 100644 rust/src/handle.rs
create mode 100644 rust/src/lib.rs
create mode 100644 rust/src/types.rs
create mode 100644 rust/src/utils.rs
create mode 100644 rust/tests/nbdkit_pattern/mod.rs
create mode 100644 rust/tests/test_100_handle.rs
create mode 100644 rust/tests/test_110_defaults.rs
create mode 100644 rust/tests/test_120_set_non_defaults.rs
create mode 100644 rust/tests/test_130_private_data.rs
create mode 100644 rust/tests/test_140_explicit_close.rs
create mode 100644 rust/tests/test_200_connect_command.rs
create mode 100644 rust/tests/test_210_opt_abort.rs
create mode 100644 rust/tests/test_220_opt_list.rs
create mode 100644 rust/tests/test_230_opt_info.rs
create mode 100644 rust/tests/test_240_opt_list_meta.rs
create mode 100644 rust/tests/test_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_250_opt_set_meta.rs
create mode 100644 rust/tests/test_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_300_get_size.rs
create mode 100644 rust/tests/test_400_pread.rs
create mode 100644 rust/tests/test_405_pread_structured.rs
create mode 100644 rust/tests/test_410_pwrite.rs
create mode 100644 rust/tests/test_460_block_status.rs
create mode 100644 rust/tests/test_620_stats.rs
create mode 100644 rust/tests/test_async_100_handle.rs
create mode 100644 rust/tests/test_async_200_connect_command.rs
create mode 100644 rust/tests/test_async_210_opt_abort.rs
create mode 100644 rust/tests/test_async_220_opt_list.rs
create mode 100644 rust/tests/test_async_230_opt_info.rs
create mode 100644 rust/tests/test_async_235memleak.rs
create mode 100644 rust/tests/test_async_240_opt_list_meta.rs
create mode 100644 rust/tests/test_async_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_async_250_opt_set_meta.rs
create mode 100644 rust/tests/test_async_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_async_400_pread.rs
create mode 100644 rust/tests/test_async_405_pread_structured.rs
create mode 100644 rust/tests/test_async_410_pwrite.rs
create mode 100644 rust/tests/test_async_460_block_status.rs
create mode 100644 rust/tests/test_async_620_stats.rs
create mode 100644 rust/tests/test_log/mod.rs
create mode 100644 rustfmt.toml
base-commit: fbde5974fd5c8a3bcb081db0b1074c4a3e723e76
--
2.41.0
1 year, 3 months
[PATCH nbdkit 0/3] curl: Use curl multi interface
by Richard W.M. Jones
Sorry, patch 2 is a mess (and so am I after spending days researching
and implementing the change). There's not an easy way to simplify the
change that I can see, but I'll look at it again with fresh eyes later.
However can't argue with the performance improvement which is
spectacular.
Rich.
1 year, 3 months
[libnbd PATCH v4 0/6] NBD 64-bit extensions (libnbd portions, prep work)
by Eric Blake
This is preliminary work towards enabling 64-bit NBD extensions in
libnbd, based on review feedback given by Laszlo and others. The v3
patch series is here:
https://listman.redhat.com/archives/libguestfs/2023-May/031617.html
This series focuses on patches 1 and 3-6 of v3 (patch 2 from that
series was already pushed earlier); there remains more work to do on
7-22 that will follow later. For convenience, I've tagged this as
https://repo.or.cz/libnbd/ericb.git/shortlog/refs/tags/exthdr-v4a
Comparison to v3 (more notes in individual patches):
001/6:[down] 'internal: Track chunk payload length left'
002/6:[0106] [FC] 'block_status: Refactor array storage'
003/6:[0033] [FC] 'protocol: Add definitions for extended headers'
004/6:[0032] [FC] 'states: Prepare to send 64-bit requests'
005/6:[0137] [FC] 'states: Prepare to receive 64-bit replies'
006/6:[0017] [FC] 'states: Break deadlock if server goofs on extended replies'
Eric Blake (6):
internal: Track chunk payload length left
block_status: Refactor array storage
protocol: Add definitions for extended headers
states: Prepare to send 64-bit requests
states: Prepare to receive 64-bit replies
states: Break deadlock if server goofs on extended replies
lib/internal.h | 16 ++-
lib/nbd-protocol.h | 71 ++++++++---
generator/API.ml | 20 ++--
generator/state_machine.ml | 9 +-
generator/states-issue-command.c | 29 +++--
generator/states-reply.c | 109 +++++++++++++----
generator/states-reply-chunk.c | 197 ++++++++++++++++++++-----------
lib/rw.c | 17 ++-
tests/Makefile.am | 4 +
tests/pwrite-extended.c | 108 +++++++++++++++++
.gitignore | 1 +
11 files changed, 448 insertions(+), 133 deletions(-)
create mode 100644 tests/pwrite-extended.c
base-commit: 10b37a26360c19effec2733449ee5a37439181bf
--
2.41.0
1 year, 4 months