Skip to content

Commit c881bae

Browse files
committed
Bug 8966 - Oracle VM (OVM) support
OCFS2 support -- use ComponentLocater to load OCFS2 manager
1 parent c6fba0f commit c881bae

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

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

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,7 @@ public interface HostDao extends GenericDao<HostVO, Long> {
165165

166166
long countRoutingHostsByDataCenter(long dcId);
167167

168-
List<HostVO> listSecondaryStorageHosts(long dataCenterId);
168+
List<HostVO> listSecondaryStorageHosts(long dataCenterId);
169+
170+
List<HostVO> listByInAllStatus(Type type, Long clusterId, Long podId, long dcId);
169171
}

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

100644100755
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,23 @@ public List<HostVO> listBy(Host.Type type, Long clusterId, Long podId, long dcId
332332
return listBy(sc);
333333
}
334334

335+
@Override
336+
public List<HostVO> listByInAllStatus(Host.Type type, Long clusterId, Long podId, long dcId) {
337+
SearchCriteria<HostVO> sc = TypePodDcStatusSearch.create();
338+
if ( type != null ) {
339+
sc.setParameters("type", type.toString());
340+
}
341+
if (clusterId != null) {
342+
sc.setParameters("cluster", clusterId);
343+
}
344+
if (podId != null ) {
345+
sc.setParameters("pod", podId);
346+
}
347+
sc.setParameters("dc", dcId);
348+
349+
return listBy(sc);
350+
}
351+
335352
@Override
336353
public List<HostVO> listBy(Long clusterId, Long podId, long dcId) {
337354
SearchCriteria<HostVO> sc = TypePodDcStatusSearch.create();

‎server/src/com/cloud/storage/listener/StoragePoolMonitor.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,27 @@
3232
import com.cloud.host.HostVO;
3333
import com.cloud.host.Status;
3434
import com.cloud.hypervisor.Hypervisor.HypervisorType;
35+
import com.cloud.server.ManagementService;
3536
import com.cloud.storage.OCFS2Manager;
3637
import com.cloud.storage.StorageManagerImpl;
3738
import com.cloud.storage.StoragePoolVO;
3839
import com.cloud.storage.Storage.StoragePoolType;
3940
import com.cloud.storage.dao.StoragePoolDao;
41+
import com.cloud.utils.component.ComponentLocator;
4042
import com.cloud.utils.component.Inject;
4143

4244
public class StoragePoolMonitor implements Listener {
4345
private static final Logger s_logger = Logger.getLogger(StoragePoolMonitor.class);
4446
private final StorageManagerImpl _storageManager;
4547
private final StoragePoolDao _poolDao;
46-
@Inject OCFS2Manager _ocfs2Mgr;
48+
OCFS2Manager _ocfs2Mgr;
4749

4850
public StoragePoolMonitor(StorageManagerImpl mgr, StoragePoolDao poolDao) {
4951
this._storageManager = mgr;
5052
this._poolDao = poolDao;
53+
54+
ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
55+
this._ocfs2Mgr = locator.getManager(OCFS2Manager.class);
5156
}
5257

5358

0 commit comments

Comments
 (0)