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:
Mihaela Stoica 2015-03-13 13:28:21 +00:00
commit dbad1d5b19
2 changed files with 6 additions and 5 deletions

View File

@ -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
{

View File

@ -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;