Skip to content

Commit f237082

Browse files
author
Daan Hoogland
committed
static analysis warnings in User Vm Manager
1 parent 242b743 commit f237082

4 files changed

Lines changed: 256 additions & 357 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
@@ -53,7 +53,6 @@
5353
import com.cloud.exception.OperationTimedoutException;
5454
import com.cloud.exception.ResourceAllocationException;
5555
import com.cloud.exception.ResourceUnavailableException;
56-
import com.cloud.exception.StorageUnavailableException;
5756
import com.cloud.exception.VirtualMachineMigrationException;
5857
import com.cloud.host.Host;
5958
import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -111,7 +110,7 @@ public interface UserVmService {
111110

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

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

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

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

307307
/**
308308
* Creates a User VM in Advanced Zone (Security Group feature is disabled)
@@ -376,7 +376,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
376376
Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
377377
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled, String vmType, Long overrideDiskOfferingId, Volume volume, Snapshot snapshot)
378378

379-
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
379+
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException;
380380

381381
/**
382382
* Starts the virtual machine created from createVirtualMachine.
@@ -418,8 +418,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
418418

419419
HypervisorType getHypervisorTypeOfUserVM(long vmid);
420420

421-
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException,
422-
StorageUnavailableException, ResourceAllocationException;
421+
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, ResourceAllocationException;
423422

424423
/**
425424
* 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.
@@ -502,7 +501,7 @@ UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException
502501
* determine whether the uservm should be visible to the end user
503502
* @return value of the display flag
504503
*/
505-
public boolean isDisplayResourceEnabled(Long vmId);
504+
boolean isDisplayResourceEnabled(Long vmId);
506505

507506
void collectVmDiskStatistics(UserVm userVm);
508507

0 commit comments

Comments
 (0)