Signed-off-by: Yu Chuan 13186087857@163.com --- providers/qemu/kvm.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 35678fbd44ef..93977ec15438 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -6,6 +6,9 @@
: ${nr_cpu:=1} : ${memory:=1G} +: ${LKP_SRC:="/c/lkp-tests"} + +source ${LKP_SRC}/lib/log.sh
check_logfile() { @@ -52,15 +55,23 @@ parse_ipxe_script()
check_option_value() { + [ -n "$kernel" ] || { + log_info "Can not find job for current hostname: $hostname." + exit 0 + } + [ -s "$kernel" ] || { - echo "The kernel does not exist: $kernel" - exit + log_error "Can not find kernel file or kernel file is empty: $kernel." + exit 1 } # debian has both qemu-system-x86_64 and qemu-system-riscv64 command [[ $kernel =~ 'riscv64' ]] && qemu=qemu-system-riscv64
- [ -n "$initrds" ] || exit + [ -n "$initrds" ] || { + log_error "Can not find any initrd for current vm." + exit 1 + } }
set_initrd()