Source:
<code>protected boolean validate() { boolean valid = true; if (getVm() == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (getVm().getStatus() != VMStatus.Up) { valid = failVmStatusIllegal(); } if (getParameters().getVm().getCpuPerSocket() > Config.<Integer>getValue( ConfigValues.MaxNumOfCpuPerSocket, getVm().getCompatibilityVersion().getValue())) { valid = failValidation(EngineMessage.ACTION_TYPE_FAILED_MAX_CPU_PER_SOCKET); } if (getParameters().getVm().getThreadsPerCpu() > Config.<Integer>getValue( ConfigValues.MaxNumOfThreadsPerCpu, getVm().getClusterCompatibilityVersion().getValue())) { valid = failValidation(EngineMessage.ACTION_TYPE_FAILED_MAX_THREADS_PER_CPU); } if (getParameters().getVm().getNumOfSockets() > Config.<Integer>getValue( ConfigValues.MaxNumOfVmSockets, getVm().getCompatibilityVersion().getValue())) { valid = failValidation(EngineMessage.ACTION_TYPE_FAILED_MAX_NUM_SOCKETS); } if (getParameters().getPlugAction() == PlugAction.PLUG) { if (!FeatureSupported.hotPlugCpu(getVm().getCompatibilityVersion(), getVm().getClusterArch())) { valid = failValidation(EngineMessage.HOT_PLUG_CPU_IS_NOT_SUPPORTED); } else { <START> OsRepository osRepository = SimpleDependencyInjector.getInstance().get(OsRepository.class); <END> if (!osRepository.isCpuHotplugSupported(getVm().getVmOsId())) { valid = failValidation(EngineMessage.HOT_PLUG_CPU_IS_NOT_SUPPORTED_FOR_GUEST_OS); } } } else if (!FeatureSupported.hotUnplugCpu(getVm().getCompatibilityVersion(), getVm().getClusterArch())) { valid = failValidation(EngineMessage.HOT_UNPLUG_CPU_IS_NOT_SUPPORTED); } return valid; }</code><technical_language>osRepository is inherited VmCommand. Please osRepository field</technical_language>

Target:
protected boolean validate() { boolean valid = true; if (getVm() == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (getVm().getStatus() != VMStatus.Up) { valid = failVmStatusIllegal(); } if (getParameters().getVm().getCpuPerSocket() > Config.<Integer>getValue( ConfigValues.MaxNumOfCpuPerSocket, getVm().getCompatibilityVersion().getValue())) { valid = failValidation(EngineMessage.ACTION_TYPE_FAILED_MAX_CPU_PER_SOCKET); } if (getParameters().getVm().getThreadsPerCpu() > Config.<Integer>getValue( ConfigValues.MaxNumOfThreadsPerCpu, getVm().getClusterCompatibilityVersion().getValue())) { valid = failValidation(EngineMessage.ACTION_TYPE_FAILED_MAX_THREADS_PER_CPU); } if (getParameters().getVm().getNumOfSockets() > Config.<Integer>getValue( ConfigValues.MaxNumOfVmSockets, getVm().getCompatibilityVersion().getValue())) { valid = failValidation(EngineMessage.ACTION_TYPE_FAILED_MAX_NUM_SOCKETS); } if (getParameters().getPlugAction() == PlugAction.PLUG) { if (!FeatureSupported.hotPlugCpu(getVm().getCompatibilityVersion(), getVm().getClusterArch())) { valid = failValidation(EngineMessage.HOT_PLUG_CPU_IS_NOT_SUPPORTED); } else if (!osRepository.isCpuHotplugSupported(getVm().getVmOsId())) { valid = failValidation(EngineMessage.HOT_PLUG_CPU_IS_NOT_SUPPORTED_FOR_GUEST_OS); } } else if (!FeatureSupported.hotUnplugCpu(getVm().getCompatibilityVersion(), getVm().getClusterArch())) { valid = failValidation(EngineMessage.HOT_UNPLUG_CPU_IS_NOT_SUPPORTED); } return valid; }