Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
CA-193817: Allow GVT-g even when device is hidden from xen/dom0
GVT-g is now always enabled, independent of whether the device is hidden
from xen/dom0.

Passthrough of Intel GPUs still requires the device to be hidden from
both xen and dom0.

Signed-off-by: John Else <[email protected]>
  • Loading branch information
johnelse committed Dec 16, 2015
commit 3c65fa0218718a7b1d3699134ae354754beec38c
19 changes: 7 additions & 12 deletions ocaml/xapi/xapi_vgpu_type.ml
Original file line number Diff line number Diff line change
Expand Up @@ -486,18 +486,13 @@ module Intel = struct
~is_host_display_enabled
~is_pci_hidden =
let types =
if is_system_display_device
then begin
match is_host_display_enabled, is_pci_hidden with
| false, true -> [passthrough_gpu]
| true, true -> []
| _, false ->
(make_vgpu_types ~__context
~pci ~whitelist:!Xapi_globs.gvt_g_whitelist)
end else
passthrough_gpu ::
(make_vgpu_types ~__context
~pci ~whitelist:!Xapi_globs.gvt_g_whitelist)
let passthrough_types =
if is_system_display_device && (is_host_display_enabled || not is_pci_hidden)
then []
else [passthrough_gpu]
in
passthrough_types @
(make_vgpu_types ~__context ~pci ~whitelist:!Xapi_globs.gvt_g_whitelist)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The match statement means I have to keep track of what's what. Given they're all boolean values wouldn't it be jsut as clean to use if statements?

let passthrough_types = 
  if not is_system_display_device || not is_host_display_enabled && is_pci_hidden
  then [passthrough_gpu]
  else [] in
...

The match case with false, _, _ and then true, [other stuff] are collapsed.

in
List.map (find_or_create ~__context) types
end
Expand Down