From d4c021dea37bf83b1bc21616fde8b6f365f6742d Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Wed, 17 Aug 2022 14:36:38 +0530 Subject: [PATCH] Convert to a workspace Convert the vhost git repository into a crate, which hosts vhost crate for now. Support for vhost-user-backend and other crates will be added later on. Signed-off-by: Viresh Kumar --- Cargo.toml | 39 ++---------------- coverage_config_aarch64.json | 6 ++- coverage_config_x86_64.json | 6 ++- CHANGELOG.md => crates/vhost/CHANGELOG.md | 0 crates/vhost/Cargo.toml | 36 ++++++++++++++++ README.md => crates/vhost/README.md | 0 .../vhost/docs}/vhost_architecture.drawio | 0 .../vhost/docs}/vhost_architecture.png | Bin {src => crates/vhost/src}/backend.rs | 0 {src => crates/vhost/src}/lib.rs | 0 {src => crates/vhost/src}/net.rs | 0 {src => crates/vhost/src}/vdpa.rs | 0 {src => crates/vhost/src}/vhost_kern/mod.rs | 0 {src => crates/vhost/src}/vhost_kern/net.rs | 0 {src => crates/vhost/src}/vhost_kern/vdpa.rs | 0 .../vhost/src}/vhost_kern/vhost_binding.rs | 0 {src => crates/vhost/src}/vhost_kern/vsock.rs | 0 .../vhost/src}/vhost_user/connection.rs | 0 .../vhost/src}/vhost_user/dummy_slave.rs | 0 .../vhost/src}/vhost_user/master.rs | 0 .../src}/vhost_user/master_req_handler.rs | 0 .../vhost/src}/vhost_user/message.rs | 0 {src => crates/vhost/src}/vhost_user/mod.rs | 0 {src => crates/vhost/src}/vhost_user/slave.rs | 0 .../vhost/src}/vhost_user/slave_fs_cache.rs | 0 .../src}/vhost_user/slave_req_handler.rs | 0 {src => crates/vhost/src}/vsock.rs | 0 27 files changed, 50 insertions(+), 37 deletions(-) rename CHANGELOG.md => crates/vhost/CHANGELOG.md (100%) create mode 100644 crates/vhost/Cargo.toml rename README.md => crates/vhost/README.md (100%) rename {docs => crates/vhost/docs}/vhost_architecture.drawio (100%) rename {docs => crates/vhost/docs}/vhost_architecture.png (100%) rename {src => crates/vhost/src}/backend.rs (100%) rename {src => crates/vhost/src}/lib.rs (100%) rename {src => crates/vhost/src}/net.rs (100%) rename {src => crates/vhost/src}/vdpa.rs (100%) rename {src => crates/vhost/src}/vhost_kern/mod.rs (100%) rename {src => crates/vhost/src}/vhost_kern/net.rs (100%) rename {src => crates/vhost/src}/vhost_kern/vdpa.rs (100%) rename {src => crates/vhost/src}/vhost_kern/vhost_binding.rs (100%) rename {src => crates/vhost/src}/vhost_kern/vsock.rs (100%) rename {src => crates/vhost/src}/vhost_user/connection.rs (100%) rename {src => crates/vhost/src}/vhost_user/dummy_slave.rs (100%) rename {src => crates/vhost/src}/vhost_user/master.rs (100%) rename {src => crates/vhost/src}/vhost_user/master_req_handler.rs (100%) rename {src => crates/vhost/src}/vhost_user/message.rs (100%) rename {src => crates/vhost/src}/vhost_user/mod.rs (100%) rename {src => crates/vhost/src}/vhost_user/slave.rs (100%) rename {src => crates/vhost/src}/vhost_user/slave_fs_cache.rs (100%) rename {src => crates/vhost/src}/vhost_user/slave_req_handler.rs (100%) rename {src => crates/vhost/src}/vsock.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index af6bd3b..e378a2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,36 +1,5 @@ -[package] -name = "vhost" -version = "0.5.0" -keywords = ["vhost", "vhost-user", "virtio", "vdpa"] -description = "a pure rust library for vdpa, vhost and vhost-user" -authors = ["Liu Jiang "] -repository = "https://github.com/rust-vmm/vhost" -documentation = "https://docs.rs/vhost" -readme = "README.md" -license = "Apache-2.0 OR BSD-3-Clause" -edition = "2018" +[workspace] -[package.metadata.docs.rs] -all-features = true - -[features] -default = [] -vhost-vsock = [] -vhost-kern = [] -vhost-vdpa = ["vhost-kern"] -vhost-net = ["vhost-kern"] -vhost-user = [] -vhost-user-master = ["vhost-user"] -vhost-user-slave = ["vhost-user"] - -[dependencies] -bitflags = "1.0" -libc = "0.2.39" - -vmm-sys-util = "0.10.0" -vm-memory = "0.9.0" - -[dev-dependencies] -tempfile = "3.2.0" -vm-memory = { version = "0.9.0", features=["backend-mmap"] } -serial_test = "0.5" +members = [ + "crates/vhost", +] diff --git a/coverage_config_aarch64.json b/coverage_config_aarch64.json index 67543fc..089bc19 100644 --- a/coverage_config_aarch64.json +++ b/coverage_config_aarch64.json @@ -1 +1,5 @@ -{"coverage_score": 39.8, "exclude_path": "", "crate_features": "vhost-vsock,vhost-kern,vhost-user-master,vhost-user-slave"} \ No newline at end of file +{ + "coverage_score": 39.8, + "exclude_path": "", + "crate_features": "vhost/vhost-vsock,vhost/vhost-kern,vhost/vhost-user-master,vhost/vhost-user-slave" +} diff --git a/coverage_config_x86_64.json b/coverage_config_x86_64.json index 8e3c887..f6bd3c3 100644 --- a/coverage_config_x86_64.json +++ b/coverage_config_x86_64.json @@ -1 +1,5 @@ -{"coverage_score": 80.5, "exclude_path": "src/vhost_kern/", "crate_features": "vhost-user-master,vhost-user-slave"} +{ + "coverage_score": 80.5, + "exclude_path": "vhost/src/vhost_kern/", + "crate_features": "vhost/vhost-user-master,vhost/vhost-user-slave" +} diff --git a/CHANGELOG.md b/crates/vhost/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to crates/vhost/CHANGELOG.md diff --git a/crates/vhost/Cargo.toml b/crates/vhost/Cargo.toml new file mode 100644 index 0000000..af6bd3b --- /dev/null +++ b/crates/vhost/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "vhost" +version = "0.5.0" +keywords = ["vhost", "vhost-user", "virtio", "vdpa"] +description = "a pure rust library for vdpa, vhost and vhost-user" +authors = ["Liu Jiang "] +repository = "https://github.com/rust-vmm/vhost" +documentation = "https://docs.rs/vhost" +readme = "README.md" +license = "Apache-2.0 OR BSD-3-Clause" +edition = "2018" + +[package.metadata.docs.rs] +all-features = true + +[features] +default = [] +vhost-vsock = [] +vhost-kern = [] +vhost-vdpa = ["vhost-kern"] +vhost-net = ["vhost-kern"] +vhost-user = [] +vhost-user-master = ["vhost-user"] +vhost-user-slave = ["vhost-user"] + +[dependencies] +bitflags = "1.0" +libc = "0.2.39" + +vmm-sys-util = "0.10.0" +vm-memory = "0.9.0" + +[dev-dependencies] +tempfile = "3.2.0" +vm-memory = { version = "0.9.0", features=["backend-mmap"] } +serial_test = "0.5" diff --git a/README.md b/crates/vhost/README.md similarity index 100% rename from README.md rename to crates/vhost/README.md diff --git a/docs/vhost_architecture.drawio b/crates/vhost/docs/vhost_architecture.drawio similarity index 100% rename from docs/vhost_architecture.drawio rename to crates/vhost/docs/vhost_architecture.drawio diff --git a/docs/vhost_architecture.png b/crates/vhost/docs/vhost_architecture.png similarity index 100% rename from docs/vhost_architecture.png rename to crates/vhost/docs/vhost_architecture.png diff --git a/src/backend.rs b/crates/vhost/src/backend.rs similarity index 100% rename from src/backend.rs rename to crates/vhost/src/backend.rs diff --git a/src/lib.rs b/crates/vhost/src/lib.rs similarity index 100% rename from src/lib.rs rename to crates/vhost/src/lib.rs diff --git a/src/net.rs b/crates/vhost/src/net.rs similarity index 100% rename from src/net.rs rename to crates/vhost/src/net.rs diff --git a/src/vdpa.rs b/crates/vhost/src/vdpa.rs similarity index 100% rename from src/vdpa.rs rename to crates/vhost/src/vdpa.rs diff --git a/src/vhost_kern/mod.rs b/crates/vhost/src/vhost_kern/mod.rs similarity index 100% rename from src/vhost_kern/mod.rs rename to crates/vhost/src/vhost_kern/mod.rs diff --git a/src/vhost_kern/net.rs b/crates/vhost/src/vhost_kern/net.rs similarity index 100% rename from src/vhost_kern/net.rs rename to crates/vhost/src/vhost_kern/net.rs diff --git a/src/vhost_kern/vdpa.rs b/crates/vhost/src/vhost_kern/vdpa.rs similarity index 100% rename from src/vhost_kern/vdpa.rs rename to crates/vhost/src/vhost_kern/vdpa.rs diff --git a/src/vhost_kern/vhost_binding.rs b/crates/vhost/src/vhost_kern/vhost_binding.rs similarity index 100% rename from src/vhost_kern/vhost_binding.rs rename to crates/vhost/src/vhost_kern/vhost_binding.rs diff --git a/src/vhost_kern/vsock.rs b/crates/vhost/src/vhost_kern/vsock.rs similarity index 100% rename from src/vhost_kern/vsock.rs rename to crates/vhost/src/vhost_kern/vsock.rs diff --git a/src/vhost_user/connection.rs b/crates/vhost/src/vhost_user/connection.rs similarity index 100% rename from src/vhost_user/connection.rs rename to crates/vhost/src/vhost_user/connection.rs diff --git a/src/vhost_user/dummy_slave.rs b/crates/vhost/src/vhost_user/dummy_slave.rs similarity index 100% rename from src/vhost_user/dummy_slave.rs rename to crates/vhost/src/vhost_user/dummy_slave.rs diff --git a/src/vhost_user/master.rs b/crates/vhost/src/vhost_user/master.rs similarity index 100% rename from src/vhost_user/master.rs rename to crates/vhost/src/vhost_user/master.rs diff --git a/src/vhost_user/master_req_handler.rs b/crates/vhost/src/vhost_user/master_req_handler.rs similarity index 100% rename from src/vhost_user/master_req_handler.rs rename to crates/vhost/src/vhost_user/master_req_handler.rs diff --git a/src/vhost_user/message.rs b/crates/vhost/src/vhost_user/message.rs similarity index 100% rename from src/vhost_user/message.rs rename to crates/vhost/src/vhost_user/message.rs diff --git a/src/vhost_user/mod.rs b/crates/vhost/src/vhost_user/mod.rs similarity index 100% rename from src/vhost_user/mod.rs rename to crates/vhost/src/vhost_user/mod.rs diff --git a/src/vhost_user/slave.rs b/crates/vhost/src/vhost_user/slave.rs similarity index 100% rename from src/vhost_user/slave.rs rename to crates/vhost/src/vhost_user/slave.rs diff --git a/src/vhost_user/slave_fs_cache.rs b/crates/vhost/src/vhost_user/slave_fs_cache.rs similarity index 100% rename from src/vhost_user/slave_fs_cache.rs rename to crates/vhost/src/vhost_user/slave_fs_cache.rs diff --git a/src/vhost_user/slave_req_handler.rs b/crates/vhost/src/vhost_user/slave_req_handler.rs similarity index 100% rename from src/vhost_user/slave_req_handler.rs rename to crates/vhost/src/vhost_user/slave_req_handler.rs diff --git a/src/vsock.rs b/crates/vhost/src/vsock.rs similarity index 100% rename from src/vsock.rs rename to crates/vhost/src/vsock.rs