diff --git a/pve/vm-core.func b/pve/vm-core.func index 3b7c88a..9eaafe8 100644 --- a/pve/vm-core.func +++ b/pve/vm-core.func @@ -719,10 +719,11 @@ cleanup() { if declare -f post_update_to_api >/dev/null 2>&1; then if [[ $exit_code -ne 0 ]]; then post_update_to_api "failed" "$exit_code" + elif [[ -n "${VMID:-}" ]] && qm config "$VMID" &>/dev/null; then + # Clean exit with the VM in place: a script that never said so itself. + post_update_to_api "done" "none" else - # Exited cleanly but description()/success was never called: the user - # backed out of a dialog. Report as aborted - NOT "failed 1" (which - # produced meaningless 'General error' records with no error text). + # Clean exit, no VM: the user backed out of a dialog. post_update_to_api "aborted" "0" fi fi