From 3beb9a72d9928f806319bf9875285c7088570c64 Mon Sep 17 00:00:00 2001 From: Yang Kaiyong Date: Sun, 26 Jan 2025 18:21:17 +0800 Subject: [PATCH] chore: bump deps to address rustsec warnning - Bump vm-memory to 1.14.1, vmm-sys-util to 0.12.1 and vhost to 0.11.0. - Bump cargo-deny-action version from v1 to v2 in workflows. Signed-off-by: Yang Kaiyong --- .github/workflows/smoke.yml | 2 +- Cargo.lock | 115 +++++++++++++++++---------------- Cargo.toml | 14 ++-- api/Cargo.toml | 2 +- builder/Cargo.toml | 2 +- deny.toml | 36 +---------- rafs/Cargo.toml | 4 +- rafs/src/metadata/layout/v5.rs | 1 + service/Cargo.toml | 12 ++-- src/bin/nydusd/virtiofs.rs | 33 ++++++---- storage/Cargo.toml | 4 +- upgrade/Cargo.toml | 4 +- utils/Cargo.toml | 2 +- 13 files changed, 107 insertions(+), 124 deletions(-) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index a0dce7cb698..f8a28ab3c70 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -312,7 +312,7 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 - - uses: EmbarkStudios/cargo-deny-action@v1 + - uses: EmbarkStudios/cargo-deny-action@v2 performance-test: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 6a8a61af857..bf89ab17891 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,9 +239,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "jobserver", "libc", @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" dependencies = [ "clap_builder", "clap_derive", @@ -278,9 +278,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", @@ -345,9 +345,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -378,9 +378,9 @@ dependencies = [ [[package]] name = "crc64" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55626594feae15d266d52440b26ff77de0e22230cf0c113abe619084c1ddc910" +checksum = "2707e3afba5e19b75d582d88bc79237418f2a2a2d673d01cf9b03633b46e98f3" [[package]] name = "crypto-common" @@ -403,9 +403,9 @@ dependencies = [ [[package]] name = "dbs-snapshot" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8c92771f804e5635f82c7285b240663e09be1bb457e10e095357b7fb326e79" +checksum = "0315cb247b6726d92c74b955b7d79b4be475be58335fee120f19292740132eb1" dependencies = [ "displaydoc", "libc", @@ -577,9 +577,9 @@ dependencies = [ [[package]] name = "fuse-backend-rs" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1663480cae165243a6c7f75abecfb868c16d17346afc74faf61a2febcadd11b" +checksum = "49f251e5fd17ca8206cad5d8863f080d11d29646b21a614dba1f1912fa6e4747" dependencies = [ "arc-swap", "bitflags 1.3.2", @@ -1024,9 +1024,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -1044,19 +1044,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1260,9 +1260,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" dependencies = [ "libc", "log", @@ -1430,7 +1430,7 @@ dependencies = [ "tokio", "vhost", "vhost-user-backend", - "virtio-bindings", + "virtio-bindings 0.1.0", "virtio-queue", "vm-memory", "vmm-sys-util", @@ -1464,7 +1464,7 @@ dependencies = [ "versionize_derive", "vhost", "vhost-user-backend", - "virtio-bindings", + "virtio-bindings 0.1.0", "virtio-queue", "vm-memory", "vmm-sys-util", @@ -1564,9 +1564,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ "bitflags 2.8.0", "cfg-if", @@ -1590,9 +1590,9 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" @@ -1605,9 +1605,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" dependencies = [ "cc", "libc", @@ -1906,9 +1906,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags 2.8.0", "errno", @@ -2022,9 +2022,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", @@ -2395,9 +2395,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" [[package]] name = "url" @@ -2430,9 +2430,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ "getrandom", "rand", @@ -2452,9 +2452,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "versionize" -version = "0.1.10" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca4b7062e7e6d685901e815c35f9671e059de97c1c0905eeff8592f3fff442f" +checksum = "62929d59c7f6730b7298fcb363760550f4db6e353fbac4076d447d0e82799d6d" dependencies = [ "bincode", "crc64", @@ -2480,11 +2480,11 @@ dependencies = [ [[package]] name = "vhost" -version = "0.6.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6769e8dbf5276b4376439fbf36bb880d203bf614bf7ef444198edc24b5a9f35" +checksum = "6be08d1166d41a78861ad50212ab3f9eca0729c349ac3a7a8f557c62406b87cc" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.8.0", "libc", "vm-memory", "vmm-sys-util", @@ -2492,14 +2492,14 @@ dependencies = [ [[package]] name = "vhost-user-backend" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f237b91db4ac339d639fb43398b52d785fa51e3c7760ac9425148863c1f4303" +checksum = "1f0ffb1dd8e00a708a0e2c32d5efec5812953819888591fff9ff68236b8a5096" dependencies = [ "libc", "log", "vhost", - "virtio-bindings", + "virtio-bindings 0.2.4", "virtio-queue", "vm-memory", "vmm-sys-util", @@ -2511,34 +2511,41 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff512178285488516ed85f15b5d0113a7cdb89e9e8a760b269ae4f02b84bd6b" +[[package]] +name = "virtio-bindings" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1711e61c00f8cb450bd15368152a1e37a12ef195008ddc7d0f4812f9e2b30a68" + [[package]] name = "virtio-queue" -version = "0.7.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ba81e2bcc21c0d2fc5e6683e79367e26ad219197423a498df801d79d5ba77bd" +checksum = "07d8406e7250c934462de585d8f2d2781c31819bca1fbb7c5e964ca6bbaabfe8" dependencies = [ "log", - "virtio-bindings", + "virtio-bindings 0.2.4", "vm-memory", "vmm-sys-util", ] [[package]] name = "vm-memory" -version = "0.10.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688a70366615b45575a424d9c665561c1b5ab2224d494f706b6a6812911a827c" +checksum = "3c3aba5064cc5f6f7740cddc8dae34d2d9a311cac69b60d942af7f3ab8fc49f4" dependencies = [ "arc-swap", "libc", + "thiserror", "winapi", ] [[package]] name = "vmm-sys-util" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48b7b084231214f7427041e4220d77dfe726897a6d41fddee450696e66ff2a29" +checksum = "1d1435039746e20da4f8d507a72ee1b916f7b4b05af7a91c093d2c6561934ede" dependencies = [ "bitflags 1.3.2", "libc", diff --git a/Cargo.toml b/Cargo.toml index d2574728096..d48a8a0a460 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ tar = "0.4.40" tokio = { version = "1.35.1", features = ["macros"] } # Build static linked openssl library -openssl = { version = '0.10.68', features = ["vendored"] } +openssl = { version = '0.10.70', features = ["vendored"] } nydus-api = { version = "0.3.0", path = "api", features = [ "error-backtrace", @@ -69,21 +69,21 @@ nydus-storage = { version = "0.6.3", path = "storage", features = [ ] } nydus-utils = { version = "0.4.2", path = "utils" } -vhost = { version = "0.6.0", features = ["vhost-user-slave"], optional = true } -vhost-user-backend = { version = "0.8.0", optional = true } +vhost = { version = "0.11.0", features = ["vhost-user"], optional = true } +vhost-user-backend = { version = "0.15.0", optional = true } virtio-bindings = { version = "0.1", features = [ "virtio-v5_0_0", ], optional = true } -virtio-queue = { version = "0.7.0", optional = true } -vm-memory = { version = "0.10.0", features = ["backend-mmap"], optional = true } -vmm-sys-util = { version = "0.11.0", optional = true } +virtio-queue = { version = "0.12.0", optional = true } +vm-memory = { version = "0.14.1", features = ["backend-mmap","backend-atomic"], optional = true } +vmm-sys-util = { version = "0.12.1", optional = true } [build-dependencies] time = { version = "0.3.14", features = ["formatting"] } [dev-dependencies] xattr = "1.0.1" -vmm-sys-util = "0.11.0" +vmm-sys-util = "0.12.1" [features] default = [ diff --git a/api/Cargo.toml b/api/Cargo.toml index 3bd8c03a057..e1f722927f4 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -24,7 +24,7 @@ serde = { version = "1.0.110", features = ["rc", "serde_derive"] } url = { version = "2.1.1", optional = true } [dev-dependencies] -vmm-sys-util = { version = "0.11" } +vmm-sys-util = { version = "0.12.1" } [features] error-backtrace = ["backtrace"] diff --git a/builder/Cargo.toml b/builder/Cargo.toml index fa76a36f947..bc38a481e33 100644 --- a/builder/Cargo.toml +++ b/builder/Cargo.toml @@ -20,7 +20,7 @@ serde = { version = "1.0.110", features = ["serde_derive", "rc"] } serde_json = "1.0.53" sha2 = "0.10.2" tar = "0.4.40" -vmm-sys-util = "0.11.0" +vmm-sys-util = "0.12.1" xattr = "1.0.1" nydus-api = { version = "0.3", path = "../api" } diff --git a/deny.toml b/deny.toml index bda5d9262e9..ef22c536e2f 100644 --- a/deny.toml +++ b/deny.toml @@ -17,6 +17,7 @@ # this list would mean the nix crate, as well as any of its exclusive # dependencies not shared by any other crates, would be ignored, as the target # list here is effectively saying which targets you are building for. +[graph] targets = [ # The triple can be any string, but only the target triples built in to # rustc (as of 1.40) can be checked against actual config expressions @@ -35,21 +36,11 @@ targets = [ db-path = "~/.cargo/advisory-db" # The url(s) of the advisory databases to use db-urls = ["https://github.com/rustsec/advisory-db"] -# The lint level for security vulnerabilities -vulnerability = "deny" -# The lint level for unmaintained crates -unmaintained = "warn" # The lint level for crates that have been yanked from their source registry yanked = "warn" -# The lint level for crates with security notices. Note that as of -# 2019-12-17 there are no security notice advisories in -# https://github.com/rustsec/advisory-db -notice = "warn" # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. -ignore = [ - { id = "RUSTSEC-2024-0357", reason = "openssl 0.10.55 can't build in riscv64 and ppc64le" }, -] +ignore = [] # Threshold for security vulnerabilities, any vulnerability with a CVSS score # lower than the range specified will be ignored. Note that ignored advisories # will still output a note when they are encountered. @@ -64,8 +55,6 @@ ignore = [ # More documentation for the licenses section can be found here: # https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html [licenses] -# The lint level for crates which do not have a detectable license -unlicensed = "deny" # List of explictly allowed licenses # See https://spdx.org/licenses/ for list of possible licenses # [possible values: any SPDX 3.11 short identifier (+ optional exception)]. @@ -75,29 +64,8 @@ allow = [ "BSD-3-Clause", "BSD-2-Clause", "CC0-1.0", - "Unicode-DFS-2016", "Unicode-3.0", ] -# List of explictly disallowed licenses -# See https://spdx.org/licenses/ for list of possible licenses -# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. -deny = [ - #"Nokia", -] -# Lint level for licenses considered copyleft -copyleft = "deny" -# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses -# * both - The license will be approved if it is both OSI-approved *AND* FSF -# * either - The license will be approved if it is either OSI-approved *OR* FSF -# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF -# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved -# * neither - This predicate is ignored and the default lint level is used -allow-osi-fsf-free = "neither" -# Lint level used when no other predicates are matched -# 1. License isn't in the allow or deny lists -# 2. License isn't copyleft -# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither" -default = "deny" # The confidence threshold for detecting a license from license text. # The higher the value, the more closely the license text must be to the # canonical license text of a valid SPDX license file. diff --git a/rafs/Cargo.toml b/rafs/Cargo.toml index 5cbb972bb3a..9ffe3499647 100644 --- a/rafs/Cargo.toml +++ b/rafs/Cargo.toml @@ -18,7 +18,7 @@ log = "0.4" nix = "0.24" serde = { version = "1.0.110", features = ["serde_derive", "rc"] } serde_json = "1.0.53" -vm-memory = "0.10" +vm-memory = "0.14.1" fuse-backend-rs = "^0.12.0" thiserror = "1" @@ -29,7 +29,7 @@ nydus-storage = { version = "0.6", path = "../storage", features = [ nydus-utils = { version = "0.4", path = "../utils" } [dev-dependencies] -vmm-sys-util = "0.11" +vmm-sys-util = "0.12.1" assert_matches = "1.5.0" [features] diff --git a/rafs/src/metadata/layout/v5.rs b/rafs/src/metadata/layout/v5.rs index 01f47b167c1..5cf2af3a924 100644 --- a/rafs/src/metadata/layout/v5.rs +++ b/rafs/src/metadata/layout/v5.rs @@ -45,6 +45,7 @@ use std::sync::Arc; use nydus_utils::digest::{self, DigestHasher, RafsDigest}; use nydus_utils::{compress, ByteSize}; +#[allow(unused_imports)] use vm_memory::VolatileMemory; // With Rafs v5, the storage manager needs to access file system metadata to decompress the // compressed blob file. To avoid circular dependency, the following Rafs v5 metadata structures diff --git a/service/Cargo.toml b/service/Cargo.toml index 56c980b8926..3ff4fb00414 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -24,7 +24,7 @@ thiserror = "1.0" time = { version = "0.3.14", features = ["serde-human-readable"] } tokio = { version = "1.24", features = ["macros"] } versionize_derive = "0.1.6" -versionize = "0.1.10" +versionize = "0.2.0" nydus-api = { version = "0.3.0", path = "../api" } nydus-rafs = { version = "0.3.1", path = "../rafs" } @@ -32,19 +32,19 @@ nydus-storage = { version = "0.6.3", path = "../storage" } nydus-upgrade = { version = "0.1.0", path = "../upgrade" } nydus-utils = { version = "0.4.2", path = "../utils" } -vhost = { version = "0.6.0", features = ["vhost-user-slave"], optional = true } -vhost-user-backend = { version = "0.8.0", optional = true } +vhost = { version = "0.11.0", features = ["vhost-user"], optional = true } +vhost-user-backend = { version = "0.15.0", optional = true } virtio-bindings = { version = "0.1", features = [ "virtio-v5_0_0", ], optional = true } -virtio-queue = { version = "0.7.0", optional = true } -vm-memory = { version = "0.10.0", features = ["backend-mmap"], optional = true } +virtio-queue = { version = "0.12.0", optional = true } +vm-memory = { version = "0.14.1", features = ["backend-mmap"], optional = true } [target.'cfg(target_os = "linux")'.dependencies] tokio-uring = "0.4" [dev-dependencies] -vmm-sys-util = "0.11.0" +vmm-sys-util = "0.12.1" [features] default = ["fuse-backend-rs/fusedev"] diff --git a/src/bin/nydusd/virtiofs.rs b/src/bin/nydusd/virtiofs.rs index f51e0b30993..1dcbb54fb64 100644 --- a/src/bin/nydusd/virtiofs.rs +++ b/src/bin/nydusd/virtiofs.rs @@ -12,7 +12,8 @@ use std::thread; use fuse_backend_rs::api::{server::Server, Vfs}; use fuse_backend_rs::transport::{FsCacheReqHandler, Reader, VirtioFsWriter}; -use vhost::vhost_user::{message::*, Listener, SlaveFsCacheReq}; +use vhost::vhost_user::{message::*, Backend, Listener}; +use vhost_user_backend::bitmap::BitmapReplace; use vhost_user_backend::{ VhostUserBackend, VhostUserBackendMut, VhostUserDaemon, VringMutex, VringState, VringT, }; @@ -21,6 +22,7 @@ use virtio_bindings::bindings::virtio_ring::{ }; use virtio_queue::DescriptorChain; use virtio_queue::QueueOwnedT; +use vm_memory::mmap::NewBitmap; use vm_memory::{GuestAddressSpace, GuestMemoryAtomic, GuestMemoryLoadGuard, GuestMemoryMmap}; use vmm_sys_util::epoll::EventSet; use vmm_sys_util::eventfd::EventFd; @@ -52,7 +54,7 @@ struct VhostUserFsBackend { mem: Option>, server: Arc>>, // handle request from slave to master - vu_req: Option, + vu_req: Option, } impl VhostUserFsBackend { @@ -142,7 +144,10 @@ impl VhostUserFsBackendHandler { } } -impl VhostUserBackendMut for VhostUserFsBackendHandler { +impl VhostUserBackendMut for VhostUserFsBackendHandler { + type Bitmap = (); + type Vring = VringMutex; + fn num_queues(&self) -> usize { NUM_QUEUES } @@ -159,7 +164,7 @@ impl VhostUserBackendMut for VhostUserFsBackendHandler { } fn protocol_features(&self) -> VhostUserProtocolFeatures { - VhostUserProtocolFeatures::MQ | VhostUserProtocolFeatures::SLAVE_REQ + VhostUserProtocolFeatures::MQ | VhostUserProtocolFeatures::BACKEND_REQ } fn set_event_idx(&mut self, _enabled: bool) { @@ -174,7 +179,7 @@ impl VhostUserBackendMut for VhostUserFsBackendHandler { Ok(()) } - fn set_slave_req_fd(&mut self, vu_req: SlaveFsCacheReq) { + fn set_backend_req_fd(&mut self, vu_req: Backend) { self.backend.lock().unwrap().vu_req = Some(vu_req); } @@ -190,7 +195,7 @@ impl VhostUserBackendMut for VhostUserFsBackendHandler { evset: EventSet, vrings: &[VringMutex], _thread_id: usize, - ) -> VhostUserBackendResult { + ) -> VhostUserBackendResult<()> { if evset != EventSet::IN { return Err(Error::HandleEventNotEpollIn.into()); } @@ -230,7 +235,7 @@ impl VhostUserBackendMut for VhostUserFsBackendHandler { .process_queue(&mut vring_state)?; } - Ok(false) + Ok(()) } } @@ -272,7 +277,7 @@ impl FsService for VirtioFsService { } } -struct VirtiofsDaemon + Clone> { +struct VirtiofsDaemon { bti: BuildTimeInfo, id: Option, request_sender: Arc>>, @@ -281,11 +286,15 @@ struct VirtiofsDaemon + Clone> { state: AtomicI32, supervisor: Option, - daemon: Arc>>, + daemon: Arc>>, sock: String, } -impl + Clone> NydusDaemon for VirtiofsDaemon { +impl NydusDaemon for VirtiofsDaemon +where + ::Vring: Send + Sync + Clone, + ::Bitmap: Send + Sync + BitmapReplace + NewBitmap + Clone, +{ fn as_any(&self) -> &dyn Any { self } @@ -353,9 +362,7 @@ impl + Clone> NydusDaemon for Virtiofs } } -impl + Clone> DaemonStateMachineSubscriber - for VirtiofsDaemon -{ +impl DaemonStateMachineSubscriber for VirtiofsDaemon { fn on_event(&self, event: DaemonStateMachineInput) -> Result<()> { self.request_sender .lock() diff --git a/storage/Cargo.toml b/storage/Cargo.toml index 8636d5cb53c..22c64e47279 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -41,7 +41,7 @@ tokio = { version = "1.19.0", features = [ "time", ] } url = { version = "2.1.1", optional = true } -vm-memory = "0.10" +vm-memory = "0.14.1" fuse-backend-rs = "^0.12.0" gpt = { version = "3.1.0", optional = true } @@ -52,7 +52,7 @@ nydus-utils = { version = "0.4", path = "../utils", features = [ ] } [dev-dependencies] -vmm-sys-util = "0.11" +vmm-sys-util = "0.12.1" tar = "0.4.40" regex = "1.7.0" toml = "0.5" diff --git a/upgrade/Cargo.toml b/upgrade/Cargo.toml index 0d57759692e..08800c85ba5 100644 --- a/upgrade/Cargo.toml +++ b/upgrade/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" [dependencies] sendfd = "0.4.3" -dbs-snapshot = "1.5.1" +dbs-snapshot = "1.5.2" thiserror = "1" versionize_derive = "0.1.6" -versionize = "0.1.10" +versionize = "0.2.0" diff --git a/utils/Cargo.toml b/utils/Cargo.toml index dd02c8544ac..f92aa9dcf47 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -36,7 +36,7 @@ libz-sys = { version = "1.1.8", features = ["zlib-ng"], default-features = false flate2 = { version = "1.0.28", features = ["zlib-ng-compat"], default-features = false } [dev-dependencies] -vmm-sys-util = "0.11.0" +vmm-sys-util = "0.12.1" tar = "0.4.40" [features]