@@ -251,6 +251,8 @@ let string_of_vdi_info (x : vdi_info) = Jsonrpc.to_string (rpc_of vdi_info x)
251
251
"datapaths". *)
252
252
type dp = string [@@ deriving rpcty ]
253
253
254
+ type image_format = string [@@ deriving rpcty ]
255
+
254
256
type sock_path = string [@@ deriving rpcty ]
255
257
256
258
type dp_stat_t = {
@@ -277,6 +279,8 @@ type probe_result =
277
279
module Mirror = struct
278
280
type id = string [@@ deriving rpcty ]
279
281
282
+ type image_format = string [@@ deriving rpcty ]
283
+
280
284
type state = Receiving | Sending | Copying [@@ deriving rpcty ]
281
285
282
286
type t = {source_vdi : Vdi .t ; dest_vdi : Vdi .t ; state : state list ; failed : bool }
@@ -998,6 +1002,8 @@ module StorageAPI (R : RPC) = struct
998
1002
)
999
1003
1000
1004
module MIRROR = struct
1005
+ let image_format_p = Param. mk ~name: " image_format" image_format
1006
+
1001
1007
let mirror_vm_p = Param. mk ~name: " mirror_vm" Vm. t
1002
1008
1003
1009
let copy_vm_p = Param. mk ~name: " copy_vm" Vm. t
@@ -1009,6 +1015,7 @@ module StorageAPI (R : RPC) = struct
1009
1015
(dbg_p
1010
1016
@-> sr_p
1011
1017
@-> vdi_p
1018
+ @-> image_format_p
1012
1019
@-> dp_p
1013
1020
@-> mirror_vm_p
1014
1021
@-> copy_vm_p
@@ -1034,27 +1041,35 @@ module StorageAPI (R : RPC) = struct
1034
1041
Use the receive_start2 function instead.
1035
1042
*)
1036
1043
let receive_start =
1044
+ let image_format_p =
1045
+ Param. mk ~name: " image_format" Mirror. image_format
1046
+ in
1037
1047
let similar_p = Param. mk ~name: " similar" Mirror. similars in
1038
1048
let result = Param. mk ~name: " result" Mirror. mirror_receive_result in
1039
1049
declare " DATA.MIRROR.receive_start" []
1040
1050
(dbg_p
1041
1051
@-> sr_p
1042
1052
@-> VDI. vdi_info_p
1043
1053
@-> id_p
1054
+ @-> image_format_p
1044
1055
@-> similar_p
1045
1056
@-> returning result err
1046
1057
)
1047
1058
1048
1059
(* * Called on the receiving end to prepare for receipt of the storage. This
1049
1060
function should be used in conjunction with [receive_finalize2]*)
1050
1061
let receive_start2 =
1062
+ let image_format_p =
1063
+ Param. mk ~name: " image_format" Mirror. image_format
1064
+ in
1051
1065
let similar_p = Param. mk ~name: " similar" Mirror. similars in
1052
1066
let result = Param. mk ~name: " result" Mirror. mirror_receive_result in
1053
1067
declare " DATA.MIRROR.receive_start2" []
1054
1068
(dbg_p
1055
1069
@-> sr_p
1056
1070
@-> VDI. vdi_info_p
1057
1071
@-> id_p
1072
+ @-> image_format_p
1058
1073
@-> similar_p
1059
1074
@-> vm_p
1060
1075
@-> returning result err
@@ -1420,6 +1435,7 @@ module type Server_impl = sig
1420
1435
-> dbg :debug_info
1421
1436
-> sr :sr
1422
1437
-> vdi :vdi
1438
+ -> image_format :string
1423
1439
-> dp :dp
1424
1440
-> mirror_vm :vm
1425
1441
-> copy_vm :vm
@@ -1438,6 +1454,7 @@ module type Server_impl = sig
1438
1454
-> sr :sr
1439
1455
-> vdi_info :vdi_info
1440
1456
-> id :Mirror .id
1457
+ -> image_format :Mirror .image_format
1441
1458
-> similar :Mirror .similars
1442
1459
-> Mirror .mirror_receive_result
1443
1460
@@ -1447,6 +1464,7 @@ module type Server_impl = sig
1447
1464
-> sr :sr
1448
1465
-> vdi_info :vdi_info
1449
1466
-> id :Mirror .id
1467
+ -> image_format :Mirror .image_format
1450
1468
-> similar :Mirror .similars
1451
1469
-> vm :vm
1452
1470
-> Mirror .mirror_receive_result
@@ -1633,17 +1651,20 @@ module Server (Impl : Server_impl) () = struct
1633
1651
Impl.DATA. copy () ~dbg ~sr ~vdi ~vm ~url ~dest ~verify_dest
1634
1652
) ;
1635
1653
S.DATA.MIRROR. start
1636
- (fun dbg sr vdi dp mirror_vm copy_vm url dest verify_dest ->
1637
- Impl.DATA.MIRROR. start () ~dbg ~sr ~vdi ~dp ~mirror_vm ~copy_vm ~url
1638
- ~dest ~verify_dest
1654
+ (fun dbg sr vdi image_format dp mirror_vm copy_vm url dest verify_dest ->
1655
+ Impl.DATA.MIRROR. start () ~dbg ~sr ~vdi ~image_format ~dp ~mirror_vm
1656
+ ~copy_vm ~url ~ dest ~verify_dest
1639
1657
) ;
1640
1658
S.DATA.MIRROR. stop (fun dbg id -> Impl.DATA.MIRROR. stop () ~dbg ~id ) ;
1641
1659
S.DATA.MIRROR. stat (fun dbg id -> Impl.DATA.MIRROR. stat () ~dbg ~id ) ;
1642
- S.DATA.MIRROR. receive_start (fun dbg sr vdi_info id similar ->
1643
- Impl.DATA.MIRROR. receive_start () ~dbg ~sr ~vdi_info ~id ~similar
1660
+ S.DATA.MIRROR. receive_start (fun dbg sr vdi_info id image_format similar ->
1661
+ Impl.DATA.MIRROR. receive_start () ~dbg ~sr ~vdi_info ~id ~image_format
1662
+ ~similar
1644
1663
) ;
1645
- S.DATA.MIRROR. receive_start2 (fun dbg sr vdi_info id similar vm ->
1646
- Impl.DATA.MIRROR. receive_start2 () ~dbg ~sr ~vdi_info ~id ~similar ~vm
1664
+ S.DATA.MIRROR. receive_start2
1665
+ (fun dbg sr vdi_info id image_format similar vm ->
1666
+ Impl.DATA.MIRROR. receive_start2 () ~dbg ~sr ~vdi_info ~id ~image_format
1667
+ ~similar ~vm
1647
1668
) ;
1648
1669
S.DATA.MIRROR. receive_cancel (fun dbg id ->
1649
1670
Impl.DATA.MIRROR. receive_cancel () ~dbg ~id
0 commit comments