commit | 74bfcdba2834c01607c27cfa464a44f0380f80f0 | [log] [tgz] |
---|---|---|
author | Keiichi Watanabe <keiichiw@chromium.org> | Wed Nov 17 23:13:16 2021 +0900 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Nov 18 07:57:32 2021 +0000 |
tree | 819cd799ec96172646366e464ce488d3f961cae9 | |
parent | f5a3037eec805ff0e410912f2508c6c40d3beec1 [diff] |
vhost_user: Fix cfg for take_single_file BUG=none TEST=cargo test --all-features TEST=cargo test --features=vhost-user passed with no warnings Change-Id: I98e69309c6ec81ede3e790c9b6b8b79991484cc1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3288732 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
diff --git a/third_party/vmm_vhost/src/vhost_user/mod.rs b/third_party/vmm_vhost/src/vhost_user/mod.rs index 6968b4a..725a2d3 100644 --- a/third_party/vmm_vhost/src/vhost_user/mod.rs +++ b/third_party/vmm_vhost/src/vhost_user/mod.rs
@@ -173,6 +173,7 @@ /// Utility function to take the first element from option of a vector of files. /// Returns `None` if the vector contains no file or more than one file. +#[cfg(any(feature = "vhost-user-master", feature = "vhost-user-slave"))] pub(crate) fn take_single_file(files: Option<Vec<File>>) -> Option<File> { let mut files = files?; if files.len() != 1 {