mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	1) More fixes for the problems found by findBugs
2) Corrected some logging in MidoNetPublicNetworkGuru - removed .toString method call on the objects in the log body as toString is called on the object by default when use log4j
This commit is contained in:
		
							parent
							
								
									90c485e5d6
								
							
						
					
					
						commit
						6c23e201ad
					
				| @ -99,5 +99,5 @@ public interface VirtualMachineTemplate extends ControlledEntity, Identity, Inte | |||||||
| 
 | 
 | ||||||
|     Map getDetails(); |     Map getDetails(); | ||||||
| 
 | 
 | ||||||
|     Boolean isDynamicallyScalable(); |     boolean isDynamicallyScalable(); | ||||||
| } | } | ||||||
|  | |||||||
| @ -593,7 +593,7 @@ public class VMTemplateVO implements VirtualMachineTemplate { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public Boolean isDynamicallyScalable() { |     public boolean isDynamicallyScalable() { | ||||||
|         return dynamicallyScalable; |         return dynamicallyScalable; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -23,8 +23,6 @@ import java.util.Map; | |||||||
| 
 | 
 | ||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.acl.IAMEntityType; | import org.apache.cloudstack.acl.IAMEntityType; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; | import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; | import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; | ||||||
| @ -37,6 +35,7 @@ import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager; | |||||||
| import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao; | import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao; | ||||||
| import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO; | import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO; | ||||||
| import org.apache.cloudstack.storage.to.TemplateObjectTO; | import org.apache.cloudstack.storage.to.TemplateObjectTO; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.agent.api.Answer; | import com.cloud.agent.api.Answer; | ||||||
| import com.cloud.agent.api.to.DataObjectType; | import com.cloud.agent.api.to.DataObjectType; | ||||||
| @ -435,8 +434,8 @@ public class TemplateObject implements TemplateInfo { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public Boolean isDynamicallyScalable() { |     public boolean isDynamicallyScalable() { | ||||||
|         return Boolean.FALSE; |         return false; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|  | |||||||
| @ -27,12 +27,11 @@ import java.util.Random; | |||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| import javax.naming.ConfigurationException; | import javax.naming.ConfigurationException; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; | import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; | import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; | ||||||
| import org.apache.cloudstack.framework.config.dao.ConfigurationDao; | import org.apache.cloudstack.framework.config.dao.ConfigurationDao; | ||||||
| import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; | import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.dc.ClusterVO; | import com.cloud.dc.ClusterVO; | ||||||
| import com.cloud.dc.dao.ClusterDao; | import com.cloud.dc.dao.ClusterDao; | ||||||
|  | |||||||
| @ -25,11 +25,10 @@ import javax.ejb.Local; | |||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| import javax.naming.ConfigurationException; | import javax.naming.ConfigurationException; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| import org.springframework.stereotype.Component; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; | import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; | ||||||
| import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; | import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
| 
 | 
 | ||||||
| import com.cloud.deploy.DeploymentPlan; | import com.cloud.deploy.DeploymentPlan; | ||||||
| import com.cloud.deploy.DeploymentPlanner.ExcludeList; | import com.cloud.deploy.DeploymentPlanner.ExcludeList; | ||||||
|  | |||||||
| @ -108,8 +108,8 @@ public class TemplateEntityImpl implements TemplateEntity { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public Boolean isDynamicallyScalable() { |     public boolean isDynamicallyScalable() { | ||||||
|         return null;  //To change body of implemented methods use File | Settings | File Templates. |         return false; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|  | |||||||
| @ -26,9 +26,6 @@ import java.util.Map; | |||||||
| 
 | 
 | ||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| import org.springframework.stereotype.Component; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity; | import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; | import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; | import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; | ||||||
| @ -41,7 +38,6 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; | |||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector; | import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; | import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event; | import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult; |  | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore; | import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; | import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; | ||||||
| import org.apache.cloudstack.engine.subsystem.api.storage.Scope; | import org.apache.cloudstack.engine.subsystem.api.storage.Scope; | ||||||
| @ -61,8 +57,10 @@ import org.apache.cloudstack.storage.command.DeleteCommand; | |||||||
| import org.apache.cloudstack.storage.datastore.PrimaryDataStoreProviderManager; | import org.apache.cloudstack.storage.datastore.PrimaryDataStoreProviderManager; | ||||||
| import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao; | import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao; | ||||||
| import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO; | import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO; | ||||||
| import org.apache.cloudstack.storage.to.VolumeObjectTO; |  | ||||||
| import org.apache.cloudstack.storage.to.TemplateObjectTO; | import org.apache.cloudstack.storage.to.TemplateObjectTO; | ||||||
|  | import org.apache.cloudstack.storage.to.VolumeObjectTO; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
| 
 | 
 | ||||||
| import com.cloud.agent.api.Answer; | import com.cloud.agent.api.Answer; | ||||||
| import com.cloud.agent.api.storage.ListVolumeAnswer; | import com.cloud.agent.api.storage.ListVolumeAnswer; | ||||||
| @ -75,8 +73,8 @@ import com.cloud.event.EventTypes; | |||||||
| import com.cloud.event.UsageEventUtils; | import com.cloud.event.UsageEventUtils; | ||||||
| import com.cloud.exception.ConcurrentOperationException; | import com.cloud.exception.ConcurrentOperationException; | ||||||
| import com.cloud.exception.ResourceAllocationException; | import com.cloud.exception.ResourceAllocationException; | ||||||
| import com.cloud.host.dao.HostDao; |  | ||||||
| import com.cloud.host.Host; | import com.cloud.host.Host; | ||||||
|  | import com.cloud.host.dao.HostDao; | ||||||
| import com.cloud.storage.DataStoreRole; | import com.cloud.storage.DataStoreRole; | ||||||
| import com.cloud.storage.ScopeType; | import com.cloud.storage.ScopeType; | ||||||
| import com.cloud.storage.StoragePool; | import com.cloud.storage.StoragePool; | ||||||
| @ -625,15 +623,15 @@ public class VolumeServiceImpl implements VolumeService { | |||||||
|                     if (templatePoolRef != null) { |                     if (templatePoolRef != null) { | ||||||
|                         long templatePoolRefId = templatePoolRef.getId(); |                         long templatePoolRefId = templatePoolRef.getId(); | ||||||
|                         templatePoolRef = _tmpltPoolDao.acquireInLockTable(templatePoolRefId, 1200); |                         templatePoolRef = _tmpltPoolDao.acquireInLockTable(templatePoolRefId, 1200); | ||||||
|                         if (templatePoolRef == null) { |  | ||||||
|                             s_logger.warn("Reset Template State On Pool failed - unable to lock TemplatePoolRef " + templatePoolRefId); |  | ||||||
|                         } |  | ||||||
| 
 |  | ||||||
|                         try { |                         try { | ||||||
|                             templatePoolRef.setDownloadState(VMTemplateStorageResourceAssoc.Status.NOT_DOWNLOADED); |                             if (templatePoolRef == null) { | ||||||
|                             templatePoolRef.setState(ObjectInDataStoreStateMachine.State.Allocated); |                                 s_logger.warn("Reset Template State On Pool failed - unable to lock TemplatePoolRef " + templatePoolRefId); | ||||||
|                             _tmpltPoolDao.update(templatePoolRefId, templatePoolRef); |                             } else { | ||||||
|                         } finally { |                                 templatePoolRef.setDownloadState(VMTemplateStorageResourceAssoc.Status.NOT_DOWNLOADED); | ||||||
|  |                                 templatePoolRef.setState(ObjectInDataStoreStateMachine.State.Allocated); | ||||||
|  |                                 _tmpltPoolDao.update(templatePoolRefId, templatePoolRef); | ||||||
|  |                             } | ||||||
|  |                         }finally { | ||||||
|                             _tmpltPoolDao.releaseFromLockTable(templatePoolRefId); |                             _tmpltPoolDao.releaseFromLockTable(templatePoolRefId); | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -23,10 +23,9 @@ import java.util.Set; | |||||||
| import javax.ejb.Local; | import javax.ejb.Local; | ||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.affinity.dao.AffinityGroupDao; | import org.apache.cloudstack.affinity.dao.AffinityGroupDao; | ||||||
| import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; | import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.dc.ClusterVO; | import com.cloud.dc.ClusterVO; | ||||||
| import com.cloud.dc.DataCenter; | import com.cloud.dc.DataCenter; | ||||||
| @ -120,10 +119,10 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase implement | |||||||
|                 DataCenterVO zoneOfHost = _dcDao.findById(host.getDataCenterId()); |                 DataCenterVO zoneOfHost = _dcDao.findById(host.getDataCenterId()); | ||||||
|                 if (resourceList != null && resourceList.size() != 0) { |                 if (resourceList != null && resourceList.size() != 0) { | ||||||
|                     for (DedicatedResourceVO resource : resourceList) { |                     for (DedicatedResourceVO resource : resourceList) { | ||||||
|                         if ((resource.getHostId() != null && resource.getHostId() == plan.getHostId()) || |                         if ((resource.getHostId() != null && resource.getHostId().longValue() == plan.getHostId().longValue()) || | ||||||
|                             (resource.getClusterId() != null && resource.getClusterId() == clusterofHost.getId()) || |                                 (resource.getClusterId() != null && resource.getClusterId().longValue() == clusterofHost.getId()) || | ||||||
|                             (resource.getPodId() != null && resource.getPodId() == podOfHost.getId()) || |                                 (resource.getPodId() != null && resource.getPodId().longValue() == podOfHost.getId()) || | ||||||
|                             (resource.getDataCenterId() != null && resource.getDataCenterId() == zoneOfHost.getId())) { |                                 (resource.getDataCenterId() != null && resource.getDataCenterId().longValue() == zoneOfHost.getId())) { | ||||||
|                             canUse = true; |                             canUse = true; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -33,10 +33,8 @@ import javax.ejb.Local; | |||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| import javax.naming.ConfigurationException; | import javax.naming.ConfigurationException; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.api.ApiConstants; | import org.apache.cloudstack.api.ApiConstants; | ||||||
| import org.apache.cloudstack.framework.config.dao.ConfigurationDao; | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.agent.api.StartupCommand; | import com.cloud.agent.api.StartupCommand; | ||||||
| import com.cloud.agent.api.StartupRoutingCommand; | import com.cloud.agent.api.StartupRoutingCommand; | ||||||
| @ -44,18 +42,14 @@ import com.cloud.baremetal.networkservice.BareMetalResourceBase; | |||||||
| import com.cloud.configuration.Config; | import com.cloud.configuration.Config; | ||||||
| import com.cloud.dc.ClusterVO; | import com.cloud.dc.ClusterVO; | ||||||
| import com.cloud.dc.DataCenterVO; | import com.cloud.dc.DataCenterVO; | ||||||
| import com.cloud.dc.dao.ClusterDao; |  | ||||||
| import com.cloud.dc.dao.DataCenterDao; |  | ||||||
| import com.cloud.exception.DiscoveryException; | import com.cloud.exception.DiscoveryException; | ||||||
| import com.cloud.host.Host; | import com.cloud.host.Host; | ||||||
| import com.cloud.host.HostVO; | import com.cloud.host.HostVO; | ||||||
| import com.cloud.host.dao.HostDao; |  | ||||||
| import com.cloud.hypervisor.Hypervisor; | import com.cloud.hypervisor.Hypervisor; | ||||||
| import com.cloud.hypervisor.Hypervisor.HypervisorType; | import com.cloud.hypervisor.Hypervisor.HypervisorType; | ||||||
| import com.cloud.network.Network; | import com.cloud.network.Network; | ||||||
| import com.cloud.resource.Discoverer; | import com.cloud.resource.Discoverer; | ||||||
| import com.cloud.resource.DiscovererBase; | import com.cloud.resource.DiscovererBase; | ||||||
| import com.cloud.resource.ResourceManager; |  | ||||||
| import com.cloud.resource.ResourceStateAdapter; | import com.cloud.resource.ResourceStateAdapter; | ||||||
| import com.cloud.resource.ServerResource; | import com.cloud.resource.ServerResource; | ||||||
| import com.cloud.resource.UnableDeleteHostException; | import com.cloud.resource.UnableDeleteHostException; | ||||||
| @ -71,17 +65,7 @@ import com.cloud.vm.dao.VMInstanceDao; | |||||||
| public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { | public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { | ||||||
|     protected static final Logger s_logger = Logger.getLogger(BareMetalDiscoverer.class); |     protected static final Logger s_logger = Logger.getLogger(BareMetalDiscoverer.class); | ||||||
|     @Inject |     @Inject | ||||||
|     protected ClusterDao _clusterDao; |  | ||||||
|     @Inject |  | ||||||
|     protected HostDao _hostDao; |  | ||||||
|     @Inject |  | ||||||
|     protected DataCenterDao _dcDao; |  | ||||||
|     @Inject |  | ||||||
|     protected VMInstanceDao _vmDao = null; |     protected VMInstanceDao _vmDao = null; | ||||||
|     @Inject |  | ||||||
|     protected ResourceManager _resourceMgr; |  | ||||||
|     @Inject |  | ||||||
|     protected ConfigurationDao _configDao; |  | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { |     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { | ||||||
|  | |||||||
| @ -43,12 +43,9 @@ import com.cloud.agent.api.SetupCommand; | |||||||
| import com.cloud.agent.api.StartupCommand; | import com.cloud.agent.api.StartupCommand; | ||||||
| import com.cloud.agent.api.StartupRoutingCommand; | import com.cloud.agent.api.StartupRoutingCommand; | ||||||
| import com.cloud.alert.AlertManager; | import com.cloud.alert.AlertManager; | ||||||
| import com.cloud.dc.ClusterDetailsDao; |  | ||||||
| import com.cloud.dc.ClusterVO; | import com.cloud.dc.ClusterVO; | ||||||
| import com.cloud.dc.DataCenterVO; | import com.cloud.dc.DataCenterVO; | ||||||
| import com.cloud.dc.HostPodVO; | import com.cloud.dc.HostPodVO; | ||||||
| import com.cloud.dc.dao.ClusterDao; |  | ||||||
| import com.cloud.dc.dao.DataCenterDao; |  | ||||||
| import com.cloud.dc.dao.HostPodDao; | import com.cloud.dc.dao.HostPodDao; | ||||||
| import com.cloud.exception.AgentUnavailableException; | import com.cloud.exception.AgentUnavailableException; | ||||||
| import com.cloud.exception.ConnectionException; | import com.cloud.exception.ConnectionException; | ||||||
| @ -58,13 +55,11 @@ import com.cloud.host.Host; | |||||||
| import com.cloud.host.HostEnvironment; | import com.cloud.host.HostEnvironment; | ||||||
| import com.cloud.host.HostVO; | import com.cloud.host.HostVO; | ||||||
| import com.cloud.host.Status; | import com.cloud.host.Status; | ||||||
| import com.cloud.host.dao.HostDao; |  | ||||||
| import com.cloud.hypervisor.Hypervisor; | import com.cloud.hypervisor.Hypervisor; | ||||||
| import com.cloud.hypervisor.Hypervisor.HypervisorType; | import com.cloud.hypervisor.Hypervisor.HypervisorType; | ||||||
| import com.cloud.hypervisor.hyperv.resource.HypervDirectConnectResource; | import com.cloud.hypervisor.hyperv.resource.HypervDirectConnectResource; | ||||||
| import com.cloud.resource.Discoverer; | import com.cloud.resource.Discoverer; | ||||||
| import com.cloud.resource.DiscovererBase; | import com.cloud.resource.DiscovererBase; | ||||||
| import com.cloud.resource.ResourceManager; |  | ||||||
| import com.cloud.resource.ResourceStateAdapter; | import com.cloud.resource.ResourceStateAdapter; | ||||||
| import com.cloud.resource.ServerResource; | import com.cloud.resource.ServerResource; | ||||||
| import com.cloud.resource.UnableDeleteHostException; | import com.cloud.resource.UnableDeleteHostException; | ||||||
| @ -78,27 +73,14 @@ import com.cloud.storage.StorageLayer; | |||||||
| @Local(value = Discoverer.class) | @Local(value = Discoverer.class) | ||||||
| public class HypervServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter { | public class HypervServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter { | ||||||
|     private static final Logger s_logger = Logger.getLogger(HypervServerDiscoverer.class); |     private static final Logger s_logger = Logger.getLogger(HypervServerDiscoverer.class); | ||||||
| 
 |  | ||||||
|     private String _instance; |  | ||||||
|     private String _mountParent; |  | ||||||
|     private int _timeout; |  | ||||||
|     Random _rand = new Random(System.currentTimeMillis()); |     Random _rand = new Random(System.currentTimeMillis()); | ||||||
| 
 | 
 | ||||||
|     Map<String, String> _storageMounts = new HashMap<String, String>(); |     Map<String, String> _storageMounts = new HashMap<String, String>(); | ||||||
|     StorageLayer _storage; |     StorageLayer _storage; | ||||||
| 
 | 
 | ||||||
|     @Inject |  | ||||||
|     private HostDao _hostDao = null; |  | ||||||
|     @Inject |  | ||||||
|     private ClusterDao _clusterDao; |  | ||||||
|     @Inject |  | ||||||
|     private ClusterDetailsDao _clusterDetailsDao; |  | ||||||
|     @Inject |  | ||||||
|     private ResourceManager _resourceMgr; |  | ||||||
|     @Inject |     @Inject | ||||||
|     private HostPodDao _podDao; |     private HostPodDao _podDao; | ||||||
|     @Inject | 
 | ||||||
|     private DataCenterDao _dcDao; |  | ||||||
| 
 | 
 | ||||||
|     // TODO: AgentManager and AlertManager not being used to transmit info, |     // TODO: AgentManager and AlertManager not being used to transmit info, | ||||||
|     // may want to reconsider. |     // may want to reconsider. | ||||||
|  | |||||||
| @ -449,7 +449,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv | |||||||
|     protected int _stopTimeout; |     protected int _stopTimeout; | ||||||
| 
 | 
 | ||||||
|     // TODO vmsync { |     // TODO vmsync { | ||||||
|     protected static HashMap<DomainInfo.DomainState, State> s_statesTable; |     protected static final HashMap<DomainInfo.DomainState, State> s_statesTable; | ||||||
|     static { |     static { | ||||||
|         s_statesTable = new HashMap<DomainInfo.DomainState, State>(); |         s_statesTable = new HashMap<DomainInfo.DomainState, State>(); | ||||||
|         s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, State.Stopped); |         s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, State.Stopped); | ||||||
| @ -461,7 +461,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv | |||||||
|     } |     } | ||||||
|     // TODO vmsync } |     // TODO vmsync } | ||||||
| 
 | 
 | ||||||
|     protected static HashMap<DomainInfo.DomainState, PowerState> s_powerStatesTable; |     protected static final HashMap<DomainInfo.DomainState, PowerState> s_powerStatesTable; | ||||||
|     static { |     static { | ||||||
|         s_powerStatesTable = new HashMap<DomainInfo.DomainState, PowerState>(); |         s_powerStatesTable = new HashMap<DomainInfo.DomainState, PowerState>(); | ||||||
|         s_powerStatesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, PowerState.PowerOff); |         s_powerStatesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, PowerState.PowerOff); | ||||||
|  | |||||||
| @ -30,8 +30,7 @@ import org.xml.sax.helpers.DefaultHandler; | |||||||
| 
 | 
 | ||||||
| public class LibvirtXMLParser extends DefaultHandler { | public class LibvirtXMLParser extends DefaultHandler { | ||||||
|     private static final Logger s_logger = Logger.getLogger(LibvirtXMLParser.class); |     private static final Logger s_logger = Logger.getLogger(LibvirtXMLParser.class); | ||||||
|     protected static SAXParserFactory s_spf; |     protected static final SAXParserFactory s_spf; | ||||||
| 
 |  | ||||||
|     static { |     static { | ||||||
|         s_spf = SAXParserFactory.newInstance(); |         s_spf = SAXParserFactory.newInstance(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -25,12 +25,11 @@ import javax.ejb.Local; | |||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| import javax.naming.ConfigurationException; | import javax.naming.ConfigurationException; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.storage.datastore.db.ImageStoreDao; | import org.apache.cloudstack.storage.datastore.db.ImageStoreDao; | ||||||
| import org.apache.cloudstack.storage.datastore.db.ImageStoreVO; | import org.apache.cloudstack.storage.datastore.db.ImageStoreVO; | ||||||
| import org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer; | import org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer; | ||||||
| import org.apache.cloudstack.storage.resource.SecondaryStorageResource; | import org.apache.cloudstack.storage.resource.SecondaryStorageResource; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.agent.AgentManager; | import com.cloud.agent.AgentManager; | ||||||
| import com.cloud.agent.Listener; | import com.cloud.agent.Listener; | ||||||
| @ -55,8 +54,6 @@ public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer imp | |||||||
|     @Inject |     @Inject | ||||||
|     AgentManager _agentMgr; |     AgentManager _agentMgr; | ||||||
|     @Inject |     @Inject | ||||||
|     ResourceManager _resourceMgr; |  | ||||||
|     @Inject |  | ||||||
|     SnapshotDao _snapshotDao; |     SnapshotDao _snapshotDao; | ||||||
|     @Inject |     @Inject | ||||||
|     ImageStoreDao imageStoreDao; |     ImageStoreDao imageStoreDao; | ||||||
|  | |||||||
| @ -27,12 +27,8 @@ import javax.ejb.Local; | |||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| import javax.naming.ConfigurationException; | import javax.naming.ConfigurationException; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import com.vmware.vim25.ClusterDasConfigInfo; |  | ||||||
| import com.vmware.vim25.ManagedObjectReference; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.api.ApiConstants; | import org.apache.cloudstack.api.ApiConstants; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.agent.api.StartupCommand; | import com.cloud.agent.api.StartupCommand; | ||||||
| import com.cloud.agent.api.StartupRoutingCommand; | import com.cloud.agent.api.StartupRoutingCommand; | ||||||
| @ -42,7 +38,6 @@ import com.cloud.dc.ClusterDetailsDao; | |||||||
| import com.cloud.dc.ClusterVO; | import com.cloud.dc.ClusterVO; | ||||||
| import com.cloud.dc.DataCenter.NetworkType; | import com.cloud.dc.DataCenter.NetworkType; | ||||||
| import com.cloud.dc.DataCenterVO; | import com.cloud.dc.DataCenterVO; | ||||||
| import com.cloud.dc.dao.DataCenterDao; |  | ||||||
| import com.cloud.exception.DiscoveredWithErrorException; | import com.cloud.exception.DiscoveredWithErrorException; | ||||||
| import com.cloud.exception.DiscoveryException; | import com.cloud.exception.DiscoveryException; | ||||||
| import com.cloud.exception.InvalidParameterValueException; | import com.cloud.exception.InvalidParameterValueException; | ||||||
| @ -69,7 +64,6 @@ import com.cloud.network.element.CiscoNexusVSMElement; | |||||||
| import com.cloud.network.element.NetworkElement; | import com.cloud.network.element.NetworkElement; | ||||||
| import com.cloud.resource.Discoverer; | import com.cloud.resource.Discoverer; | ||||||
| import com.cloud.resource.DiscovererBase; | import com.cloud.resource.DiscovererBase; | ||||||
| import com.cloud.resource.ResourceManager; |  | ||||||
| import com.cloud.resource.ResourceStateAdapter; | import com.cloud.resource.ResourceStateAdapter; | ||||||
| import com.cloud.resource.ServerResource; | import com.cloud.resource.ServerResource; | ||||||
| import com.cloud.resource.UnableDeleteHostException; | import com.cloud.resource.UnableDeleteHostException; | ||||||
| @ -80,6 +74,8 @@ import com.cloud.storage.dao.VMTemplateDao; | |||||||
| import com.cloud.user.Account; | import com.cloud.user.Account; | ||||||
| import com.cloud.utils.Pair; | import com.cloud.utils.Pair; | ||||||
| import com.cloud.utils.UriUtils; | import com.cloud.utils.UriUtils; | ||||||
|  | import com.vmware.vim25.ClusterDasConfigInfo; | ||||||
|  | import com.vmware.vim25.ManagedObjectReference; | ||||||
| 
 | 
 | ||||||
| @Local(value = Discoverer.class) | @Local(value = Discoverer.class) | ||||||
| public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { | public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { | ||||||
| @ -94,13 +90,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer | |||||||
|     @Inject |     @Inject | ||||||
|     ClusterDetailsDao _clusterDetailsDao; |     ClusterDetailsDao _clusterDetailsDao; | ||||||
|     @Inject |     @Inject | ||||||
|     DataCenterDao _dcDao; |  | ||||||
|     @Inject |  | ||||||
|     ResourceManager _resourceMgr; |  | ||||||
|     @Inject |  | ||||||
|     CiscoNexusVSMDeviceDao _nexusDao; |     CiscoNexusVSMDeviceDao _nexusDao; | ||||||
|     CiscoNexusVSMElement _nexusElement; |  | ||||||
|     List<NetworkElement> networkElements; |  | ||||||
|     @Inject |     @Inject | ||||||
|     NetworkModel _netmgr; |     NetworkModel _netmgr; | ||||||
|     @Inject |     @Inject | ||||||
| @ -113,6 +103,8 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer | |||||||
|     protected Map<String, String> _urlParams; |     protected Map<String, String> _urlParams; | ||||||
|     protected boolean useDVS = false; |     protected boolean useDVS = false; | ||||||
|     protected boolean nexusDVS = false; |     protected boolean nexusDVS = false; | ||||||
|  |     CiscoNexusVSMElement _nexusElement; | ||||||
|  |     List<NetworkElement> networkElements; | ||||||
| 
 | 
 | ||||||
|     public VmwareServerDiscoverer() { |     public VmwareServerDiscoverer() { | ||||||
|         s_logger.info("VmwareServerDiscoverer is constructed"); |         s_logger.info("VmwareServerDiscoverer is constructed"); | ||||||
|  | |||||||
| @ -34,13 +34,6 @@ import javax.persistence.EntityExistsException; | |||||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||||
| import org.apache.xmlrpc.XmlRpcException; | import org.apache.xmlrpc.XmlRpcException; | ||||||
| 
 | 
 | ||||||
| import com.xensource.xenapi.Connection; |  | ||||||
| import com.xensource.xenapi.Host; |  | ||||||
| import com.xensource.xenapi.Pool; |  | ||||||
| import com.xensource.xenapi.Session; |  | ||||||
| import com.xensource.xenapi.Types.SessionAuthenticationFailed; |  | ||||||
| import com.xensource.xenapi.Types.XenAPIException; |  | ||||||
| 
 |  | ||||||
| import com.cloud.agent.AgentManager; | import com.cloud.agent.AgentManager; | ||||||
| import com.cloud.agent.Listener; | import com.cloud.agent.Listener; | ||||||
| import com.cloud.agent.api.AgentControlAnswer; | import com.cloud.agent.api.AgentControlAnswer; | ||||||
| @ -57,7 +50,6 @@ import com.cloud.configuration.Config; | |||||||
| import com.cloud.dc.ClusterVO; | import com.cloud.dc.ClusterVO; | ||||||
| import com.cloud.dc.DataCenterVO; | import com.cloud.dc.DataCenterVO; | ||||||
| import com.cloud.dc.HostPodVO; | import com.cloud.dc.HostPodVO; | ||||||
| import com.cloud.dc.dao.DataCenterDao; |  | ||||||
| import com.cloud.dc.dao.HostPodDao; | import com.cloud.dc.dao.HostPodDao; | ||||||
| import com.cloud.exception.AgentUnavailableException; | import com.cloud.exception.AgentUnavailableException; | ||||||
| import com.cloud.exception.ConnectionException; | import com.cloud.exception.ConnectionException; | ||||||
| @ -85,7 +77,6 @@ import com.cloud.hypervisor.xen.resource.XenServerConnectionPool; | |||||||
| import com.cloud.hypervisor.xen.resource.Xenserver625Resource; | import com.cloud.hypervisor.xen.resource.Xenserver625Resource; | ||||||
| import com.cloud.resource.Discoverer; | import com.cloud.resource.Discoverer; | ||||||
| import com.cloud.resource.DiscovererBase; | import com.cloud.resource.DiscovererBase; | ||||||
| import com.cloud.resource.ResourceManager; |  | ||||||
| import com.cloud.resource.ResourceStateAdapter; | import com.cloud.resource.ResourceStateAdapter; | ||||||
| import com.cloud.resource.ServerResource; | import com.cloud.resource.ServerResource; | ||||||
| import com.cloud.resource.UnableDeleteHostException; | import com.cloud.resource.UnableDeleteHostException; | ||||||
| @ -99,6 +90,12 @@ import com.cloud.utils.db.QueryBuilder; | |||||||
| import com.cloud.utils.db.SearchCriteria.Op; | import com.cloud.utils.db.SearchCriteria.Op; | ||||||
| import com.cloud.utils.exception.CloudRuntimeException; | import com.cloud.utils.exception.CloudRuntimeException; | ||||||
| import com.cloud.utils.exception.HypervisorVersionChangedException; | import com.cloud.utils.exception.HypervisorVersionChangedException; | ||||||
|  | import com.xensource.xenapi.Connection; | ||||||
|  | import com.xensource.xenapi.Host; | ||||||
|  | import com.xensource.xenapi.Pool; | ||||||
|  | import com.xensource.xenapi.Session; | ||||||
|  | import com.xensource.xenapi.Types.SessionAuthenticationFailed; | ||||||
|  | import com.xensource.xenapi.Types.XenAPIException; | ||||||
| 
 | 
 | ||||||
| @Local(value = Discoverer.class) | @Local(value = Discoverer.class) | ||||||
| public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter { | public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter { | ||||||
| @ -122,11 +119,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L | |||||||
|     @Inject |     @Inject | ||||||
|     VMTemplateDao _tmpltDao; |     VMTemplateDao _tmpltDao; | ||||||
|     @Inject |     @Inject | ||||||
|     ResourceManager _resourceMgr; |  | ||||||
|     @Inject |  | ||||||
|     HostPodDao _podDao; |     HostPodDao _podDao; | ||||||
|     @Inject |  | ||||||
|     DataCenterDao _dcDao; |  | ||||||
| 
 | 
 | ||||||
|     protected XcpServerDiscoverer() { |     protected XcpServerDiscoverer() { | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ | |||||||
| // under the License. | // under the License. | ||||||
| package com.cloud.hypervisor.xen.resource; | package com.cloud.hypervisor.xen.resource; | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| import java.io.BufferedReader; | import java.io.BufferedReader; | ||||||
| import java.io.File; | import java.io.File; | ||||||
| import java.io.FileInputStream; | import java.io.FileInputStream; | ||||||
| @ -329,7 +330,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     protected static HashMap<Types.VmPowerState, PowerState> s_powerStatesTable; |     protected static final HashMap<Types.VmPowerState, PowerState> s_powerStatesTable; | ||||||
|     static { |     static { | ||||||
|         s_powerStatesTable = new HashMap<Types.VmPowerState, PowerState>(); |         s_powerStatesTable = new HashMap<Types.VmPowerState, PowerState>(); | ||||||
|         s_powerStatesTable.put(Types.VmPowerState.HALTED, PowerState.PowerOff); |         s_powerStatesTable.put(Types.VmPowerState.HALTED, PowerState.PowerOff); | ||||||
| @ -340,7 +341,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // TODO vmsync { |     // TODO vmsync { | ||||||
|     protected static HashMap<Types.VmPowerState, State> s_statesTable; |     protected static final HashMap<Types.VmPowerState, State> s_statesTable; | ||||||
|     static { |     static { | ||||||
|         s_statesTable = new HashMap<Types.VmPowerState, State>(); |         s_statesTable = new HashMap<Types.VmPowerState, State>(); | ||||||
|         s_statesTable.put(Types.VmPowerState.HALTED, State.Stopped); |         s_statesTable.put(Types.VmPowerState.HALTED, State.Stopped); | ||||||
|  | |||||||
| @ -72,7 +72,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
|     // Only change is to make broadcast domain type Mido |     // Only change is to make broadcast domain type Mido | ||||||
|     @Override |     @Override | ||||||
|     public Network design(NetworkOffering offering, DeploymentPlan plan, Network network, Account owner) { |     public Network design(NetworkOffering offering, DeploymentPlan plan, Network network, Account owner) { | ||||||
|         s_logger.debug("design called with network: " + network.toString()); |         s_logger.debug("design called with network: " + network); | ||||||
|         if (!canHandle(offering)) { |         if (!canHandle(offering)) { | ||||||
|             return null; |             return null; | ||||||
|         } |         } | ||||||
| @ -96,7 +96,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
|         InsufficientAddressCapacityException, ConcurrentOperationException { |         InsufficientAddressCapacityException, ConcurrentOperationException { | ||||||
|         if (nic.getIp4Address() == null) { |         if (nic.getIp4Address() == null) { | ||||||
|             PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), Vlan.VlanType.VirtualNetwork, null, null, false); |             PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), Vlan.VlanType.VirtualNetwork, null, null, false); | ||||||
|             nic.setIp4Address(ip.getAddress().toString()); |             nic.setIp4Address(ip.getAddress().addr()); | ||||||
| 
 | 
 | ||||||
|             nic.setGateway(ip.getGateway()); |             nic.setGateway(ip.getGateway()); | ||||||
| 
 | 
 | ||||||
| @ -121,7 +121,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public void updateNicProfile(NicProfile profile, Network network) { |     public void updateNicProfile(NicProfile profile, Network network) { | ||||||
|         s_logger.debug("updateNicProfile called with network: " + network.toString() + " profile: " + profile.toString()); |         s_logger.debug("updateNicProfile called with network: " + network + " profile: " + profile); | ||||||
| 
 | 
 | ||||||
|         DataCenter dc = _dcDao.findById(network.getDataCenterId()); |         DataCenter dc = _dcDao.findById(network.getDataCenterId()); | ||||||
|         if (profile != null) { |         if (profile != null) { | ||||||
| @ -134,16 +134,15 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
|     public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, |     public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, | ||||||
|         InsufficientAddressCapacityException, ConcurrentOperationException { |         InsufficientAddressCapacityException, ConcurrentOperationException { | ||||||
| 
 | 
 | ||||||
|         s_logger.debug("allocate called with network: " + network.toString() + " nic: " + nic.toString() + " vm: " + vm.toString()); |  | ||||||
|         DataCenter dc = _dcDao.findById(network.getDataCenterId()); |  | ||||||
| 
 |  | ||||||
|         if (nic != null && nic.getRequestedIpv4() != null) { |  | ||||||
|             throw new CloudRuntimeException("Does not support custom ip allocation at this time: " + nic); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         if (nic == null) { |         if (nic == null) { | ||||||
|             nic = new NicProfile(Nic.ReservationStrategy.Create, null, null, null, null); |             nic = new NicProfile(Nic.ReservationStrategy.Create, null, null, null, null); | ||||||
|         } |         } | ||||||
|  |         s_logger.debug("allocate called with network: " + network + " nic: " + nic + " vm: " + vm); | ||||||
|  |         DataCenter dc = _dcDao.findById(network.getDataCenterId()); | ||||||
|  | 
 | ||||||
|  |         if (nic.getRequestedIpv4() != null) { | ||||||
|  |             throw new CloudRuntimeException("Does not support custom ip allocation at this time: " + nic); | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         getIp(nic, dc, vm, network); |         getIp(nic, dc, vm, network); | ||||||
| 
 | 
 | ||||||
| @ -163,7 +162,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
|     @Override |     @Override | ||||||
|     public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) |     public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) | ||||||
|         throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { |         throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException { | ||||||
|         s_logger.debug("reserve called with network: " + network.toString() + " nic: " + nic.toString() + " vm: " + vm.toString()); |         s_logger.debug("reserve called with network: " + network + " nic: " + nic + " vm: " + vm); | ||||||
|         if (nic.getIp4Address() == null) { |         if (nic.getIp4Address() == null) { | ||||||
|             getIp(nic, dest.getDataCenter(), vm, network); |             getIp(nic, dest.getDataCenter(), vm, network); | ||||||
|         } |         } | ||||||
| @ -171,14 +170,14 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { |     public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { | ||||||
|         s_logger.debug("release called with nic: " + nic.toString() + " vm: " + vm.toString()); |         s_logger.debug("release called with nic: " + nic + " vm: " + vm); | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public Network implement(Network network, NetworkOffering offering, DeployDestination destination, ReservationContext context) |     public Network implement(Network network, NetworkOffering offering, DeployDestination destination, ReservationContext context) | ||||||
|         throws InsufficientVirtualNetworkCapcityException { |         throws InsufficientVirtualNetworkCapcityException { | ||||||
|         s_logger.debug("implement called with network: " + network.toString()); |         s_logger.debug("implement called with network: " + network); | ||||||
|         long dcId = destination.getDataCenter().getId(); |         long dcId = destination.getDataCenter().getId(); | ||||||
| 
 | 
 | ||||||
|         //get physical network id |         //get physical network id | ||||||
| @ -205,7 +204,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
|     @Override |     @Override | ||||||
|     @DB |     @DB | ||||||
|     public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { |     public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { | ||||||
|         s_logger.debug("deallocate called with network: " + network.toString() + " nic: " + nic.toString() + " vm: " + vm.toString()); |         s_logger.debug("deallocate called with network: " + network + " nic: " + nic + " vm: " + vm); | ||||||
|         if (s_logger.isDebugEnabled()) { |         if (s_logger.isDebugEnabled()) { | ||||||
|             s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address()); |             s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address()); | ||||||
|         } |         } | ||||||
| @ -229,12 +228,12 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru { | |||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public void shutdown(NetworkProfile network, NetworkOffering offering) { |     public void shutdown(NetworkProfile network, NetworkOffering offering) { | ||||||
|         s_logger.debug("shutdown called with network: " + network.toString()); |         s_logger.debug("shutdown called with network: " + network); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public boolean trash(Network network, NetworkOffering offering) { |     public boolean trash(Network network, NetworkOffering offering) { | ||||||
|         s_logger.debug("trash called with network: " + network.toString()); |         s_logger.debug("trash called with network: " + network); | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -51,7 +51,6 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; | |||||||
| import com.cloud.network.PhysicalNetworkSetupInfo; | import com.cloud.network.PhysicalNetworkSetupInfo; | ||||||
| import com.cloud.resource.Discoverer; | import com.cloud.resource.Discoverer; | ||||||
| import com.cloud.resource.DiscovererBase; | import com.cloud.resource.DiscovererBase; | ||||||
| import com.cloud.resource.ResourceManager; |  | ||||||
| import com.cloud.resource.ResourceStateAdapter; | import com.cloud.resource.ResourceStateAdapter; | ||||||
| import com.cloud.resource.ServerResource; | import com.cloud.resource.ServerResource; | ||||||
| import com.cloud.resource.UnableDeleteHostException; | import com.cloud.resource.UnableDeleteHostException; | ||||||
| @ -65,8 +64,6 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements | |||||||
|     private String _kvmPublicNic; |     private String _kvmPublicNic; | ||||||
|     private String _kvmGuestNic; |     private String _kvmGuestNic; | ||||||
|     @Inject |     @Inject | ||||||
|     ResourceManager _resourceMgr; |  | ||||||
|     @Inject |  | ||||||
|     AgentManager _agentMgr; |     AgentManager _agentMgr; | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|  | |||||||
| @ -25,13 +25,13 @@ import java.util.Map; | |||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| import javax.naming.ConfigurationException; | import javax.naming.ConfigurationException; | ||||||
| 
 | 
 | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.framework.config.dao.ConfigurationDao; | import org.apache.cloudstack.framework.config.dao.ConfigurationDao; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.configuration.Config; | import com.cloud.configuration.Config; | ||||||
| import com.cloud.dc.ClusterVO; | import com.cloud.dc.ClusterVO; | ||||||
| import com.cloud.dc.dao.ClusterDao; | import com.cloud.dc.dao.ClusterDao; | ||||||
|  | import com.cloud.dc.dao.DataCenterDao; | ||||||
| import com.cloud.host.HostVO; | import com.cloud.host.HostVO; | ||||||
| import com.cloud.host.dao.HostDao; | import com.cloud.host.dao.HostDao; | ||||||
| import com.cloud.network.NetworkModel; | import com.cloud.network.NetworkModel; | ||||||
| @ -49,6 +49,10 @@ public abstract class DiscovererBase extends AdapterBase implements Discoverer { | |||||||
|     protected NetworkModel _networkMgr; |     protected NetworkModel _networkMgr; | ||||||
|     @Inject |     @Inject | ||||||
|     protected HostDao _hostDao; |     protected HostDao _hostDao; | ||||||
|  |     @Inject | ||||||
|  |     protected ResourceManager _resourceMgr; | ||||||
|  |     @Inject | ||||||
|  |     protected DataCenterDao _dcDao; | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { |     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user