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>
Merge pull request #1448 from simonjbeaumont/cp-5923

Fixes and unit tests for Xapi_pgpu module