Skip to content

Commit 31b22cc

Browse files
krizexgaborigloi
authored andcommitted
CA-262059: Remove VDI.resize_online - no SM backends support it
But keep the associated CLI code in cli_operations.ml, so that the CLI user gets an error if they pass in the online=true parameter to "xe vdi-resize", instead of silently ignoring it. Signed-off-by: Yang Qian <[email protected]>
1 parent 167b9f4 commit 31b22cc

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

ocaml/idl/datamodel.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3441,7 +3441,10 @@ let vdi_resize = call
34413441
let vdi_resize_online = call
34423442
~name:"resize_online"
34433443
~in_oss_since:None
3444-
~in_product_since:rel_rio
3444+
~lifecycle: [
3445+
Published, rel_rio, "";
3446+
Removed, rel_inverness, "Online VDI resize is not supported by any of the storage backends."
3447+
]
34453448
~params:[Ref _vdi, "vdi", "The VDI to resize"; Int, "size", "The new size of the VDI" ]
34463449
~doc:"Resize the VDI which may or may not be attached to running guests."
34473450
~allowed_roles:_R_VM_ADMIN

ocaml/xapi/message_forwarding.ml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,15 +3614,6 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
36143614
forward_vdi_op ~local_fn ~__context ~self:vdi
36153615
(fun session_id rpc -> Client.VDI.resize rpc session_id vdi size))
36163616

3617-
let resize_online ~__context ~vdi ~size =
3618-
info "VDI.resize_online: VDI = '%s'; size = %Ld" (vdi_uuid ~__context vdi) size;
3619-
let local_fn = Local.VDI.resize_online ~vdi ~size in
3620-
let sR = Db.VDI.get_SR ~__context ~self:vdi in
3621-
with_sr_andor_vdi ~__context ~sr:(sR, `vdi_resize) ~vdi:(vdi, `resize_online) ~doc:"VDI.resize_online"
3622-
(fun () ->
3623-
forward_vdi_op ~local_fn ~__context ~self:vdi
3624-
(fun session_id rpc -> Client.VDI.resize_online rpc session_id vdi size))
3625-
36263617
let generate_config ~__context ~host ~vdi =
36273618
info "VDI.generate_config: VDI = '%s'; host = '%s'" (vdi_uuid ~__context vdi) (host_uuid ~__context host);
36283619
let local_fn = Local.VDI.generate_config ~host ~vdi in

ocaml/xapi/xapi_vdi.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ let _data_destroy ~__context ~self ~timeout =
721721

722722
let data_destroy = _data_destroy ~timeout:4.0
723723

724-
let resize_online ~__context ~vdi ~size =
724+
let resize ~__context ~vdi ~size =
725725
Sm.assert_pbd_is_plugged ~__context ~sr:(Db.VDI.get_SR ~__context ~self:vdi);
726726
Xapi_vdi_helpers.assert_managed ~__context ~vdi;
727727
Storage_access.transform_storage_exn
@@ -735,8 +735,6 @@ let resize_online ~__context ~vdi ~size =
735735
Db.VDI.set_virtual_size ~__context ~self:vdi ~value:new_size
736736
)
737737

738-
let resize = resize_online
739-
740738
let generate_config ~__context ~host ~vdi =
741739
Sm.assert_pbd_is_plugged ~__context ~sr:(Db.VDI.get_SR ~__context ~self:vdi);
742740
Xapi_vdi_helpers.assert_managed ~__context ~vdi;

ocaml/xapi/xapi_vdi.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ val _data_destroy : __context:Context.t -> self:[ `VDI ] API.Ref.t -> timeout:fl
154154
for waiting for the VDI's VBDs to disappear is configurable to enable faster
155155
unit tests. *)
156156

157-
val resize_online :
158-
__context:Context.t -> vdi:[ `VDI ] API.Ref.t -> size:int64 -> unit
159157
val resize :
160158
__context:Context.t -> vdi:[ `VDI ] API.Ref.t -> size:int64 -> unit
161159
val generate_config :

0 commit comments

Comments
 (0)