disk: fix compile-time warning

Do not warn if the `image_path` parameter is unused, as it is only used
if the composite-disk feature is enabled.

BUG=b:221887571
TEST=cargo build

Change-Id: I91f747152c0e5f4d75f7522a33d35f91890c6df6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3531731
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
Alexandre Courbot 2022-03-17 15:14:06 +09:00 committed by Commit Bot
parent dbd241847b
commit 1cca2c79c9

View file

@ -238,7 +238,8 @@ pub fn create_async_disk_file(raw_image: File) -> Result<Box<dyn ToAsyncDisk>> {
pub fn create_disk_file(
raw_image: File,
mut max_nesting_depth: u32,
image_path: &Path,
// image_path is only used if the composite-disk feature is enabled.
#[allow(unused_variables)] image_path: &Path,
) -> Result<Box<dyn DiskFile>> {
if max_nesting_depth == 0 {
return Err(Error::MaxNestingDepthExceeded);