Skip to content

Commit 242f6db

Browse files
authored
Remove image format from deprecated receive start (#7144)
The field image_format added to receive_start and receive_start2 breaks migration from old XAPI to new XAPI. Both are sending RPC to the destination, which runs them locally. If the destination has the field but not the source it breaks compatibility. On the other hand, receive_start3 runs on the source. It is the VDI.create that is sent remotely to the destination. This patch removes the new field. That means that you will not be able to choose the format of the destination when migrating from old version of XAPI to new version of XAPI. As receive_start and receive_start2 are deprecated the situation will become more and more rare.
2 parents 3e43f1f + 71a2576 commit 242f6db

7 files changed

Lines changed: 35 additions & 57 deletions

File tree

ocaml/xapi-idl/storage/storage_interface.ml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,6 @@ module StorageAPI (R : RPC) = struct
11761176
@-> sr_p
11771177
@-> VDI.vdi_info_p
11781178
@-> id_p
1179-
@-> image_format_p
11801179
@-> similar_p
11811180
@-> returning result err
11821181
)
@@ -1194,7 +1193,6 @@ module StorageAPI (R : RPC) = struct
11941193
@-> sr_p
11951194
@-> VDI.vdi_info_p
11961195
@-> id_p
1197-
@-> image_format_p
11981196
@-> similar_p
11991197
@-> vm_p
12001198
@-> returning result err
@@ -1358,7 +1356,6 @@ module type MIRROR = sig
13581356
-> sr:sr
13591357
-> vdi_info:vdi_info
13601358
-> id:Mirror.id
1361-
-> image_format:string
13621359
-> similar:Mirror.similars
13631360
-> Mirror.mirror_receive_result
13641361

