vhost_user_block, virtio-devices, block_util: Extract common block code

Extract the code that is used by vhost_user_block from the
virtio-devices crate to remove the dependencies on unrequired
functionality such as the virtio transports.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-07-14 10:43:33 +01:00
parent ce79482ec4
commit 9c867edc35
9 changed files with 417 additions and 342 deletions

16
Cargo.lock generated
View File

@@ -145,6 +145,19 @@ dependencies = [
"constant_time_eq",
]
[[package]]
name = "block_util"
version = "0.1.0"
dependencies = [
"log 0.4.8",
"serde",
"serde_derive",
"serde_json",
"virtio-bindings",
"vm-memory",
"vm-virtio",
]
[[package]]
name = "byteorder"
version = "1.3.4"
@@ -1437,6 +1450,7 @@ dependencies = [
name = "vhost_user_block"
version = "0.1.0"
dependencies = [
"block_util",
"clap",
"epoll",
"libc",
@@ -1446,7 +1460,6 @@ dependencies = [
"vhost",
"vhost_user_backend",
"virtio-bindings",
"virtio-devices",
"vm-memory",
"vmm-sys-util",
]
@@ -1501,6 +1514,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"arc-swap",
"block_util",
"byteorder",
"devices",
"epoll",