diff --git a/ocaml/idl/datamodel_lifecycle.ml b/ocaml/idl/datamodel_lifecycle.ml index 5044adec27b..14365c257f8 100644 --- a/ocaml/idl/datamodel_lifecycle.ml +++ b/ocaml/idl/datamodel_lifecycle.ml @@ -133,8 +133,14 @@ let prototyped_of_message = function Some "22.27.0" | "host", "set_numa_affinity_policy" -> Some "24.0.0" + | "VM", "get_secureboot_readiness" -> + Some "24.15.0-next" + | "VM", "set_uefi_mode" -> + Some "24.15.0-next" | "VM", "restart_device_models" -> Some "23.30.0" + | "pool", "get_guest_secureboot_readiness" -> + Some "24.15.0-next" | "pool", "set_ext_auth_max_threads" -> Some "23.27.0" | "pool", "set_local_auth_max_threads" -> diff --git a/ocaml/xapi-storage-script/main.ml b/ocaml/xapi-storage-script/main.ml index f708bb30dfc..0ad8b900e3b 100644 --- a/ocaml/xapi-storage-script/main.ml +++ b/ocaml/xapi-storage-script/main.ml @@ -1507,6 +1507,49 @@ let bind ~volume_script_dir = S.SR.list sr_list ; (* SR.reset is a no op in SMAPIv3 *) S.SR.reset (fun _ _ -> Deferred.Result.return () |> wrap) ; + let ( let* ) = ( >>>= ) in + let vdi_enable_cbt_impl dbg sr vdi = + wrap + @@ + let* sr = Attached_SRs.find sr in + let vdi = Storage_interface.Vdi.string_of vdi in + return_volume_rpc (fun () -> Volume_client.enable_cbt volume_rpc dbg sr vdi) + in + S.VDI.enable_cbt vdi_enable_cbt_impl ; + let vdi_disable_cbt_impl dbg sr vdi = + wrap + @@ + let* sr = Attached_SRs.find sr in + let vdi = Storage_interface.Vdi.string_of vdi in + return_volume_rpc (fun () -> Volume_client.disable_cbt volume_rpc dbg sr vdi) + in + S.VDI.disable_cbt vdi_disable_cbt_impl ; + let vdi_list_changed_blocks_impl dbg sr vdi vdi' = + wrap + @@ + let* sr = Attached_SRs.find sr in + let vdi, vdi' = Storage_interface.Vdi.(string_of vdi, string_of vdi') in + let ( let* ) = ( >>= ) in + let* result = + return_volume_rpc (fun () -> + (* Negative lengths indicate that we want the full length. *) + Volume_client.list_changed_blocks volume_rpc dbg sr vdi vdi' 0L (-1) + ) + in + let proj_bitmap r = r.Xapi_storage.Control.bitmap in + return (Result.map ~f:proj_bitmap result) + in + S.VDI.list_changed_blocks vdi_list_changed_blocks_impl ; + let vdi_data_destroy_impl dbg sr vdi = + wrap + @@ + let* sr = Attached_SRs.find sr in + let vdi = Storage_interface.Vdi.string_of vdi in + return_volume_rpc (fun () -> + Volume_client.data_destroy volume_rpc dbg sr vdi + ) + in + S.VDI.data_destroy vdi_data_destroy_impl ; let u name _ = failwith ("Unimplemented: " ^ name) in S.get_by_name (u "get_by_name") ; S.VDI.compose (u "VDI.compose") ; @@ -1514,13 +1557,11 @@ let bind ~volume_script_dir = S.DATA.MIRROR.receive_start (u "DATA.MIRROR.receive_start") ; S.UPDATES.get (u "UPDATES.get") ; S.SR.update_snapshot_info_dest (u "SR.update_snapshot_info_dest") ; - S.VDI.data_destroy (u "VDI.data_destroy") ; S.DATA.MIRROR.list (u "DATA.MIRROR.list") ; S.TASK.stat (u "TASK.stat") ; S.VDI.remove_from_sm_config (u "VDI.remove_from_sm_config") ; S.DP.diagnostics (u "DP.diagnostics") ; S.TASK.destroy (u "TASK.destroy") ; - S.VDI.list_changed_blocks (u "VDI.list_changed_blocks") ; S.DP.destroy (u "DP.destroy") ; S.VDI.add_to_sm_config (u "VDI.add_to_sm_config") ; S.VDI.similar_content (u "VDI.similar_content") ; @@ -1529,7 +1570,6 @@ let bind ~volume_script_dir = S.DATA.MIRROR.receive_finalize (u "DATA.MIRROR.receive_finalize") ; S.DP.create (u "DP.create") ; S.VDI.set_content_id (u "VDI.set_content_id") ; - S.VDI.disable_cbt (u "VDI.disable_cbt") ; S.DP.attach_info (u "DP.attach_info") ; S.TASK.cancel (u "TASK.cancel") ; S.VDI.attach (u "VDI.attach") ; @@ -1538,7 +1578,6 @@ let bind ~volume_script_dir = S.DATA.MIRROR.stat (u "DATA.MIRROR.stat") ; S.TASK.list (u "TASK.list") ; S.VDI.get_url (u "VDI.get_url") ; - S.VDI.enable_cbt (u "VDI.enable_cbt") ; S.DATA.MIRROR.start (u "DATA.MIRROR.start") ; S.Policy.get_backend_vm (u "Policy.get_backend_vm") ; S.DATA.copy_into (u "DATA.copy_into") ;