From 5798fb43a3af5a0c1e0dba548d6a62dbb74f47e2 Mon Sep 17 00:00:00 2001 From: Harikrishna Date: Thu, 27 Nov 2025 20:26:26 +0530 Subject: [PATCH 1/7] Fix upgrade files (#12155) --- ...42200to42300-cleanup.sql => schema-42210to42300-cleanup.sql} | 2 +- .../db/{schema-42200to42300.sql => schema-42210to42300.sql} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename engine/schema/src/main/resources/META-INF/db/{schema-42200to42300-cleanup.sql => schema-42210to42300-cleanup.sql} (93%) rename engine/schema/src/main/resources/META-INF/db/{schema-42200to42300.sql => schema-42210to42300.sql} (94%) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42300-cleanup.sql b/engine/schema/src/main/resources/META-INF/db/schema-42210to42300-cleanup.sql similarity index 93% rename from engine/schema/src/main/resources/META-INF/db/schema-42200to42300-cleanup.sql rename to engine/schema/src/main/resources/META-INF/db/schema-42210to42300-cleanup.sql index f2f5dec5003..e2b066af780 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42300-cleanup.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42210to42300-cleanup.sql @@ -16,5 +16,5 @@ -- under the License. --; --- Schema upgrade cleanup from 4.22.0.0 to 4.23.0.0 +-- Schema upgrade cleanup from 4.22.1.0 to 4.23.0.0 --; diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42300.sql b/engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql similarity index 94% rename from engine/schema/src/main/resources/META-INF/db/schema-42200to42300.sql rename to engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql index c1f1bb2c094..7024368a1d5 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42300.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql @@ -16,5 +16,5 @@ -- under the License. --; --- Schema upgrade from 4.22.0.0 to 4.23.0.0 +-- Schema upgrade from 4.22.1.0 to 4.23.0.0 --; From f379d789635a140fd6ea287d1d4384743328fc56 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 28 Nov 2025 09:29:10 +0100 Subject: [PATCH 2/7] ui: fix section search filter (#12146) Signed-off-by: Abhishek Kumar --- ui/src/views/AutogenView.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index b1f26a17f8f..a01e300c1c9 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -1821,8 +1821,13 @@ export default { }, onSearch (opts) { const query = Object.assign({}, this.$route.query) - const searchFilters = this.$route?.meta?.searchFilters || [] - searchFilters.forEach(key => delete query[key]) + let searchFilters = this.$route?.meta?.searchFilters || [] + if (typeof searchFilters === 'function') { + searchFilters = searchFilters() + } + if (Array.isArray(searchFilters)) { + searchFilters.forEach(key => delete query[key]) + } delete query.name delete query.templatetype delete query.keyword From db6147060b58f0d2a05a4e6a36d128aa77bbb425 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Fri, 28 Nov 2025 19:01:38 +1000 Subject: [PATCH 3/7] Rename PRE-COMMIT.md to PRE_COMMIT.md and fix link (#12157) --- PRE-COMMIT.md => PRE_COMMIT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename PRE-COMMIT.md => PRE_COMMIT.md (97%) diff --git a/PRE-COMMIT.md b/PRE_COMMIT.md similarity index 97% rename from PRE-COMMIT.md rename to PRE_COMMIT.md index 9b76929d422..62dc296c99e 100644 --- a/PRE-COMMIT.md +++ b/PRE_COMMIT.md @@ -20,7 +20,7 @@ # pre-commit We run [pre-commit](https://pre-commit.com/) with -[GitHub Actions](https://github.com/apache/cloudstack/blob/main/.github/workflows/linter.yml) so installation on your +[GitHub Actions](https://github.com/apache/cloudstack/blob/main/.github/workflows/pre-commit.yml) so installation on your local machine is currently optional. The `pre-commit` [configuration file](https://github.com/apache/cloudstack/blob/main/.pre-commit-config.yaml) From 44119cf34fcbbd12086a694cbc2cd06abe9bfb9d Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 28 Nov 2025 10:29:18 +0100 Subject: [PATCH 4/7] ui: fix dsiple managementservermetricsresponse - agentcount (#12148) Signed-off-by: Abhishek Kumar --- ui/src/config/section/infra/managementServers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/config/section/infra/managementServers.js b/ui/src/config/section/infra/managementServers.js index bc7b42d9cf0..1466a440296 100644 --- a/ui/src/config/section/infra/managementServers.js +++ b/ui/src/config/section/infra/managementServers.js @@ -26,8 +26,8 @@ export default { permission: ['listManagementServersMetrics'], resourceType: 'ManagementServer', columns: () => { - const fields = ['name', 'state', 'ipaddress', 'version', 'osdistribution', 'agentcount'] - const metricsFields = ['collectiontime', 'availableprocessors', 'cpuload', 'heapmemoryused'] + const fields = ['name', 'state', 'ipaddress', 'version', 'osdistribution'] + const metricsFields = ['agentcount', 'collectiontime', 'availableprocessors', 'cpuload', 'heapmemoryused'] if (store.getters.metrics) { fields.push(...metricsFields) } From 516012a0b492ef8613f919c48bad950cc541bd97 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 28 Nov 2025 15:44:00 +0100 Subject: [PATCH 5/7] ceph: fix offline volume migration between ceph pools (#12103) --- .../cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java index e8924ecf5eb..87544cfaa9d 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java @@ -1689,7 +1689,11 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { */ srcFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(srcPool, sourcePath)); srcFile.setFormat(sourceFormat); - destFile = new QemuImgFile(destPath); + if (destPool.getType() == StoragePoolType.RBD) { + destFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(destPool, destPath)); + } else { + destFile = new QemuImgFile(destPath); + } destFile.setFormat(destFormat); try { From 243f566a603a6215505342d93d45a67d5386251e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 1 Dec 2025 08:19:09 +0100 Subject: [PATCH 6/7] refactor: add null check for BroadcastDomainType retrievals (#11572) Signed-off-by: Abhishek Kumar --- .../main/java/com/cloud/network/Networks.java | 12 ++++++------ .../java/com/cloud/network/NetworksTest.java | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/api/src/main/java/com/cloud/network/Networks.java b/api/src/main/java/com/cloud/network/Networks.java index dfa0ddb84ca..8e7399bb21d 100644 --- a/api/src/main/java/com/cloud/network/Networks.java +++ b/api/src/main/java/com/cloud/network/Networks.java @@ -78,7 +78,7 @@ public class Networks { } @Override public String getValueFrom(URI uri) { - return uri.getAuthority(); + return uri == null ? null : uri.getAuthority(); } }, Vswitch("vs", String.class), LinkLocal(null, null), Vnet("vnet", Long.class), Storage("storage", Integer.class), Lswitch("lswitch", String.class) { @@ -96,7 +96,7 @@ public class Networks { */ @Override public String getValueFrom(URI uri) { - return uri.getSchemeSpecificPart(); + return uri == null ? null : uri.getSchemeSpecificPart(); } }, Mido("mido", String.class), Pvlan("pvlan", String.class), @@ -176,7 +176,7 @@ public class Networks { * @return the scheme as BroadcastDomainType */ public static BroadcastDomainType getSchemeValue(URI uri) { - return toEnumValue(uri.getScheme()); + return toEnumValue(uri == null ? null : uri.getScheme()); } /** @@ -190,7 +190,7 @@ public class Networks { if (com.cloud.dc.Vlan.UNTAGGED.equalsIgnoreCase(str)) { return Native; } - return getSchemeValue(new URI(str)); + return getSchemeValue(str == null ? null : new URI(str)); } /** @@ -219,7 +219,7 @@ public class Networks { * @return the host part as String */ public String getValueFrom(URI uri) { - return uri.getHost(); + return uri == null ? null : uri.getHost(); } /** @@ -242,7 +242,7 @@ public class Networks { * @throws URISyntaxException the string is not even an uri */ public static String getValue(String uriString) throws URISyntaxException { - return getValue(new URI(uriString)); + return getValue(uriString == null ? null : new URI(uriString)); } /** diff --git a/api/src/test/java/com/cloud/network/NetworksTest.java b/api/src/test/java/com/cloud/network/NetworksTest.java index ef582924342..6f0f3fbd1ef 100644 --- a/api/src/test/java/com/cloud/network/NetworksTest.java +++ b/api/src/test/java/com/cloud/network/NetworksTest.java @@ -37,6 +37,24 @@ public class NetworksTest { public void setUp() { } + @Test + public void nullBroadcastDomainTypeTest() throws URISyntaxException { + BroadcastDomainType type = BroadcastDomainType.getTypeOf(null); + Assert.assertEquals("a null uri should mean a broadcasttype of undecided", BroadcastDomainType.UnDecided, type); + } + + @Test + public void nullBroadcastDomainTypeValueTest() { + URI uri = null; + Assert.assertNull(BroadcastDomainType.getValue(uri)); + } + + @Test + public void nullBroadcastDomainTypeStringValueTest() throws URISyntaxException { + String uriString = null; + Assert.assertNull(BroadcastDomainType.getValue(uriString)); + } + @Test public void emptyBroadcastDomainTypeTest() throws URISyntaxException { BroadcastDomainType type = BroadcastDomainType.getTypeOf(""); From f3a112fd9e7437b6507434190083005824915ec8 Mon Sep 17 00:00:00 2001 From: dahn Date: Mon, 1 Dec 2025 08:33:14 +0100 Subject: [PATCH 7/7] use upstream method for creating enums from strings (#12158) Co-authored-by: Daan Hoogland --- .../datastore/api/VTreeMigrationInfo.java | 2 +- .../main/java/com/cloud/api/ApiDBUtils.java | 2 +- .../main/java/com/cloud/utils/EnumUtils.java | 26 ------------------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/api/VTreeMigrationInfo.java b/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/api/VTreeMigrationInfo.java index f4e926bfd33..072b52b69d6 100644 --- a/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/api/VTreeMigrationInfo.java +++ b/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/api/VTreeMigrationInfo.java @@ -59,7 +59,7 @@ public class VTreeMigrationInfo { } public void setMigrationStatus(String migrationStatus) { - this.migrationStatus = EnumUtils.fromString(MigrationStatus.class, migrationStatus, MigrationStatus.None); + this.migrationStatus = EnumUtils.getEnumIgnoreCase(MigrationStatus.class, migrationStatus, MigrationStatus.None); } public void setMigrationStatus(MigrationStatus migrationStatus) { diff --git a/server/src/main/java/com/cloud/api/ApiDBUtils.java b/server/src/main/java/com/cloud/api/ApiDBUtils.java index f7ffb039801..57eeb63ea9f 100644 --- a/server/src/main/java/com/cloud/api/ApiDBUtils.java +++ b/server/src/main/java/com/cloud/api/ApiDBUtils.java @@ -1767,7 +1767,7 @@ public class ApiDBUtils { return null; } String jobInstanceId = null; - ApiCommandResourceType jobInstanceType = EnumUtils.fromString(ApiCommandResourceType.class, job.getInstanceType(), ApiCommandResourceType.None); + ApiCommandResourceType jobInstanceType = EnumUtils.getEnumIgnoreCase(ApiCommandResourceType.class, job.getInstanceType(), ApiCommandResourceType.None); if (job.getInstanceId() == null) { // when assert is hit, implement 'getInstanceId' of BaseAsyncCmd and return appropriate instance id diff --git a/utils/src/main/java/com/cloud/utils/EnumUtils.java b/utils/src/main/java/com/cloud/utils/EnumUtils.java index 380b595a0ad..1af29066ef1 100644 --- a/utils/src/main/java/com/cloud/utils/EnumUtils.java +++ b/utils/src/main/java/com/cloud/utils/EnumUtils.java @@ -29,30 +29,4 @@ public class EnumUtils extends org.apache.commons.lang3.EnumUtils { b.append("]"); return b.toString(); } - - public static > T fromString(Class clz, String value, T defaultVal) { - assert (clz != null); - - if (value != null) { - try { - return Enum.valueOf(clz, value.trim()); - } catch (IllegalArgumentException ex) { - assert (false); - } - } - return defaultVal; - } - - public static > T fromString(Class clz, String value) { - assert (clz != null); - - if (value != null) { - try { - return Enum.valueOf(clz, value.trim()); - } catch (IllegalArgumentException ex) { - assert (false); - } - } - return null; - } }