Repository navigation
B #8198: Check Domain not found in kvm/shutdown and destroy exit code - #8199
Open
trukhinyuri wants to merge 1 commit into
Open
trukhinyuri wants to merge 1 commit into
trukhinyuri wants to merge 1 commit into
Conversation
… exit code Ensure src/vmm_mad/remotes/kvm/shutdown only treats virsh dominfo failures as an already-terminated domain when virsh reports that the domain was not found (or is in 'shut off' state), rather than exiting 0 on transient libvirtd connection failures. Also check the exit status of the destroy command in force_shutdown when FORCE_DESTROY=yes. Signed-off-by: Iurii Trukhin <yuri@trukhin.com>
There was a problem hiding this comment.
🟡 Changes recommended
Shutdown detection still accepts generic lookup failures and misses already-stopped domains during preflight.
2 open findings
What changed in this PR
This PR addresses #8198 by tightening KVM shutdown detection and reporting forced-destroy failures.
Changes:
- Inspect domain-query output before shutdown and during polling.
- Route forced destruction through
exec_and_logto propagate failures.
| File | Description |
|---|---|
| src/vmm_mad/remotes/kvm/shutdown | Adds diagnostic checks and shut-off-state detection during polling. |
| src/mad/sh/scripts_common.sh | Reports forced-destroy command failures. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| DOMINFO_OUT=$(LC_ALL=C virsh --connect $LIBVIRT_URI --readonly dominfo "$deploy_id" 2>&1) | ||
| DOMINFO_RC=$? | ||
| if [ $DOMINFO_RC -ne 0 ]; then | ||
| if echo "$DOMINFO_OUT" | grep -qiE "domain not found|failed to get domain|no domain with matching"; then |
| fi | ||
| error_message "Could not query domain $deploy_id: $DOMINFO_OUT" | ||
| exit 1 | ||
| fi |
Member
|
Both expressions accept |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes #8198.
src/vmm_mad/remotes/kvm/shutdown, checkDOMINFO_OUTfordomain not found/failed to get domain/no domain with matching(orState: shut off) before and duringretry $TIMEOUT monitor, rather than treating any non-zerovirsh dominfoexit status (such as a transientlibvirtdconnection failure) as a shut-down domain.force_shutdown(src/mad/sh/scripts_common.sh), execute$commandviaexec_and_log "$command" "Could not destroy $deploy_id"whenFORCE_DESTROY=yesso a failedvirsh destroyafter shutdown timeout is reported instead of silently ignored.Branches to which this PR applies