Skip to content

Commit

Permalink
Review changes - will be squashed later
Browse files Browse the repository at this point in the history
Change service name from `gpu` to `gpumon`.
Change `dom_id` to `domid`.
Define better compatibility type.
Add pgpu_address parameter to get_pgpu_vm_compatibility.
Add helpful comments to both API functions.
Remove unused json_url and json_path.

Signed-off-by: Frederico Mazzone <frederico.mazzone@citrix.com>
  • Loading branch information
Frezzle committed Apr 12, 2017
1 parent 224cb70 commit acd8554
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 0 additions & 1 deletion gpumon/gpumon_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
open Gpumon_interface
open Xcp_client

let json_url () = "file:" ^ json_path
let xml_url () = "file:" ^ xml_path

module Client = Gpumon_interface.Client(struct
Expand Down
17 changes: 12 additions & 5 deletions gpumon/gpumon_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@
* GNU Lesser General Public License for more details.
*)

let service_name = "gpu"
let service_name = "gpumon"
let queue_name = Xcp_service.common_prefix ^ service_name
let json_path = "/var/xapi/" ^ service_name ^ ".json"
let xml_path = "/var/xapi/" ^ service_name

type debug_info = string

type pgpu_address = string
type pgpu_metadata = string
type dom_id = int
type vgpu_compatibility = unit (* temporarily unit, until real type is determined *)
type domid = int

type incompatibility_reason = Host_driver | Guest_driver | GPU | Other
type compatibility = Compatible | Incompatible of incompatibility_reason list

(* Get the metadata for a pGPU, given its address (PCI bus ID). *)
external get_pgpu_metadata: debug_info -> pgpu_address -> pgpu_metadata = ""
external get_pgpu_vm_compatibility: debug_info -> pgpu_metadata -> dom_id -> vgpu_compatibility list = ""

(* Check compatibility between a VM's vGPU(s) and another pGPU. *)
(* pgpu_address = PCI bus ID of the pGPU in which the VM is currently running. *)
(* domid = domain ID of the VM in which the vGPU(s) is running. *)
(* pgpu_metadata = metadata of the pGPU to check compatibility for. *)
external get_pgpu_vm_compatibility: debug_info -> pgpu_address -> domid -> pgpu_metadata -> compatibility = ""

0 comments on commit acd8554

Please sign in to comment.