Skip to content

Commit b42ebf4

Browse files
author
Chiradeep Vittal
committed
Build fixes after first pass at merge
1 parent 303e2a7 commit b42ebf4

12 files changed

Lines changed: 658 additions & 584 deletions

File tree

‎agent/src/com/cloud/agent/resource/computing/FakeComputingResource.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ protected CreateAnswer execute(final CreateCommand cmd) {
556556

557557
VolumeTO vol = new VolumeTO(cmd.getVolumeId(),
558558
Volume.Type.ROOT,
559-
Storage.StorageResourceType.STORAGE_POOL,
560559
com.cloud.storage.Storage.StoragePoolType.LVM, cmd
561560
.getPool().getUuid(), "dummy", "/mountpoint",
562561
"dummyPath", 1000L, null);

‎agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
import com.cloud.agent.api.Command;
7979
import com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand;
8080
import com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand;
81+
import com.cloud.agent.api.CreateStoragePoolCommand;
8182
import com.cloud.agent.api.CreateVolumeFromSnapshotAnswer;
8283
import com.cloud.agent.api.CreateVolumeFromSnapshotCommand;
8384
import com.cloud.agent.api.DeleteSnapshotBackupAnswer;

‎api/src/com/cloud/api/ApiConstants.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public class ApiConstants {
221221
public static final String PING_STORAGE_SERVER_IP = "pingstorageserverip";
222222
public static final String PING_DIR = "pingdir";
223223
public static final String TFTP_DIR = "tftpdir";
224-
public static final String PZING_CIFS_USERNAME = "pingcifsusername";
224+
public static final String PING_CIFS_USERNAME = "pingcifsusername";
225225
public static final String PING_CIFS_PASSWORD = "pingcifspassword";
226226
public static final String CHECKSUM="checksum";
227227
public static final String NETWORK_DEVICE_TYPE = "networkdevicetype";

‎core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -520,35 +520,6 @@ public void cleanupPrivateNetwork(String privNwName, String privBrName){
520520
}
521521
}
522522

523-
private void deletExitingLinkLocalRoutTable(String linkLocalBr) {
524-
Script command = new Script("/bin/bash", _timeout);
525-
command.add("-c");
526-
command.add("ip route | grep " + NetUtils.getLinkLocalCIDR());
527-
OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser();
528-
String result = command.execute(parser);
529-
boolean foundLinkLocalBr = false;
530-
if (result == null && parser.getLines() != null) {
531-
String[] lines = parser.getLines().split("\\n");
532-
for (String line : lines) {
533-
String[] tokens = line.split(" ");
534-
if (!tokens[2].equalsIgnoreCase(linkLocalBr)) {
535-
Script.runSimpleBashScript("ip route del " + NetUtils.getLinkLocalCIDR());
536-
} else {
537-
foundLinkLocalBr = true;
538-
}
539-
}
540-
}
541-
if (!foundLinkLocalBr) {
542-
Script.runSimpleBashScript("ip route add " + NetUtils.getLinkLocalCIDR() + " dev " + linkLocalBr + " src " + NetUtils.getLinkLocalGateway());
543-
}
544-
}
545-
546-
public void createControlNetwork(String privBrName) {
547-
deletExitingLinkLocalRoutTable(privBrName);
548-
if (!isBridgeExists(privBrName)) {
549-
Script.runSimpleBashScript("brctl addbr " + privBrName + "; ifconfig " + privBrName + " up;", _timeout);
550-
}
551-
}
552523

553524
// protected Answer execute(final SetFirewallRuleCommand cmd) {
554525
// String args;

‎server/src/com/cloud/agent/AgentManager.java‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,6 @@ public enum OnError {
142142
int registerForHostEvents(Listener listener, boolean connections, boolean commands, boolean priority);
143143

144144

145-
/**
146-
* Register to listen for initial agent connections.
147-
* @param creator
148-
* @param priority in listening for events.
149-
* @return id to unregister if needed.
150-
*/
151-
int registerForInitialConnects(StartupCommandProcessor creator, boolean priority);
152-
153-
154145
/**
155146
* Register to listen for initial agent connections.
156147
* @param creator

‎server/src/com/cloud/configuration/Config.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ public enum Config {
238238
DefaultMaxAccountTemplates("Account Defaults", ManagementServer.class, Long.class, "max.account.templates", "20", "The default maximum number of templates that can be deployed for an account", null),
239239
DefaultMaxAccountSnapshots("Account Defaults", ManagementServer.class, Long.class, "max.account.snapshots", "20", "The default maximum number of snapshots that can be created for an account", null),
240240
DefaultMaxAccountVolumes("Account Defaults", ManagementServer.class, Long.class, "max.account.volumes", "20", "The default maximum number of volumes that can be created for an account", null);
241-
EndpointeUrl("Advanced", ManagementServer.class, String.class, "endpointe.url", "http://localhost:8080/client/api", "Endpointe Url", null);
242241

243242
private final String _category;
244243
private final Class<?> _componentClass;

‎server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,6 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
260260

261261
@Override
262262
public ConsoleProxyInfo assignProxy(final long dataCenterId, final long vmId) {
263-
if (!isConsoleProxyVmRequired(dataCenterId)) {
264-
return null;
265-
}
266-
267263
final Pair<ConsoleProxyManagerImpl, ConsoleProxyVO> result = new Pair<ConsoleProxyManagerImpl, ConsoleProxyVO>(this, null);
268264

269265
_requestHandlerScheduler.execute(new Runnable() {

‎server/src/com/cloud/host/dao/HostDao.java‎

Lines changed: 113 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
* You should have received a copy of the GNU General Public License
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*
17-
*/
18-
package com.cloud.host.dao;
19-
17+
*/
18+
package com.cloud.host.dao;
19+
2020
import java.util.Date;
2121
import java.util.List;
22-
import java.util.Map;
2322

2423
import com.cloud.host.Host;
2524
import com.cloud.host.Host.Type;
@@ -29,115 +28,119 @@
2928
import com.cloud.hypervisor.Hypervisor.HypervisorType;
3029
import com.cloud.info.RunningHostCountInfo;
3130
import com.cloud.utils.db.GenericDao;
32-
33-
/**
34-
* Data Access Object for server
35-
*
36-
*/
37-
public interface HostDao extends GenericDao<HostVO, Long> {
31+
32+
/**
33+
* Data Access Object for server
34+
*
35+
*/
36+
public interface HostDao extends GenericDao<HostVO, Long> {
3837
List<HostVO> listBy(Host.Type type, Long clusterId, Long podId, long dcId);
3938

4039
long countBy(long clusterId, Status... statuses);
41-
42-
List<HostVO> listByDataCenter(long dcId);
43-
List<HostVO> listByHostPod(long podId);
44-
List<HostVO> listByStatus(Status... status);
40+
41+
List<HostVO> listByDataCenter(long dcId);
42+
List<HostVO> listByHostPod(long podId);
43+
List<HostVO> listByStatus(Status... status);
4544
List<HostVO> listBy(Host.Type type, long dcId);
46-
List<HostVO> listAllBy(Host.Type type, long dcId);
47-
HostVO findSecondaryStorageHost(long dcId);
48-
List<HostVO> listByCluster(long clusterId);
49-
/**
50-
* Lists all secondary storage hosts, across all zones
51-
* @return list of Hosts
52-
*/
53-
List<HostVO> listSecondaryStorageHosts();
54-
55-
/**
56-
* Mark all hosts in Up or Orphaned state as disconnected. This method
57-
* is used at AgentManager startup to reset all of the connections.
58-
*
59-
* @param msId management server id.
60-
* @param statuses states of the host.
61-
*/
62-
void markHostsAsDisconnected(long msId, Status... states);
63-
64-
List<HostVO> findLostHosts(long timeout);
65-
66-
List<HostVO> findHostsLike(String hostName);
67-
68-
/**
69-
* Find hosts that are directly connected.
70-
*/
71-
List<HostVO> findDirectlyConnectedHosts();
72-
73-
List<HostVO> findDirectAgentToLoad(long msid, long lastPingSecondsAfter, Long limit);
74-
75-
/**
76-
* Mark the host as disconnected if it is in one of these states.
77-
* The management server id is set to null.
78-
* The lastPinged timestamp is set to current.
79-
* The state is set to the state passed in.
80-
* The disconnectedOn timestamp is set to current.
81-
*
82-
* @param host host to be marked
83-
* @param state state to be set to.
84-
* @param ifStates only if it is one of these states.
85-
* @return true if it's updated; false if not.
86-
*/
87-
boolean disconnect(HostVO host, Event event, long msId);
88-
89-
boolean connect(HostVO host, long msId);
90-
91-
HostVO findByStorageIpAddressInDataCenter(long dcId, String privateIpAddress);
92-
HostVO findByPrivateIpAddressInDataCenter(long dcId, String privateIpAddress);
93-
94-
/**
95-
* find a host by its mac address
96-
* @param macAddress
97-
* @return HostVO or null if not found.
98-
*/
45+
List<HostVO> listAllBy(Host.Type type, long dcId);
46+
HostVO findSecondaryStorageHost(long dcId);
47+
List<HostVO> listByCluster(long clusterId);
48+
/**
49+
* Lists all secondary storage hosts, across all zones
50+
* @return list of Hosts
51+
*/
52+
List<HostVO> listSecondaryStorageHosts();
53+
54+
/**
55+
* Mark all hosts in Up or Orphaned state as disconnected. This method
56+
* is used at AgentManager startup to reset all of the connections.
57+
*
58+
* @param msId management server id.
59+
* @param statuses states of the host.
60+
*/
61+
void markHostsAsDisconnected(long msId, Status... states);
62+
63+
List<HostVO> findLostHosts(long timeout);
64+
65+
List<HostVO> findHostsLike(String hostName);
66+
67+
/**
68+
* Find hosts that are directly connected.
69+
*/
70+
List<HostVO> findDirectlyConnectedHosts();
71+
72+
List<HostVO> findDirectAgentToLoad(long msid, long lastPingSecondsAfter, Long limit);
73+
74+
/**
75+
* Mark the host as disconnected if it is in one of these states.
76+
* The management server id is set to null.
77+
* The lastPinged timestamp is set to current.
78+
* The state is set to the state passed in.
79+
* The disconnectedOn timestamp is set to current.
80+
*
81+
* @param host host to be marked
82+
* @param state state to be set to.
83+
* @param ifStates only if it is one of these states.
84+
* @return true if it's updated; false if not.
85+
*/
86+
boolean disconnect(HostVO host, Event event, long msId);
87+
88+
boolean connect(HostVO host, long msId);
89+
90+
HostVO findByStorageIpAddressInDataCenter(long dcId, String privateIpAddress);
91+
HostVO findByPrivateIpAddressInDataCenter(long dcId, String privateIpAddress);
92+
93+
/**
94+
* find a host by its mac address
95+
* @param macAddress
96+
* @return HostVO or null if not found.
97+
*/
9998
public HostVO findByGuid(String macAddress);
100-
101-
102-
/**
103-
* find all hosts of a certain type in a data center
104-
* @param type
105-
* @param routingCapable
106-
* @param dcId
107-
* @return
108-
*/
109-
List<HostVO> listByTypeDataCenter(Host.Type type, long dcId);
110-
111-
/**
112-
* find all hosts of a particular type
113-
* @param type
114-
* @return
115-
*/
116-
List<HostVO> listByType(Type type);
117-
118-
/**
119-
* Find hosts that have not responded to a ping regardless of state
120-
* @param timeout
121-
* @param type
122-
* @return
123-
*/
124-
List<HostVO> findLostHosts2(long timeout, Type type);
125-
126-
/**
127-
* update the host and changes the status depending on the Event and
128-
* the current status. If the status changed between
129-
* @param host host object to change
130-
* @param event event that happened.
131-
* @param management server who's making this update
132-
* @return true if updated; false if not.
133-
*/
134-
boolean updateStatus(HostVO host, Event event, long msId);
135-
136-
List<RunningHostCountInfo> getRunningHostCounts(Date cutTime);
137-
138-
long getNextSequence(long hostId);
139-
99+
100+
public HostVO findByName(String name);
101+
102+
103+
/**
104+
* find all hosts of a certain type in a data center
105+
* @param type
106+
* @param routingCapable
107+
* @param dcId
108+
* @return
109+
*/
110+
List<HostVO> listByTypeDataCenter(Host.Type type, long dcId);
111+
112+
/**
113+
* find all hosts of a particular type
114+
* @param type
115+
* @return
116+
*/
117+
List<HostVO> listByType(Type type);
118+
119+
/**
120+
* Find hosts that have not responded to a ping regardless of state
121+
* @param timeout
122+
* @param type
123+
* @return
124+
*/
125+
List<HostVO> findLostHosts2(long timeout, Type type);
126+
127+
/**
128+
* update the host and changes the status depending on the Event and
129+
* the current status. If the status changed between
130+
* @param host host object to change
131+
* @param event event that happened.
132+
* @param management server who's making this update
133+
* @return true if updated; false if not.
134+
*/
135+
boolean updateStatus(HostVO host, Event event, long msId);
136+
137+
List<RunningHostCountInfo> getRunningHostCounts(Date cutTime);
138+
139+
long getNextSequence(long hostId);
140+
140141
void loadDetails(HostVO host);
142+
143+
void saveDetails(HostVO host);
141144

142145
HostVO findConsoleProxyHost(String name, Type type);
143146

@@ -159,9 +162,8 @@ public interface HostDao extends GenericDao<HostVO, Long> {
159162
void loadHostTags(HostVO host);
160163

161164
List<HostVO> listByHostTag(Host.Type type, Long clusterId, Long podId, long dcId, String hostTag);
162-
165+
163166
long countRoutingHostsByDataCenter(long dcId);
164167

165-
List<HostVO> listSecondaryStorageHosts(long dataCenterId);
166-
167-
}
168+
List<HostVO> listSecondaryStorageHosts(long dataCenterId);
169+
}

‎server/src/com/cloud/host/dao/HostDaoImpl.java‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
7878
protected final SearchBuilder<HostVO> TypeSearch;
7979
protected final SearchBuilder<HostVO> StatusSearch;
8080
protected final SearchBuilder<HostVO> NameLikeSearch;
81+
protected final SearchBuilder<HostVO> NameSearch;
8182
protected final SearchBuilder<HostVO> SequenceSearch;
8283
protected final SearchBuilder<HostVO> DirectlyConnectedSearch;
8384
protected final SearchBuilder<HostVO> UnmanagedDirectConnectSearch;
@@ -183,6 +184,10 @@ public HostDaoImpl() {
183184
StatusSearch.and("status", StatusSearch.entity().getStatus(), SearchCriteria.Op.IN);
184185
StatusSearch.done();
185186

187+
NameSearch = createSearchBuilder();
188+
NameSearch.and("name", NameSearch.entity().getName(), SearchCriteria.Op.EQ);
189+
NameSearch.done();
190+
186191
NameLikeSearch = createSearchBuilder();
187192
NameLikeSearch.and("name", NameLikeSearch.entity().getName(), SearchCriteria.Op.LIKE);
188193
NameLikeSearch.done();
@@ -525,6 +530,12 @@ public HostVO findByGuid(String guid) {
525530
return findOneBy(sc);
526531
}
527532

533+
@Override
534+
public HostVO findByName(String name) {
535+
SearchCriteria<HostVO> sc = NameSearch.create("name", name);
536+
return findOneBy(sc);
537+
}
538+
528539
@Override
529540
public List<HostVO> findLostHosts(long timeout) {
530541
SearchCriteria<HostVO> sc = LastPingedSearch.create();
@@ -598,7 +609,7 @@ public List<HostVO> listByType(Type type) {
598609
return listBy(sc);
599610
}
600611

601-
protected void saveDetails(HostVO host) {
612+
public void saveDetails(HostVO host) {
602613
Map<String, String> details = host.getDetails();
603614
if (details == null) {
604615
return;

‎server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424

2525
import org.apache.log4j.Logger;
2626

27+
import com.cloud.configuration.ZoneConfig;
2728
import com.cloud.dc.DataCenter;
2829
import com.cloud.dc.DataCenter.NetworkType;
30+
import com.cloud.dc.DataCenterVO;
2931
import com.cloud.dc.Pod;
3032
import com.cloud.dc.Vlan;
3133
import com.cloud.dc.Vlan.VlanType;

0 commit comments

Comments
 (0)