From cbfcf16d9129cd6ca7fb628df59b79ff1d21c173 Mon Sep 17 00:00:00 2001 From: Giovanni Torres Date: Sat, 6 Sep 2025 16:48:24 -0400 Subject: [PATCH] feat: output logs in verbose mode before cleanup --- kvm-install-vm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kvm-install-vm b/kvm-install-vm index 00ae0ef..4be434f 100755 --- a/kvm-install-vm +++ b/kvm-install-vm @@ -574,8 +574,17 @@ _EOF_ ${GRAPHICS_OPTION} \ ${BOOTFLAG} \ ${VIRT_INSTALL_EXTRA}; then + # Cleanup on failure red "VM creation failed. Cleaning up..." + + if [ "${VERBOSE}" -eq 1 ] && [ -f "${VMNAME}.log" ]; then + yellow "Log contents:" + cat "${VMNAME}.log" + else + yellow "Run with -v flag to see detailed logs" + fi + popd delete_vm die "Could not create domain with virt-install."