Skip to content

Conversation

@cgwalters
Copy link
Collaborator

When replacing a transient VM, the old VM disappears after virsh destroy since transient domains are not persistent. Previously, the remove logic would then fail trying to virsh undefine a domain that no longer exists.

Detect transient VMs explicitly to handle their removal.

Assisted-by: OpenCode (claude-sonnet-4-20250514)

When replacing a transient VM, the old VM disappears after `virsh destroy`
since transient domains are not persistent. Previously, the remove logic
would then fail trying to `virsh undefine` a domain that no longer exists.

Detect transient VMs explicitly to handle their removal.

Assisted-by: OpenCode (claude-sonnet-4-20250514)
Signed-off-by: Colin Walters <walters@verbum.org>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an issue where replacing a transient VM would fail because the old VM, being transient, disappears after being destroyed, causing the subsequent undefine operation to fail. The fix correctly detects if a VM is transient and skips the undefine step in that case. A new function is_domain_persistent is added for this detection, and the removal logic is updated accordingly. A comprehensive integration test is also added to validate the fix. The changes are logical and well-tested. I have one critical suggestion to improve the error handling to avoid masking potential issues.

@cgwalters cgwalters enabled auto-merge (rebase) January 14, 2026 14:09
@cgwalters cgwalters merged commit 087e8d5 into bootc-dev:main Jan 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants