Skip to content

Commit ba600d1

Browse files
committed
Merge remote-tracking branch 'origin/4.22' into fix-snapshot-chain-on-xen
2 parents 6409de9 + 3b42fbf commit ba600d1

File tree

141 files changed

+1676
-1772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1676
-1772
lines changed

.github/workflows/merge-conflict-checker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
name: "PR Merge Conflict Check"
1919
on:
2020
push:
21-
pull_request_target:
22-
types: [synchronize]
21+
pull_request:
22+
types: [opened, synchronize, reopened]
2323

2424
permissions: # added using https://github.com/step-security/secure-workflows
2525
contents: read

api/src/main/java/com/cloud/host/Host.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public static String[] toStrings(Host.Type... types) {
5959
String HOST_INSTANCE_CONVERSION = "host.instance.conversion";
6060
String HOST_OVFTOOL_VERSION = "host.ovftool.version";
6161
String HOST_VIRTV2V_VERSION = "host.virtv2v.version";
62+
String HOST_SSH_PORT = "host.ssh.port";
63+
64+
int DEFAULT_SSH_PORT = 22;
6265

6366
/**
6467
* @return name of the machine.

api/src/main/java/org/apache/cloudstack/api/ApiServerService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,7 @@ public ResponseObject loginUser(HttpSession session, String username, String pas
4949

5050
boolean resetPassword(UserAccount userAccount, String token, String password);
5151

52+
String getDomainId(Map<String, Object[]> params);
53+
5254
boolean isPostRequestsAndTimestampsEnforced();
5355
}

api/src/main/java/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ public Map getDetails() {
153153
return (Map) (paramsCollection.toArray())[0];
154154
}
155155

156-
public boolean isCleanupDetails(){
157-
return cleanupDetails == null ? false : cleanupDetails.booleanValue();
156+
public boolean isCleanupDetails() {
157+
return cleanupDetails != null && cleanupDetails;
158158
}
159159

160160
public CPU.CPUArch getCPUArch() {

api/src/main/java/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public class AddHostCmd extends BaseCmd {
6060
@Parameter(name = ApiConstants.POD_ID, type = CommandType.UUID, entityType = PodResponse.class, required = true, description = "The Pod ID for the host")
6161
private Long podId;
6262

63-
@Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "The host URL")
63+
@Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "The host URL, optionally add ssh port (format: 'host:port') for KVM hosts," +
64+
" otherwise falls back to the port defined at the config 'kvm.host.discovery.ssh.port'")
6465
private String url;
6566

6667
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true, description = "The Zone ID for the host")

api/src/main/java/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public class CreateStaticRouteCmd extends BaseAsyncCreateCmd {
4646
@Parameter(name = ApiConstants.GATEWAY_ID,
4747
type = CommandType.UUID,
4848
entityType = PrivateGatewayResponse.class,
49-
required = true,
5049
description = "The gateway ID we are creating static route for. Mutually exclusive with the nexthop parameter")
5150
private Long gatewayId;
5251

api/src/main/java/org/apache/cloudstack/backup/BackupManager.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.apache.cloudstack.api.command.user.backup.ListBackupsCmd;
3333
import org.apache.cloudstack.api.response.BackupResponse;
3434
import org.apache.cloudstack.framework.config.ConfigKey;
35+
import org.apache.cloudstack.framework.config.ValidatedConfigKey;
3536
import org.apache.cloudstack.framework.config.Configurable;
3637

3738
import com.cloud.exception.ResourceUnavailableException;
@@ -53,10 +54,11 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
5354
"false",
5455
"Is backup and recovery framework enabled.", false, ConfigKey.Scope.Zone);
5556

56-
ConfigKey<String> BackupProviderPlugin = new ConfigKey<>("Advanced", String.class,
57+
ConfigKey<String> BackupProviderPlugin = new ValidatedConfigKey<>("Advanced", String.class,
5758
"backup.framework.provider.plugin",
5859
"dummy",
59-
"The backup and recovery provider plugin. Valid plugin values: dummy, veeam, networker and nas", true, ConfigKey.Scope.Zone, BackupFrameworkEnabled.key());
60+
"The backup and recovery provider plugin. Valid plugin values: dummy, veeam, networker and nas",
61+
true, ConfigKey.Scope.Zone, BackupFrameworkEnabled.key(), value -> validateBackupProviderConfig((String)value));
6062

6163
ConfigKey<Long> BackupSyncPollingInterval = new ConfigKey<>("Advanced", Long.class,
6264
"backup.framework.sync.interval",
@@ -247,4 +249,14 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
247249
Capacity getBackupStorageUsedStats(Long zoneId);
248250

249251
void checkAndRemoveBackupOfferingBeforeExpunge(VirtualMachine vm);
252+
253+
static void validateBackupProviderConfig(String value) {
254+
if (value != null && (value.contains(",") || value.trim().contains(" "))) {
255+
throw new IllegalArgumentException("Multiple backup provider plugins are not supported. Please provide a single plugin value.");
256+
}
257+
List<String> validPlugins = List.of("dummy", "veeam", "networker", "nas");
258+
if (value != null && !validPlugins.contains(value)) {
259+
throw new IllegalArgumentException("Invalid backup provider plugin: " + value + ". Valid plugin values are: " + String.join(", ", validPlugins));
260+
}
261+
}
250262
}

core/src/main/java/com/cloud/agent/api/ModifyStoragePoolAnswer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, long capacityBytes,
4646
templateInfo = tInfo;
4747
}
4848

49+
public ModifyStoragePoolAnswer(final Command command, final boolean success, final String details) {
50+
super(command, success, details);
51+
}
52+
4953
public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, boolean success, String details) {
5054
super(cmd, success, details);
5155
}

core/src/main/java/org/apache/cloudstack/backup/RestoreBackupCommand.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public class RestoreBackupCommand extends Command {
3434
private List<String> backupVolumesUUIDs;
3535
private List<PrimaryDataStoreTO> restoreVolumePools;
3636
private List<String> restoreVolumePaths;
37+
private List<String> backupFiles;
3738
private String diskType;
3839
private Boolean vmExists;
39-
private String restoreVolumeUUID;
4040
private VirtualMachine.State vmState;
4141
private Integer mountTimeout;
4242

@@ -92,6 +92,14 @@ public void setRestoreVolumePaths(List<String> restoreVolumePaths) {
9292
this.restoreVolumePaths = restoreVolumePaths;
9393
}
9494

95+
public List<String> getBackupFiles() {
96+
return backupFiles;
97+
}
98+
99+
public void setBackupFiles(List<String> backupFiles) {
100+
this.backupFiles = backupFiles;
101+
}
102+
95103
public Boolean isVmExists() {
96104
return vmExists;
97105
}
@@ -116,14 +124,6 @@ public void setMountOptions(String mountOptions) {
116124
this.mountOptions = mountOptions;
117125
}
118126

119-
public String getRestoreVolumeUUID() {
120-
return restoreVolumeUUID;
121-
}
122-
123-
public void setRestoreVolumeUUID(String restoreVolumeUUID) {
124-
this.restoreVolumeUUID = restoreVolumeUUID;
125-
}
126-
127127
public VirtualMachine.State getVmState() {
128128
return vmState;
129129
}

engine/components-api/src/main/java/com/cloud/agent/AgentManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public interface AgentManager {
5454
"This timeout overrides the wait global config. This holds a comma separated key value pairs containing timeout (in seconds) for specific commands. " +
5555
"For example: DhcpEntryCommand=600, SavePasswordCommand=300, VmDataCommand=300", false);
5656

57+
ConfigKey<Integer> KVMHostDiscoverySshPort = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED, Integer.class,
58+
"kvm.host.discovery.ssh.port", String.valueOf(Host.DEFAULT_SSH_PORT), "SSH port used for KVM host discovery and any other operations on host (using SSH)." +
59+
" Please note that this is applicable when port is not defined through host url while adding the KVM host.", true, ConfigKey.Scope.Cluster);
60+
5761
enum TapAgentsAction {
5862
Add, Del, Contains,
5963
}
@@ -172,4 +176,6 @@ enum TapAgentsAction {
172176
void propagateChangeToAgents(Map<String, String> params);
173177

174178
boolean transferDirectAgentsFromMS(String fromMsUuid, long fromMsId, long timeoutDurationInMs, boolean excludeHostsInMaintenance);
179+
180+
int getHostSshPort(HostVO host);
175181
}

0 commit comments

Comments
 (0)