[kvmbuild]: print out kvm_log on error (#4384)

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
lguohan 2020-04-07 12:31:20 -07:00 committed by GitHub
parent 2a59551eff
commit 5299644dc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,8 +20,11 @@ on_exit()
rm -f $kvm_log
}
kvm_log=$(mktemp)
trap on_exit EXIT
on_error()
{
echo "============= kvm_log =============="
cat $kvm_log
}
create_disk()
{
@ -56,6 +59,10 @@ if [[ "$vs_build_prepare_mem" == "yes" ]]; then
free -m
fi
kvm_log=$(mktemp)
trap on_exit EXIT
trap on_error ERR
/usr/bin/kvm -m $MEM \
-name "onie" \
-boot "order=cd,once=d" -cdrom "$ONIE_RECOVERY_ISO" \