From 40834941413714b4add385844fc51f1f77feb1ba Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Thu, 21 Nov 2024 17:59:16 +0000 Subject: [PATCH] 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 723a4983ab1555b24222b417350cddebbf6dc1f5 Signed-off-by: Pau Ruiz Safont --- ocaml/xapi/xapi_sr_operations.ml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ocaml/xapi/xapi_sr_operations.ml b/ocaml/xapi/xapi_sr_operations.ml index 56f4c466ce6..eef09a7d9eb 100644 --- a/ocaml/xapi/xapi_sr_operations.ml +++ b/ocaml/xapi/xapi_sr_operations.ml @@ -26,7 +26,32 @@ open Client open Record_util -let all_ops = API.storage_operations__all +(* This is a subset of the API enumeration. Not all values can be included + because older versions which don't have them are unable to migrate VMs to the + the versions that have new fields in allowed operations *) +let all_ops : API.storage_operations_set = + [ + `scan + ; `destroy + ; `forget + ; `plug + ; `unplug + ; `vdi_create + ; `vdi_destroy + ; `vdi_resize + ; `vdi_clone + ; `vdi_snapshot + ; `vdi_mirror + ; `vdi_enable_cbt + ; `vdi_disable_cbt + ; `vdi_data_destroy + ; `vdi_list_changed_blocks + ; `vdi_set_on_boot + ; `vdi_introduce + ; `update + ; `pbd_create + ; `pbd_destroy + ] (* This list comes from https://github.com/xenserver/xen-api/blob/tampa-bugfix/ocaml/xapi/xapi_sr_operations.ml#L36-L38 *) let all_rpu_ops : API.storage_operations_set =