Skip to content

Commit d93b722

Browse files
author
Daan Hoogland
committed
static analysis warnings in User Vm Manager
1 parent 913ac08 commit d93b722

4 files changed

Lines changed: 194 additions & 285 deletions

File tree

api/src/main/java/com/cloud/template/VirtualMachineTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public enum TemplateFilter {
131131

132132
String getTemplateTag();
133133

134-
Map getDetails();
134+
Map<String, String> getDetails();
135135

136136
boolean isDynamicallyScalable();
137137

api/src/main/java/com/cloud/vm/UserVmService.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import com.cloud.exception.OperationTimedoutException;
5555
import com.cloud.exception.ResourceAllocationException;
5656
import com.cloud.exception.ResourceUnavailableException;
57-
import com.cloud.exception.StorageUnavailableException;
5857
import com.cloud.exception.VirtualMachineMigrationException;
5958
import com.cloud.host.Host;
6059
import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -112,7 +111,7 @@ public interface UserVmService {
112111

113112
UserVm resetVMUserData(ResetVMUserDataCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException;
114113

115-
UserVm startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, ExecutionException, ConcurrentOperationException, ResourceUnavailableException,
114+
UserVm startVirtualMachine(StartVMCmd cmd) throws ExecutionException, ConcurrentOperationException, ResourceUnavailableException,
116115
InsufficientCapacityException, ResourceAllocationException;
117116

118117
UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ResourceAllocationException;
@@ -229,8 +228,8 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
229228
String userData, Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, Boolean displayVm, String keyboard,
230229
List<Long> affinityGroupIdList, Map<String, String> customParameter, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
231230
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
232-
Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, Volume volume, Snapshot snapshot) throws InsufficientCapacityException,
233-
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
231+
Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, Volume volume, Snapshot snapshot)
232+
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException;
234233

235234
/**
236235
* Creates a User VM in Advanced Zone (Security Group feature is enabled) in
@@ -305,7 +304,8 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
305304
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, List<VmDiskInfo> dataDiskInfoList, String group, HypervisorType hypervisor,
306305
HTTPMethod httpmethod, String userData, Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard,
307306
List<Long> affinityGroupIdList, Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
308-
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, String vmType, Volume volume, Snapshot snapshot) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
307+
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, String vmType, Volume volume, Snapshot snapshot)
308+
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException;
309309

310310
/**
311311
* Creates a User VM in Advanced Zone (Security Group feature is disabled)
@@ -379,7 +379,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
379379
Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
380380
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled, String vmType, Long overrideDiskOfferingId, Volume volume, Snapshot snapshot)
381381

382-
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
382+
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException;
383383

384384
/**
385385
* Starts the virtual machine created from createVirtualMachine.
@@ -421,8 +421,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
421421

422422
HypervisorType getHypervisorTypeOfUserVM(long vmid);
423423

424-
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException,
425-
StorageUnavailableException, ResourceAllocationException;
424+
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, ResourceAllocationException;
426425

427426
/**
428427
* This API is mostly to trigger VM.CREATE event for deployVirtualMachine with startvm=false, because there is no code in "execute" part of VM creation.
@@ -505,7 +504,7 @@ UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException
505504
* determine whether the uservm should be visible to the end user
506505
* @return value of the display flag
507506
*/
508-
public boolean isDisplayResourceEnabled(Long vmId);
507+
boolean isDisplayResourceEnabled(Long vmId);
509508

510509
void collectVmDiskStatistics(UserVm userVm);
511510

0 commit comments

Comments
 (0)