kata-ctl: add host check for aarch64

For now, we can check if host support running kata by check if "/dev/kvm"
exist on aarch64.

Fixes: #5768
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
This commit is contained in:
Jianyong Wu 2022-11-23 14:44:00 +08:00
parent df3d9878d5
commit a5e4cad4b6

View File

@ -8,8 +8,18 @@ pub use arch_specific::*;
mod arch_specific {
use anyhow::Result;
use std::path::Path;
const KVM_DEV: &str = "/dev/kvm";
pub fn check() -> Result<()> {
unimplemented!("Check not implemented in aarch64")
println!("INFO: check: aarch64");
if Path::new(KVM_DEV).exists() {
println!("Kata Containers can run on this host\n");
} else {
eprintln!("WARNING: Kata Containers can't run on this host as lack of virtulization support\n");
}
Ok(())
}
}