Skip to content

CP-50050 track CBT status for SMAPIv3 SRs #5756

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 1 commit into from
Jul 1, 2024
Merged
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
12 changes: 8 additions & 4 deletions ocaml/xapi-storage-script/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ let vdi_of_volume x =
; snapshot_time= find_string _snapshot_time_key ~default:"19700101T00:00:00Z"
; snapshot_of= Vdi.of_string (find_string _snapshot_of_key ~default:"")
; read_only= not x.Xapi_storage.Control.read_write
; cbt_enabled= false
; cbt_enabled= Option.value x.Xapi_storage.Control.cbt_enabled ~default:false
; virtual_size= x.Xapi_storage.Control.virtual_size
; physical_utilisation= x.Xapi_storage.Control.physical_utilisation
; sm_config= []
Expand Down Expand Up @@ -1553,9 +1553,13 @@ let bind ~volume_script_dir =
@@
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
)
let* response =
return_volume_rpc (fun () ->
Volume_client.data_destroy volume_rpc dbg sr vdi
)
in
let* () = set ~dbg ~sr ~vdi ~key:_vdi_type_key ~value:"cbt_metadata" in
Deferred.Result.return response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this response var is always going to be a unit, isn't it? We could just return unit here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be changed to

let* () = return_volume_rpc (...) in
set ~dbg ... ~value"cbt_metadata"

But the way it is right now is fine as well

in
S.VDI.data_destroy vdi_data_destroy_impl ;
let u name _ = failwith ("Unimplemented: " ^ name) in
Expand Down
Loading