Garbage collect unused and unsupported VGPU_types

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Fix a pattern match

It's only by chance that this pattern match worked as intended.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1423 from johnelse/vgpu-pattern-match-fix

Fix a pattern match
Whitespace: Reformat vGPU code in Xapi_xenops

$ camlp4o xapi/xapi_xenops.ml -printer o | md5sum
abdefbc35df8f7715beb82efbfabe8eb  -

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5599: Vgpuops filters for PCI-passthrough VGPUs

Updated the logic for original VGPU functionality (full-GPU-passthrough) to
only passthrough the PCIs when appropriate (full-GPU-passthrough).

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5599: Remove unused (and ambiguous) function

With the introduction of vGPU alongside GPU-passthrough (both of which are
termed VGPUs in xapi) this function is now ambiguous. It's also unused in the
codebase and so has been removed.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5599: Factor out PCI-passthrough VGPU creation

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5599: Add internal_conf to VGPU_type

This has been added as a (string * string) map to be most forwards compatible
and will currently be used to hold the path to the config file that needs to be
passed to the NVIDIA VGX plugin.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5599: Strengthen assert_VGPU_type_allowed

A VGPU_type is only allowed if it is also enabled.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5599: Allocate vGPU on VM start

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 Xapi_globs to avoid
transcription errors.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #1424 from simonjbeaumont/cp-5599

Allocate vGPUs on VM start
Remove unneeded assertion

assert_VGPU_type_allowed now calls assert_VGPU_type_enabled

Signed-off-by: John Else <john.else@citrix.com>
Make free PCI functions check a bit more cautious

Signed-off-by: John Else <john.else@citrix.com>
Handle and ignore missing information in pci.ids

If Pci_db fails to find the subdevice information for the vGPUs then the
creation of the type is ignored. It is assumed that the config file is either
corrupt or the pci.ids database in the hwdata package is in need of updating.
Merge pull request #1425 from simonjbeaumont/handle-missing-pci-ids

Handle and ignore missing information in pci.ids
Add API call PGPU.set_enabled_VGPU_types

Signed-off-by: John Else <john.else@citrix.com>
Make PGPU.enabled_VGPU_types settable on the CLI

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1426 from johnelse/pgpu-fixes

A few fixes for dealing with PGPUs
CP-5842: Blank VGPU.resident_on on VM shutdown

Signed-off-by: John Else <john.else@citrix.com>
CP-5842: Update VGPU.resident_on for passthrough VGPUs

Signed-off-by: John Else <john.else@citrix.com>