Skip to content

Commit

Permalink
CP-5599: Allocate vGPU on VM start
Browse files Browse the repository at this point in the history
Find a pGPU on which the vGPU can be allocated as part of the Vgpuops
performed by VM.start.

The strings used for the platform map have been added to
Xenops_interface to avoid transcription errors.

Imported from xen-api.git 5676980f5f75c54f5fc0f39b61445f5c8f4b689a

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Imported-by: John Else <john.else@citrix.com>
  • Loading branch information
johnelse committed Mar 12, 2014
1 parent 2de2872 commit 65223a0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions xc/xenops_server_xen.ml
Expand Up @@ -905,13 +905,14 @@ module VM = struct
| Cirrus -> Device.Dm.Cirrus, None
| Standard_VGA -> Device.Dm.Std_vga, None
| Vgpu ->
List.iter (fun (k,v) -> if try String.sub k 0 4 = "vgpu" with
Invalid_argument _ -> false then
debug "VGPU config: %s -> %s" k v) vm.Vm.platformdata;
let vgpu =
try
Some (List.assoc "vgpu_pci_id" vm.Vm.platformdata,
List.assoc "vgpu_config" vm.Vm.platformdata)
let vgpu_pci = List.assoc Xenops_interface.vgpu_pci_key vm.Vm.platformdata
and vgpu_config = List.assoc Xenops_interface.vgpu_config_key vm.Vm.platformdata in
debug "VGPU config: %s -> %s; %s -> %s"
Xenops_interface.vgpu_pci_key vgpu_pci
Xenops_interface.vgpu_config_key vgpu_config;
Some (vgpu_pci, vgpu_config)
with Not_found -> failwith "Missing vGPU config in platform data" in
Device.Dm.Vgpu, vgpu
in
Expand Down

0 comments on commit 65223a0

Please sign in to comment.