CA-174923: Fix combined vGPU/passthrough bootstorm
CA-174923: Fix combined vGPU/passthrough bootstorm

assert_VGPU_type_allowed wasn't talking into account VGPUs which were
only scheduled to be resident on a PGPU, leading to conflicts multiple
VMs with a mix of passthrough and vGPU were started at once.

Here we pull out some code from get_remaining_capacity_internal into a
new function, so that it can be reused by assert_VGPU_type_allowed.

Signed-off-by: John Else <37b74501daa612e48fea94f9846ed4ddeb6a8f07@citrix.com>

simonjbeaumont/xen-api,agimofcarmen/xen-api,srowe/xen-api,djs55/xen-api,anoobs/xen-api,euanh/xen-api,Frezzle/xen-api,srowe/xen-api,simonjbeaumont/xen-api,jjd27/xen-api,euanh/xen-api,vasilenkomike/xen-api,anoobs/xen-api,salvocambria/xen-api,euanh/xen-api,robertbreker/xen-api,rafalmiel/xen-api,djs55/xen-api,jjd27/xen-api,thomassa/xen-api,agimofcarmen/xen-api,robertbreker/xen-api,salvocambria/xen-api,Frezzle/xen-api,anoobs/xen-api,anoobs/xen-api,vasilenkomike/xen-api,agimofcarmen/xen-api,djs55/xen-api,guard163/xen-api,Frezzle/xen-api,srowe/xen-api,jjd27/xen-api,thomassa/xen-api,rafalmiel/xen-api,djs55/xen-api,simonjbeaumont/xen-api,rafalmiel/xen-api,simonjbeaumont/xen-api,jjd27/xen-api,Frezzle/xen-api,salvocambria/xen-api,robertbreker/xen-api,salvocambria/xen-api,thomassa/xen-api,guard163/xen-api,vasilenkomike/xen-api,djs55/xen-api,euanh/xen-api,robertbreker/xen-api,rafalmiel/xen-api,salvocambria/xen-api,thomassa/xen-api,euanh/xen-api,thomassa/xen-api,agimofcarmen/xen-api,agimofcarmen/xen-api,guard163/xen-api,rafalmiel/xen-api,anoobs/xen-api,salvocambria/xen-api,guard163/xen-api,vasilenkomike/xen-api,vasilenkomike/xen-api,rafalmiel/xen-api,robertbreker/xen-api,agimofcarmen/xen-api,vasilenkomike/xen-api,jjd27/xen-api,simonjbeaumont/xen-api,srowe/xen-api,Frezzle/xen-api,anoobs/xen-api,guard163/xen-api,euanh/xen-api,guard163/xen-api,simonjbeaumont/xen-api,djs55/xen-api,robertbreker/xen-api,thomassa/xen-api,jjd27/xen-api,srowe/xen-api