Skip to content

Commit b31bea6

Browse files
simonjbeaumontjohnelse
authored andcommitted
CP-5845: Use PGPU.get_remaining_capacity API call
Signed-off-by: Si Beaumont <[email protected]>
1 parent 715fbd9 commit b31bea6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ocaml/xapi/vgpuops.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ let create_virtual_vgpu ~__context vm vgpu =
100100
| `breadth_first -> true
101101
in
102102
let sorted_pgpus = Helpers.sort_by_schwarzian ~descending:sort_desc
103-
(fun pgpu -> Xapi_pgpu_helpers.get_remaining_capacity ~__context
104-
~self:pgpu ~vgpu_type:vgpu.type_ref)
103+
(fun pgpu ->
104+
Helpers.call_api_functions (fun rpc session_id ->
105+
Client.Client.PGPU.get_remaining_capacity ~rpc ~session_id
106+
~self:pgpu ~vgpu_type:vgpu.type_ref))
105107
pgpus
106108
in
107109
let rec allocate_vgpu vgpu_type = function

0 commit comments

Comments
 (0)