From 342ee12b7c70952cb662cf6970aba08da5881adf Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Mon, 23 Oct 2023 22:00:41 +0100 Subject: [PATCH 1/3] fix(rebuild): don't report skipped segments as transferred When a segment is unallocated then we should not include this segment for transferred stats. This addresses an issue where for an empty thin volume the transferred bytes were being shown as the entire volume size. Signed-off-by: Tiago Castro --- io-engine/src/rebuild/rebuild_task.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/io-engine/src/rebuild/rebuild_task.rs b/io-engine/src/rebuild/rebuild_task.rs index 4c0ba13dbe..038a670f62 100644 --- a/io-engine/src/rebuild/rebuild_task.rs +++ b/io-engine/src/rebuild/rebuild_task.rs @@ -94,7 +94,7 @@ impl RebuildTask { len, })?; - // Perform the copy + // Perform the copy. let result = self.copy_one(blk, descriptor).await; // Wait for the LBA range to be unlocked. @@ -113,27 +113,30 @@ impl RebuildTask { descriptor.blk_synced(blk); } - result.map(|_| true) + result } /// Copies one segment worth of data from source into destination. + /// Returns true if write transfer took place, false otherwise. async fn copy_one( &mut self, offset_blk: u64, desc: &RebuildDescriptor, - ) -> Result<(), RebuildError> { + ) -> Result { let iov = desc.adjusted_iov(&self.buffer, offset_blk); let iovs = &mut [iov]; - if desc.read_src_segment(offset_blk, iovs).await? { - desc.write_dst_segment(offset_blk, iovs).await?; + if !desc.read_src_segment(offset_blk, iovs).await? { + // Segment is not allocated in the source, skip the write. + return Ok(false); + } + desc.write_dst_segment(offset_blk, iovs).await?; - if !matches!(desc.options.verify_mode, RebuildVerifyMode::None) { - desc.verify_segment(offset_blk, iovs).await?; - } + if !matches!(desc.options.verify_mode, RebuildVerifyMode::None) { + desc.verify_segment(offset_blk, iovs).await?; } - Ok(()) + Ok(true) } } From 2e5df081d2f8c736fbefae71008d6d326c1107fd Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Mon, 23 Oct 2023 22:26:45 +0100 Subject: [PATCH 2/3] fix(io-engine-client): add subcommand required message Signed-off-by: Tiago Castro --- io-engine/src/bin/io-engine-client/v0/bdev_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/controller_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/device_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/mod.rs | 2 +- io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/nexus_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/perf_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/pool_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/replica_cli.rs | 1 + io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/bdev_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/controller_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/device_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/mod.rs | 1 + io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/nexus_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/perf_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/pool_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/replica_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs | 1 + io-engine/src/bin/io-engine-client/v1/test_cli.rs | 1 + 25 files changed, 25 insertions(+), 1 deletion(-) diff --git a/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs b/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs index d4262fab3e..ff658b8e73 100644 --- a/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs @@ -62,6 +62,7 @@ pub fn subcommands() -> Command { .arg(Arg::new("name").required(true).index(1)); Command::new("bdev") + .subcommand_required(true) .arg_required_else_help(true) .about("Block device management") .subcommand(list) diff --git a/io-engine/src/bin/io-engine-client/v0/controller_cli.rs b/io-engine/src/bin/io-engine-client/v0/controller_cli.rs index bb0f3c9022..671d225127 100755 --- a/io-engine/src/bin/io-engine-client/v0/controller_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/controller_cli.rs @@ -15,6 +15,7 @@ pub fn subcommands() -> Command { .about("Display I/O statistics for NVMe controllers"); Command::new("controller") + .subcommand_required(true) .arg_required_else_help(true) .about("NVMe controllers") .subcommand(list) diff --git a/io-engine/src/bin/io-engine-client/v0/device_cli.rs b/io-engine/src/bin/io-engine-client/v0/device_cli.rs index 93572a8e9e..df976f7bdf 100644 --- a/io-engine/src/bin/io-engine-client/v0/device_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/device_cli.rs @@ -21,6 +21,7 @@ pub fn subcommands() -> Command { ); Command::new("device") + .subcommand_required(true) .arg_required_else_help(true) .about("Host devices") .subcommand(list) diff --git a/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs b/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs index f81dc75956..4b9a5a4028 100644 --- a/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs @@ -11,6 +11,7 @@ use tracing::debug; pub fn subcommands() -> Command { Command::new("jsonrpc") + .subcommand_required(true) .arg_required_else_help(true) .about("Call a json-rpc method with a raw JSON payload") .arg( diff --git a/io-engine/src/bin/io-engine-client/v0/mod.rs b/io-engine/src/bin/io-engine-client/v0/mod.rs index e22c38d9d1..6b51961b8b 100644 --- a/io-engine/src/bin/io-engine-client/v0/mod.rs +++ b/io-engine/src/bin/io-engine-client/v0/mod.rs @@ -73,7 +73,7 @@ pub(super) async fn main_() -> crate::Result<()> { .subcommand(snapshot_cli::subcommands()) .subcommand(jsonrpc_cli::subcommands()) .subcommand(controller_cli::subcommands()) - .arg_required_else_help(true) + .subcommand_required(true).arg_required_else_help(true) .get_matches(); let ctx = context::Context::new(&matches) diff --git a/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs b/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs index 3072161002..f375487a4d 100644 --- a/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs @@ -87,6 +87,7 @@ pub fn subcommands() -> Command { ); Command::new("child") + .subcommand_required(true) .arg_required_else_help(true) .about("Nexus child management") .subcommand(fault) diff --git a/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs b/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs index d5812f15c6..244ef9c52f 100644 --- a/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs @@ -215,6 +215,7 @@ pub fn subcommands() -> Command { ); Command::new("nexus") + .subcommand_required(true) .arg_required_else_help(true) .about("Nexus device management") .subcommand(create) diff --git a/io-engine/src/bin/io-engine-client/v0/perf_cli.rs b/io-engine/src/bin/io-engine-client/v0/perf_cli.rs index 11a1956b98..01e04eb6c6 100644 --- a/io-engine/src/bin/io-engine-client/v0/perf_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/perf_cli.rs @@ -18,6 +18,7 @@ pub fn subcommands() -> Command { let resource = Command::new("resource").about("Resource usage statistics"); Command::new("perf") + .subcommand_required(true) .arg_required_else_help(true) .about("Performance statistics") .subcommand(resource) diff --git a/io-engine/src/bin/io-engine-client/v0/pool_cli.rs b/io-engine/src/bin/io-engine-client/v0/pool_cli.rs index 912f251071..392a1ce0f4 100644 --- a/io-engine/src/bin/io-engine-client/v0/pool_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/pool_cli.rs @@ -33,6 +33,7 @@ pub fn subcommands() -> Command { .help("Storage pool name"), ); Command::new("pool") + .subcommand_required(true) .arg_required_else_help(true) .about("Storage pool management") .subcommand(create) diff --git a/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs b/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs index ba7c0469de..7244c2816c 100644 --- a/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs @@ -135,6 +135,7 @@ pub fn subcommands() -> Command { ); Command::new("rebuild") + .subcommand_required(true) .arg_required_else_help(true) .about("Rebuild management") .subcommand(start) diff --git a/io-engine/src/bin/io-engine-client/v0/replica_cli.rs b/io-engine/src/bin/io-engine-client/v0/replica_cli.rs index adf8d97311..802b65994e 100644 --- a/io-engine/src/bin/io-engine-client/v0/replica_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/replica_cli.rs @@ -131,6 +131,7 @@ pub fn subcommands() -> Command { .help("NQN of hosts which are allowed to connect to the target")); Command::new("replica") + .subcommand_required(true) .arg_required_else_help(true) .about("Replica management") .subcommand(create) diff --git a/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs b/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs index 5723554b92..9771e5b2df 100644 --- a/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs @@ -31,6 +31,7 @@ pub fn subcommands() -> Command { ); Command::new("snapshot") + .subcommand_required(true) .arg_required_else_help(true) .about("Snapshot management") .subcommand(create) diff --git a/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs b/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs index 6e0299ed70..e3335ac97f 100644 --- a/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs @@ -63,6 +63,7 @@ pub fn subcommands() -> Command { .arg(Arg::new("name").required(true).index(1)); Command::new("bdev") + .subcommand_required(true) .arg_required_else_help(true) .about("Block device management") .subcommand(list) diff --git a/io-engine/src/bin/io-engine-client/v1/controller_cli.rs b/io-engine/src/bin/io-engine-client/v1/controller_cli.rs index c5c9045b4e..d9328912ac 100755 --- a/io-engine/src/bin/io-engine-client/v1/controller_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/controller_cli.rs @@ -20,6 +20,7 @@ pub fn subcommands() -> Command { ); Command::new("controller") + .subcommand_required(true) .arg_required_else_help(true) .about("NVMe controllers") .subcommand(list) diff --git a/io-engine/src/bin/io-engine-client/v1/device_cli.rs b/io-engine/src/bin/io-engine-client/v1/device_cli.rs index c3976502ce..a550f3202f 100644 --- a/io-engine/src/bin/io-engine-client/v1/device_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/device_cli.rs @@ -21,6 +21,7 @@ pub fn subcommands() -> Command { ); Command::new("device") + .subcommand_required(true) .arg_required_else_help(true) .about("Host devices") .subcommand(list) diff --git a/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs b/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs index 8d08b8edfb..d1f0c9d94f 100644 --- a/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs @@ -24,6 +24,7 @@ pub fn subcommands() -> Command { .index(2) .help("Parameters (JSON string) to pass to method call"), ) + .subcommand_required(true) .arg_required_else_help(true) } diff --git a/io-engine/src/bin/io-engine-client/v1/mod.rs b/io-engine/src/bin/io-engine-client/v1/mod.rs index b33101a9a2..0b324a4587 100644 --- a/io-engine/src/bin/io-engine-client/v1/mod.rs +++ b/io-engine/src/bin/io-engine-client/v1/mod.rs @@ -76,6 +76,7 @@ pub(super) async fn main_() -> crate::Result<()> { .subcommand(jsonrpc_cli::subcommands()) .subcommand(controller_cli::subcommands()) .subcommand(test_cli::subcommands()) + .subcommand_required(true) .arg_required_else_help(true) .get_matches(); diff --git a/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs b/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs index 493ea22f35..e9a1b8f80a 100644 --- a/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs @@ -87,6 +87,7 @@ pub fn subcommands() -> Command { ); Command::new("child") + .subcommand_required(true) .arg_required_else_help(true) .about("Nexus child management") .subcommand(fault) diff --git a/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs b/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs index 33abe349f7..5215bbeaa1 100644 --- a/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs @@ -196,6 +196,7 @@ pub fn subcommands() -> Command { ); Command::new("nexus") + .subcommand_required(true) .arg_required_else_help(true) .about("Nexus device management") .subcommand(create) diff --git a/io-engine/src/bin/io-engine-client/v1/perf_cli.rs b/io-engine/src/bin/io-engine-client/v1/perf_cli.rs index 972dc5e1ea..c21f6b5fa7 100644 --- a/io-engine/src/bin/io-engine-client/v1/perf_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/perf_cli.rs @@ -18,6 +18,7 @@ pub fn subcommands() -> Command { let resource = Command::new("resource").about("Resource usage statistics"); Command::new("perf") + .subcommand_required(true) .arg_required_else_help(true) .about("Performance statistics") .subcommand(resource) diff --git a/io-engine/src/bin/io-engine-client/v1/pool_cli.rs b/io-engine/src/bin/io-engine-client/v1/pool_cli.rs index 9da6d1b810..c19897baee 100644 --- a/io-engine/src/bin/io-engine-client/v1/pool_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/pool_cli.rs @@ -79,6 +79,7 @@ pub fn subcommands() -> Command { ); Command::new("pool") + .subcommand_required(true) .arg_required_else_help(true) .about("Storage pool management") .subcommand(create) diff --git a/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs b/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs index 658f4468f0..5f1540567f 100644 --- a/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs @@ -145,6 +145,7 @@ pub fn subcommands() -> Command { ); Command::new("rebuild") + .subcommand_required(true) .arg_required_else_help(true) .about("Rebuild management") .subcommand(start) diff --git a/io-engine/src/bin/io-engine-client/v1/replica_cli.rs b/io-engine/src/bin/io-engine-client/v1/replica_cli.rs index cb749d6276..60b80e54d3 100644 --- a/io-engine/src/bin/io-engine-client/v1/replica_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/replica_cli.rs @@ -107,6 +107,7 @@ pub fn subcommands() -> Command { .help("Replica uuid"), ); Command::new("replica") + .subcommand_required(true) .arg_required_else_help(true) .about("Replica management") .subcommand(create) diff --git a/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs b/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs index 893215fc40..9a2ea4d603 100644 --- a/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs @@ -162,6 +162,7 @@ pub fn subcommands() -> Command { .help("Snapshot uuid"), ); Command::new("snapshot") + .subcommand_required(true) .arg_required_else_help(true) .about("Snapshot management") .subcommand(create_for_nexus) diff --git a/io-engine/src/bin/io-engine-client/v1/test_cli.rs b/io-engine/src/bin/io-engine-client/v1/test_cli.rs index 7c371eb0da..f7dd837224 100644 --- a/io-engine/src/bin/io-engine-client/v1/test_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/test_cli.rs @@ -86,6 +86,7 @@ pub fn subcommands() -> Command { ); Command::new("test") + .subcommand_required(true) .arg_required_else_help(true) .about("Test management") .subcommand(inject) From 32933db6a784e46c99abac596d52b8752927b362 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Fri, 27 Oct 2023 16:58:39 +0100 Subject: [PATCH 3/3] refactor: pull rpc from dependencies Move to latest dependencies submodule and pull the rpc from there. This also upgrades tonic/prost to latest versions. Signed-off-by: Tiago Castro --- .gitmodules | 8 +- .rustfmt.toml | 2 +- Cargo.lock | 388 +++++------------- Cargo.toml | 11 +- io-engine-bench/Cargo.toml | 6 +- io-engine-tests/Cargo.toml | 12 +- io-engine-tests/src/compose/rpc/v0.rs | 2 +- io-engine-tests/src/compose/rpc/v1.rs | 2 +- io-engine-tests/src/replica.rs | 4 +- io-engine-tests/src/snapshot.rs | 2 +- io-engine/Cargo.toml | 14 +- io-engine/src/bdev/nexus/nexus_bdev.rs | 2 +- io-engine/src/bin/io-engine-client/context.rs | 2 +- io-engine/src/bin/io-engine-client/main.rs | 2 +- .../src/bin/io-engine-client/v0/bdev_cli.rs | 2 +- .../bin/io-engine-client/v0/controller_cli.rs | 5 +- .../src/bin/io-engine-client/v0/device_cli.rs | 2 +- .../bin/io-engine-client/v0/jsonrpc_cli.rs | 2 +- .../io-engine-client/v0/nexus_child_cli.rs | 2 +- .../src/bin/io-engine-client/v0/nexus_cli.rs | 13 +- .../src/bin/io-engine-client/v0/perf_cli.rs | 2 +- .../src/bin/io-engine-client/v0/pool_cli.rs | 5 +- .../bin/io-engine-client/v0/rebuild_cli.rs | 2 +- .../bin/io-engine-client/v0/replica_cli.rs | 13 +- .../bin/io-engine-client/v0/snapshot_cli.rs | 2 +- .../src/bin/io-engine-client/v1/bdev_cli.rs | 2 +- .../bin/io-engine-client/v1/controller_cli.rs | 5 +- .../src/bin/io-engine-client/v1/device_cli.rs | 2 +- .../bin/io-engine-client/v1/jsonrpc_cli.rs | 2 +- .../io-engine-client/v1/nexus_child_cli.rs | 2 +- .../src/bin/io-engine-client/v1/nexus_cli.rs | 11 +- .../src/bin/io-engine-client/v1/perf_cli.rs | 2 +- .../src/bin/io-engine-client/v1/pool_cli.rs | 5 +- .../bin/io-engine-client/v1/rebuild_cli.rs | 5 +- .../bin/io-engine-client/v1/replica_cli.rs | 13 +- .../bin/io-engine-client/v1/snapshot_cli.rs | 2 +- .../src/bin/io-engine-client/v1/test_cli.rs | 2 +- io-engine/src/grpc/server.rs | 2 +- io-engine/src/grpc/v0/bdev_grpc.rs | 2 +- io-engine/src/grpc/v0/json_grpc.rs | 4 +- io-engine/src/grpc/v0/mayastor_grpc.rs | 4 +- io-engine/src/grpc/v0/nexus_grpc.rs | 2 +- io-engine/src/grpc/v1/bdev.rs | 2 +- io-engine/src/grpc/v1/host.rs | 4 +- io-engine/src/grpc/v1/json.rs | 2 +- io-engine/src/grpc/v1/nexus.rs | 6 +- io-engine/src/grpc/v1/pool.rs | 2 +- io-engine/src/grpc/v1/replica.rs | 2 +- io-engine/src/grpc/v1/snapshot.rs | 2 +- io-engine/src/grpc/v1/test.rs | 2 +- io-engine/src/subsys/config/pool.rs | 4 +- .../subsys/registration/registration_grpc.rs | 6 +- io-engine/tests/snapshot_nexus.rs | 2 +- io-engine/tests/wipe.rs | 2 +- jsonrpc/Cargo.toml | 2 +- rpc/mayastor-api | 1 - utils/dependencies | 1 + utils/io-engine-dependencies | 1 - 58 files changed, 225 insertions(+), 390 deletions(-) delete mode 160000 rpc/mayastor-api create mode 160000 utils/dependencies delete mode 160000 utils/io-engine-dependencies diff --git a/.gitmodules b/.gitmodules index c9a360c162..2dc1e92e0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,8 @@ -[submodule "rpc/mayastor-api"] - path = rpc/mayastor-api - url = https://github.com/openebs/mayastor-api - branch = develop [submodule "spdk-rs"] path = spdk-rs url = https://github.com/openebs/spdk-rs branch = develop -[submodule "utils/io-engine-dependencies"] - path = utils/io-engine-dependencies +[submodule "utils/dependencies"] + path = utils/dependencies url = https://github.com/openebs/mayastor-dependencies.git branch = develop diff --git a/.rustfmt.toml b/.rustfmt.toml index 550e330151..f1d06f5586 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -15,5 +15,5 @@ spaces_around_ranges = true edition = "2018" ignore = [ - "rpc/mayastor-api" + "utils/dependencies/apis/io-engine" ] diff --git a/Cargo.lock b/Cargo.lock index 24d8ba8f9a..43a43ac880 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,7 +143,7 @@ dependencies = [ "polling", "rustix 0.37.19", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] @@ -255,9 +255,9 @@ checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", @@ -338,9 +338,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -370,7 +370,7 @@ dependencies = [ "lazycell", "log", "peeking_take_while", - "prettyplease 0.2.15", + "prettyplease", "proc-macro2", "quote", "regex", @@ -699,7 +699,7 @@ dependencies = [ "criterion-plot", "futures", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -721,7 +721,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -1010,15 +1010,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "erased-serde" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da96524cc884f6558f1769b6c46686af2fe8e8b4cd253bd5a3cdba8181b8e070" -dependencies = [ - "serde", -] - [[package]] name = "errno" version = "0.3.4" @@ -1047,11 +1038,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d982a3b3088a5f95d19882d298b352a2e0be20703e3080c1e6767731d5dec79" dependencies = [ "http", - "prost 0.12.1", + "prost", "tokio", "tokio-stream", - "tonic 0.10.2", - "tonic-build 0.10.2", + "tonic", + "tonic-build", "tower", "tower-service", ] @@ -1094,14 +1085,14 @@ dependencies = [ "chrono", "futures", "once_cell", - "prost 0.11.9", - "prost-wkt-types", + "prost", + "prost-extend", "serde", "serde_json", "snafu", "tokio", - "tonic 0.9.2", - "tonic-build 0.9.2", + "tonic", + "tonic-build", "tracing", "uuid", ] @@ -1358,9 +1349,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1477,7 +1468,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1579,12 +1570,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "inventory" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53088c87cf71c9d4f3372a2cb9eea1e7b8a0b1bf8b7f7d23fe5b76dbb07e63b" - [[package]] name = "io-engine" version = "1.0.0" @@ -1614,6 +1599,7 @@ dependencies = [ "hex", "http", "humantime", + "io-engine-api", "io-engine-tests", "io-uring", "ioctl-gen", @@ -1622,7 +1608,6 @@ dependencies = [ "libc", "libnvme-rs", "log", - "mayastor-api", "md5", "merge", "nix", @@ -1630,8 +1615,8 @@ dependencies = [ "parking_lot", "pin-utils", "proc-mounts", - "prost 0.11.9", - "prost-derive 0.11.9", + "prost", + "prost-derive", "rand", "regex", "rstack", @@ -1648,7 +1633,7 @@ dependencies = [ "sysfs", "tokio", "tokio-stream", - "tonic 0.9.2", + "tonic", "tower", "tracing", "tracing-core", @@ -1660,6 +1645,23 @@ dependencies = [ "version-info", ] +[[package]] +name = "io-engine-api" +version = "1.0.0" +dependencies = [ + "bytes", + "prost", + "prost-build", + "prost-derive", + "prost-extend", + "prost-types", + "serde", + "serde_derive", + "serde_json", + "tonic", + "tonic-build", +] + [[package]] name = "io-engine-bench" version = "0.1.0" @@ -1671,14 +1673,14 @@ dependencies = [ "env_logger", "futures", "io-engine", + "io-engine-api", "io-engine-tests", "libnvme-rs", - "mayastor-api", "once_cell", "run_script", "spdk-rs", "tokio", - "tonic 0.9.2", + "tonic", "tracing", "tracing-core", "tracing-futures", @@ -1708,6 +1710,7 @@ dependencies = [ "hex", "http", "io-engine", + "io-engine-api", "io-engine-tests-macros", "io-uring", "ioctl-gen", @@ -1716,7 +1719,6 @@ dependencies = [ "libc", "libnvme-rs", "log", - "mayastor-api", "md5", "merge", "nix", @@ -1724,8 +1726,8 @@ dependencies = [ "parking_lot", "pin-utils", "proc-mounts", - "prost 0.11.9", - "prost-derive 0.11.9", + "prost", + "prost-derive", "rand", "rand_chacha", "regex", @@ -1739,7 +1741,7 @@ dependencies = [ "spdk-rs", "sysfs", "tokio", - "tonic 0.9.2", + "tonic", "tower", "tracing", "tracing-core", @@ -1816,6 +1818,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1840,7 +1851,7 @@ dependencies = [ "serde_derive", "serde_json", "tokio", - "tonic 0.9.2", + "tonic", "tracing", ] @@ -1935,26 +1946,9 @@ dependencies = [ [[package]] name = "matchit" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" - -[[package]] -name = "mayastor-api" -version = "1.0.0" -dependencies = [ - "bytes", - "prost 0.11.9", - "prost-build 0.11.9", - "prost-derive 0.11.9", - "prost-types 0.11.9", - "prost-wkt-types", - "serde", - "serde_derive", - "serde_json", - "tonic 0.9.2", - "tonic-build 0.9.2", -] +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "md5" @@ -2031,9 +2025,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "log", @@ -2346,16 +2340,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "prettyplease" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" -dependencies = [ - "proc-macro2", - "syn 1.0.109", -] - [[package]] name = "prettyplease" version = "0.2.15" @@ -2408,16 +2392,6 @@ dependencies = [ "partition-identity", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.1" @@ -2425,29 +2399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" dependencies = [ "bytes", - "prost-derive 0.12.1", -] - -[[package]] -name = "prost-build" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" -dependencies = [ - "bytes", - "heck", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prettyplease 0.1.25", - "prost 0.11.9", - "prost-types 0.11.9", - "regex", - "syn 1.0.109", - "tempfile", - "which", + "prost-derive", ] [[package]] @@ -2458,33 +2410,20 @@ checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.11.0", "log", "multimap", "once_cell", "petgraph", - "prettyplease 0.2.15", - "prost 0.12.1", - "prost-types 0.12.1", + "prettyplease", + "prost", + "prost-types", "regex", "syn 2.0.38", "tempfile", "which", ] -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "prost-derive" version = "0.12.1" @@ -2492,19 +2431,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" dependencies = [ "anyhow", - "itertools", + "itertools 0.11.0", "proc-macro2", "quote", "syn 2.0.38", ] [[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +name = "prost-extend" +version = "0.1.0" dependencies = [ - "prost 0.11.9", + "chrono", + "prost", + "serde", + "tonic-build", ] [[package]] @@ -2513,53 +2453,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" dependencies = [ - "prost 0.12.1", -] - -[[package]] -name = "prost-wkt" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562788060bcf2bfabe055194bd991ed2442457661744c88e0a0828ff9a08c08b" -dependencies = [ - "chrono", - "inventory", - "prost 0.11.9", - "serde", - "serde_derive", - "serde_json", - "typetag", -] - -[[package]] -name = "prost-wkt-build" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4dca8bcead3b728a6a7da017cc95e7f4cb2320ec4f6896bc593a1c4700f7328" -dependencies = [ - "heck", - "prost 0.11.9", - "prost-build 0.11.9", - "prost-types 0.11.9", - "quote", -] - -[[package]] -name = "prost-wkt-types" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2377c5680f2342871823045052e791b4487f7c90aae17e0feaee24cf59578a34" -dependencies = [ - "chrono", - "prost 0.11.9", - "prost-build 0.11.9", - "prost-types 0.11.9", - "prost-wkt", - "prost-wkt-build", - "regex", - "serde", - "serde_derive", - "serde_json", + "prost", ] [[package]] @@ -2880,18 +2774,18 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -3075,9 +2969,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -3085,9 +2979,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -3309,7 +3203,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.5", "tokio-macros", "windows-sys", ] @@ -3369,9 +3263,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -3381,34 +3275,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tonic" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" -dependencies = [ - "async-trait", - "axum", - "base64", - "bytes", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost 0.11.9", - "tokio", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tonic" version = "0.10.2" @@ -3427,7 +3293,7 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.12.1", + "prost", "tokio", "tokio-stream", "tower", @@ -3436,28 +3302,15 @@ dependencies = [ "tracing", ] -[[package]] -name = "tonic-build" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" -dependencies = [ - "prettyplease 0.1.25", - "proc-macro2", - "prost-build 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "tonic-build" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" dependencies = [ - "prettyplease 0.2.15", + "prettyplease", "proc-macro2", - "prost-build 0.12.1", + "prost-build", "quote", "syn 2.0.38", ] @@ -3496,11 +3349,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -3509,9 +3361,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -3520,9 +3372,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -3579,30 +3431,6 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" -[[package]] -name = "typetag" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aec6850cc671cd0cfb3ab285465e48a3b927d9de155051c35797446b32f9169f" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c49a6815b4f8379c36f06618bc1b80ca77aaf8a3fd4d8549dca6fdb016000f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.38", -] - [[package]] name = "udev" version = "0.8.0" @@ -3880,9 +3708,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -3895,45 +3723,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "yansi" diff --git a/Cargo.toml b/Cargo.toml index 52d10ef370..5bf6369ba2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,11 +9,12 @@ members = [ "io-engine", "io-engine-bench", "io-engine-tests", - "rpc/mayastor-api", "sysfs", "spdk-rs", - "utils/io-engine-dependencies/version-info", - "utils/io-engine-dependencies/composer", - "utils/io-engine-dependencies/devinfo", - "utils/io-engine-dependencies/nvmeadm", + "utils/dependencies/apis/io-engine", + "utils/dependencies/prost-extend", + "utils/dependencies/version-info", + "utils/dependencies/composer", + "utils/dependencies/devinfo", + "utils/dependencies/nvmeadm", ] diff --git a/io-engine-bench/Cargo.toml b/io-engine-bench/Cargo.toml index c820a89f87..c106423e51 100644 --- a/io-engine-bench/Cargo.toml +++ b/io-engine-bench/Cargo.toml @@ -11,7 +11,7 @@ chrono = "0.4.31" env_logger = "0.10.0" futures = "0.3.28" once_cell = "1.18.0" -tonic = "0.9.2" +tonic = "0.10.2" tracing = "0.1.37" tracing-core = "0.1.31" tracing-futures = "0.2.5" @@ -20,9 +20,9 @@ url = "2.4.1" crossbeam = "0.8.2" uuid = { version = "1.4.1", features = ["v4"] } run_script = "0.10.1" -mayastor-api = { path = "../rpc/mayastor-api" } +io-engine-api = { path = "../utils/dependencies/apis/io-engine" } io-engine = { path = "../io-engine" } -composer = { path = "../utils/io-engine-dependencies/composer" } +composer = { path = "../utils/dependencies/composer" } spdk-rs = { path = "../spdk-rs" } io-engine-tests = { path = "../io-engine-tests" } libnvme-rs = { path = "../libnvme-rs", version = "0.1.0" } diff --git a/io-engine-tests/Cargo.toml b/io-engine-tests/Cargo.toml index 0480c7fa64..5a0cd00c4a 100644 --- a/io-engine-tests/Cargo.toml +++ b/io-engine-tests/Cargo.toml @@ -33,8 +33,8 @@ once_cell = "1.18.0" parking_lot = "0.12.1" pin-utils = "0.1.0" proc-mounts = "0.3.0" -prost = "0.11.9" -prost-derive = "0.11.9" +prost = "0.12.1" +prost-derive = "0.12.1" rand = "0.8.5" rand_chacha = "0.3.1" regex = "1.10.0" @@ -44,7 +44,7 @@ serde_yaml = "0.9.25" sha2 = "0.10.8" signal-hook = "0.3.17" snafu = "0.7.5" -tonic = "0.9.2" +tonic = "0.10.2" tower = "0.4.13" tracing = "0.1.37" tracing-core = "0.1.31" @@ -53,10 +53,10 @@ tracing-subscriber = "0.3.17" udev = "0.8.0" url = "2.4.1" -composer = { path = "../utils/io-engine-dependencies/composer" } +composer = { path = "../utils/dependencies/composer" } libnvme-rs = { path = "../libnvme-rs" } -mayastor-api = { path = "../rpc/mayastor-api" } -version-info = { path = "../utils/io-engine-dependencies/version-info" } +io-engine-api = { path = "../utils/dependencies/apis/io-engine" } +version-info = { path = "../utils/dependencies/version-info" } io-engine = { path = "../io-engine" } io-engine-tests-macros = { path = "./io-engine-tests-macros" } diff --git a/io-engine-tests/src/compose/rpc/v0.rs b/io-engine-tests/src/compose/rpc/v0.rs index 920f4d8451..805ceb6fb2 100644 --- a/io-engine-tests/src/compose/rpc/v0.rs +++ b/io-engine-tests/src/compose/rpc/v0.rs @@ -14,7 +14,7 @@ use std::{ use tonic::transport::Channel; pub mod mayastor { - pub use mayastor_api::v0::*; + pub use io_engine_api::v0::*; } #[derive(Clone)] diff --git a/io-engine-tests/src/compose/rpc/v1.rs b/io-engine-tests/src/compose/rpc/v1.rs index 2866f086c6..9e9c14f875 100644 --- a/io-engine-tests/src/compose/rpc/v1.rs +++ b/io-engine-tests/src/compose/rpc/v1.rs @@ -10,7 +10,7 @@ use std::{ use tonic::transport::Channel; pub use tonic::Status; -pub use mayastor_api::v1::*; +pub use io_engine_api::v1::*; type HandleLock = tokio::sync::Mutex; type HandleLockGuard<'a, T> = tokio::sync::MutexGuard<'a, T>; diff --git a/io-engine-tests/src/replica.rs b/io-engine-tests/src/replica.rs index 60e0d4f640..ae39ae38e6 100644 --- a/io-engine-tests/src/replica.rs +++ b/io-engine-tests/src/replica.rs @@ -5,7 +5,7 @@ use super::{ pool::PoolBuilder, }; use io_engine::{constants::NVME_NQN_PREFIX, subsys::make_subsystem_serial}; -use mayastor_api::v1::replica::{ +use io_engine_api::v1::replica::{ destroy_replica_request, CreateReplicaRequest, DestroyReplicaRequest, @@ -83,7 +83,7 @@ impl ReplicaBuilder { } pub fn with_nvmf(mut self) -> Self { - self.share = mayastor_api::v1::common::ShareProtocol::Nvmf as i32; + self.share = io_engine_api::v1::common::ShareProtocol::Nvmf as i32; self } diff --git a/io-engine-tests/src/snapshot.rs b/io-engine-tests/src/snapshot.rs index 261af23a88..66d92d5345 100644 --- a/io-engine-tests/src/snapshot.rs +++ b/io-engine-tests/src/snapshot.rs @@ -1,6 +1,6 @@ use super::{compose::rpc::v1::SharedRpcHandle, generate_uuid}; -use mayastor_api::v1::snapshot::{ +use io_engine_api::v1::snapshot::{ CreateReplicaSnapshotRequest, CreateReplicaSnapshotResponse, CreateSnapshotCloneRequest, diff --git a/io-engine/Cargo.toml b/io-engine/Cargo.toml index 9ef728a8f5..199a1f478a 100644 --- a/io-engine/Cargo.toml +++ b/io-engine/Cargo.toml @@ -74,8 +74,8 @@ once_cell = "1.18.0" parking_lot = "0.12.1" pin-utils = "0.1.0" proc-mounts = "0.3.0" -prost = "0.11.9" -prost-derive = "0.11.9" +prost = "0.12.1" +prost-derive = "0.12.1" rand = "0.8.5" regex = "1.10.0" serde_json = "1.0.107" @@ -85,7 +85,7 @@ signal-hook = "0.3.17" snafu = "0.7.5" strum = "0.25" strum_macros = "0.25" -tonic = "0.9.2" +tonic = "0.10.2" tower = "0.4.13" tracing = "0.1.37" tracing-core = "0.1.31" @@ -99,12 +99,12 @@ rstack = { version = "0.3.3" } tokio-stream = "0.1.14" jsonrpc = { path = "../jsonrpc"} -mayastor-api = { path = "../rpc/mayastor-api" } +io-engine-api = { path = "../utils/dependencies/apis/io-engine" } spdk-rs = { path = "../spdk-rs" } sysfs = { path = "../sysfs" } -version-info = { path = "../utils/io-engine-dependencies/version-info" } -events-api = { path = "../utils/io-engine-dependencies/events-api" } -event-publisher = { path = "../utils/io-engine-dependencies/event-publisher" } +version-info = { path = "../utils/dependencies/version-info" } +events-api = { path = "../utils/dependencies/apis/events" } +event-publisher = { path = "../utils/dependencies/event-publisher" } [dependencies.serde] features = ["derive"] diff --git a/io-engine/src/bdev/nexus/nexus_bdev.rs b/io-engine/src/bdev/nexus/nexus_bdev.rs index 7f92139543..b483e3eaae 100644 --- a/io-engine/src/bdev/nexus/nexus_bdev.rs +++ b/io-engine/src/bdev/nexus/nexus_bdev.rs @@ -1261,7 +1261,7 @@ impl<'n> BdevOps for Nexus<'n> { | IoType::WriteZeros => { let supported = self.io_is_supported(io_type); if !supported { - info!( + debug!( "{:?}: I/O type '{:?}' not supported by at least \ one of child devices", self, io_type diff --git a/io-engine/src/bin/io-engine-client/context.rs b/io-engine/src/bin/io-engine-client/context.rs index 782ad75b6c..28ca5e5b2b 100644 --- a/io-engine/src/bin/io-engine-client/context.rs +++ b/io-engine/src/bin/io-engine-client/context.rs @@ -56,7 +56,7 @@ impl FromStr for OutputFormat { mod v1 { use super::Error; - use mayastor_api::v1::*; + use io_engine_api::v1::*; use tonic::transport::{Channel, Endpoint}; pub type BdevRpcClient = bdev::BdevRpcClient; diff --git a/io-engine/src/bin/io-engine-client/main.rs b/io-engine/src/bin/io-engine-client/main.rs index c1550d8bcd..10eae3ef70 100644 --- a/io-engine/src/bin/io-engine-client/main.rs +++ b/io-engine/src/bin/io-engine-client/main.rs @@ -2,7 +2,7 @@ use byte_unit::Byte; use snafu::{Backtrace, Snafu}; use tonic::transport::Channel; -use mayastor_api::v0::{ +use io_engine_api::v0::{ bdev_rpc_client::BdevRpcClient, json_rpc_client::JsonRpcClient, mayastor_client::MayastorClient, diff --git a/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs b/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs index ff658b8e73..899794c6e6 100644 --- a/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/bdev_cli.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::prelude::*; -use mayastor_api::v0::{BdevShareRequest, BdevUri, CreateReply, Null}; +use io_engine_api::v0::{BdevShareRequest, BdevUri, CreateReply, Null}; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v0/controller_cli.rs b/io-engine/src/bin/io-engine-client/v0/controller_cli.rs index 671d225127..da47fc4215 100755 --- a/io-engine/src/bin/io-engine-client/v0/controller_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/controller_cli.rs @@ -5,8 +5,9 @@ use super::context::Context; use crate::{context::OutputFormat, GrpcStatus}; use clap::{ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::Status; pub fn subcommands() -> Command { @@ -34,7 +35,7 @@ pub async fn handler(ctx: Context, matches: &ArgMatches) -> crate::Result<()> { } fn controller_state_to_str(idx: i32) -> String { - match rpc::NvmeControllerState::from_i32(idx).unwrap() { + match rpc::NvmeControllerState::try_from(idx).unwrap() { rpc::NvmeControllerState::New => "new", rpc::NvmeControllerState::Initializing => "init", rpc::NvmeControllerState::Running => "running", diff --git a/io-engine/src/bin/io-engine-client/v0/device_cli.rs b/io-engine/src/bin/io-engine-client/v0/device_cli.rs index df976f7bdf..b56cb5e51e 100644 --- a/io-engine/src/bin/io-engine-client/v0/device_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/device_cli.rs @@ -5,7 +5,7 @@ use super::context::Context; use crate::{context::OutputFormat, GrpcStatus}; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs b/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs index 4b9a5a4028..d52f23406f 100644 --- a/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/jsonrpc_cli.rs @@ -5,7 +5,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; use tracing::debug; diff --git a/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs b/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs index f375487a4d..027cd0fe62 100644 --- a/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/nexus_child_cli.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs b/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs index 244ef9c52f..cadb1a357e 100644 --- a/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/nexus_cli.rs @@ -8,8 +8,9 @@ use crate::{ use byte_unit::Byte; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::{v0, v1}; +use io_engine_api::{v0, v1}; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::{Code, Status}; use uuid::Uuid; @@ -615,7 +616,7 @@ async fn nexus_children( .iter() .map(|c| { let state = child_state_to_str_v0( - v0::ChildState::from_i32(c.state).unwrap(), + v0::ChildState::try_from(c.state).unwrap(), ); vec![c.uri.clone(), state.to_string()] }) @@ -677,10 +678,10 @@ async fn nexus_children_2( .iter() .map(|c| { let state = child_state_to_str_v1( - v1::nexus::ChildState::from_i32(c.state).unwrap(), + v1::nexus::ChildState::try_from(c.state).unwrap(), ); let reason = child_reason_to_str_v1( - v1::nexus::ChildStateReason::from_i32(c.state_reason) + v1::nexus::ChildStateReason::try_from(c.state_reason) .unwrap(), ); vec![c.uri.clone(), state.to_string(), reason.to_string()] @@ -943,7 +944,7 @@ async fn nexus_remove( } fn ana_state_idx_to_str(idx: i32) -> &'static str { - match v0::NvmeAnaState::from_i32(idx).unwrap() { + match v0::NvmeAnaState::try_from(idx).unwrap() { v0::NvmeAnaState::NvmeAnaInvalidState => "invalid", v0::NvmeAnaState::NvmeAnaOptimizedState => "optimized", v0::NvmeAnaState::NvmeAnaNonOptimizedState => "non_optimized", @@ -954,7 +955,7 @@ fn ana_state_idx_to_str(idx: i32) -> &'static str { } fn nexus_state_to_str(idx: i32) -> &'static str { - match v0::NexusState::from_i32(idx).unwrap() { + match v0::NexusState::try_from(idx).unwrap() { v0::NexusState::NexusUnknown => "unknown", v0::NexusState::NexusOnline => "online", v0::NexusState::NexusDegraded => "degraded", diff --git a/io-engine/src/bin/io-engine-client/v0/perf_cli.rs b/io-engine/src/bin/io-engine-client/v0/perf_cli.rs index 01e04eb6c6..aab689c2fa 100644 --- a/io-engine/src/bin/io-engine-client/v0/perf_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/perf_cli.rs @@ -10,7 +10,7 @@ use super::{ }; use clap::{ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v0/pool_cli.rs b/io-engine/src/bin/io-engine-client/v0/pool_cli.rs index 392a1ce0f4..613d4eab51 100644 --- a/io-engine/src/bin/io-engine-client/v0/pool_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/pool_cli.rs @@ -6,8 +6,9 @@ use crate::{ use byte_unit::Byte; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::Status; pub fn subcommands() -> Command { @@ -181,7 +182,7 @@ async fn list(mut ctx: Context, _matches: &ArgMatches) -> crate::Result<()> { } fn pool_state_to_str(idx: i32) -> &'static str { - match rpc::PoolState::from_i32(idx).unwrap() { + match rpc::PoolState::try_from(idx).unwrap() { rpc::PoolState::PoolUnknown => "unknown", rpc::PoolState::PoolOnline => "online", rpc::PoolState::PoolDegraded => "degraded", diff --git a/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs b/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs index 7244c2816c..f902e9ab70 100644 --- a/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/rebuild_cli.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v0/replica_cli.rs b/io-engine/src/bin/io-engine-client/v0/replica_cli.rs index 802b65994e..576fea5b19 100644 --- a/io-engine/src/bin/io-engine-client/v0/replica_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/replica_cli.rs @@ -7,8 +7,9 @@ use crate::{ use byte_unit::Byte; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::{Code, Status}; pub fn subcommands() -> Command { @@ -539,10 +540,10 @@ fn parse_replica_protocol(pcol: Option<&String>) -> Result { } fn replica_protocol_to_str(idx: i32) -> &'static str { - match rpc::ShareProtocolReplica::from_i32(idx) { - Some(rpc::ShareProtocolReplica::ReplicaNone) => "none", - Some(rpc::ShareProtocolReplica::ReplicaNvmf) => "nvmf", - Some(rpc::ShareProtocolReplica::ReplicaIscsi) => "iscsi", - None => "unknown", + match rpc::ShareProtocolReplica::try_from(idx) { + Ok(rpc::ShareProtocolReplica::ReplicaNone) => "none", + Ok(rpc::ShareProtocolReplica::ReplicaNvmf) => "nvmf", + Ok(rpc::ShareProtocolReplica::ReplicaIscsi) => "iscsi", + Err(_) => "unknown", } } diff --git a/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs b/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs index 9771e5b2df..0a8b80a8e5 100644 --- a/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs +++ b/io-engine/src/bin/io-engine-client/v0/snapshot_cli.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs b/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs index e3335ac97f..a2d2c4841a 100644 --- a/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/bdev_cli.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::prelude::*; -use mayastor_api::v1 as v1rpc; +use io_engine_api::v1 as v1rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v1/controller_cli.rs b/io-engine/src/bin/io-engine-client/v1/controller_cli.rs index d9328912ac..ee1920de69 100755 --- a/io-engine/src/bin/io-engine-client/v1/controller_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/controller_cli.rs @@ -5,8 +5,9 @@ use super::context::Context; use crate::{context::OutputFormat, GrpcStatus}; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v1 as v1rpc; +use io_engine_api::v1 as v1rpc; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::Status; pub fn subcommands() -> Command { @@ -39,7 +40,7 @@ pub async fn handler(ctx: Context, matches: &ArgMatches) -> crate::Result<()> { } fn controller_state_to_str(idx: i32) -> String { - match v1rpc::host::NvmeControllerState::from_i32(idx).unwrap() { + match v1rpc::host::NvmeControllerState::try_from(idx).unwrap() { v1rpc::host::NvmeControllerState::New => "new", v1rpc::host::NvmeControllerState::Initializing => "init", v1rpc::host::NvmeControllerState::Running => "running", diff --git a/io-engine/src/bin/io-engine-client/v1/device_cli.rs b/io-engine/src/bin/io-engine-client/v1/device_cli.rs index a550f3202f..e0820251cd 100644 --- a/io-engine/src/bin/io-engine-client/v1/device_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/device_cli.rs @@ -5,7 +5,7 @@ use super::context::Context; use crate::{context::OutputFormat, GrpcStatus}; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v1 as v1rpc; +use io_engine_api::v1 as v1rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs b/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs index d1f0c9d94f..dca073a348 100644 --- a/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/jsonrpc_cli.rs @@ -5,7 +5,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v1 as v1rpc; +use io_engine_api::v1 as v1rpc; use snafu::ResultExt; use tracing::debug; diff --git a/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs b/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs index e9a1b8f80a..50fa323e13 100644 --- a/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/nexus_child_cli.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v1 as v1rpc; +use io_engine_api::v1 as v1rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs b/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs index 5215bbeaa1..0496c6059a 100644 --- a/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/nexus_cli.rs @@ -8,8 +8,9 @@ use crate::{ use byte_unit::Byte; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::{v1, v1::nexus::NvmeReservation}; +use io_engine_api::{v1, v1::nexus::NvmeReservation}; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::{Code, Status}; use uuid::Uuid; @@ -535,10 +536,10 @@ async fn nexus_children_2( .iter() .map(|c| { let state = child_state_to_str_v1( - v1::nexus::ChildState::from_i32(c.state).unwrap(), + v1::nexus::ChildState::try_from(c.state).unwrap(), ); let reason = child_reason_to_str_v1( - v1::nexus::ChildStateReason::from_i32(c.state_reason) + v1::nexus::ChildStateReason::try_from(c.state_reason) .unwrap(), ); let fault_timestamp = match &c.fault_timestamp { @@ -823,7 +824,7 @@ async fn nexus_remove( } fn ana_state_idx_to_str(idx: i32) -> &'static str { - match v1::nexus::NvmeAnaState::from_i32(idx).unwrap() { + match v1::nexus::NvmeAnaState::try_from(idx).unwrap() { v1::nexus::NvmeAnaState::NvmeAnaInvalidState => "invalid", v1::nexus::NvmeAnaState::NvmeAnaOptimizedState => "optimized", v1::nexus::NvmeAnaState::NvmeAnaNonOptimizedState => "non_optimized", @@ -836,7 +837,7 @@ fn ana_state_idx_to_str(idx: i32) -> &'static str { } fn nexus_state_to_str(idx: i32) -> &'static str { - match v1::nexus::NexusState::from_i32(idx).unwrap() { + match v1::nexus::NexusState::try_from(idx).unwrap() { v1::nexus::NexusState::NexusUnknown => "unknown", v1::nexus::NexusState::NexusOnline => "online", v1::nexus::NexusState::NexusDegraded => "degraded", diff --git a/io-engine/src/bin/io-engine-client/v1/perf_cli.rs b/io-engine/src/bin/io-engine-client/v1/perf_cli.rs index c21f6b5fa7..4dcf20d459 100644 --- a/io-engine/src/bin/io-engine-client/v1/perf_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/perf_cli.rs @@ -10,7 +10,7 @@ use super::{ }; use clap::{ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v1/pool_cli.rs b/io-engine/src/bin/io-engine-client/v1/pool_cli.rs index c19897baee..408698d60a 100644 --- a/io-engine/src/bin/io-engine-client/v1/pool_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/pool_cli.rs @@ -7,8 +7,9 @@ use crate::{ use byte_unit::Byte; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v1 as v1rpc; +use io_engine_api::v1 as v1rpc; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::Status; pub fn subcommands() -> Command { @@ -325,7 +326,7 @@ async fn list(mut ctx: Context, _matches: &ArgMatches) -> crate::Result<()> { } fn pool_state_to_str(idx: i32) -> &'static str { - match v1rpc::pool::PoolState::from_i32(idx).unwrap() { + match v1rpc::pool::PoolState::try_from(idx).unwrap() { v1rpc::pool::PoolState::PoolUnknown => "unknown", v1rpc::pool::PoolState::PoolOnline => "online", v1rpc::pool::PoolState::PoolDegraded => "degraded", diff --git a/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs b/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs index 5f1540567f..c330861894 100644 --- a/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/rebuild_cli.rs @@ -8,8 +8,9 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v1; +use io_engine_api::v1; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::Status; pub async fn handler(ctx: Context, matches: &ArgMatches) -> crate::Result<()> { @@ -404,7 +405,7 @@ async fn history(mut ctx: Context, matches: &ArgMatches) -> crate::Result<()> { .iter() .map(|r| { let state = rebuild_state_to_str( - v1::nexus::RebuildJobState::from_i32(r.state).unwrap(), + v1::nexus::RebuildJobState::try_from(r.state).unwrap(), ) .to_string(); diff --git a/io-engine/src/bin/io-engine-client/v1/replica_cli.rs b/io-engine/src/bin/io-engine-client/v1/replica_cli.rs index 60b80e54d3..0a3f225a6d 100644 --- a/io-engine/src/bin/io-engine-client/v1/replica_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/replica_cli.rs @@ -7,8 +7,9 @@ use crate::{ use byte_unit::Byte; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::{v0 as rpc, v1 as v1_rpc}; +use io_engine_api::{v0 as rpc, v1 as v1_rpc}; use snafu::ResultExt; +use std::convert::TryFrom; use tonic::{Code, Status}; pub fn subcommands() -> Command { @@ -480,10 +481,10 @@ fn parse_replica_protocol(pcol: Option<&String>) -> Result { } fn replica_protocol_to_str(idx: i32) -> &'static str { - match v1_rpc::common::ShareProtocol::from_i32(idx) { - Some(v1_rpc::common::ShareProtocol::None) => "none", - Some(v1_rpc::common::ShareProtocol::Nvmf) => "nvmf", - Some(v1_rpc::common::ShareProtocol::Iscsi) => "iscsi", - None => "unknown", + match v1_rpc::common::ShareProtocol::try_from(idx) { + Ok(v1_rpc::common::ShareProtocol::None) => "none", + Ok(v1_rpc::common::ShareProtocol::Nvmf) => "nvmf", + Ok(v1_rpc::common::ShareProtocol::Iscsi) => "iscsi", + Err(_) => "unknown", } } diff --git a/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs b/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs index 9a2ea4d603..97535e6e92 100644 --- a/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/snapshot_cli.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; -use mayastor_api::v1 as v1_rpc; +use io_engine_api::v1 as v1_rpc; use snafu::ResultExt; use tonic::Status; diff --git a/io-engine/src/bin/io-engine-client/v1/test_cli.rs b/io-engine/src/bin/io-engine-client/v1/test_cli.rs index f7dd837224..29cca6de45 100644 --- a/io-engine/src/bin/io-engine-client/v1/test_cli.rs +++ b/io-engine/src/bin/io-engine-client/v1/test_cli.rs @@ -8,7 +8,7 @@ use byte_unit::Byte; use clap::{Arg, ArgMatches, Command}; use colored_json::ToColoredJson; use futures::StreamExt; -use mayastor_api::v1 as v1_rpc; +use io_engine_api::v1 as v1_rpc; use snafu::ResultExt; use std::{convert::TryInto, str::FromStr}; use strum::VariantNames; diff --git a/io-engine/src/grpc/server.rs b/io-engine/src/grpc/server.rs index cfb655d2a6..3a838e13e5 100644 --- a/io-engine/src/grpc/server.rs +++ b/io-engine/src/grpc/server.rs @@ -16,7 +16,7 @@ use super::{ }, }; -use mayastor_api::{ +use io_engine_api::{ v0::{ bdev_rpc_server::BdevRpcServer, json_rpc_server::JsonRpcServer, diff --git a/io-engine/src/grpc/v0/bdev_grpc.rs b/io-engine/src/grpc/v0/bdev_grpc.rs index cf3ae2e500..4e5b5a0732 100644 --- a/io-engine/src/grpc/v0/bdev_grpc.rs +++ b/io-engine/src/grpc/v0/bdev_grpc.rs @@ -4,7 +4,7 @@ use tracing::instrument; use std::{convert::TryFrom, pin::Pin}; use url::Url; -use mayastor_api::v0::{ +use io_engine_api::v0::{ bdev_rpc_server::BdevRpc, Bdev as RpcBdev, BdevShareReply, diff --git a/io-engine/src/grpc/v0/json_grpc.rs b/io-engine/src/grpc/v0/json_grpc.rs index 4512742281..d2e4519936 100644 --- a/io-engine/src/grpc/v0/json_grpc.rs +++ b/io-engine/src/grpc/v0/json_grpc.rs @@ -2,12 +2,12 @@ //! gRPC method to proxy calls to (local) SPDK json-rpc service use crate::grpc::GrpcResult; -use jsonrpc::error::Error; -use mayastor_api::v0::{ +use io_engine_api::v0::{ json_rpc_server::JsonRpc, JsonRpcReply, JsonRpcRequest, }; +use jsonrpc::error::Error; use std::borrow::Cow; use tonic::{Request, Response}; diff --git a/io-engine/src/grpc/v0/mayastor_grpc.rs b/io-engine/src/grpc/v0/mayastor_grpc.rs index 78dd92930c..15cbff7a3c 100644 --- a/io-engine/src/grpc/v0/mayastor_grpc.rs +++ b/io-engine/src/grpc/v0/mayastor_grpc.rs @@ -58,7 +58,7 @@ use crate::{ use chrono::Utc; use futures::FutureExt; -use mayastor_api::v0::*; +use io_engine_api::v0::*; use nix::errno::Errno; use std::{ convert::{TryFrom, TryInto}, @@ -392,7 +392,7 @@ impl From for RebuildStatsReply { } } -impl From for mayastor_api::v0::MayastorFeatures { +impl From for io_engine_api::v0::MayastorFeatures { fn from(f: MayastorFeatures) -> Self { Self { asymmetric_namespace_access: f.asymmetric_namespace_access, diff --git a/io-engine/src/grpc/v0/nexus_grpc.rs b/io-engine/src/grpc/v0/nexus_grpc.rs index 85d020c7d3..4528d8d546 100644 --- a/io-engine/src/grpc/v0/nexus_grpc.rs +++ b/io-engine/src/grpc/v0/nexus_grpc.rs @@ -1,5 +1,5 @@ ///! Helpers related to nexus grpc methods. -use mayastor_api::v0 as rpc; +use io_engine_api::v0 as rpc; use rpc::{ChildState, ChildStateReason}; use std::{convert::From, pin::Pin}; use uuid::Uuid; diff --git a/io-engine/src/grpc/v1/bdev.rs b/io-engine/src/grpc/v1/bdev.rs index 203b680c1e..fd9c043664 100644 --- a/io-engine/src/grpc/v1/bdev.rs +++ b/io-engine/src/grpc/v1/bdev.rs @@ -4,7 +4,7 @@ use crate::{ core::{CoreError, Protocol, Share, ShareProps}, grpc::{rpc_submit, GrpcResult}, }; -use mayastor_api::v1::bdev::{ +use io_engine_api::v1::bdev::{ Bdev, BdevRpc, BdevShareRequest, diff --git a/io-engine/src/grpc/v1/host.rs b/io-engine/src/grpc/v1/host.rs index 1499739dcb..8cc570390a 100644 --- a/io-engine/src/grpc/v1/host.rs +++ b/io-engine/src/grpc/v1/host.rs @@ -17,7 +17,7 @@ use crate::{ }; use ::function_name::named; use futures::FutureExt; -use mayastor_api::v1::{host as host_rpc, registration::RegisterRequest}; +use io_engine_api::v1::{host as host_rpc, registration::RegisterRequest}; use std::panic::AssertUnwindSafe; use tonic::{Request, Response, Status}; use version_info::raw_version_string; @@ -221,7 +221,7 @@ impl host_rpc::HostRpc for HostService { .api_versions .iter() .map(|v| { - let api_version: mayastor_api::v1::registration::ApiVersion = + let api_version: io_engine_api::v1::registration::ApiVersion = v.clone().into(); api_version as i32 }) diff --git a/io-engine/src/grpc/v1/json.rs b/io-engine/src/grpc/v1/json.rs index c3503fd075..ec3a763381 100644 --- a/io-engine/src/grpc/v1/json.rs +++ b/io-engine/src/grpc/v1/json.rs @@ -2,8 +2,8 @@ //! gRPC method to proxy calls to (local) SPDK json-rpc service use crate::grpc::GrpcResult; +use io_engine_api::v1::json::{JsonRpc, JsonRpcRequest, JsonRpcResponse}; use jsonrpc::error::Error; -use mayastor_api::v1::json::{JsonRpc, JsonRpcRequest, JsonRpcResponse}; use std::borrow::Cow; use tonic::{Request, Response}; diff --git a/io-engine/src/grpc/v1/nexus.rs b/io-engine/src/grpc/v1/nexus.rs index fa7f3e2c8b..c6d431360c 100644 --- a/io-engine/src/grpc/v1/nexus.rs +++ b/io-engine/src/grpc/v1/nexus.rs @@ -27,7 +27,7 @@ use std::{ }; use tonic::{Request, Response, Status}; -use mayastor_api::v1::nexus::*; +use io_engine_api::v1::nexus::*; #[derive(Debug)] struct UnixStream(tokio::net::UnixStream); @@ -199,7 +199,7 @@ impl From for RebuildStatsResponse { } } -impl From for mayastor_api::v1::nexus::RebuildJobState { +impl From for io_engine_api::v1::nexus::RebuildJobState { fn from(state: RebuildState) -> Self { match state { RebuildState::Init => RebuildJobState::Init, @@ -1063,7 +1063,7 @@ impl NexusRpc for NexusService { let count = args.count.unwrap_or(u32::MAX) as usize; let end_time = args .since_end_time - .map(chrono::DateTime::::from); + .and_then(|t| chrono::DateTime::::try_from(t).ok()); let rx = rpc_submit::<_, _, nexus::Error>(async move { let mut newest_end_time = None; let default_end_time = chrono::Utc::now(); diff --git a/io-engine/src/grpc/v1/pool.rs b/io-engine/src/grpc/v1/pool.rs index eadb4250ca..1c04b23b76 100644 --- a/io-engine/src/grpc/v1/pool.rs +++ b/io-engine/src/grpc/v1/pool.rs @@ -9,7 +9,7 @@ use nix::errno::Errno; use std::{convert::TryFrom, fmt::Debug}; use tonic::{Request, Response, Status}; -use mayastor_api::v1::pool::*; +use io_engine_api::v1::pool::*; #[derive(Debug)] struct UnixStream(tokio::net::UnixStream); diff --git a/io-engine/src/grpc/v1/replica.rs b/io-engine/src/grpc/v1/replica.rs index 82b937558d..6856b40169 100644 --- a/io-engine/src/grpc/v1/replica.rs +++ b/io-engine/src/grpc/v1/replica.rs @@ -16,7 +16,7 @@ use crate::{ }; use ::function_name::named; use futures::FutureExt; -use mayastor_api::v1::replica::*; +use io_engine_api::v1::replica::*; use nix::errno::Errno; use std::{convert::TryFrom, panic::AssertUnwindSafe, pin::Pin}; use tonic::{Request, Response, Status}; diff --git a/io-engine/src/grpc/v1/snapshot.rs b/io-engine/src/grpc/v1/snapshot.rs index a7eb3857c7..07745e4d77 100644 --- a/io-engine/src/grpc/v1/snapshot.rs +++ b/io-engine/src/grpc/v1/snapshot.rs @@ -30,7 +30,7 @@ use ::function_name::named; use chrono::{DateTime, Utc}; use core::ffi::{c_char, c_void}; use futures::FutureExt; -use mayastor_api::v1::snapshot::*; +use io_engine_api::v1::snapshot::*; use nix::errno::Errno; use spdk_rs::libspdk::spdk_blob_get_xattr_value; use std::{convert::TryFrom, panic::AssertUnwindSafe}; diff --git a/io-engine/src/grpc/v1/test.rs b/io-engine/src/grpc/v1/test.rs index 2b05887a35..dd615b7db2 100644 --- a/io-engine/src/grpc/v1/test.rs +++ b/io-engine/src/grpc/v1/test.rs @@ -9,7 +9,7 @@ use crate::{ lvs::{Error as LvsError, Lvol, Lvs, LvsLvol}, }; use ::function_name::named; -use mayastor_api::{ +use io_engine_api::{ v1, v1::test::{ wipe_options::WipeMethod, diff --git a/io-engine/src/subsys/config/pool.rs b/io-engine/src/subsys/config/pool.rs index f0c857abbb..9af4191856 100644 --- a/io-engine/src/subsys/config/pool.rs +++ b/io-engine/src/subsys/config/pool.rs @@ -209,7 +209,9 @@ struct Replica { share: Option, } -async fn create_pool(args: PoolArgs) -> Result { +async fn create_pool( + args: PoolArgs, +) -> Result { if args.disks.is_empty() { return Err(Status::invalid_argument("Missing devices")); } diff --git a/io-engine/src/subsys/registration/registration_grpc.rs b/io-engine/src/subsys/registration/registration_grpc.rs index 1b82c48573..abf4398a20 100644 --- a/io-engine/src/subsys/registration/registration_grpc.rs +++ b/io-engine/src/subsys/registration/registration_grpc.rs @@ -2,7 +2,7 @@ use futures::{select, FutureExt, StreamExt}; use http::Uri; -use mayastor_api::v1::registration::{ +use io_engine_api::v1::registration::{ registration_client, DeregisterRequest, RegisterRequest, @@ -158,7 +158,7 @@ impl Registration { .clone() .into_iter() .map(|v| { - let api_version: mayastor_api::v1::registration::ApiVersion = + let api_version: io_engine_api::v1::registration::ApiVersion = v.into(); api_version as i32 }) @@ -254,7 +254,7 @@ impl Registration { } } -impl From for mayastor_api::v1::registration::ApiVersion { +impl From for io_engine_api::v1::registration::ApiVersion { fn from(api_version: ApiVersion) -> Self { match api_version { ApiVersion::V0 => Self::V0, diff --git a/io-engine/tests/snapshot_nexus.rs b/io-engine/tests/snapshot_nexus.rs index 8051531e7b..79b9517218 100755 --- a/io-engine/tests/snapshot_nexus.rs +++ b/io-engine/tests/snapshot_nexus.rs @@ -40,7 +40,7 @@ use io_engine::{ use io_engine_tests::file_io::{test_write_to_file, DataSize}; use nix::errno::Errno; -use mayastor_api::v1::{ +use io_engine_api::v1::{ replica::list_replica_options, snapshot::{ destroy_snapshot_request::Pool, diff --git a/io-engine/tests/wipe.rs b/io-engine/tests/wipe.rs index f63aaf4558..84e07e6333 100644 --- a/io-engine/tests/wipe.rs +++ b/io-engine/tests/wipe.rs @@ -12,7 +12,7 @@ use io_engine_tests::{ replica::ReplicaBuilder, }; -use mayastor_api::{ +use io_engine_api::{ v1 as v1_rpc, v1::{ replica::Replica, diff --git a/jsonrpc/Cargo.toml b/jsonrpc/Cargo.toml index b165017031..2910b54577 100644 --- a/jsonrpc/Cargo.toml +++ b/jsonrpc/Cargo.toml @@ -9,7 +9,7 @@ nix = "0.27.1" serde = "1.0.188" serde_derive = "1.0.188" serde_json = "1.0.107" -tonic = "0.9.2" +tonic = "0.10.2" tokio = { version = "1.33.0", features = ["full"] } tracing = "0.1.37" diff --git a/rpc/mayastor-api b/rpc/mayastor-api deleted file mode 160000 index 669c958a20..0000000000 --- a/rpc/mayastor-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 669c958a204b3a42e51aa83e594d9f374664474a diff --git a/utils/dependencies b/utils/dependencies new file mode 160000 index 0000000000..2a43512b95 --- /dev/null +++ b/utils/dependencies @@ -0,0 +1 @@ +Subproject commit 2a43512b95d1974ac85c661d036c0ec389e6fd94 diff --git a/utils/io-engine-dependencies b/utils/io-engine-dependencies deleted file mode 160000 index 236918d70b..0000000000 --- a/utils/io-engine-dependencies +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 236918d70b137cc0f434af031ae9358c0a54c21e