@@ -1368,7 +1365,6 @@ module type MIRROR = sig
13681365
-> sr:sr
13691366
-> vdi_info:vdi_info
13701367
-> id:Mirror.id
1371-
-> image_format:string
13721368
-> similar:Mirror.similars
13731369
-> vm:vm
13741370
-> Mirror.mirror_receive_result
@@ -1901,14 +1897,11 @@ module Server (Impl : Server_impl) () = struct
19011897
~mirror_vm ~mirror_id ~local_vdi ~copy_vm ~live_vm ~url ~remote_mirror
19021898
~dest_sr ~verify_dest
19031899
) ;
1904-
S.DATA.MIRROR.receive_start (fun dbg sr vdi_info id image_format similar ->
1905-
Impl.DATA.MIRROR.receive_start () ~dbg ~sr ~vdi_info ~id ~image_format
1906-
~similar
1900+
S.DATA.MIRROR.receive_start (fun dbg sr vdi_info id similar ->
1901+
Impl.DATA.MIRROR.receive_start () ~dbg ~sr ~vdi_info ~id ~similar
19071902
) ;
1908-
S.DATA.MIRROR.receive_start2
1909-
(fun dbg sr vdi_info id image_format similar vm ->
1910-
Impl.DATA.MIRROR.receive_start2 () ~dbg ~sr ~vdi_info ~id ~image_format
1911-
~similar ~vm
1903+
S.DATA.MIRROR.receive_start2 (fun dbg sr vdi_info id similar vm ->
1904+
Impl.DATA.MIRROR.receive_start2 () ~dbg ~sr ~vdi_info ~id ~similar ~vm
19121905
) ;
19131906
S.DATA.MIRROR.receive_start3
19141907
(fun dbg sr vdi_info mirror_id image_format similar vm url verify_dest ->

ocaml/xapi-idl/storage/storage_skeleton.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ module DATA = struct
206206
~verify_dest =
207207
Storage_interface.unimplemented __FUNCTION__
208208

209-
let receive_start ctx ~dbg ~sr ~vdi_info ~id ~image_format ~similar =
209+
let receive_start ctx ~dbg ~sr ~vdi_info ~id ~similar =
210210
Storage_interface.unimplemented __FUNCTION__
211211

212-
let receive_start2 ctx ~dbg ~sr ~vdi_info ~id ~image_format ~similar ~vm =
212+
let receive_start2 ctx ~dbg ~sr ~vdi_info ~id ~similar ~vm =
213213
Storage_interface.unimplemented __FUNCTION__
214214

215215
let receive_start3 ctx ~dbg ~sr ~vdi_info ~mirror_id ~image_format ~similar

ocaml/xapi/storage_mux.ml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -875,35 +875,31 @@ module Mux = struct
875875
Storage_interface.unimplemented
876876
__FUNCTION__ (* see storage_smapi{v1,v3}_migrate.ml *)
877877

878-
let receive_start () ~dbg ~sr ~vdi_info ~id ~image_format ~similar =
878+
let receive_start () ~dbg ~sr ~vdi_info ~id ~similar =
879879
with_dbg ~name:"DATA.MIRROR.receive_start" ~dbg @@ fun _di ->
880-
info
881-
"%s dbg: %s sr: %s vdi_info: %s mirror_id: %s image_format: %s \
882-
similar: %s"
880+
info "%s dbg: %s sr: %s vdi_info: %s mirror_id: %s similar: %s"
883881
__FUNCTION__ dbg (s_of_sr sr)
884882
(string_of_vdi_info vdi_info)
885-
id image_format
883+
id
886884
(String.concat ";" similar) ;
887885
(* This goes straight to storage_smapiv1_migrate for backwards compatability
888886
reasons, new code should not call receive_start any more *)
889887
Storage_smapiv1_migrate.MIRROR.receive_start () ~dbg ~sr ~vdi_info ~id
890-
~image_format ~similar
888+
~similar
891889

892-
let receive_start2 () ~dbg ~sr ~vdi_info ~id ~image_format ~similar ~vm =
890+
let receive_start2 () ~dbg ~sr ~vdi_info ~id ~similar ~vm =
893891
with_dbg ~name:"DATA.MIRROR.receive_start2" ~dbg @@ fun _di ->
894-
info
895-
"%s dbg: %s sr: %s vdi_info: %s mirror_id: %s image_format: %s \
896-
similar: %s vm: %s"
892+
info "%s dbg: %s sr: %s vdi_info: %s mirror_id: %s similar: %s vm: %s"
897893
__FUNCTION__ dbg (s_of_sr sr)
898894
(string_of_vdi_info vdi_info)
899-
id image_format
895+
id
900896
(String.concat ";" similar)
901897
(s_of_vm vm) ;
902898
info "%s dbg:%s" __FUNCTION__ dbg ;
903899
(* This goes straight to storage_smapiv1_migrate for backwards compatability
904900
reasons, new code should not call receive_start any more *)
905901
Storage_smapiv1_migrate.MIRROR.receive_start2 () ~dbg ~sr ~vdi_info ~id
906-
~image_format ~similar ~vm
902+
~similar ~vm
907903

908904
(** see storage_smapiv{1,3}_migrate.receive_start3 *)
909905
let receive_start3 () ~dbg:_ ~sr:_ ~vdi_info:_ ~mirror_id:_

ocaml/xapi/storage_smapiv1.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,12 +1168,11 @@ module SMAPIv1 : Server_impl = struct
11681168
~remote_mirror:_ ~dest_sr:_ ~verify_dest:_ =
11691169
assert false
11701170

1171-
let receive_start _context ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~image_format:_
1172-
~similar:_ =
1171+
let receive_start _context ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~similar:_ =
11731172
assert false
11741173

1175-
let receive_start2 _context ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~image_format:_
1176-
~similar:_ ~vm:_ =
1174+
let receive_start2 _context ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~similar:_
1175+
~vm:_ =
11771176
assert false
11781177

11791178
let receive_start3 _context ~dbg:_ ~sr:_ ~vdi_info:_ ~mirror_id:_

ocaml/xapi/storage_smapiv1_migrate.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -757,21 +757,19 @@ module MIRROR : SMAPIv2_MIRROR = struct
757757
!on_fail ;
758758
raise e
759759

760-
let receive_start _ctx ~dbg ~sr ~vdi_info ~id ~image_format ~similar =
761-
D.debug "%s dbg: %s sr: %s vdi: %s id: %s image_format: %s" __FUNCTION__ dbg
762-
(s_of_sr sr)
760+
let receive_start _ctx ~dbg ~sr ~vdi_info ~id ~similar =
761+
D.debug "%s dbg: %s sr: %s vdi: %s id: %s" __FUNCTION__ dbg (s_of_sr sr)
763762
(string_of_vdi_info vdi_info)
764-
id image_format ;
765-
receive_start_common ~dbg ~sr ~vdi_info ~id ~image_format ~similar
763+
id ;
764+
receive_start_common ~dbg ~sr ~vdi_info ~id ~image_format:"" ~similar
766765
~vm:(Vm.of_string "0")
767766
(module Local)
768767

769-
let receive_start2 _ctx ~dbg ~sr ~vdi_info ~id ~image_format ~similar ~vm =
770-
D.debug "%s dbg: %s sr: %s vdi: %s id: %s image_format: %s" __FUNCTION__ dbg
771-
(s_of_sr sr)
768+
let receive_start2 _ctx ~dbg ~sr ~vdi_info ~id ~similar ~vm =
769+
D.debug "%s dbg: %s sr: %s vdi: %s id: %s" __FUNCTION__ dbg (s_of_sr sr)
772770
(string_of_vdi_info vdi_info)
773-
id image_format ;
774-
receive_start_common ~dbg ~sr ~vdi_info ~id ~image_format ~similar ~vm
771+
id ;
772+
receive_start_common ~dbg ~sr ~vdi_info ~id ~image_format:"" ~similar ~vm
775773
(module Local)
776774

777775
let receive_start3 _ctx ~dbg ~sr ~vdi_info ~mirror_id ~image_format ~similar

ocaml/xapi/storage_smapiv1_wrapper.ml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,26 +1218,20 @@ functor
12181218
~remote_mirror:_ ~dest_sr:_ ~verify_dest:_ =
12191219
Storage_interface.unimplemented __FUNCTION__
12201220

1221-
let receive_start context ~dbg ~sr ~vdi_info ~id ~image_format ~similar
1222-
=
1223-
info
1224-
"DATA.MIRROR.receive_start dbg:%s sr:%s id:%s image_format:%s \
1225-
similar:[%s]"
1226-
dbg (s_of_sr sr) id image_format
1221+
let receive_start context ~dbg ~sr ~vdi_info ~id ~similar =
1222+
info "DATA.MIRROR.receive_start dbg:%s sr:%s id:%s similar:[%s]" dbg
1223+
(s_of_sr sr) id
12271224
(String.concat "," similar) ;
1228-
Impl.DATA.MIRROR.receive_start context ~dbg ~sr ~vdi_info ~id
1229-
~image_format ~similar
1225+
Impl.DATA.MIRROR.receive_start context ~dbg ~sr ~vdi_info ~id ~similar
12301226

1231-
let receive_start2 context ~dbg ~sr ~vdi_info ~id ~image_format ~similar
1232-
~vm =
1227+
let receive_start2 context ~dbg ~sr ~vdi_info ~id ~similar ~vm =
12331228
info
1234-
"DATA.MIRROR.receive_start2 dbg:%s sr:%s id:%s image_format:%s \
1235-
similar:[%s] vm:%s"
1236-
dbg (s_of_sr sr) id image_format
1229+
"DATA.MIRROR.receive_start2 dbg:%s sr:%s id:%s similar:[%s] vm:%s"
1230+
dbg (s_of_sr sr) id
12371231
(String.concat "," similar)
12381232
(s_of_vm vm) ;
12391233
Impl.DATA.MIRROR.receive_start2 context ~dbg ~sr ~vdi_info ~id
1240-
~image_format ~similar ~vm
1234+
~similar ~vm
12411235

12421236
let receive_start3 _context ~dbg:_ ~sr:_ ~vdi_info:_ ~mirror_id:_
12431237
~image_format:_ ~similar:_ ~vm:_ =

ocaml/xapi/storage_smapiv3_migrate.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,10 @@ module MIRROR : SMAPIv2_MIRROR = struct
190190
)
191191
)
192192

193-
let receive_start _ctx ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~image_format:_
194-
~similar:_ =
193+
let receive_start _ctx ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~similar:_ =
195194
Storage_interface.unimplemented __FUNCTION__
196195

197-
let receive_start2 _ctx ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~image_format:_
198-
~similar:_ ~vm:_ =
196+
let receive_start2 _ctx ~dbg:_ ~sr:_ ~vdi_info:_ ~id:_ ~similar:_ ~vm:_ =
199197
Storage_interface.unimplemented __FUNCTION__
200198

201199
let receive_start3 _ctx ~dbg ~sr ~vdi_info ~mirror_id ~image_format ~similar:_

0 commit comments

Comments
 (0)