From 545ae3f0ee93389616837000b5179b245d02afa3 Mon Sep 17 00:00:00 2001 From: xuejun-xj Date: Mon, 18 Jul 2022 09:34:06 +0800 Subject: [PATCH] runtime-rs: fix warning Module anyhow::anyhow is only used on x86_64 architecture in crates/hypervisor/src/device/vfio.rs file. Fixes: #4676 Signed-off-by: xuejun-xj --- src/runtime-rs/crates/hypervisor/src/device/vfio.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime-rs/crates/hypervisor/src/device/vfio.rs b/src/runtime-rs/crates/hypervisor/src/device/vfio.rs index 5e62d4549c..fcbaeb19fe 100644 --- a/src/runtime-rs/crates/hypervisor/src/device/vfio.rs +++ b/src/runtime-rs/crates/hypervisor/src/device/vfio.rs @@ -6,7 +6,9 @@ use std::{fs, path::Path, process::Command}; -use anyhow::{anyhow, Context, Result}; +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +use anyhow::anyhow; +use anyhow::{Context, Result}; fn override_driver(bdf: &str, driver: &str) -> Result<()> { let driver_override = format!("/sys/bus/pci/devices/{}/driver_override", bdf);