xapi_vm_lifecycle: Only consult data-cant-suspend-reason and feature-suspend for live VMs#7047
Merged
last-genius merged 1 commit intoxapi-project:masterfrom Apr 30, 2026
Merged
Conversation
…suspend for live VMs
Otherwise, a shutdown VM that had data/cant_suspend_reason populated during its
runtime will not be migratable with VM_NON_SUSPENDABLE error.
Additionally uses Xapi_vm_lifecycle_helpers.is_live (which checks for both
`Paused and `Running) instead of a check for `Running to determine if the VM is
live.
The following matrix of cases was tested:
[x] Test on migratable Windows (shouldn't block suspend) → OK
[x] Test on Windows with a non-migratable device (should block suspend as VM
lacks feature) → OK
[x] Test on migratable Linux with XenServer tools (shouldn't block) → OK
[x] Test on migratable Linux with XCP-ng tools (shouldn't block) → OK
[x] Test on Linux with a non-migratable device (should block) → OK
[x] Test nopv Windows/Linux without unmigratable devices with manual
`feature-suspend` xenstore entry forced (shouldn't block, should
resume correctly)
[x] Windows BIOS → OK
[x] Linux BIOS → OK
[x] Test VDI migration on VM that had cant_suspend_reason populated but was
shut down (shouldn't block VDI migration) → OK
Fixes: c895469 ("xapi_vm_lifecycle: Disallow suspend when cant_suspend_reason is present")
Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
psafont
approved these changes
Apr 30, 2026
lindig
approved these changes
Apr 30, 2026
Merged
via the queue into
xapi-project:master
with commit Apr 30, 2026
ca64708
18 of 19 checks passed
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.
Otherwise, a shutdown VM that had
data/cant_suspend_reasonpopulated during its runtime will not be migratable withVM_NON_SUSPENDABLEerror.Additionally uses
Xapi_vm_lifecycle_helpers.is_live(which checks for bothPausedandRunning) instead of a check forRunningto determine if the VM is live.The following matrix of cases was tested:
Test on migratable Windows (shouldn't block suspend) → OK
Test on Windows with a non-migratable device (should block suspend as VM
lacks feature) → OK
Test on migratable Linux with XenServer tools (shouldn't block) → OK
Test on migratable Linux with XCP-ng tools (shouldn't block) → OK
Test on Linux with a non-migratable device (should block) → OK
Test nopv Windows/Linux without unmigratable devices with manual
feature-suspendxenstore entry forced (shouldn't block, shouldresume correctly)
Windows BIOS → OK
Linux BIOS → OK
Test VDI migration on VM that had cant_suspend_reason populated but was
shut down (shouldn't block VDI migration) → OK
Fixes: c895469 ("xapi_vm_lifecycle: Disallow suspend when cant_suspend_reason is present")