Skip to content

Commit 4083494

Browse files
committed
CA-402263, xapi_sr_operatrions: don't include all API storage operations in all_ops
Otherwise the allowed_operations field in SRs can contain newly added operations, which can break cross-pool migrations when using `xe` Partially reverts 723a498 Signed-off-by: Pau Ruiz Safont <[email protected]>
1 parent 7c62ede commit 4083494

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

ocaml/xapi/xapi_sr_operations.ml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,32 @@ open Client
2626

2727
open Record_util
2828

29-
let all_ops = API.storage_operations__all
29+
(* This is a subset of the API enumeration. Not all values can be included
30+
because older versions which don't have them are unable to migrate VMs to the
31+
the versions that have new fields in allowed operations *)
32+
let all_ops : API.storage_operations_set =
33+
[
34+
`scan
35+
; `destroy
36+
; `forget
37+
; `plug
38+
; `unplug
39+
; `vdi_create
40+
; `vdi_destroy
41+
; `vdi_resize
42+
; `vdi_clone
43+
; `vdi_snapshot
44+
; `vdi_mirror
45+
; `vdi_enable_cbt
46+
; `vdi_disable_cbt
47+
; `vdi_data_destroy
48+
; `vdi_list_changed_blocks
49+
; `vdi_set_on_boot
50+
; `vdi_introduce
51+
; `update
52+
; `pbd_create
53+
; `pbd_destroy
54+
]
3055

3156
(* This list comes from https://github.com/xenserver/xen-api/blob/tampa-bugfix/ocaml/xapi/xapi_sr_operations.ml#L36-L38 *)
3257
let all_rpu_ops : API.storage_operations_set =

0 commit comments

Comments
 (0)