Skip to content

Commit 79b1584

Browse files
committed
cleaning up a few more whitespace issues
1 parent 49ebeb9 commit 79b1584

12 files changed

Lines changed: 213 additions & 213 deletions

‎agent/src/com/cloud/agent/mockvm/MockVm.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/**
22
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
3-
*
3+
*
44
* This software is licensed under the GNU General Public License v3 or later.
5-
*
5+
*
66
* It is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
88
* the Free Software Foundation, either version 3 of the License, or any later version.
99
* This program is distributed in the hope that it will be useful,
1010
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
* GNU General Public License for more details.
13-
*
13+
*
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/>.
16-
*
16+
*
1717
*/
1818

1919
package com.cloud.agent.mockvm;

‎agent/src/com/cloud/agent/mockvm/MockVmMgr.java‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/**
22
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
3-
*
3+
*
44
* This software is licensed under the GNU General Public License v3 or later.
5-
*
5+
*
66
* It is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
88
* the Free Software Foundation, either version 3 of the License, or any later version.
99
* This program is distributed in the hope that it will be useful,
1010
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
* GNU General Public License for more details.
13-
*
13+
*
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/>.
16-
*
16+
*
1717
*/
1818

1919
package com.cloud.agent.mockvm;
@@ -37,7 +37,7 @@ public class MockVmMgr implements VmMgr {
3737

3838
private final Map<String, MockVm> vms = new HashMap<String, MockVm>();
3939
private long vncPortMap = 0;
40-
40+
4141
private Map<String, Object> _params = null;
4242

4343
public MockVmMgr() {
@@ -185,7 +185,7 @@ public double getHostCpuUtilization() {
185185

186186
@Override
187187
public int getHostCpuCount() {
188-
188+
189189
return getConfiguredProperty("cpus", 4);
190190
}
191191

@@ -255,24 +255,24 @@ public void freeVncPort(int port) {
255255
@Override
256256
public MockVm createVmFromSpec(VirtualMachineTO vmSpec) {
257257
String vmName = vmSpec.getName();
258-
long ramSize = vmSpec.getMinRam();
258+
long ramSize = vmSpec.getMinRam();
259259
int utilizationPercent = randSeed.nextInt() % 100;
260260
MockVm vm = null;
261-
261+
262262
synchronized(this) {
263263
vm = vms.get(vmName);
264264
if(vm == null) {
265265
if (ramSize > getHostFreeMemory()) {
266266
s_logger.debug("host is out of memory");
267267
throw new CloudRuntimeException("Host is out of Memory");
268268
}
269-
269+
270270
int vncPort = allocVncPort();
271271
if(vncPort < 0){
272272
s_logger.debug("Unable to allocate VNC port");
273273
throw new CloudRuntimeException("Unable to allocate vnc port");
274274
}
275-
275+
276276
vm = new MockVm(vmName, State.Running, ramSize, vmSpec.getCpus(), utilizationPercent, vncPort);
277277
vms.put(vmName, vm);
278278
}
@@ -283,33 +283,33 @@ public MockVm createVmFromSpec(VirtualMachineTO vmSpec) {
283283
@Override
284284
public void createVbd(VirtualMachineTO vmSpec, String vmName, MockVm vm) {
285285
// TODO Auto-generated method stub
286-
286+
287287
}
288288

289289
@Override
290290
public void createVif(VirtualMachineTO vmSpec, String vmName, MockVm vm) {
291291
// TODO Auto-generated method stub
292-
292+
293293
}
294294

295295
@Override
296296
public void configure(Map<String, Object> params) {
297297
_params = params;
298298
}
299-
299+
300300
protected Long getConfiguredProperty(String key, Long defaultValue) {
301301
String val = (String)_params.get(key);
302-
302+
303303
if (val != null) {
304304
Long result = Long.parseLong(val);
305305
return result;
306306
}
307307
return defaultValue;
308308
}
309-
309+
310310
protected Integer getConfiguredProperty(String key, Integer defaultValue) {
311311
String val = (String)_params.get(key);
312-
312+
313313
if (val != null) {
314314
Integer result = Integer.parseInt(val);
315315
return result;

‎agent/src/com/cloud/agent/mockvm/VmMgr.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/**
22
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
3-
*
3+
*
44
* This software is licensed under the GNU General Public License v3 or later.
5-
*
5+
*
66
* It is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
88
* the Free Software Foundation, either version 3 of the License, or any later version.
99
* This program is distributed in the hope that it will be useful,
1010
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
* GNU General Public License for more details.
13-
*
13+
*
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/>.
16-
*
16+
*
1717
*/
1818

1919
package com.cloud.agent.mockvm;
@@ -59,6 +59,6 @@ public String startVM(String vmName, String vnetId, String gateway, String dns,
5959
public void createVbd(VirtualMachineTO vmSpec, String vmName, MockVm vm);
6060

6161
public void createVif(VirtualMachineTO vmSpec, String vmName, MockVm vm);
62-
62+
6363
public void configure(Map<String, Object> params);
6464
}

‎agent/src/com/cloud/agent/resource/DummyResource.java‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/**
22
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
3-
*
3+
*
44
* This software is licensed under the GNU General Public License v3 or later.
5-
*
5+
*
66
* It is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
88
* the Free Software Foundation, either version 3 of the License, or any later version.
99
* This program is distributed in the hope that it will be useful,
1010
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
* GNU General Public License for more details.
13-
*
13+
*
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/>.
16-
*
16+
*
1717
*/
1818
package com.cloud.agent.resource;
1919

@@ -55,7 +55,7 @@ public class DummyResource implements ServerResource {
5555
@Override
5656
public void disconnected() {
5757
}
58-
58+
5959
@Override
6060
public Answer executeRequest(Command cmd) {
6161
if (cmd instanceof CheckNetworkCommand) {
@@ -76,15 +76,15 @@ public PingCommand getCurrentStatus(long id) {
7676
public Type getType() {
7777
return _type;
7878
}
79-
79+
8080
protected String getConfiguredProperty(String key, String defaultValue) {
8181
String val = (String)_params.get(key);
8282
return val==null?defaultValue:val;
8383
}
84-
84+
8585
protected Long getConfiguredProperty(String key, Long defaultValue) {
8686
String val = (String)_params.get(key);
87-
87+
8888
if (val != null) {
8989
Long result = Long.parseLong(val);
9090
return result;
@@ -105,55 +105,55 @@ protected List<Object> getHostInfo() {
105105
info.add(speed);
106106
info.add(ram);
107107
info.add(cap);
108-
info.add(dom0ram);
108+
info.add(dom0ram);
109109
return info;
110-
110+
111111
}
112-
112+
113113
protected void fillNetworkInformation(final StartupCommand cmd) {
114114

115115
cmd.setPrivateIpAddress((String)getConfiguredProperty("private.ip.address", "127.0.0.1"));
116116
cmd.setPrivateMacAddress((String)getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3"));
117117
cmd.setPrivateNetmask((String)getConfiguredProperty("private.ip.netmask", "255.255.255.0"));
118-
118+
119119
cmd.setStorageIpAddress((String)getConfiguredProperty("private.ip.address", "127.0.0.1"));
120120
cmd.setStorageMacAddress((String)getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3"));
121121
cmd.setStorageNetmask((String)getConfiguredProperty("private.ip.netmask", "255.255.255.0"));
122122
cmd.setGatewayIpAddress((String)getConfiguredProperty("gateway.ip.address", "127.0.0.1"));
123123

124124
}
125-
125+
126126
private Map<String, String> getVersionStrings() {
127127
Map<String, String> result = new HashMap<String, String>();
128128
String hostOs = (String) _params.get("Host.OS");
129129
String hostOsVer = (String) _params.get("Host.OS.Version");
130130
String hostOsKernVer = (String) _params.get("Host.OS.Kernel.Version");
131-
result.put("Host.OS", hostOs==null?"Fedora":hostOs);
132-
result.put("Host.OS.Version", hostOsVer==null?"14":hostOsVer);
131+
result.put("Host.OS", hostOs==null?"Fedora":hostOs);
132+
result.put("Host.OS.Version", hostOsVer==null?"14":hostOsVer);
133133
result.put("Host.OS.Kernel.Version", hostOsKernVer==null?"2.6.35.6-45.fc14.x86_64":hostOsKernVer);
134134
return result;
135135
}
136-
136+
137137
protected StoragePoolInfo initializeLocalStorage() {
138138
String hostIp = (String)getConfiguredProperty("private.ip.address", "127.0.0.1");
139139
String localStoragePath = (String)getConfiguredProperty("local.storage.path", "/mnt");
140140
String lh = hostIp + localStoragePath;
141141
String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString();
142-
142+
143143
String capacity = (String)getConfiguredProperty("local.storage.capacity", "1000000000");
144144
String available = (String)getConfiguredProperty("local.storage.avail", "10000000");
145145

146-
return new StoragePoolInfo(uuid, hostIp, localStoragePath,
147-
localStoragePath, StoragePoolType.Filesystem,
146+
return new StoragePoolInfo(uuid, hostIp, localStoragePath,
147+
localStoragePath, StoragePoolType.Filesystem,
148148
Long.parseLong(capacity), Long.parseLong(available));
149149

150150
}
151-
151+
152152
@Override
153153
public StartupCommand[] initialize() {
154154
Map<String, VmState> changes = null;
155155

156-
156+
157157
final List<Object> info = getHostInfo();
158158

159159
final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3), HypervisorType.KVM, RouterPrivateIpStrategy.HostLocal, changes);
@@ -173,16 +173,16 @@ public StartupCommand[] initialize() {
173173
@Override
174174
public boolean configure(String name, Map<String, Object> params) {
175175
_name = name;
176-
176+
177177
String value = (String)params.get("type");
178178
_type = Host.Type.valueOf(value);
179-
179+
180180
value = (String)params.get("negative.reply");
181181
_negative = Boolean.parseBoolean(value);
182182
setParams(params);
183183
return true;
184184
}
185-
185+
186186
public void setParams(Map<String, Object> _params) {
187187
this._params = _params;
188188
}
@@ -201,12 +201,12 @@ public boolean start() {
201201
public boolean stop() {
202202
return true;
203203
}
204-
204+
205205
@Override
206206
public IAgentControl getAgentControl() {
207207
return _agentControl;
208208
}
209-
209+
210210
@Override
211211
public void setAgentControl(IAgentControl agentControl) {
212212
_agentControl = agentControl;

0 commit comments

Comments
 (0)