mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
402e2458ce
# HG changeset patch # User Mihaela Stoica <Mihaela.Stoica@citrix.com> # Date 1381486465 -3600 # Fri Oct 11 11:14:25 2013 +0100 # Node ID ae162fb56bac4f1c2f7cc4c47b640a6933ea6deb # Parent 48644db7dcf80d93efb9d6e86e982b95894cbd9d Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
29 lines
914 B
C#
29 lines
914 B
C#
using XenAPI;
|
|
|
|
namespace XenAdmin.Actions
|
|
{
|
|
public class SetGpuPlacementPolicyAction : PureAsyncAction
|
|
{
|
|
private allocation_algorithm allocationAlgorithm;
|
|
|
|
public SetGpuPlacementPolicyAction(Pool pool, allocation_algorithm allocationAlgorithm)
|
|
: base(pool.Connection, Messages.SET_GPU_PLACEMENT_POLICY_ACTION_TITLE,
|
|
Messages.SET_GPU_PLACEMENT_POLICY_ACTION_DESCRIPTION, true)
|
|
{
|
|
this.allocationAlgorithm = allocationAlgorithm;
|
|
}
|
|
|
|
protected override void Run()
|
|
{
|
|
var gpuGroups = Connection.Cache.GPU_groups;
|
|
|
|
foreach (var gpuGroup in gpuGroups)
|
|
{
|
|
GPU_group.set_allocation_algorithm(Session, gpuGroup.opaque_ref, allocationAlgorithm);
|
|
}
|
|
|
|
Description = Messages.SET_GPU_PLACEMENT_POLICY_ACTION_DONE;
|
|
}
|
|
}
|
|
}
|