From 2de4f73275bec45bbd5154b875a8e1d55489c475 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Thu, 16 Jul 2020 14:30:20 +0800 Subject: [PATCH] arch: Add log messages in GIC creation The retry order to create virtual GIC is GICv3-ITS, GICv3 and GICv2. But there was not log message to show what was finally created. The log messages also mute the warning for unused "log" crate. Signed-off-by: Michael Zhao --- arch/src/aarch64/gic.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/src/aarch64/gic.rs b/arch/src/aarch64/gic.rs index c2fc62b29..560524ce5 100644 --- a/arch/src/aarch64/gic.rs +++ b/arch/src/aarch64/gic.rs @@ -166,7 +166,12 @@ pub fn create_gic( if its_required { GICv3ITS::new(vm, vcpu_count) } else { - GICv3ITS::new(vm, vcpu_count) - .or_else(|_| GICv3::new(vm, vcpu_count).or_else(|_| GICv2::new(vm, vcpu_count))) + GICv3ITS::new(vm, vcpu_count).or_else(|_| { + debug!("Failed to create GICv3-ITS, will try GICv3 instead."); + GICv3::new(vm, vcpu_count).or_else(|_| { + debug!("Failed to create GICv3, will try GICv2 instead."); + GICv2::new(vm, vcpu_count) + }) + }) } }