Fixed few coverity issues

This commit is contained in:
Santhosh Edukulla 2014-08-11 16:02:19 +05:30
parent 354756219c
commit f9e11540c7
4 changed files with 15 additions and 9 deletions

View File

@ -100,7 +100,7 @@ public class PropertiesStorage implements StorageComponent {
}
@Override
public String getName() {
public synchronized String getName() {
return _name;
}

View File

@ -3988,11 +3988,14 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
s_logger.debug("Creating VLAN " + tag + " on host " + _host.ip + " on device " + nPifr.device);
}
VLAN vlan = VLAN.create(conn, nPif, tag, vlanNetwork);
VLAN.Record vlanr = vlan.getRecord(conn);
if (s_logger.isDebugEnabled()) {
s_logger.debug("VLAN is created for " + tag + ". The uuid is " + vlanr.uuid);
if (vlan != null) {
VLAN.Record vlanr = vlan.getRecord(conn);
if (vlanr != null) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("VLAN is created for " + tag + ". The uuid is " + vlanr.uuid);
}
}
}
return vlanNetwork;
}

View File

@ -278,10 +278,11 @@ public class AlertManagerImpl extends ManagerBase implements AlertManager, Confi
// Calculate CPU and RAM capacities
// get all hosts...even if they are not in 'UP' state
List<HostVO> hosts = _resourceMgr.listAllNotInMaintenanceHostsInOneZone(Host.Type.Routing, null);
for (HostVO host : hosts) {
_capacityMgr.updateCapacityForHost(host);
if (hosts != null) {
for (HostVO host : hosts) {
_capacityMgr.updateCapacityForHost(host);
}
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("Done executing cpu/ram capacity update");
s_logger.debug("Executing storage capacity update");

View File

@ -1600,7 +1600,9 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
if (implementedNetwork == null || implementedNetwork.first() == null) {
s_logger.warn("Failed to implement the network " + guestNetwork);
}
guestNetwork = implementedNetwork.second();
if (implementedNetwork != null) {
guestNetwork = implementedNetwork.second();
}
} catch (Exception ex) {
s_logger.warn("Failed to implement network " + guestNetwork + " elements and resources as a part of" + " network provision due to ", ex);
CloudRuntimeException e = new CloudRuntimeException("Failed to implement network (with specified id)"