Skip to content

Commit df7cbfd

Browse files
authored
CA-380789: Not get power_state from snapshots with suspend VDIs
This commit is to fix an issue which was introduced by 3d039f3. In VM migration, the suspend_vdis will be get from snapshots the power_state of which is `Suspended. The individual snapshots are represented as VM records in XAPI as well. They are different with the base VM record. This commit reverts this part to the logic prior to 3d039f3. Signed-off-by: Ming Lu <[email protected]>
1 parent 3bd4451 commit df7cbfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ocaml/xapi/xapi_vm_migrate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
12411241
let suspends_vdis =
12421242
List.fold_left
12431243
(fun acc vm ->
1244-
if power_state = `Suspended then
1244+
if Db.VM.get_power_state ~__context ~self:vm = `Suspended then
12451245
let vdi = Db.VM.get_suspend_VDI ~__context ~self:vm in
12461246
let sr = Db.VDI.get_SR ~__context ~self:vdi in
12471247
if

0 commit comments

Comments
 (0)