已开启
add loongarch64 support for ovirt-engine-4.4.4.1 #80
zhangwenlong01创建于 27 天前
add loongarch64 support for ovirt-engine-4.4.4.1 #80
已开启
共 4 个文件变更+705-1
| @@ -0,0 +1,683 @@ | |||
| 1 | +From 2a48074204fe0fa2268383f77e6a5d7ae007cad5 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Wenlong Zhang <zhangwenlong@loongson.cn> | ||
| 3 | +Date: Sat, 5 Sep 2026 16:29:44 +0800 | ||
| 4 | +Subject: [PATCH] add loongarch64 support for ovirt-engine-4.4.4.1 | ||
| 5 | + | ||
| 6 | +--- | ||
| 7 | + .../modules/org/postgresql/main/module.xml | 4 +++ | ||
| 8 | + .../core/bll/ClusterOperationCommandBase.java | 2 ++ | ||
| 9 | + .../core/bll/CpuFlagsManagerHandler.java | 11 ++++++++ | ||
| 10 | + .../ovirt/engine/core/bll/RunVmCommand.java | 3 ++- | ||
| 11 | + .../architecture/HasMaximumNumberOfDisks.java | 5 ++++ | ||
| 12 | + .../cluster/KubevirtProviderProxy.java | 22 ++++++++++++--- | ||
| 13 | + .../core/bll/validator/ClusterValidator.java | 3 ++- | ||
| 14 | + .../businessentities/ArchitectureType.java | 2 ++ | ||
| 15 | + .../core/common/config/ConfigValues.java | 3 +++ | ||
| 16 | + .../core/common/osinfo/OsRepository.java | 1 + | ||
| 17 | + .../engine/core/common/utils/CpuVendor.java | 3 ++- | ||
| 18 | + .../core/common/utils/VmCommonUtils.java | 4 ++- | ||
| 19 | + .../src/main/resources/v3/capabilities.xml | 4 +++ | ||
| 20 | + .../engine/api/restapi/types/CPUMapper.java | 2 ++ | ||
| 21 | + .../engine/core/utils/OsRepositoryImpl.java | 1 + | ||
| 22 | + .../core/utils/archstrategy/ArchCommand.java | 2 ++ | ||
| 23 | + .../archstrategy/ArchStrategyFactory.java | 1 + | ||
| 24 | + .../archstrategy/Loongarch64Strategy.java | 18 +++++++++++++ | ||
| 25 | + .../CreateAdditionalControllers.java | 5 ++++ | ||
| 26 | + ...eateAdditionalControllersForDomainXml.java | 5 ++++ | ||
| 27 | + .../architecture/GetBootableDiskIndex.java | 5 ++++ | ||
| 28 | + .../architecture/GetControllerIndices.java | 6 +++++ | ||
| 29 | + .../builder/vminfo/LibvirtVmXmlBuilder.java | 21 +++++++++------ | ||
| 30 | + .../builder/vminfo/VmInfoBuildUtils.java | 3 +++ | ||
| 31 | + .../uicommonweb/models/hosts/HostModel.java | 2 ++ | ||
| 32 | + .../models/vms/ImportVmFromOvaModel.java | 3 +-- | ||
| 33 | + packaging/bin/pki-enroll-pkcs12.sh | 27 +++++++++++++------ | ||
| 34 | + ...0860_add_loongarch64_max_memory_config.sql | 1 + | ||
| 35 | + .../upgrade/pre_upgrade/0000_config.sql | 5 ++-- | ||
| 36 | + .../engine_common/constants.py | 1 + | ||
| 37 | + .../ovirt-engine/config/protocols.py | 2 ++ | ||
| 38 | + 31 files changed, 149 insertions(+), 28 deletions(-) | ||
| 39 | + create mode 100644 backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/Loongarch64Strategy.java | ||
| 40 | + create mode 100644 packaging/dbscripts/upgrade/04_04_0860_add_loongarch64_max_memory_config.sql | ||
| 41 | + | ||
| 42 | +diff --git a/backend/manager/dependencies/common/src/main/modules/org/postgresql/main/module.xml b/backend/manager/dependencies/common/src/main/modules/org/postgresql/main/module.xml | ||
| 43 | +index 36e24a2..2052899 100644 | ||
| 44 | +--- a/backend/manager/dependencies/common/src/main/modules/org/postgresql/main/module.xml | ||
| 45 | ++++ b/backend/manager/dependencies/common/src/main/modules/org/postgresql/main/module.xml | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + <resources> | ||
| 49 | + <resource-root path="postgresql.jar"/> | ||
| 50 | ++ <resource-root path="common.jar"/> | ||
| 51 | ++ <resource-root path="client.jar"/> | ||
| 52 | ++ <resource-root path="saslprep.jar"/> | ||
| 53 | ++ <resource-root path="stringprep.jar"/> | ||
| 54 | + </resources> | ||
| 55 | + | ||
| 56 | + <dependencies> | ||
| 57 | +diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClusterOperationCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClusterOperationCommandBase.java | ||
| 58 | +index 5f3e4db..a8139f9 100644 | ||
| 59 | +--- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClusterOperationCommandBase.java | ||
| 60 | ++++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClusterOperationCommandBase.java | ||
| 61 | + public abstract class ClusterOperationCommandBase<T extends ClusterOperationPara | ||
| 62 | + cluster.setBiosType(BiosType.Q35_SEA_BIOS); | ||
| 63 | + } else if (cluster.getArchitecture().getFamily() == ArchitectureType.aarch64) { | ||
| 64 | + cluster.setBiosType(BiosType.VIRT_OVMF); | ||
| 65 | ++ } else if (cluster.getArchitecture().getFamily() == ArchitectureType.loongarch64) { | ||
| 66 | ++ cluster.setBiosType(BiosType.VIRT_OVMF); | ||
| 67 | + } else { | ||
| 68 | + cluster.setBiosType(BiosType.I440FX_SEA_BIOS); | ||
| 69 | + } | ||
| 70 | +diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java | ||
| 71 | +index c0273a2..644e314 100644 | ||
| 72 | +--- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java | ||
| 73 | ++++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java | ||
| 74 | + public class CpuFlagsManagerHandler implements BackendService { | ||
| 75 | + private List<ServerCpu> ibmCpuList; | ||
| 76 | + private List<ServerCpu> s390CpuList; | ||
| 77 | + private List<ServerCpu> kunpengCpuList; | ||
| 78 | ++ private List<ServerCpu> loongsonCpuList; | ||
| 79 | + private List<ServerCpu> allCpuList = new ArrayList<>(); | ||
| 80 | + private Map<String, ServerCpu> intelCpuByNameDictionary = new HashMap<>(); | ||
| 81 | + private Map<String, ServerCpu> amdCpuByNameDictionary = new HashMap<>(); | ||
| 82 | + private Map<String, ServerCpu> ibmCpuByNameDictionary = new HashMap<>(); | ||
| 83 | + private Map<String, ServerCpu> s390CpuByNameDictionary = new HashMap<>(); | ||
| 84 | + private Map<String, ServerCpu> kunpengCpuByNameDictionary = new HashMap<>(); | ||
| 85 | ++ private Map<String, ServerCpu> loongsonCpuByNameDictionary = new HashMap<>(); | ||
| 86 | + private Map<String, ServerCpu> intelCpuByVdsNameDictionary = new HashMap<>(); | ||
| 87 | + private Map<String, ServerCpu> amdCpuByVdsNameDictionary = new HashMap<>(); | ||
| 88 | + private Map<String, ServerCpu> ibmCpuByVdsNameDictionary = new HashMap<>(); | ||
| 89 | + private Map<String, ServerCpu> s390CpuByVdsNameDictionary = new HashMap<>(); | ||
| 90 | + private Map<String, ServerCpu> kunpengCpuByVdsNameDictionary = new HashMap<>(); | ||
| 91 | ++ private Map<String, ServerCpu> loongsonCpuByVdsNameDictionary = new HashMap<>(); | ||
| 92 | + | ||
| 93 | + public CpuFlagsManager(Version ver) { | ||
| 94 | + initDictionaries(ver); | ||
| 95 | + public class CpuFlagsManagerHandler implements BackendService { | ||
| 96 | + result = CpuVendor.IBMS390.name(); | ||
| 97 | + } else if (kunpengCpuByNameDictionary.get(cpuName) != null) { | ||
| 98 | + result = CpuVendor.KUNPENG.name(); | ||
| 99 | ++ } else if (loongsonCpuByNameDictionary.get(cpuName) != null) { | ||
| 100 | ++ result = CpuVendor.LOONGSON.name(); | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + return result; | ||
| 104 | + public class CpuFlagsManagerHandler implements BackendService { | ||
| 105 | + ibmCpuByNameDictionary.clear(); | ||
| 106 | + s390CpuByNameDictionary.clear(); | ||
| 107 | + kunpengCpuByNameDictionary.clear(); | ||
| 108 | ++ loongsonCpuByNameDictionary.clear(); | ||
| 109 | + allCpuList.clear(); | ||
| 110 | + | ||
| 111 | + String[] cpus = Config.<String> getValue(ConfigValues.ServerCPUList, ver.toString()).trim().split("[;]", -1); | ||
| 112 | + public class CpuFlagsManagerHandler implements BackendService { | ||
| 113 | + } else if (sc.getFlags().contains(CpuVendor.KUNPENG.getFlag())) { | ||
| 114 | + kunpengCpuByNameDictionary.put(sc.getCpuName(), sc); | ||
| 115 | + kunpengCpuByVdsNameDictionary.put(sc.getVdsVerbData(), sc); | ||
| 116 | ++ } else if (sc.getFlags().contains(CpuVendor.LOONGSON.getFlag())) { | ||
| 117 | ++ loongsonCpuByNameDictionary.put(sc.getCpuName(), sc); | ||
| 118 | ++ loongsonCpuByVdsNameDictionary.put(sc.getVdsVerbData(), sc); | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + allCpuList.add(sc); | ||
| 122 | + public class CpuFlagsManagerHandler implements BackendService { | ||
| 123 | + ibmCpuList = new ArrayList<>(ibmCpuByNameDictionary.values()); | ||
| 124 | + s390CpuList = new ArrayList<>(s390CpuByNameDictionary.values()); | ||
| 125 | + kunpengCpuList = new ArrayList<>(kunpengCpuByNameDictionary.values()); | ||
| 126 | ++ loongsonCpuList = new ArrayList<>(loongsonCpuByNameDictionary.values()); | ||
| 127 | + | ||
| 128 | + Comparator<ServerCpu> cpuComparator = Comparator.comparingInt(ServerCpu::getLevel); | ||
| 129 | + | ||
| 130 | + public class CpuFlagsManagerHandler implements BackendService { | ||
| 131 | + Collections.sort(ibmCpuList, cpuComparator); | ||
| 132 | + Collections.sort(s390CpuList, cpuComparator); | ||
| 133 | + Collections.sort(kunpengCpuList, cpuComparator); | ||
| 134 | ++ Collections.sort(loongsonCpuList, cpuComparator); | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + public String getVDSVerbDataByCpuName(String name) { | ||
| 138 | +diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java | ||
| 139 | +index 7782b90..1c48d35 100644 | ||
| 140 | +--- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java | ||
| 141 | ++++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java | ||
| 142 | + public class RunVmCommand<T extends RunVmParams> extends RunVmCommandBase<T> | ||
| 143 | + && getVm().getCustomBiosType() != BiosType.CLUSTER_DEFAULT | ||
| 144 | + && getVm().getCustomBiosType() != BiosType.I440FX_SEA_BIOS | ||
| 145 | + && getCluster().getArchitecture().getFamily() != ArchitectureType.x86 | ||
| 146 | +- && getCluster().getArchitecture().getFamily() != ArchitectureType.aarch64) { | ||
| 147 | ++ && getCluster().getArchitecture().getFamily() != ArchitectureType.aarch64 | ||
| 148 | ++ && getCluster().getArchitecture().getFamily() != ArchitectureType.loongarch64) { | ||
| 149 | + return failValidation(EngineMessage.NON_DEFAULT_BIOS_TYPE_FOR_X86_ONLY); | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | +diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/architecture/HasMaximumNumberOfDisks.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/architecture/HasMaximumNumberOfDisks.java | ||
| 153 | +index 9812295..f671681 100644 | ||
| 154 | +--- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/architecture/HasMaximumNumberOfDisks.java | ||
| 155 | ++++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/architecture/HasMaximumNumberOfDisks.java | ||
| 156 | + public class HasMaximumNumberOfDisks implements ArchCommand { | ||
| 157 | + hasMaximum = VmCommand.MAX_VIRTIO_CCW_DISKS == countDisks(DiskInterface.VirtIO); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | ++ @Override | ||
| 161 | ++ public void runForLoongarch64() { | ||
| 162 | ++ hasMaximum = VmCommand.MAX_VIRTIO_CCW_DISKS == countDisks(DiskInterface.VirtIO); | ||
| 163 | ++ } | ||
| 164 | ++ | ||
| 165 | + public boolean returnValue() { | ||
| 166 | + return hasMaximum; | ||
| 167 | + } | ||
| 168 | +diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/cluster/KubevirtProviderProxy.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/cluster/KubevirtProviderProxy.java | ||
| 169 | +index 1773be7..ce1dd2e 100644 | ||
| 170 | +--- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/cluster/KubevirtProviderProxy.java | ||
| 171 | ++++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/cluster/KubevirtProviderProxy.java | ||
| 172 | + public class KubevirtProviderProxy implements ProviderProxy<ProviderValidator<Ku | ||
| 173 | + cluster.setStoragePoolId(findOrCreateKubevirtDataCenterId()); | ||
| 174 | + cluster.setDescription(provider.getDescription()); | ||
| 175 | + cluster.setCompatibilityVersion(Version.getLast()); | ||
| 176 | +- cluster.setArchitecture(ArchitectureType.aarch64); | ||
| 177 | +- cluster.setCpuName("Kunpeng 920"); | ||
| 178 | +-// cluster.setArchitecture(ArchitectureType.x86_64); | ||
| 179 | +-// cluster.setCpuName("Intel Nehalem Family"); | ||
| 180 | ++ ArchitectureType arch = cluster.getArchitecture(); | ||
| 181 | ++ if (arch != null) { | ||
| 182 | ++ switch (arch) { | ||
| 183 | ++ case aarch64: | ||
| 184 | ++ cluster.setCpuName("Kunpeng 920"); | ||
| 185 | ++ break; | ||
| 186 | ++ case loongarch64: | ||
| 187 | ++ cluster.setCpuName("Loongson-64bit"); | ||
| 188 | ++ break; | ||
| 189 | ++ default: | ||
| 190 | ++ cluster.setArchitecture(ArchitectureType.x86_64); | ||
| 191 | ++ cluster.setCpuName("Intel Nehalem Family"); | ||
| 192 | ++ break; | ||
| 193 | ++ } | ||
| 194 | ++ } else { | ||
| 195 | ++ cluster.setArchitecture(ArchitectureType.x86_64); | ||
| 196 | ++ cluster.setCpuName("Intel Nehalem Family"); | ||
| 197 | ++ } | ||
| 198 | + cluster.setId(provider.getId()); | ||
| 199 | + cluster.setManaged(false); | ||
| 200 | + FencingPolicy fencingPolicy = new FencingPolicy(); | ||
| 201 | +diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ClusterValidator.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ClusterValidator.java | ||
| 202 | +index 4f43154..8042987 100644 | ||
| 203 | +--- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ClusterValidator.java | ||
| 204 | ++++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ClusterValidator.java | ||
| 205 | + public class ClusterValidator { | ||
| 206 | + && eCluster.getBiosType() != BiosType.CLUSTER_DEFAULT | ||
| 207 | + && eCluster.getBiosType() != BiosType.I440FX_SEA_BIOS | ||
| 208 | + && architecture.getFamily() != ArchitectureType.x86 | ||
| 209 | +- && architecture.getFamily() != ArchitectureType.aarch64); | ||
| 210 | ++ && architecture.getFamily() != ArchitectureType.aarch64 | ||
| 211 | ++ && architecture.getFamily() != ArchitectureType.loongarch64); | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + private boolean attestationServerEnabled() { | ||
| 215 | +diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java | ||
| 216 | +index 50351fd..69c015a 100644 | ||
| 217 | +--- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java | ||
| 218 | ++++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java | ||
| 219 | + public enum ArchitectureType implements Identifiable { | ||
| 220 | + s390x(7), | ||
| 221 | + /* Host & Guest architecture */ | ||
| 222 | + aarch64(8), | ||
| 223 | ++ /* Host & Guest architecture */ | ||
| 224 | ++ loongarch64(9), | ||
| 225 | + | ||
| 226 | + // Specific architectures | ||
| 227 | + /* Host & Guest architecture */ | ||
| 228 | +diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java | ||
| 229 | +index 19f2e91..3ee6b60 100644 | ||
| 230 | +--- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java | ||
| 231 | ++++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java | ||
| 232 | + public enum ConfigValues { | ||
| 233 | + @TypeConverterAttribute(Integer.class) | ||
| 234 | + VMAarch64BitMaxMemorySizeInMB(ClientAccessLevel.User), | ||
| 235 | + | ||
| 236 | ++ @TypeConverterAttribute(Integer.class) | ||
| 237 | ++ VMLoongarch64BitMaxMemorySizeInMB(ClientAccessLevel.User), | ||
| 238 | ++ | ||
| 239 | + @TypeConverterAttribute(Boolean.class) | ||
| 240 | + AutoImportHostedEngine, | ||
| 241 | + | ||
| 242 | +diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/osinfo/OsRepository.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/osinfo/OsRepository.java | ||
| 243 | +index 63605f2..35d4c1a 100644 | ||
| 244 | +--- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/osinfo/OsRepository.java | ||
| 245 | ++++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/osinfo/OsRepository.java | ||
| 246 | + public interface OsRepository { | ||
| 247 | + int DEFAULT_PPC_OS = 1001; | ||
| 248 | + int DEFAULT_S390_OS = 2001; | ||
| 249 | + int DEFAULT_AARCH64_OS = 3001; | ||
| 250 | ++ int DEFAULT_LOONGARCH64_OS = 4001; | ||
| 251 | + | ||
| 252 | + /* | ||
| 253 | + * This value is used to enable the auto selection of an appropriate OS when | ||
| 254 | +diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/CpuVendor.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/CpuVendor.java | ||
| 255 | +index 09909ff..88a9fee 100644 | ||
| 256 | +--- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/CpuVendor.java | ||
| 257 | ++++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/CpuVendor.java | ||
| 258 | + public enum CpuVendor implements Serializable { | ||
| 259 | + AMD("svm"), | ||
| 260 | + IBM("powernv"), | ||
| 261 | + IBMS390("sie"), | ||
| 262 | +- KUNPENG("asimd"); | ||
| 263 | ++ KUNPENG("asimd"), | ||
| 264 | ++ LOONGSON("lam"); | ||
| 265 | + | ||
| 266 | + private final String flag; | ||
| 267 | + | ||
| 268 | +diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmCommonUtils.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmCommonUtils.java | ||
| 269 | +index cc73d5c..f2bf7cb 100644 | ||
| 270 | +--- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmCommonUtils.java | ||
| 271 | ++++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmCommonUtils.java | ||
| 272 | + public class VmCommonUtils { | ||
| 273 | + ? ConfigValues.VMAarch64BitMaxMemorySizeInMB | ||
| 274 | + : (osRepository.getOsArchitectures().get(osId).getFamily() == ArchitectureType.ppc | ||
| 275 | + ? ConfigValues.VMPpc64BitMaxMemorySizeInMB | ||
| 276 | +- : ConfigValues.VM64BitMaxMemorySizeInMB)) | ||
| 277 | ++ : (osRepository.getOsArchitectures().get(osId).getFamily() == ArchitectureType.loongarch64 | ||
| 278 | ++ ? ConfigValues.VMLoongarch64BitMaxMemorySizeInMB | ||
| 279 | ++ : ConfigValues.VM64BitMaxMemorySizeInMB))) | ||
| 280 | + : ConfigValues.VM32BitMaxMemorySizeInMB; | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | +diff --git a/backend/manager/modules/restapi/jaxrs/src/main/resources/v3/capabilities.xml b/backend/manager/modules/restapi/jaxrs/src/main/resources/v3/capabilities.xml | ||
| 284 | +index 1dffa6c..360886b 100644 | ||
| 285 | +--- a/backend/manager/modules/restapi/jaxrs/src/main/resources/v3/capabilities.xml | ||
| 286 | ++++ b/backend/manager/modules/restapi/jaxrs/src/main/resources/v3/capabilities.xml | ||
| 287 | + | ||
| 288 | + <level>3</level> | ||
| 289 | + <architecture>AARCH64</architecture> | ||
| 290 | + </cpu> | ||
| 291 | ++ <cpu id="Loongson 3A5000"> | ||
| 292 | ++ <level>3</level> | ||
| 293 | ++ <architecture>LOONGARCH64</architecture> | ||
| 294 | ++ </cpu> | ||
| 295 | + </cpus> | ||
| 296 | + <power_managers> | ||
| 297 | + <power_management type="apc"> | ||
| 298 | +diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/CPUMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/CPUMapper.java | ||
| 299 | +index ce33104..ba5eec6 100644 | ||
| 300 | +--- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/CPUMapper.java | ||
| 301 | ++++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/CPUMapper.java | ||
| 302 | + public class CPUMapper { | ||
| 303 | + return Architecture.S390X; | ||
| 304 | + case aarch64: | ||
| 305 | + return Architecture.AARCH64; | ||
| 306 | ++ case loongarch64: | ||
| 307 | ++ return Architecture.LOONGARCH64; | ||
| 308 | + default: | ||
| 309 | + return null; | ||
| 310 | + } | ||
| 311 | +diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/OsRepositoryImpl.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/OsRepositoryImpl.java | ||
| 312 | +index 956fc6c..7fbae50 100644 | ||
| 313 | +--- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/OsRepositoryImpl.java | ||
| 314 | ++++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/OsRepositoryImpl.java | ||
| 315 | + public enum OsRepositoryImpl implements OsRepository { | ||
| 316 | + defaultOsMap.put(ArchitectureType.x86_64, DEFAULT_X86_OS); | ||
| 317 | + defaultOsMap.put(ArchitectureType.ppc64, DEFAULT_PPC_OS); | ||
| 318 | + defaultOsMap.put(ArchitectureType.s390x, DEFAULT_S390_OS); | ||
| 319 | ++ defaultOsMap.put(ArchitectureType.loongarch64, DEFAULT_LOONGARCH64_OS); | ||
| 320 | + defaultOsMap.put(ArchitectureType.aarch64, DEFAULT_AARCH64_OS); | ||
| 321 | + } | ||
| 322 | + | ||
| 323 | +diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchCommand.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchCommand.java | ||
| 324 | +index 4f1cdda..478b814 100644 | ||
| 325 | +--- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchCommand.java | ||
| 326 | ++++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchCommand.java | ||
| 327 | + public interface ArchCommand { | ||
| 328 | + void runForS390X(); | ||
| 329 | + | ||
| 330 | + void runForAarch64(); | ||
| 331 | ++ | ||
| 332 | ++ void runForLoongarch64(); | ||
| 333 | + } | ||
| 334 | +diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchStrategyFactory.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchStrategyFactory.java | ||
| 335 | +index d5ae95b..15652e8 100644 | ||
| 336 | +--- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchStrategyFactory.java | ||
| 337 | ++++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/ArchStrategyFactory.java | ||
| 338 | + public class ArchStrategyFactory { | ||
| 339 | + architectureArchStrategyMap.put(ArchitectureType.x86_64, new X86_64Strategy()); | ||
| 340 | + architectureArchStrategyMap.put(ArchitectureType.ppc64, new PPC64Strategy()); | ||
| 341 | + architectureArchStrategyMap.put(ArchitectureType.s390x, new S390XStrategy()); | ||
| 342 | ++ architectureArchStrategyMap.put(ArchitectureType.loongarch64, new Loongarch64Strategy()); | ||
| 343 | + architectureArchStrategyMap.put(ArchitectureType.aarch64, new Aarch64Strategy()); | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | +diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/Loongarch64Strategy.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/Loongarch64Strategy.java | ||
| 347 | +new file mode 100644 | ||
| 348 | +index 0000000..16cc68e | ||
| 349 | +--- /dev/null | ||
| 350 | ++++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archstrategy/Loongarch64Strategy.java | ||
| 351 | + | ||
| 352 | ++package org.ovirt.engine.core.utils.archstrategy; | ||
| 353 | ++ | ||
| 354 | ++import org.ovirt.engine.core.common.businessentities.ArchitectureType; | ||
| 355 | ++ | ||
| 356 | ++public class Loongarch64Strategy implements ArchStrategy { | ||
| 357 | ++ | ||
| 358 | ++ @Override | ||
| 359 | ++ public ArchitectureType getArchitecture() { | ||
| 360 | ++ return ArchitectureType.loongarch64; | ||
| 361 | ++ } | ||
| 362 | ++ | ||
| 363 | ++ @Override | ||
| 364 | ++ public <T extends ArchCommand> T run(T c) { | ||
| 365 | ++ c.runForLoongarch64(); | ||
| 366 | ++ return c; | ||
| 367 | ++ } | ||
| 368 | ++ | ||
| 369 | ++} | ||
| 370 | +diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllers.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllers.java | ||
| 371 | +index 2d4511e..e6996e1 100644 | ||
| 372 | +--- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllers.java | ||
| 373 | ++++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllers.java | ||
| 374 | + public class CreateAdditionalControllers implements ArchCommand { | ||
| 375 | + // For now same as on x86 | ||
| 376 | + runForX86_64(); | ||
| 377 | + } | ||
| 378 | ++ @Override | ||
| 379 | ++ public void runForLoongarch64() { | ||
| 380 | ++ // For now same as on x86 | ||
| 381 | ++ runForX86_64(); | ||
| 382 | ++ } | ||
| 383 | + } | ||
| 384 | +diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllersForDomainXml.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllersForDomainXml.java | ||
| 385 | +index b06514c..1a78cad 100644 | ||
| 386 | +--- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllersForDomainXml.java | ||
| 387 | ++++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/CreateAdditionalControllersForDomainXml.java | ||
| 388 | + public class CreateAdditionalControllersForDomainXml implements ArchCommand { | ||
| 389 | + // For now same as on x86 | ||
| 390 | + runForX86_64(); | ||
| 391 | + } | ||
| 392 | ++ @Override | ||
| 393 | ++ public void runForLoongarch64() { | ||
| 394 | ++ // For now same as on x86 | ||
| 395 | ++ runForX86_64(); | ||
| 396 | ++ } | ||
| 397 | + } | ||
| 398 | +diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetBootableDiskIndex.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetBootableDiskIndex.java | ||
| 399 | +index 69a6bd3..0c6b4ad 100644 | ||
| 400 | +--- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetBootableDiskIndex.java | ||
| 401 | ++++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetBootableDiskIndex.java | ||
| 402 | + public class GetBootableDiskIndex implements ArchCommand { | ||
| 403 | + diskIndex = 0; | ||
| 404 | + } | ||
| 405 | + | ||
| 406 | ++ @Override | ||
| 407 | ++ public void runForLoongarch64() { | ||
| 408 | ++ diskIndex = 0; | ||
| 409 | ++ } | ||
| 410 | ++ | ||
| 411 | + public int returnValue() { | ||
| 412 | + return diskIndex; | ||
| 413 | + } | ||
| 414 | +diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetControllerIndices.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetControllerIndices.java | ||
| 415 | +index 086f2ed..b89f024 100644 | ||
| 416 | +--- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetControllerIndices.java | ||
| 417 | ++++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/GetControllerIndices.java | ||
| 418 | + public class GetControllerIndices implements ArchCommand { | ||
| 419 | + runForX86_64(); | ||
| 420 | + } | ||
| 421 | + | ||
| 422 | ++ @Override | ||
| 423 | ++ public void runForLoongarch64() { | ||
| 424 | ++ // For now the same as x86 | ||
| 425 | ++ runForX86_64(); | ||
| 426 | ++ } | ||
| 427 | ++ | ||
| 428 | + public Map<DiskInterface, Integer> returnValue() { | ||
| 429 | + return controllerIndexMap; | ||
| 430 | + } | ||
| 431 | +diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilder.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilder.java | ||
| 432 | +index 712d3c3..85e328d 100644 | ||
| 433 | +--- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilder.java | ||
| 434 | ++++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilder.java | ||
| 435 | + public class LibvirtVmXmlBuilder { | ||
| 436 | + writer.writeStartElement("cpu"); | ||
| 437 | + | ||
| 438 | + String cpuType = vm.getCpuName(); | ||
| 439 | +- if (vm.isUseHostCpuFlags() || vm.getClusterArch().getFamily() == ArchitectureType.aarch64){ | ||
| 440 | ++ if (vm.isUseHostCpuFlags() || vm.getClusterArch().getFamily() == ArchitectureType.aarch64 | ||
| 441 | ++ || vm.getClusterArch().getFamily() == ArchitectureType.loongarch64){ | ||
| 442 | + cpuType = "hostPassthrough"; | ||
| 443 | + } | ||
| 444 | + if (vm.getUseTscFrequency() && tscFrequencySupplier.get() != null) { | ||
| 445 | + public class LibvirtVmXmlBuilder { | ||
| 446 | + writer.writeStartElement("nvram"); | ||
| 447 | + String nvramTemplate = vmCustomProperties.get("nvram_template"); | ||
| 448 | + if (nvramTemplate == null) { | ||
| 449 | +- if(vm.getClusterArch().getFamily() == ArchitectureType.aarch64){ | ||
| 450 | ++ if(vm.getClusterArch().getFamily() == ArchitectureType.aarch64 || vm.getClusterArch().getFamily() == ArchitectureType.loongarch64){ | ||
| 451 | + nvramTemplate = "/usr/share/edk2/aarch64/vars-template-pflash.raw"; | ||
| 452 | + } else { | ||
| 453 | + nvramTemplate = String.format("/usr/share/OVMF/%s", | ||
| 454 | + public class LibvirtVmXmlBuilder { | ||
| 455 | + // <timer name="rtc" tickpolicy="catchup"> | ||
| 456 | + // </clock> | ||
| 457 | + writer.writeStartElement("clock"); | ||
| 458 | +- if (vm.getClusterArch().getFamily() == ArchitectureType.aarch64) { | ||
| 459 | ++ if (vm.getClusterArch().getFamily() == ArchitectureType.aarch64 || vm.getClusterArch().getFamily() == ArchitectureType.loongarch64) { | ||
| 460 | + writer.writeAttributeString("offset", "utc"); | ||
| 461 | + } else { | ||
| 462 | + writer.writeAttributeString("offset", "variable"); | ||
| 463 | + public class LibvirtVmXmlBuilder { | ||
| 464 | + writer.writeAttributeString("present", "yes"); | ||
| 465 | + writer.writeEndElement(); | ||
| 466 | + } | ||
| 467 | +- if(vm.getClusterArch().getFamily() != ArchitectureType.aarch64) { | ||
| 468 | ++ if(vm.getClusterArch().getFamily() != ArchitectureType.aarch64 && vm.getClusterArch().getFamily() != ArchitectureType.loongarch64) { | ||
| 469 | + writer.writeStartElement("timer"); | ||
| 470 | + writer.writeAttributeString("name", "rtc"); | ||
| 471 | + writer.writeAttributeString("tickpolicy", "catchup"); | ||
| 472 | + public class LibvirtVmXmlBuilder { | ||
| 473 | + | ||
| 474 | + if (acpiEnabled) { | ||
| 475 | + writer.writeElement("acpi"); | ||
| 476 | +- if( vm.getClusterArch().getFamily() == ArchitectureType.aarch64 ) { | ||
| 477 | ++ if( vm.getClusterArch().getFamily() == ArchitectureType.aarch64 || vm.getClusterArch().getFamily() == ArchitectureType.loongarch64 ) { | ||
| 478 | + writer.writeStartElement("gic"); | ||
| 479 | + writer.writeAttributeString("version", "3"); | ||
| 480 | + } | ||
| 481 | + public class LibvirtVmXmlBuilder { | ||
| 482 | + case aarch64: | ||
| 483 | + writeInput(); | ||
| 484 | + break; | ||
| 485 | ++ case loongarch64: | ||
| 486 | ++ writeInput(); | ||
| 487 | ++ break; | ||
| 488 | + case ppc: | ||
| 489 | + if (vmInfoBuildUtils.hasUsbController(vm)) { | ||
| 490 | + writeInput(); | ||
| 491 | + public class LibvirtVmXmlBuilder { | ||
| 492 | + | ||
| 493 | + if ((vm.getClusterArch().getFamily() == ArchitectureType.x86 | ||
| 494 | + && vm.getEffectiveBiosType().getChipsetType() == ChipsetType.Q35) | ||
| 495 | +- || vm.getClusterArch().getFamily() == ArchitectureType.aarch64) { | ||
| 496 | ++ || vm.getClusterArch().getFamily() == ArchitectureType.aarch64 | ||
| 497 | ++ || vm.getClusterArch().getFamily() == ArchitectureType.loongarch64) { | ||
| 498 | + writePciEControllers(pciERootExists, pciEPorts); | ||
| 499 | + } | ||
| 500 | + | ||
| 501 | + public class LibvirtVmXmlBuilder { | ||
| 502 | + writer.writeStartElement("video"); | ||
| 503 | + | ||
| 504 | + writer.writeStartElement("model"); | ||
| 505 | +- if (vm.getClusterArch().getFamily() == ArchitectureType.aarch64) { | ||
| 506 | ++ if (vm.getClusterArch().getFamily() == ArchitectureType.aarch64 || vm.getClusterArch().getFamily() == ArchitectureType.loongarch64) { | ||
| 507 | + writer.writeAttributeString("type", "virtio"); | ||
| 508 | + Object heads = device.getSpecParams().get(VdsProperties.VIDEO_HEADS); | ||
| 509 | + writer.writeAttributeString("heads", heads != null ? heads.toString() : "1"); | ||
| 510 | + public class LibvirtVmXmlBuilder { | ||
| 511 | + | ||
| 512 | + writer.writeEndElement(); | ||
| 513 | + | ||
| 514 | +- if (vm.getClusterArch().getFamily() == ArchitectureType.aarch64){ | ||
| 515 | ++ if (vm.getClusterArch().getFamily() == ArchitectureType.aarch64 || vm.getClusterArch().getFamily() == ArchitectureType.loongarch64){ | ||
| 516 | + writer.writeStartElement("input"); | ||
| 517 | + writer.writeAttributeString("type", "keyboard"); | ||
| 518 | + writer.writeAttributeString("bus", "usb"); | ||
| 519 | +diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/VmInfoBuildUtils.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/VmInfoBuildUtils.java | ||
| 520 | +index 8d3315c..cf04a44 100644 | ||
| 521 | +--- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/VmInfoBuildUtils.java | ||
| 522 | ++++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/VmInfoBuildUtils.java | ||
| 523 | + public class VmInfoBuildUtils { | ||
| 524 | + private static final Base64 BASE_64 = new Base64(0, null); | ||
| 525 | + private static final int DEFAULT_HUGEPAGESIZE_X86_64 = 2048; | ||
| 526 | + private static final int DEFAULT_HUGEPAGESIZE_PPC64LE = 16384; | ||
| 527 | ++ private static final int DEFAULT_HUGEPAGESIZE_LOONGARCH64 = 16384; | ||
| 528 | + private static final List<String> SCSI_HOST_DEV_WITH_PREDETERMINED_ADDRESS; | ||
| 529 | + | ||
| 530 | + public static final String VDSM_LIBGF_CAP_NAME = "libgfapi_supported"; | ||
| 531 | + public class VmInfoBuildUtils { | ||
| 532 | + | ||
| 533 | + public int getDefaultHugepageSize(VM vm) { | ||
| 534 | + switch(vm.getClusterArch().getFamily()) { | ||
| 535 | ++ case loongarch64: | ||
| 536 | ++ return DEFAULT_HUGEPAGESIZE_LOONGARCH64; | ||
| 537 | + case ppc: | ||
| 538 | + return DEFAULT_HUGEPAGESIZE_PPC64LE; | ||
| 539 | + default: | ||
| 540 | +diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java | ||
| 541 | +index bf9e8b3..a850013 100644 | ||
| 542 | +--- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java | ||
| 543 | ++++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java | ||
| 544 | + public abstract class HostModel extends Model implements HasValidatedTabs { | ||
| 545 | + case INTEL: | ||
| 546 | + case AMD: | ||
| 547 | + case IBMS390: | ||
| 548 | ++ case LOONGSON: | ||
| 549 | + case KUNPENG: | ||
| 550 | + resetKernelCmdlineCheckboxesValue(); | ||
| 551 | + break; | ||
| 552 | + public abstract class HostModel extends Model implements HasValidatedTabs { | ||
| 553 | + case INTEL: | ||
| 554 | + case AMD: | ||
| 555 | + case IBMS390: | ||
| 556 | ++ case LOONGSON: | ||
| 557 | + case KUNPENG: | ||
| 558 | + setKernelCmdlineCheckboxesChangeability( | ||
| 559 | + isKernelCmdlineParsable(), | ||
| 560 | +diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromOvaModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromOvaModel.java | ||
| 561 | +index 8451e9e..e8372b0 100644 | ||
| 562 | +--- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromOvaModel.java | ||
| 563 | ++++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromOvaModel.java | ||
| 564 | + import java.util.Map; | ||
| 565 | + import org.ovirt.engine.core.common.action.ActionParametersBase; | ||
| 566 | + import org.ovirt.engine.core.common.action.ActionType; | ||
| 567 | + import org.ovirt.engine.core.common.action.ImportVmFromOvaParameters; | ||
| 568 | +-import org.ovirt.engine.core.common.businessentities.ArchitectureType; | ||
| 569 | + import org.ovirt.engine.core.common.businessentities.VM; | ||
| 570 | + import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; | ||
| 571 | + import org.ovirt.engine.core.common.businessentities.storage.Disk; | ||
| 572 | + public class ImportVmFromOvaModel extends ImportVmFromExternalProviderModel { | ||
| 573 | + | ||
| 574 | + @Override | ||
| 575 | + protected void setTargetArchitecture(List<VM> externalVms) { | ||
| 576 | +- setTargetArchitecture(ArchitectureType.aarch64); | ||
| 577 | ++ setTargetArchitecture(getCluster().getSelectedItem().getArchitecture().getFamily()); | ||
| 578 | + } | ||
| 579 | + | ||
| 580 | + public void setIsoName(String ovaPath) { | ||
| 581 | +diff --git a/packaging/bin/pki-enroll-pkcs12.sh b/packaging/bin/pki-enroll-pkcs12.sh | ||
| 582 | +index b551ff5..f287109 100755 | ||
| 583 | +--- a/packaging/bin/pki-enroll-pkcs12.sh | ||
| 584 | ++++ b/packaging/bin/pki-enroll-pkcs12.sh | ||
| 585 | + enroll() { | ||
| 586 | + -pass "pass:${pass}" \ | ||
| 587 | + || die "Cannot create certificate request" | ||
| 588 | + else | ||
| 589 | +- openssl \ | ||
| 590 | +- pkcs12 \ | ||
| 591 | +- -in "${pkcs12}" \ | ||
| 592 | +- -out "${TMPKEY}" \ | ||
| 593 | +- -passin "pass:${pass}" \ | ||
| 594 | +- -passout "pass:${pass}" \ | ||
| 595 | +- -nocerts \ | ||
| 596 | +- || die "Cannot export '${pkcs12}'" | ||
| 597 | ++ if [ -f "${pkcs12}" ]; then | ||
| 598 | ++ openssl \ | ||
| 599 | ++ pkcs12 \ | ||
| 600 | ++ -in "${pkcs12}" \ | ||
| 601 | ++ -out "${TMPKEY}" \ | ||
| 602 | ++ -passin "pass:${pass}" \ | ||
| 603 | ++ -passout "pass:${pass}" \ | ||
| 604 | ++ -nocerts \ | ||
| 605 | ++ || die "Cannot export '${pkcs12}'" | ||
| 606 | ++ else | ||
| 607 | ++ openssl \ | ||
| 608 | ++ genpkey \ | ||
| 609 | ++ -algorithm RSA \ | ||
| 610 | ++ -pkeyopt rsa_keygen_bits:2048 \ | ||
| 611 | ++ -out "${TMPKEY}" \ | ||
| 612 | ++ -aes256 \ | ||
| 613 | ++ -pass "pass:${pass}" \ | ||
| 614 | ++ || die "Cannot create certificate request" | ||
| 615 | ++ fi | ||
| 616 | + fi | ||
| 617 | + | ||
| 618 | + openssl \ | ||
| 619 | +diff --git a/packaging/dbscripts/upgrade/04_04_0860_add_loongarch64_max_memory_config.sql b/packaging/dbscripts/upgrade/04_04_0860_add_loongarch64_max_memory_config.sql | ||
| 620 | +new file mode 100644 | ||
| 621 | +index 0000000..17368bf | ||
| 622 | +--- /dev/null | ||
| 623 | ++++ b/packaging/dbscripts/upgrade/04_04_0860_add_loongarch64_max_memory_config.sql | ||
| 624 | +@@ -0,0 +1 @@ | ||
| 625 | ++select fn_db_add_config_value_for_versions_up_to('VMLoongarch64BitMaxMemorySizeInMB', '4194304', '4.4'); | ||
| 626 | +diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql | ||
| 627 | +index 3f42535..9c9cb10 100644 | ||
| 628 | +--- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql | ||
| 629 | ++++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql | ||
| 630 | + select fn_db_add_config_value('CipherSuite','DEFAULT','general'); | ||
| 631 | + select fn_db_add_config_value('ConnectToServerTimeoutInSeconds','20','general'); | ||
| 632 | + select fn_db_add_config_value_for_versions_up_to('ClusterEmulatedMachines','pc-i440fx-rhel7.3.0,pc-i440fx-2.6,pseries-rhel7.5.0,s390-ccw-virtio-2.8','4.2'); | ||
| 633 | + select fn_db_add_config_value('ClusterEmulatedMachines','pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel7.6.0-sxxm,s390-ccw-virtio-2.12','4.3'); | ||
| 634 | +-select fn_db_add_config_value('ClusterEmulatedMachines','pc-q35-rhel8.1.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.1.0,s390-ccw-virtio-2.12','4.4'); | ||
| 635 | +-select fn_db_add_config_value('ClusterEmulatedMachines','pc-q35-rhel8.3.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.3.0,s390-ccw-virtio-2.12','4.5'); | ||
| 636 | ++select fn_db_add_config_value('ClusterEmulatedMachines','pc-q35-rhel8.1.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.1.0,s390-ccw-virtio-2.12,virt','4.4'); | ||
| 637 | ++select fn_db_add_config_value('ClusterEmulatedMachines','pc-q35-rhel8.3.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.3.0,s390-ccw-virtio-2.12,virt','4.5'); | ||
| 638 | + select fn_db_add_config_value('CpuOverCommitDurationMinutes','2','general'); | ||
| 639 | + --Handling Data directory for ENGINE | ||
| 640 | + select fn_db_add_config_value('DataDir','/usr/share/engine','general'); | ||
| 641 | + select fn_db_add_config_value_for_versions_up_to('VM64BitMaxMemorySizeInMB','629 | ||
| 642 | + select fn_db_add_config_value_for_versions_up_to('VMPpc64BitMaxMemorySizeInMB', '1048576', '4.3'); | ||
| 643 | + select fn_db_add_config_value_for_versions_up_to('VMPpc64BitMaxMemorySizeInMB', '6291456', '4.5'); | ||
| 644 | + select fn_db_add_config_value_for_versions_up_to('VMAarch64BitMaxMemorySizeInMB', '1048576', '4.4'); | ||
| 645 | ++select fn_db_add_config_value_for_versions_up_to('VMLoongarch64BitMaxMemorySizeInMB', '4194304', '4.4'); | ||
| 646 | + select fn_db_add_config_value('VmGracefulShutdownMessage','System Administrator has initiated shutdown of this Virtual Machine. Virtual Machine is shutting down.','general'); | ||
| 647 | + select fn_db_add_config_value('VmGracefulShutdownTimeout','30','general'); | ||
| 648 | + --Number of subsequent failures in VM creation in a pool before giving up and stop creating new VMs | ||
| 649 | +diff --git a/packaging/setup/ovirt_engine_setup/engine_common/constants.py b/packaging/setup/ovirt_engine_setup/engine_common/constants.py | ||
| 650 | +index 13b0485..586189f 100644 | ||
| 651 | +--- a/packaging/setup/ovirt_engine_setup/engine_common/constants.py | ||
| 652 | ++++ b/packaging/setup/ovirt_engine_setup/engine_common/constants.py | ||
| 653 | + class Defaults(object): | ||
| 654 | + 'x86_64': 68719476736, | ||
| 655 | + 'i686': 4294967295, | ||
| 656 | + 'ppc64': 137438953472, | ||
| 657 | ++ 'loongarch64': 137438953472, | ||
| 658 | + 'aarch64': 137438953472, | ||
| 659 | + 'default': 4294967295, | ||
| 660 | + } | ||
| 661 | +diff --git a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/protocols.py b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/protocols.py | ||
| 662 | +index 275dcbb..5f822d9 100644 | ||
| 663 | +--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/protocols.py | ||
| 664 | ++++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/protocols.py | ||
| 665 | + class Plugin(plugin.PluginBase): | ||
| 666 | + return 'true' if o else 'false' | ||
| 667 | + content = ( | ||
| 668 | + 'ENGINE_FQDN={fqdn}\n' | ||
| 669 | ++ 'ENGINE_URI={engineURI}\n' | ||
| 670 | + 'ENGINE_PROXY_ENABLED={proxyFlag}\n' | ||
| 671 | + 'ENGINE_PROXY_HTTP_PORT={proxyHttpPort}\n' | ||
| 672 | + 'ENGINE_PROXY_HTTPS_PORT={proxyHttpsPort}\n' | ||
| 673 | + class Plugin(plugin.PluginBase): | ||
| 674 | + 'ENGINE_HTTPS_PORT={directHttpsPort}\n' | ||
| 675 | + ).format( | ||
| 676 | + fqdn=self.environment[osetupcons.ConfigEnv.FQDN], | ||
| 677 | ++ engineURI=oenginecons.Const.ENGINE_URI, | ||
| 678 | + proxyFlag=flag(self.environment[ | ||
| 679 | + oengcommcons.ConfigEnv.JBOSS_AJP_PORT | ||
| 680 | + ]), | ||
| 681 | +-- | ||
| 682 | +2.55.0 | ||
| 683 | + | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | +--- a/src/main/java/types/Architecture.java | ||
| 2 | ++++ b/src/main/java/types/Architecture.java | ||
| 3 | + | ||
| 4 | + * @since 4.2 | ||
| 5 | + */ | ||
| 6 | +- S390X; | ||
| 7 | ++ S390X, | ||
| 8 | ++ LOONGARCH64; | ||
| 9 | + } | ||
| @@ -176,7 +176,7 @@ getent passwd %1 >/dev/null || useradd -r -u %2 -g %3 -c %5 -s /sbin/nologin -d | |||
| 176 | 176 | ||
| 177 | Name: ovirt-engine | 177 | Name: ovirt-engine |
| 178 | Version: 4.4.4.1 | 178 | Version: 4.4.4.1 |
| 179 | -Release: 11 | 179 | +Release: 12 |
| 180 | Summary: Management server for Open Virtualization | 180 | Summary: Management server for Open Virtualization |
| 181 | Group: %{ovirt_product_group} | 181 | Group: %{ovirt_product_group} |
| 182 | License: Apache 2.0 | 182 | License: Apache 2.0 |
| @@ -189,6 +189,8 @@ Source1: xalan-2.7.1.jbossorg-2.jar | |||
| 189 | Source2: libsass-maven-plugin-0.2.8-libsass_3.4.4.pom | 189 | Source2: libsass-maven-plugin-0.2.8-libsass_3.4.4.pom |
| 190 | Source3: https://github.com/oVirt/ovirt-engine-api-model/archive/refs/tags/4.4.20.tar.gz | 190 | Source3: https://github.com/oVirt/ovirt-engine-api-model/archive/refs/tags/4.4.20.tar.gz |
| 191 | Source4: 0006-add-arm-biostype-in-front-end-api.patch | 191 | Source4: 0006-add-arm-biostype-in-front-end-api.patch |
| 192 | +#https://maven.loongnix.cn/loongarch/maven/io/bit3/jsass/5.10.3/jsass-5.10.3.jar | ||
| 193 | +Source5: jsass-5.10.3.jar | ||
| 192 | 194 | ||
| 193 | Patch1: 0001-add-dependent-package-to-lib.patch | 195 | Patch1: 0001-add-dependent-package-to-lib.patch |
| 194 | Patch2: 0002-add-support-running-on-kunpeng-platform.patch | 196 | Patch2: 0002-add-support-running-on-kunpeng-platform.patch |
| @@ -203,6 +205,8 @@ Patch10: 0010-fix-host-installation-failure.patch | |||
| 203 | Patch11: 0011-get-vdsm-id-from-dmidecode-system-uuid-on-aarch64.patch | 205 | Patch11: 0011-get-vdsm-id-from-dmidecode-system-uuid-on-aarch64.patch |
| 204 | Patch12: CVE-2024-0822.patch | 206 | Patch12: CVE-2024-0822.patch |
| 205 | Patch13: CVE-2020-35497.patch | 207 | Patch13: CVE-2020-35497.patch |
| 208 | +Patch14: 0001-add-loongarch64-support-for-ovirt-engine-4.4.4.1.patch | ||
| 209 | +Patch15: 0002-add-loongarch64-to-api-model.patch | ||
| 206 | BuildArch: noarch | 210 | BuildArch: noarch |
| 207 | 211 | ||
| 208 | BuildRequires: assertj-core >= 2.2.0 | 212 | BuildRequires: assertj-core >= 2.2.0 |
| @@ -216,6 +220,7 @@ BuildRequires: systemd | |||
| 216 | BuildRequires: unzip | 220 | BuildRequires: unzip |
| 217 | BuildRequires: ovirt-jboss-modules-maven-plugin >= 2.0.1 | 221 | BuildRequires: ovirt-jboss-modules-maven-plugin >= 2.0.1 |
| 218 | BuildRequires: javapackages-local | 222 | BuildRequires: javapackages-local |
| 223 | +BuildRequires: libsass | ||
| 219 | 224 | ||
| 220 | Requires(pre): shadow-utils | 225 | Requires(pre): shadow-utils |
| 221 | 226 | ||
| @@ -657,6 +662,7 @@ Setup imageio service. | |||
| 657 | %patch11 -p1 | 662 | %patch11 -p1 |
| 658 | %patch12 -p1 | 663 | %patch12 -p1 |
| 659 | %patch13 -p1 | 664 | %patch13 -p1 |
| 665 | +%patch14 -p1 | ||
| 660 | sed -i '87s/@Test/\/\/@Test/g' backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilderTest.java | 666 | sed -i '87s/@Test/\/\/@Test/g' backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilderTest.java |
| 661 | sed -i '88s/@MockedConfig/\/\/@MockedConfig/g' backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilderTest.java | 667 | sed -i '88s/@MockedConfig/\/\/@MockedConfig/g' backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/LibvirtVmXmlBuilderTest.java |
| 662 | sed -i '121s/@Test/\/\/@Test/g' backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddClusterCommandTest.java | 668 | sed -i '121s/@Test/\/\/@Test/g' backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddClusterCommandTest.java |
| @@ -679,12 +685,15 @@ pushd api-model | |||
| 679 | sed -i '/PPC64,/a\ AARCH64,' src/main/java/types/Architecture.java | 685 | sed -i '/PPC64,/a\ AARCH64,' src/main/java/types/Architecture.java |
| 680 | cp %{SOURCE4} ./ | 686 | cp %{SOURCE4} ./ |
| 681 | patch -p1 < 0006-add-arm-biostype-in-front-end-api.patch | 687 | patch -p1 < 0006-add-arm-biostype-in-front-end-api.patch |
| 688 | + patch -p1 < %{PATCH15} | ||
| 682 | mvn clean install -DskipTests | 689 | mvn clean install -DskipTests |
| 683 | popd | 690 | popd |
| 684 | 691 | ||
| 685 | mvn install:install-file -DgroupId=xalan -DartifactId=xalan -Dversion=2.7.1.jbossorg-2 -Dpackaging=jar -Dfile=%{SOURCE1} | 692 | mvn install:install-file -DgroupId=xalan -DartifactId=xalan -Dversion=2.7.1.jbossorg-2 -Dpackaging=jar -Dfile=%{SOURCE1} |
| 686 | mkdir -p ~/.m2/repository/com/github/warmuuh/libsass-maven-plugin/0.2.8-libsass_3.4.4 | 693 | mkdir -p ~/.m2/repository/com/github/warmuuh/libsass-maven-plugin/0.2.8-libsass_3.4.4 |
| 687 | cp %{SOURCE2} ~/.m2/repository/com/github/warmuuh/libsass-maven-plugin/0.2.8-libsass_3.4.4 | 694 | cp %{SOURCE2} ~/.m2/repository/com/github/warmuuh/libsass-maven-plugin/0.2.8-libsass_3.4.4 |
| 695 | +mkdir -p ~/.m2/repository/io/bit3/jsass/5.10.3 | ||
| 696 | +cp %{SOURCE5} ~/.m2/repository/io/bit3/jsass/5.10.3 | ||
| 688 | sed -i 's/require=\"10240\";/require=\"1024\";/g' Makefile | 697 | sed -i 's/require=\"10240\";/require=\"1024\";/g' Makefile |
| 689 | sed -i 's/MAVEN_OPTS=\"/MAVEN_OPTS=\"-Xmx16384m -Xms16384m /g' Makefile | 698 | sed -i 's/MAVEN_OPTS=\"/MAVEN_OPTS=\"-Xmx16384m -Xms16384m /g' Makefile |
| 690 | sed -i 's/$(BUILD_FLAGS) \\/-Dgwt.compiler.localWorkers=2 $(BUILD_FLAGS) \\/g' Makefile | 699 | sed -i 's/$(BUILD_FLAGS) \\/-Dgwt.compiler.localWorkers=2 $(BUILD_FLAGS) \\/g' Makefile |
| @@ -1305,6 +1314,9 @@ fi | |||
| 1305 | %{engine_data}/setup/bin/ovirt-engine-health | 1314 | %{engine_data}/setup/bin/ovirt-engine-health |
| 1306 | 1315 | ||
| 1307 | %changelog | 1316 | %changelog |
| 1317 | +* Tue Sep 01 2026 Wenlong Zhang <zhangwenlong@loongson.cn> - 4.4.4.1-12 | ||
| 1318 | +- add loongarch64 support for ovirt-engine-4.4.4.1 | ||
| 1319 | + | ||
| 1308 | * Fri Jun 07 2024 wangziliang <wangziliang@kylinos.cn> - 4.4.4.1-11 | 1320 | * Fri Jun 07 2024 wangziliang <wangziliang@kylinos.cn> - 4.4.4.1-11 |
| 1309 | - Fix CVE-2020-35497 | 1321 | - Fix CVE-2020-35497 |
| 1310 | 1322 | ||