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 <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao 2020-07-16 14:30:20 +08:00 committed by Sebastien Boeuf
parent 48966b4535
commit 2de4f73275

View File

@ -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)
})
})
}
}