Skip to content

CA-380789: Not get power_state from snapshots with suspend VDIs #5148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_vm_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
let suspends_vdis =
List.fold_left
(fun acc vm ->
if power_state = `Suspended then
if Db.VM.get_power_state ~__context ~self:vm = `Suspended then
Comment on lines 1243 to +1244
Copy link
Member

Choose a reason for hiding this comment

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

It's clear how reverting fixes the issue, maybe rename the binding to make sure it can't be mistaken again?

Suggested change
(fun acc vm ->
if power_state = `Suspended then
if Db.VM.get_power_state ~__context ~self:vm = `Suspended then
(fun acc vm_or_snapshot ->
let power_state = Db.VM.get_power_state ~__context ~self:vm_or_snapshot then
if power_state = `Suspended then

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's minimize the changes at this stage :)

let vdi = Db.VM.get_suspend_VDI ~__context ~self:vm in
let sr = Db.VDI.get_SR ~__context ~self:vdi in
if
Expand Down