@@ -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,7 @@ 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
1001
1006
let mirror_vm_p = Param. mk ~name: " mirror_vm" Vm. t
1002
1007
1003
1008
let copy_vm_p = Param. mk ~name: " copy_vm" Vm. t
@@ -1009,6 +1014,7 @@ module StorageAPI (R : RPC) = struct
1009
1014
(dbg_p
1010
1015
@-> sr_p
1011
1016
@-> vdi_p
1017
+ @-> image_format_p
1012
1018
@-> dp_p
1013
1019
@-> mirror_vm_p
1014
1020
@-> copy_vm_p
@@ -1034,27 +1040,35 @@ module StorageAPI (R : RPC) = struct
1034
1040
Use the receive_start2 function instead.
1035
1041
*)
1036
1042
let receive_start =
1043
+ let image_format_p =
1044
+ Param. mk ~name: " image_format" Mirror. image_format
1045
+ in
1037
1046
let similar_p = Param. mk ~name: " similar" Mirror. similars in
1038
1047
let result = Param. mk ~name: " result" Mirror. mirror_receive_result in
1039
1048
declare " DATA.MIRROR.receive_start" []
1040
1049
(dbg_p
1041
1050
@-> sr_p
1042
1051
@-> VDI. vdi_info_p
1043
1052
@-> id_p
1053
+ @-> image_format_p
1044
1054
@-> similar_p
1045
1055
@-> returning result err
1046
1056
)
1047
1057
1048
1058
(* * Called on the receiving end to prepare for receipt of the storage. This
1049
1059
function should be used in conjunction with [receive_finalize2]*)
1050
1060
let receive_start2 =
1061
+ let image_format_p =
1062
+ Param. mk ~name: " image_format" Mirror. image_format
1063
+ in
1051
1064
let similar_p = Param. mk ~name: " similar" Mirror. similars in
1052
1065
let result = Param. mk ~name: " result" Mirror. mirror_receive_result in
1053
1066
declare " DATA.MIRROR.receive_start2" []
1054
1067
(dbg_p
1055
1068
@-> sr_p
1056
1069
@-> VDI. vdi_info_p
1057
1070
@-> id_p
1071
+ @-> image_format_p
1058
1072
@-> similar_p
1059
1073
@-> vm_p
1060
1074
@-> returning result err
@@ -1420,6 +1434,7 @@ module type Server_impl = sig
1420
1434
-> dbg :debug_info
1421
1435
-> sr :sr
1422
1436
-> vdi :vdi
1437
+ -> image_format : string
1423
1438
-> dp :dp
1424
1439
-> mirror_vm :vm
1425
1440
-> copy_vm :vm
@@ -1438,6 +1453,7 @@ module type Server_impl = sig
1438
1453
-> sr :sr
1439
1454
-> vdi_info :vdi_info
1440
1455
-> id :Mirror .id
1456
+ -> image_format :Mirror .image_format
1441
1457
-> similar :Mirror .similars
1442
1458
-> Mirror .mirror_receive_result
1443
1459
@@ -1447,6 +1463,7 @@ module type Server_impl = sig
1447
1463
-> sr :sr
1448
1464
-> vdi_info :vdi_info
1449
1465
-> id :Mirror .id
1466
+ -> image_format :Mirror .image_format
1450
1467
-> similar :Mirror .similars
1451
1468
-> vm :vm
1452
1469
-> Mirror .mirror_receive_result
@@ -1633,17 +1650,20 @@ module Server (Impl : Server_impl) () = struct
1633
1650
Impl.DATA. copy () ~dbg ~sr ~vdi ~vm ~url ~dest ~verify_dest
1634
1651
) ;
1635
1652
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
1653
+ (fun dbg sr vdi image_format dp mirror_vm copy_vm url dest verify_dest ->
1654
+ Impl.DATA.MIRROR. start () ~dbg ~sr ~vdi ~image_format ~ dp ~mirror_vm ~copy_vm ~url
1638
1655
~dest ~verify_dest
1639
1656
) ;
1640
1657
S.DATA.MIRROR. stop (fun dbg id -> Impl.DATA.MIRROR. stop () ~dbg ~id ) ;
1641
1658
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
1659
+ S.DATA.MIRROR. receive_start (fun dbg sr vdi_info id image_format similar ->
1660
+ Impl.DATA.MIRROR. receive_start () ~dbg ~sr ~vdi_info ~id ~image_format
1661
+ ~similar
1644
1662
) ;
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
1663
+ S.DATA.MIRROR. receive_start2
1664
+ (fun dbg sr vdi_info id image_format similar vm ->
1665
+ Impl.DATA.MIRROR. receive_start2 () ~dbg ~sr ~vdi_info ~id ~image_format
1666
+ ~similar ~vm
1647
1667
) ;
1648
1668
S.DATA.MIRROR. receive_cancel (fun dbg id ->
1649
1669
Impl.DATA.MIRROR. receive_cancel () ~dbg ~id
0 commit comments