File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ let rpc __context call =
25
25
Rpc.
26
26
{
27
27
success= true
28
- ; contents= contents |> Xmlrpc . to_string |> Xmlrpc . of_string
28
+ ; contents= contents |> Jsonrpc . to_string |> Jsonrpc . of_string
29
29
; is_notification= false
30
30
}
31
31
| "VM.update_allowed_operations" , [session_id_rpc; self_rpc] ->
Original file line number Diff line number Diff line change @@ -395,7 +395,13 @@ let make_rpc ~__context rpc : Rpc.response =
395
395
let subtask_of = Ref. string_of (Context. get_task_id __context) in
396
396
let open Xmlrpc_client in
397
397
let tracing = Context. set_client_span __context in
398
- let http = xmlrpc ~subtask_of ~version: " 1.1" " /" ~tracing in
398
+ let dorpc, path =
399
+ if ! Xapi_globs. use_xmlrpc then
400
+ (XMLRPC_protocol. rpc, " /" )
401
+ else
402
+ (JSONRPC_protocol. rpc, " /jsonrpc" )
403
+ in
404
+ let http = xmlrpc ~subtask_of ~version: " 1.1" path ~tracing in
399
405
let transport =
400
406
if Pool_role. is_master () then
401
407
Unix Xapi_globs. unix_domain_socket
@@ -407,7 +413,7 @@ let make_rpc ~__context rpc : Rpc.response =
407
413
, ! Constants. https_port
408
414
)
409
415
in
410
- XMLRPC_protocol. rpc ~srcstr: " xapi" ~dststr: " xapi" ~transport ~http rpc
416
+ dorpc ~srcstr: " xapi" ~dststr: " xapi" ~transport ~http rpc
411
417
412
418
let make_timeboxed_rpc ~__context timeout rpc : Rpc.response =
413
419
let subtask_of = Ref. string_of (Context. get_task_id __context) in
Original file line number Diff line number Diff line change @@ -1025,6 +1025,8 @@ let max_spans = ref 10000
1025
1025
1026
1026
let max_traces = ref 10000
1027
1027
1028
+ let use_xmlrpc = ref true
1029
+
1028
1030
let compress_tracing_files = ref true
1029
1031
1030
1032
let prefer_nbd_attach = ref false
@@ -1436,6 +1438,11 @@ let other_options =
1436
1438
, (fun () -> string_of_bool ! allow_host_sched_gran_modification)
1437
1439
, " Allows to modify the host's scheduler granularity"
1438
1440
)
1441
+ ; ( " use-xmlrpc"
1442
+ , Arg. Set use_xmlrpc
1443
+ , (fun () -> string_of_bool ! use_xmlrpc)
1444
+ , " Use XMLRPC (deprecated) for internal communication or JSONRPC"
1445
+ )
1439
1446
; ( " extauth_ad_backend"
1440
1447
, Arg. Set_string extauth_ad_backend
1441
1448
, (fun () -> ! extauth_ad_backend)
You can’t perform that action at this time.
0 commit comments