server: don't go into O(n^2) loop for non-XenServer hosts

Introduced in https://github.com/apache/cloudstack/pull/1403 this
gates the logic only to XenServer where this would at all run. The
specific code is only applicable for XenServer and SolidFire
(https://youtu.be/YQ3pBeL-WaA?si=ed_gT_A8lZYJiEh.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2024-05-03 15:14:44 +05:30
parent 47163df2ff
commit 2a48d71909
1 changed files with 2 additions and 2 deletions

View File

@ -2390,9 +2390,9 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
_hostDao.update(host.getId(), host);
}
if (startup instanceof StartupRoutingCommand) {
if (host != null && host.getHypervisorType().equals(HypervisorType.XenServer) &&
startup instanceof StartupRoutingCommand) {
final StartupRoutingCommand ssCmd = (StartupRoutingCommand)startup;
updateSupportsClonedVolumes(host, ssCmd.getSupportsClonedVolumes());
}