From dea7a3a7c1578cd724b02a7e30c79b3c2dabccc2 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Tue, 26 Sep 2023 13:03:26 +0300 Subject: [PATCH] Move all crates to workspace root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Having all the workspace crates under the crates/ directory is unnecessary. Rust documentation itself recommends all crates to be in the root directory: https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html#creating-the-second-package-in-the-workspace I paste the text content here, in case the online page ever changes or becomes unavailable: ## Creating the Second Package in the Workspace Next, let’s create another member package in the workspace and call it add_one. Change the top-level Cargo.toml to specify the add_one path in the members list: Filename: Cargo.toml [workspace] members = [ "adder", "add_one", ] Then generate a new library crate named add_one: $ cargo new add_one --lib Created library `add_one` package Your add directory should now have these directories and files: ├── Cargo.lock ├── Cargo.toml ├── add_one │ ├── Cargo.toml │ └── src │ └── lib.rs ├── adder │ ├── Cargo.toml │ └── src │ └── main.rs └── target Signed-off-by: Manos Pitsidianakis --- Cargo.toml | 4 ++-- .../CHANGELOG.md | 0 .../Cargo.toml | 0 .../README.md | 0 .../src/backend.rs | 0 .../src/event_loop.rs | 0 .../src/handler.rs | 0 .../src/lib.rs | 0 .../src/vring.rs | 0 .../tests/vhost-user-server.rs | 0 {crates/vhost => vhost}/CHANGELOG.md | 0 {crates/vhost => vhost}/Cargo.toml | 0 {crates/vhost => vhost}/README.md | 0 .../vhost => vhost}/docs/vhost_architecture.drawio | 0 {crates/vhost => vhost}/docs/vhost_architecture.png | Bin {crates/vhost => vhost}/src/backend.rs | 0 {crates/vhost => vhost}/src/lib.rs | 0 {crates/vhost => vhost}/src/net.rs | 0 {crates/vhost => vhost}/src/vdpa.rs | 0 {crates/vhost => vhost}/src/vhost_kern/mod.rs | 0 {crates/vhost => vhost}/src/vhost_kern/net.rs | 0 {crates/vhost => vhost}/src/vhost_kern/vdpa.rs | 0 .../vhost => vhost}/src/vhost_kern/vhost_binding.rs | 0 {crates/vhost => vhost}/src/vhost_kern/vsock.rs | 0 {crates/vhost => vhost}/src/vhost_user/backend.rs | 0 .../vhost => vhost}/src/vhost_user/backend_req.rs | 0 .../src/vhost_user/backend_req_handler.rs | 0 .../vhost => vhost}/src/vhost_user/connection.rs | 0 .../vhost => vhost}/src/vhost_user/dummy_backend.rs | 0 {crates/vhost => vhost}/src/vhost_user/frontend.rs | 0 .../src/vhost_user/frontend_req_handler.rs | 0 {crates/vhost => vhost}/src/vhost_user/message.rs | 0 {crates/vhost => vhost}/src/vhost_user/mod.rs | 0 {crates/vhost => vhost}/src/vsock.rs | 0 34 files changed, 2 insertions(+), 2 deletions(-) rename {crates/vhost-user-backend => vhost-user-backend}/CHANGELOG.md (100%) rename {crates/vhost-user-backend => vhost-user-backend}/Cargo.toml (100%) rename {crates/vhost-user-backend => vhost-user-backend}/README.md (100%) rename {crates/vhost-user-backend => vhost-user-backend}/src/backend.rs (100%) rename {crates/vhost-user-backend => vhost-user-backend}/src/event_loop.rs (100%) rename {crates/vhost-user-backend => vhost-user-backend}/src/handler.rs (100%) rename {crates/vhost-user-backend => vhost-user-backend}/src/lib.rs (100%) rename {crates/vhost-user-backend => vhost-user-backend}/src/vring.rs (100%) rename {crates/vhost-user-backend => vhost-user-backend}/tests/vhost-user-server.rs (100%) rename {crates/vhost => vhost}/CHANGELOG.md (100%) rename {crates/vhost => vhost}/Cargo.toml (100%) rename {crates/vhost => vhost}/README.md (100%) rename {crates/vhost => vhost}/docs/vhost_architecture.drawio (100%) rename {crates/vhost => vhost}/docs/vhost_architecture.png (100%) rename {crates/vhost => vhost}/src/backend.rs (100%) rename {crates/vhost => vhost}/src/lib.rs (100%) rename {crates/vhost => vhost}/src/net.rs (100%) rename {crates/vhost => vhost}/src/vdpa.rs (100%) rename {crates/vhost => vhost}/src/vhost_kern/mod.rs (100%) rename {crates/vhost => vhost}/src/vhost_kern/net.rs (100%) rename {crates/vhost => vhost}/src/vhost_kern/vdpa.rs (100%) rename {crates/vhost => vhost}/src/vhost_kern/vhost_binding.rs (100%) rename {crates/vhost => vhost}/src/vhost_kern/vsock.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/backend.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/backend_req.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/backend_req_handler.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/connection.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/dummy_backend.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/frontend.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/frontend_req_handler.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/message.rs (100%) rename {crates/vhost => vhost}/src/vhost_user/mod.rs (100%) rename {crates/vhost => vhost}/src/vsock.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index f4bf566..66a3ec0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,6 @@ resolver = "2" members = [ - "crates/vhost", - "crates/vhost-user-backend", + "vhost", + "vhost-user-backend", ] diff --git a/crates/vhost-user-backend/CHANGELOG.md b/vhost-user-backend/CHANGELOG.md similarity index 100% rename from crates/vhost-user-backend/CHANGELOG.md rename to vhost-user-backend/CHANGELOG.md diff --git a/crates/vhost-user-backend/Cargo.toml b/vhost-user-backend/Cargo.toml similarity index 100% rename from crates/vhost-user-backend/Cargo.toml rename to vhost-user-backend/Cargo.toml diff --git a/crates/vhost-user-backend/README.md b/vhost-user-backend/README.md similarity index 100% rename from crates/vhost-user-backend/README.md rename to vhost-user-backend/README.md diff --git a/crates/vhost-user-backend/src/backend.rs b/vhost-user-backend/src/backend.rs similarity index 100% rename from crates/vhost-user-backend/src/backend.rs rename to vhost-user-backend/src/backend.rs diff --git a/crates/vhost-user-backend/src/event_loop.rs b/vhost-user-backend/src/event_loop.rs similarity index 100% rename from crates/vhost-user-backend/src/event_loop.rs rename to vhost-user-backend/src/event_loop.rs diff --git a/crates/vhost-user-backend/src/handler.rs b/vhost-user-backend/src/handler.rs similarity index 100% rename from crates/vhost-user-backend/src/handler.rs rename to vhost-user-backend/src/handler.rs diff --git a/crates/vhost-user-backend/src/lib.rs b/vhost-user-backend/src/lib.rs similarity index 100% rename from crates/vhost-user-backend/src/lib.rs rename to vhost-user-backend/src/lib.rs diff --git a/crates/vhost-user-backend/src/vring.rs b/vhost-user-backend/src/vring.rs similarity index 100% rename from crates/vhost-user-backend/src/vring.rs rename to vhost-user-backend/src/vring.rs diff --git a/crates/vhost-user-backend/tests/vhost-user-server.rs b/vhost-user-backend/tests/vhost-user-server.rs similarity index 100% rename from crates/vhost-user-backend/tests/vhost-user-server.rs rename to vhost-user-backend/tests/vhost-user-server.rs diff --git a/crates/vhost/CHANGELOG.md b/vhost/CHANGELOG.md similarity index 100% rename from crates/vhost/CHANGELOG.md rename to vhost/CHANGELOG.md diff --git a/crates/vhost/Cargo.toml b/vhost/Cargo.toml similarity index 100% rename from crates/vhost/Cargo.toml rename to vhost/Cargo.toml diff --git a/crates/vhost/README.md b/vhost/README.md similarity index 100% rename from crates/vhost/README.md rename to vhost/README.md diff --git a/crates/vhost/docs/vhost_architecture.drawio b/vhost/docs/vhost_architecture.drawio similarity index 100% rename from crates/vhost/docs/vhost_architecture.drawio rename to vhost/docs/vhost_architecture.drawio diff --git a/crates/vhost/docs/vhost_architecture.png b/vhost/docs/vhost_architecture.png similarity index 100% rename from crates/vhost/docs/vhost_architecture.png rename to vhost/docs/vhost_architecture.png diff --git a/crates/vhost/src/backend.rs b/vhost/src/backend.rs similarity index 100% rename from crates/vhost/src/backend.rs rename to vhost/src/backend.rs diff --git a/crates/vhost/src/lib.rs b/vhost/src/lib.rs similarity index 100% rename from crates/vhost/src/lib.rs rename to vhost/src/lib.rs diff --git a/crates/vhost/src/net.rs b/vhost/src/net.rs similarity index 100% rename from crates/vhost/src/net.rs rename to vhost/src/net.rs diff --git a/crates/vhost/src/vdpa.rs b/vhost/src/vdpa.rs similarity index 100% rename from crates/vhost/src/vdpa.rs rename to vhost/src/vdpa.rs diff --git a/crates/vhost/src/vhost_kern/mod.rs b/vhost/src/vhost_kern/mod.rs similarity index 100% rename from crates/vhost/src/vhost_kern/mod.rs rename to vhost/src/vhost_kern/mod.rs diff --git a/crates/vhost/src/vhost_kern/net.rs b/vhost/src/vhost_kern/net.rs similarity index 100% rename from crates/vhost/src/vhost_kern/net.rs rename to vhost/src/vhost_kern/net.rs diff --git a/crates/vhost/src/vhost_kern/vdpa.rs b/vhost/src/vhost_kern/vdpa.rs similarity index 100% rename from crates/vhost/src/vhost_kern/vdpa.rs rename to vhost/src/vhost_kern/vdpa.rs diff --git a/crates/vhost/src/vhost_kern/vhost_binding.rs b/vhost/src/vhost_kern/vhost_binding.rs similarity index 100% rename from crates/vhost/src/vhost_kern/vhost_binding.rs rename to vhost/src/vhost_kern/vhost_binding.rs diff --git a/crates/vhost/src/vhost_kern/vsock.rs b/vhost/src/vhost_kern/vsock.rs similarity index 100% rename from crates/vhost/src/vhost_kern/vsock.rs rename to vhost/src/vhost_kern/vsock.rs diff --git a/crates/vhost/src/vhost_user/backend.rs b/vhost/src/vhost_user/backend.rs similarity index 100% rename from crates/vhost/src/vhost_user/backend.rs rename to vhost/src/vhost_user/backend.rs diff --git a/crates/vhost/src/vhost_user/backend_req.rs b/vhost/src/vhost_user/backend_req.rs similarity index 100% rename from crates/vhost/src/vhost_user/backend_req.rs rename to vhost/src/vhost_user/backend_req.rs diff --git a/crates/vhost/src/vhost_user/backend_req_handler.rs b/vhost/src/vhost_user/backend_req_handler.rs similarity index 100% rename from crates/vhost/src/vhost_user/backend_req_handler.rs rename to vhost/src/vhost_user/backend_req_handler.rs diff --git a/crates/vhost/src/vhost_user/connection.rs b/vhost/src/vhost_user/connection.rs similarity index 100% rename from crates/vhost/src/vhost_user/connection.rs rename to vhost/src/vhost_user/connection.rs diff --git a/crates/vhost/src/vhost_user/dummy_backend.rs b/vhost/src/vhost_user/dummy_backend.rs similarity index 100% rename from crates/vhost/src/vhost_user/dummy_backend.rs rename to vhost/src/vhost_user/dummy_backend.rs diff --git a/crates/vhost/src/vhost_user/frontend.rs b/vhost/src/vhost_user/frontend.rs similarity index 100% rename from crates/vhost/src/vhost_user/frontend.rs rename to vhost/src/vhost_user/frontend.rs diff --git a/crates/vhost/src/vhost_user/frontend_req_handler.rs b/vhost/src/vhost_user/frontend_req_handler.rs similarity index 100% rename from crates/vhost/src/vhost_user/frontend_req_handler.rs rename to vhost/src/vhost_user/frontend_req_handler.rs diff --git a/crates/vhost/src/vhost_user/message.rs b/vhost/src/vhost_user/message.rs similarity index 100% rename from crates/vhost/src/vhost_user/message.rs rename to vhost/src/vhost_user/message.rs diff --git a/crates/vhost/src/vhost_user/mod.rs b/vhost/src/vhost_user/mod.rs similarity index 100% rename from crates/vhost/src/vhost_user/mod.rs rename to vhost/src/vhost_user/mod.rs diff --git a/crates/vhost/src/vsock.rs b/vhost/src/vsock.rs similarity index 100% rename from crates/vhost/src/vsock.rs rename to vhost/src/vsock.rs