CLOUDSTACK-6853: Search for non-removed nics only when check if the running vm belongs to a certain network

This commit is contained in:
Alena Prokharchyk 2014-06-05 17:07:52 -07:00
parent 4b4fb1ac90
commit 2ed9b474d8
1 changed files with 1 additions and 0 deletions

View File

@ -301,6 +301,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
if (UserVmSearch == null) {
SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder();
nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
nicSearch.and().op("ip4Address", nicSearch.entity().getIp4Address(), SearchCriteria.Op.NNULL);
nicSearch.or("ip6Address", nicSearch.entity().getIp6Address(), SearchCriteria.Op.NNULL);
nicSearch.cp();