Skip to content

Commit

Permalink
rebaseMe: PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Reis <[email protected]>
  • Loading branch information
benjamreis committed Mar 22, 2024
1 parent e505565 commit 985eeb0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ocaml/idl/datamodel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6521,7 +6521,7 @@ end
module PCI = struct
let disable_dom0_access =
call ~name:"disable_dom0_access"
~lifecycle:[(Published, rel_vgpu_tech_preview, "")]
~lifecycle:[]
~doc:
"Hide a PCI device from the dom0 kernel. (Takes affect after next \
boot.)"
Expand All @@ -6530,7 +6530,7 @@ module PCI = struct

let enable_dom0_access =
call ~name:"enable_dom0_access"
~lifecycle:[(Published, rel_vgpu_tech_preview, "")]
~lifecycle:[]
~doc:
"Unhide a PCI device from the dom0 kernel. (Takes affect after next \
boot.)"
Expand All @@ -6539,7 +6539,7 @@ module PCI = struct

let is_dom0_access_enabled =
call ~name:"is_dom0_access_enabled"
~lifecycle:[(Published, rel_vgpu_tech_preview, "")]
~lifecycle:[]
~doc:
"Returns whether the PCI device is accessible from the dom0 kernel on boot."
~params:[(Ref _pci, "self", "The PCI")]
Expand Down
9 changes: 9 additions & 0 deletions ocaml/xapi-cli-server/cli_frontend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3698,6 +3698,15 @@ let rec cmdtable_data : (string * cmd_spec) list =
; flags= []
}
)
; ( "pci-is-dom0-access-enabled"
, {
reqd= ["uuid"]
; optn= []
; help= "Returns whether the PCI device is accessible from the dom0 kernel on boot."
; implementation= No_fd Cli_operations.is_dom0_access_enabled
; flags= []
}
)
]

let cmdtable : (string, cmd_spec) Hashtbl.t = Hashtbl.create 50
Expand Down
5 changes: 5 additions & 0 deletions ocaml/xapi-cli-server/cli_operations.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7488,6 +7488,11 @@ let pci_disable_dom0_access _printer rpc session_id params =
let ref = Client.PCI.get_by_uuid ~rpc ~session_id ~uuid in
Client.PCI.disable_dom0_access ~rpc ~session_id ~self:ref

let is_dom0_access_enabled printer rpc session_id params =
let uuid = List.assoc "uuid" params in
let ref = Client.PCI.get_by_uuid ~rpc ~session_id ~uuid in
printer (Cli_printer.PMsg (Bool.to_string (Client.PCI.is_dom0_access_enabled ~rpc ~session_id ~self:ref)))

module PVS_site = struct
let introduce printer rpc session_id params =
let name_label = List.assoc "name-label" params in
Expand Down

0 comments on commit 985eeb0

Please sign in to comment.