CA-110805: Add a function to find the host's VGA device

Signed-off-by: John Else <john.else@citrix.com>
CA-110805: Blacklist the system display device rather than creating a PGPU for it

Signed-off-by: John Else <john.else@citrix.com>
Change how PGPU.set_GPU_group is called via the CLI

Instead of

  xe pgpu-set-gpu-group uuid=... gpu-group-uuid=...

a user now needs to call

  xe pgpu-param-set uuid=... gpu-group-uuid=...

for consistency with other CLI setters.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1444 from johnelse/ca-110805-pr-1061

Don't create a PGPU or GPU_group for the system display device
Merge pull request #1445 from johnelse/pgpu-cli-tweak

Change how PGPU.set_GPU_group is called via the CLI
CA-109295: Allow other_config:hvm_serial to set values other than "pty"

Signed-off-by: John Else <john.else@citrix.com>
Add tests for xapi -> xenopsd HVM metadata conversion

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1446 from johnelse/ca-109295-pr-1061

Allow other_config:hvm_serial to set values other than "pty"
Check VGPU type is supported when checking enabled

Required a re-order of function definitions.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Allow moving last PGPU out of GPU group with VGPUs

With the new API, it is perfectly reasonably to create VGPUs on GPU groups with
no pGPUs in them since vGPU -> pGPU allocation is done at VM start time. As
such we can loosen the requirements on moving the last pGPU out of a GPU group.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Disallow moving of PGPUs with resident VGPUs

The precondition was checking for PCI.attached_VMs on the PGPU's PCI. This
isn't used for VGPU and so the check was not robust. Now we check using the
resident_VGPUs field of the PGPU from the new API.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Add assert_raises_api_error to unit test helpers

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5923: Unit tests for Xapi_pgpu module

Tests for assert_can_run_VGPU, get_remaining_capacity and set_GPU_group.

Modifications are made to the mock-PGPU creation to also craete a mock PCI
device.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>