Skip to content

Commit

Permalink
CP-26717: Further changes
Browse files Browse the repository at this point in the history
- gpumon_interface: reformat API call parameter listing
- gpumon_client: only locally open Xcp_client, remove global open of
gpumon_interface

Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
  • Loading branch information
Akanksha Mathur committed Jan 29, 2018
1 parent c4334dd commit 34f3e1c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
10 changes: 4 additions & 6 deletions gpumon/gpumon_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
* GNU Lesser General Public License for more details.
*)

open Gpumon_interface
open Xcp_client

let xml_url () = "file:" ^ xml_path
let xml_url () = "file:" ^ Gpumon_interface.xml_path

let rpc call =
let open Xcp_client in
if !use_switch
then json_switch_rpc queue_name call
then json_switch_rpc Gpumon_interface.queue_name call
else xml_http_rpc
~srcstr:(get_user_agent ())
~dststr:"gpumon"
xml_url
call
module Client = RPC_API(Idl.GenClientExnRpc(struct let rpc=rpc end))
module Client = Gpumon_interface.RPC_API(Idl.GenClientExnRpc(struct let rpc=rpc end))
27 changes: 22 additions & 5 deletions gpumon/gpumon_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,29 @@ module RPC_API(R : RPC) = struct
let get_pgpu_metadata =
declare "get_pgpu_metadata"
["Gets the metadata for a pGPU, given its address (PCI bus ID)."]
(debug_info_p @-> pgpu_address_p @-> returning nvidia_pgpu_metadata_p gpu_err )
(debug_info_p
@-> pgpu_address_p
@-> returning nvidia_pgpu_metadata_p gpu_err
)

let get_pgpu_vm_compatibility =
declare "get_pgpu_vm_compatibility"
["Checks compatibility between a VM's vGPU(s) and another pGPU."]
(debug_info_p @-> pgpu_address_p @-> domid_p @-> nvidia_pgpu_metadata_p @-> returning compatibility_p gpu_err )
(debug_info_p
@-> pgpu_address_p
@-> domid_p
@-> nvidia_pgpu_metadata_p
@-> returning compatibility_p gpu_err
)

let get_vgpu_metadata =
declare "get_vgpu_metadata"
["Obtains metadata for all vGPUs running in a domain."]
( debug_info_p @-> domid_p @-> pgpu_address_p @-> returning nvidia_vgpu_metadata_list_p gpu_err )
( debug_info_p
@-> domid_p
@-> pgpu_address_p
@-> returning nvidia_vgpu_metadata_list_p gpu_err
)

(** The use case is VM.suspend/VM.resume: before
* VM.resume [nvidia_vgpu_metadata] of the suspended VM is checked
Expand All @@ -151,7 +163,12 @@ module RPC_API(R : RPC) = struct
* *)
let get_pgpu_vgpu_compatibility =
declare "get_pgpu_vgpu_compatibility"
["Checks compatibility between a pGPU (on a host) and a list of vGPUs (assigned to a VM). Note: A VM may use several vGPUs."]
( debug_info_p @-> nvidia_pgpu_metadata_p @-> nvidia_vgpu_metadata_list_p @-> returning compatibility_p gpu_err )
["Checks compatibility between a pGPU (on a host) and a list of vGPUs"
; " (assigned to a VM). Note: A VM may use several vGPUs."]
( debug_info_p
@-> nvidia_pgpu_metadata_p
@-> nvidia_vgpu_metadata_list_p
@-> returning compatibility_p gpu_err
)
end
end

0 comments on commit 34f3e1c

Please sign in to comment.