mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 14:27:26 +01:00
Merge pull request #384 from stephen-turner/CA-164236
CA-164236: Read caching enablement flag is now per-host on each VDI
This commit is contained in:
commit
dbad1d5b19
@ -327,15 +327,15 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether the read caching is enabled on this disk
|
||||
/// Whether read caching is enabled on this disk on a specific host
|
||||
/// </summary>
|
||||
public bool ReadCachingEnabled
|
||||
public bool ReadCachingEnabled(Host host)
|
||||
{
|
||||
get { return BoolKey(sm_config, "read-caching-enabled"); }
|
||||
return BoolKey(sm_config, "read-caching-enabled-on-" + host.uuid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether the read caching is supported on this disk
|
||||
/// Whether read caching is supported on this disk
|
||||
/// </summary>
|
||||
public bool ReadCachingSupported
|
||||
{
|
||||
|
@ -1752,7 +1752,8 @@ namespace XenAPI
|
||||
foreach (var vbd in Connection.ResolveAll(VBDs).Where(vbd => vbd != null && vbd.currently_attached))
|
||||
{
|
||||
var vdi = Connection.Resolve(vbd.VDI);
|
||||
if (vdi != null && vdi.ReadCachingEnabled)
|
||||
var resident_host = Connection.Resolve(resident_on);
|
||||
if (vdi != null && resident_host != null && vdi.ReadCachingEnabled(resident_host))
|
||||
readCachingVdis.Add(vdi);
|
||||
}
|
||||
return readCachingVdis;
|
||||
|
Loading…
Reference in New Issue
Block a user