File tree Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -1786,6 +1786,16 @@ module HOST = struct
1786
1786
let module B = (val get_backend () : S ) in
1787
1787
B.HOST. mask_features features mask
1788
1788
) ()
1789
+
1790
+ let update_guest_agent_features _ dbg features =
1791
+ Debug. with_thread_associated dbg
1792
+ (fun () ->
1793
+ debug " HOST.update_guest_agent_features %s"
1794
+ (Rpc. Enum (List. map Host. rpc_of_guest_agent_feature features)
1795
+ |> Jsonrpc. to_string);
1796
+ let module B = (val get_backend () : S ) in
1797
+ B.HOST. update_guest_agent_features features
1798
+ ) ()
1789
1799
end
1790
1800
1791
1801
module VM = struct
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ module type S = sig
62
62
val get_total_memory_mib : unit -> int64
63
63
val send_debug_keys : string -> unit
64
64
val mask_features : string -> string -> string
65
+ val update_guest_agent_features : Host .guest_agent_feature list -> unit
65
66
end
66
67
module VM : sig
67
68
val add : Vm .t -> unit
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ module HOST = struct
47
47
let get_total_memory_mib () = 0L
48
48
let send_debug_keys _ = ()
49
49
let mask_features features mask = features
50
+ let update_guest_agent_features _ = ()
50
51
end
51
52
module VM = struct
52
53
let add _ = ()
Original file line number Diff line number Diff line change @@ -507,6 +507,39 @@ module HOST = struct
507
507
(fun xc xs ->
508
508
Xenctrl. send_debug_keys xc keys
509
509
)
510
+
511
+ let update_guest_agent_features features =
512
+ let root = " /guest_agent_features" in
513
+ let perms =
514
+ Xs_protocol.ACL. ({
515
+ owner = 0 ;
516
+ other = READ ;
517
+ acl = [] ;
518
+ }) in
519
+ with_xs
520
+ (fun xs ->
521
+ Xs. transaction xs (fun t ->
522
+ t.Xst. rm root;
523
+ let write_with_perms key value =
524
+ t.Xst. write key value;
525
+ t.Xst. setperms key perms
526
+ in
527
+ write_with_perms root " " ;
528
+ List. iter (fun feature ->
529
+ let feature_root = Filename. concat root feature.Host. name in
530
+ let parameters_root = Filename. concat feature_root " parameters" in
531
+ write_with_perms feature_root " " ;
532
+ write_with_perms parameters_root " " ;
533
+ write_with_perms
534
+ (Filename. concat feature_root " licensed" )
535
+ (if feature.Host. licensed then " 1" else " 0" );
536
+ List. iter
537
+ (fun (key , value ) ->
538
+ write_with_perms
539
+ (Filename. concat parameters_root key)
540
+ value)
541
+ feature.Host. parameters)
542
+ features))
510
543
end
511
544
512
545
module VM = struct
You can’t perform that action at this time.
0 commit comments