Skip to content

CP-49249: Implement SMAPIv3 CBT Forwarding #5675

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 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions ocaml/idl/datamodel_lifecycle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ->
Expand Down
47 changes: 43 additions & 4 deletions ocaml/xapi-storage-script/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1507,20 +1507,61 @@ 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") ;
S.VDI.get_by_name (u "VDI.get_by_name") ;
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") ;
Expand All @@ -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") ;
Expand All @@ -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") ;
Expand Down
Loading