mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-22 00:16:03 +01:00
f7d59a8c24
# HG changeset patch # User Gabor Apati-Nagy <Gabor.Apati-Nagy@citrix.com> # Date 1382623622 -3600 # Thu Oct 24 15:07:02 2013 +0100 # Node ID 9b2305266f104c3ae9ec32804a92b3596d0aa399 # Parent 66330c7be272cd62a342e20ff109eea6b4d846f8 Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using XenAdmin.Network;
|
|
using XenAPI;
|
|
|
|
|
|
namespace XenAdmin.Actions.GPU
|
|
{
|
|
public class VgpuConfigurationAction : PureAsyncAction
|
|
{
|
|
private readonly Dictionary<PGPU, List<XenRef<VGPU_type>>> updatedEnabledVGpuListByPGpu;
|
|
|
|
public VgpuConfigurationAction(Dictionary<PGPU, List<XenRef<VGPU_type>>> updatedEnabledVGpuListByPGpu, IXenConnection connection)
|
|
: base(connection, Messages.ACTION_VGPU_CONFIGURATION_SAVING)
|
|
{
|
|
this.updatedEnabledVGpuListByPGpu = updatedEnabledVGpuListByPGpu;
|
|
Description = Messages.ACTION_PREPARING;
|
|
this.Pool = Core.Helpers.GetPool(connection);
|
|
}
|
|
|
|
protected override void Run()
|
|
{
|
|
Description = Messages.ACTION_VGPU_CONFIGURATION_SAVING;
|
|
foreach(var kvp in updatedEnabledVGpuListByPGpu)
|
|
{
|
|
var pGpu = kvp.Key;
|
|
PGPU.set_enabled_VGPU_types(Connection.Session,pGpu.opaque_ref, kvp.Value);
|
|
}
|
|
Description = Messages.ACTION_VGPU_CONFIGURATION_SAVED;
|
|
}
|
|
}
|
|
}
|