Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MVD CP-52334 multi-version driver API/CLI - small fixes
Address review comments; fix typos and parameter names.

Signed-off-by: Christian Lindig <[email protected]>
  • Loading branch information
Christian Lindig committed Jan 21, 2025
commit f34ddfece9b6ca690878f77120239c59e315e877
2 changes: 1 addition & 1 deletion ocaml/idl/datamodel_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ let apply_updates =
let rescan_drivers =
call ~name:"rescan_drivers" ~in_oss_since:None ~lifecycle:[]
~doc:"Scan the host and update its driver information."
~params:[(Ref _host, "host", "The host to be rescanned")]
~params:[(Ref _host, "self", "The host to be rescanned")]
~allowed_roles:_R_POOL_ADMIN ()

let copy_primary_host_certs =
Expand Down
2 changes: 1 addition & 1 deletion ocaml/idl/datamodel_host_driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ let t =
"selected_variant"
"Variant (if any) selected to become active after reboot. Or Null"
; field ~lifecycle:[] ~qualifier:DynamicRO ~ty:String "type"
"Devive type this driver supports, like network or storage"
"Device type this driver supports, like network or storage"
; field ~lifecycle:[] ~qualifier:DynamicRO ~ty:String "description"
"Description of the driver"
; field ~lifecycle:[] ~qualifier:DynamicRO ~ty:String "info"
Expand Down
2 changes: 1 addition & 1 deletion ocaml/util/dune
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
(library
(name xapi_host_driver_helpers)
(modules xapi_host_driver_helpers)
(libraries yojson angstrom)
(libraries yojson angstrom xapi-stdext-unix)
(wrapped false)
)
6 changes: 1 addition & 5 deletions ocaml/util/xapi_host_driver_helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ let int n = Int32.to_int n
let ( // ) = Filename.concat

(** Read a (small) file into a string *)
let read path =
let ic = open_in path in
defer (fun () -> close_in ic) @@ fun () ->
let size = in_channel_length ic in
really_input_string ic size
let read path = Xapi_stdext_unix.Unixext.string_of_file path

type note = {typ: int32; name: string; desc: string}

Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/dbsync_slave.ml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ let update_env __context sync_keys =
) ;
switched_sync Xapi_globs.sync_host_driver (fun () ->
debug "%s" __FUNCTION__ ;
ignore (Xapi_host.rescan_drivers ~__context ~host:localhost)
ignore (Xapi_host.rescan_drivers ~__context ~self:localhost)
) ;

(* CA-35549: In a pool rolling upgrade, the master will detect the end of upgrade when the software versions
Expand Down
10 changes: 5 additions & 5 deletions ocaml/xapi/message_forwarding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4143,12 +4143,12 @@ functor
info "Host.apply_updates: host = '%s'; hash = '%s'" uuid hash ;
Local.Host.apply_updates ~__context ~self ~hash

let rescan_drivers ~__context ~host =
let uuid = host_uuid ~__context host in
let rescan_drivers ~__context ~self =
let uuid = host_uuid ~__context self in
info "Host.rescan_drivers: host = '%s'" uuid ;
let local_fn = Local.Host.rescan_drivers ~host in
do_op_on ~local_fn ~__context ~host (fun session_id rpc ->
Client.Host.rescan_drivers ~rpc ~session_id ~host
let local_fn = Local.Host.rescan_drivers ~self in
do_op_on ~local_fn ~__context ~host:self (fun session_id rpc ->
Client.Host.rescan_drivers ~rpc ~session_id ~self
)

let set_https_only ~__context ~self ~value =
Expand Down
3 changes: 2 additions & 1 deletion ocaml/xapi/xapi_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3089,7 +3089,8 @@ let apply_updates ~__context ~self ~hash =
Db.Host.set_last_update_hash ~__context ~self ~value:hash ;
warnings

let rescan_drivers ~__context ~host = Xapi_host_driver.scan ~__context ~host
let rescan_drivers ~__context ~self =
Xapi_host_driver.scan ~__context ~host:self

let cc_prep () =
let cc = "CC_PREPARATIONS" in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_host.mli
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ val get_host_updates_handler : Http.Request.t -> Unix.file_descr -> 'a -> unit
val apply_updates :
__context:Context.t -> self:API.ref_host -> hash:string -> string list list

val rescan_drivers : __context:Context.t -> host:API.ref_host -> unit
val rescan_drivers : __context:Context.t -> self:API.ref_host -> unit

val copy_primary_host_certs : __context:Context.t -> host:API.ref_host -> unit

Expand Down