[libnbd PATCH 0/2] (Attempt to) fix Rust on BSD-based builds
by Eric Blake
I managed to get a build of the async Rust handle compiling on FreeBSD
(although the cirrus CI appears to not actually run 'make check' on
non-Linux machines, at least when run on my fork):
https://gitlab.com/ebblake/libnbd/-/jobs/4985192286
However, I'd really like Tage's review on patch 2 to see if my Rust
makes sense.
Eric Blake (2):
maint: Favor 4-space indent in .rs files
rust: Use mio::poll instead of requiring epoll
rust/Cargo.toml | 2 +-
rust/src/async_handle.rs | 46 +++++++++++++++++++++++++---------------
.editorconfig | 4 ++++
3 files changed, 34 insertions(+), 18 deletions(-)
--
2.41.0
1 year, 2 months
[PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
by Richard W.M. Jones
This is the first part of a pair of patch series which aim to let us
use nbdkit_parse_size (or rather, an equivalent common function) in
nbdcopy, so we can write:
nbdcopy --request-size=32M ...
We can't do that now which was annoying me earlier in the week.
This commit creates a new function called human_size_parse which is
basically nbdkit_parse_size, and turns nbdkit_parse_size into a
wrapper around it.
Rich.
1 year, 2 months
[libnbd PATCH v9 0/7] Rust Bindings for Libnbd
by Tage Johansson
Compared to v8, this patch series corrects some grammatical errors in
patch 1 and 2. Some unrelated formatting has also been removed from
patch 2. Finally, a patch has been added wich extends the Rust test
suite by checking that the Rust crate compiles even with all features
disabled.
--
Best regards,
Tage
Tage Johansson (7):
generator: Add information about asynchronous handle calls
rust: async: Create an async friendly handle type
generator: Add `modifies_fd` flag to the [call] structure
rust: async: Use the modifies_fd flag to exclude calls
rust: async: Add a couple of integration tests
rust: async: Add an example
rust: Check that compilation works with default features disabled
generator/API.ml | 64 +++++
generator/API.mli | 18 ++
generator/Rust.ml | 231 +++++++++++++++
generator/Rust.mli | 2 +
generator/generator.ml | 2 +
rust/Cargo.toml | 6 +-
rust/Makefile.am | 2 +
rust/examples/concurrent-read-write.rs | 149 ++++++++++
rust/run-tests.sh.in | 3 +
rust/src/async_handle.rs | 266 ++++++++++++++++++
rust/src/lib.rs | 9 +
rust/src/utils.rs | 9 +
rust/tests/test_async_100_handle.rs | 25 ++
rust/tests/test_async_200_connect_command.rs | 26 ++
rust/tests/test_async_210_opt_abort.rs | 32 +++
rust/tests/test_async_220_opt_list.rs | 86 ++++++
rust/tests/test_async_230_opt_info.rs | 122 ++++++++
rust/tests/test_async_240_opt_list_meta.rs | 150 ++++++++++
.../test_async_245_opt_list_meta_queries.rs | 94 +++++++
rust/tests/test_async_250_opt_set_meta.rs | 125 ++++++++
.../test_async_255_opt_set_meta_queries.rs | 110 ++++++++
rust/tests/test_async_400_pread.rs | 40 +++
rust/tests/test_async_405_pread_structured.rs | 84 ++++++
rust/tests/test_async_410_pwrite.rs | 59 ++++
rust/tests/test_async_460_block_status.rs | 98 +++++++
rust/tests/test_async_620_stats.rs | 69 +++++
scripts/git.orderfile | 1 +
27 files changed, 1881 insertions(+), 1 deletion(-)
create mode 100644 rust/examples/concurrent-read-write.rs
create mode 100644 rust/src/async_handle.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_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
base-commit: f2dac1102884e3dea1cfb33479b34dd689fbb670
prerequisite-patch-id: ce5d2f65bb12ecda61c97fdf22255e188016b3fc
prerequisite-patch-id: cb5e3f05b600a4953e2a77bd53067bb51903aecd
prerequisite-patch-id: 7613cb6ebcc41fb45da587fc9487eb6c643a14a4
prerequisite-patch-id: 397ff0bea47242cf549a894ce519b3702f072c44
prerequisite-patch-id: e0024d76b8f30c22981fa7410d3ba6935aa3fde4
prerequisite-patch-id: 8228f280bd7dc331ba6e59b3b39209ae3eca0ed3
prerequisite-patch-id: 0bfbfc74216958994f80c7363e4473090bd8bab3
prerequisite-patch-id: 02d5d810150c2042a7b4dbd4f4991fa3f69a7039
prerequisite-patch-id: c55d4346bf391f61d0f836d4d2a8818366d2a701
prerequisite-patch-id: b79c88f8e664526bff63d22faa2b8b4e068d6d85
prerequisite-patch-id: a596c70f96938e496b92d4c99e3e8004c4b3c725
prerequisite-patch-id: d6bcb838a1875541f3f125b95f346c21a7d614ea
--
2.42.0
1 year, 2 months
[libnbd PATCH] rust: Cleanups in examples/concurrent-read-write.rs.
by Tage Johansson
This patch makes some small cleanups in
rust/examples/concurrent-read-write.rs. Specificly, it refrases one
comment, removes some outcommented code, and removes a completely
redundent if statement. It also replaces a hard coded number with the
index of the task as seed to an RNG.
---
rust/examples/concurrent-read-write.rs | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/rust/examples/concurrent-read-write.rs b/rust/examples/concurrent-read-write.rs
index 4858f76..589cefd 100644
--- a/rust/examples/concurrent-read-write.rs
+++ b/rust/examples/concurrent-read-write.rs
@@ -3,11 +3,10 @@
//! --run 'cargo run --example concurrent-read-write -- $unixsocket'
//! Or connect over a URI:
//! nbdkit -U - memory 100M \
-//! --run 'cargo run --example concurrent-read-write -- $uri'
+//! --run 'cargo run --example concurrent-read-write -- "$uri"'
//!
-//! This will read and write randomly over the first megabyte of the
-//! plugin using multi-conn, multiple threads and multiple requests in
-//! flight on each thread.
+//! This will read and write randomly over the plugin using multi-conn,
+//! multiple threads and multiple requests in flight on each thread.
#![deny(warnings)]
use rand::prelude::*;
@@ -111,12 +110,11 @@ async fn run_thread(
nbd.connect_unix(socket_or_uri).await?;
}
- let mut rng = SmallRng::seed_from_u64(44 as u64);
+ let mut rng = SmallRng::seed_from_u64(task_idx as u64);
// Issue commands.
let mut stats = Stats::default();
let mut join_set = JoinSet::new();
- //tokio::time::sleep(std::time::Duration::from_secs(1)).await;
while stats.requests < NR_CYCLES || !join_set.is_empty() {
while stats.requests < NR_CYCLES && join_set.len() < MAX_IN_FLIGHT {
// If we want to issue another request, do so. Note that we reuse
@@ -144,6 +142,5 @@ async fn run_thread(
join_set.join_next().await.unwrap().unwrap()?;
}
- if task_idx == 0 {}
Ok(stats)
}
base-commit: 9afb980d05d6144129c899285e44779757a380e8
prerequisite-patch-id: 8d1779610795021ed5a3d0973ddf9ef854cd6a24
prerequisite-patch-id: 1f0f333311f11ac9b1ff0be08f5aa0a9904ba4de
prerequisite-patch-id: dc4af7343c57a4f99dc82918c07470030e542747
prerequisite-patch-id: 8e8f7a043c80d6c24e883967f5bd952a64db1228
prerequisite-patch-id: ba7b3482e2e16f76b5f285daeeda30b31a841912
prerequisite-patch-id: 219a9595e550a8caf43d466dcb2b044114e1b7bf
prerequisite-patch-id: 3de46c9673221bff1d897970aa983b3f8e6cab74
prerequisite-patch-id: 4235d5e174fce05b9a947b3b838bebf968f0fa6a
prerequisite-patch-id: 07773355d5718e0593c4030a8f035fc11fea3715
prerequisite-patch-id: f023deea8b706706e3c2980403064d90a254af3c
prerequisite-patch-id: 8639c6cc4fec58f4761771c5d8a9476d538c6251
prerequisite-patch-id: 9bc660aed54a6266b014993ff0f388a26ac2982a
--
2.42.0
1 year, 2 months
[libnbd PATCH 0/2] (Attempt to) fix some Rust CI failures
by Tage Johansson
These are two minor fixes to the Rust bindings to fix some CI failures.
--
Best regards,
Tage
Tage Johansson (2):
generator: Add string_starts_with functions to utils.ml
rust: Add missing files to EXTRA_DIST
generator/utils.ml | 11 +++++++++++
generator/utils.mli | 3 +++
rust/Makefile.am | 1 +
3 files changed, 15 insertions(+)
base-commit: 9afb980d05d6144129c899285e44779757a380e8
prerequisite-patch-id: 8d1779610795021ed5a3d0973ddf9ef854cd6a24
prerequisite-patch-id: 1f0f333311f11ac9b1ff0be08f5aa0a9904ba4de
prerequisite-patch-id: dc4af7343c57a4f99dc82918c07470030e542747
prerequisite-patch-id: 8e8f7a043c80d6c24e883967f5bd952a64db1228
prerequisite-patch-id: ba7b3482e2e16f76b5f285daeeda30b31a841912
prerequisite-patch-id: 219a9595e550a8caf43d466dcb2b044114e1b7bf
prerequisite-patch-id: 3de46c9673221bff1d897970aa983b3f8e6cab74
prerequisite-patch-id: 4235d5e174fce05b9a947b3b838bebf968f0fa6a
prerequisite-patch-id: 07773355d5718e0593c4030a8f035fc11fea3715
prerequisite-patch-id: f023deea8b706706e3c2980403064d90a254af3c
--
2.42.0
1 year, 2 months