Skip to content

Commit f9f13e8

Browse files
simonjbeaumontjohnelse
authored andcommitted
Remove redundant check for allowed VGPU type
The call to assert_capacity_exists_for_VGPU_type will make this call. Note that assert_capacity_exists_for_VGPU_type returns either VGPU_TYPE_NOT_ALLOWED or PGPU_INSUFFICIENT_CAPACITY_FOR_VGPU but we are currently ignoring this and raising VM_REQUIRES_VGPU if the VGPU cannot be allocated on any PGPU on the host. Signed-off-by: Si Beaumont <[email protected]>
1 parent ea0f24e commit f9f13e8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ocaml/xapi/vgpuops.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,9 @@ let create_virtual_vgpu ~__context vm vgpu =
115115
let rec allocate_vgpu vgpu_type = function
116116
| [] -> None
117117
| pgpu :: remaining_pgpus ->
118-
let open Xapi_pgpu_helpers in
119118
try
120-
assert_VGPU_type_allowed ~__context ~self:pgpu ~vgpu_type;
121-
assert_capacity_exists_for_VGPU_type ~__context ~self:pgpu ~vgpu_type;
119+
Xapi_pgpu_helpers.assert_capacity_exists_for_VGPU_type
120+
~__context ~self:pgpu ~vgpu_type;
122121
Some pgpu
123122
with _ -> allocate_vgpu vgpu_type remaining_pgpus
124123
in

0 commit comments

Comments
 (0)