rhtyd commented on a change in pull request #2281: CLOUDSTACK-10102: New 
network type (L2)
URL: https://github.com/apache/cloudstack/pull/2281#discussion_r144247590
 
 

 ##########
 File path: engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
 ##########
 @@ -301,13 +306,16 @@ public void updateVM(long id, String displayName, 
boolean enable, Long osTypeId,
 
     @Override
     public List<UserVmVO> listByNetworkIdAndStates(long networkId, State... 
states) {
-        if (UserVmSearch == null) {
+        NetworkVO network = networkDao.findById(networkId);
+        if (UserVmSearch == null && network != 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().getIPv4Address(), SearchCriteria.Op.NNULL);
-            nicSearch.or("ip6Address", nicSearch.entity().getIPv6Address(), 
SearchCriteria.Op.NNULL);
-            nicSearch.cp();
+            if (! network.getGuestType().equals(Network.GuestType.L2)) {
 
 Review comment:
   Space after `!` may be removed
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to