From 44607a8960e72bf4419f32fe322a53ef769c13db Mon Sep 17 00:00:00 2001 From: alena Date: Tue, 8 Feb 2011 09:42:13 -0800 Subject: [PATCH] bug 8473: fixed NPE in listUserVms - do "includingRemoved" when search for vm's host. status 9473: resolved fixed --- api/src/com/cloud/api/commands/DeployVMCmd.java | 2 +- server/src/com/cloud/api/ApiDBUtils.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/src/com/cloud/api/commands/DeployVMCmd.java b/api/src/com/cloud/api/commands/DeployVMCmd.java index 7487e78a6f3..7cfa8ddff85 100644 --- a/api/src/com/cloud/api/commands/DeployVMCmd.java +++ b/api/src/com/cloud/api/commands/DeployVMCmd.java @@ -71,7 +71,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor on which to deploy the virtual machine") private String hypervisor; - @Parameter(name=ApiConstants.SECURITY_GROUP_ID_LIST, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from service offering with Direct Attach Network support") + @Parameter(name=ApiConstants.SECURITY_GROUP_ID_LIST, type=CommandType.LIST, collectionType=CommandType.LONG, description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from service offering with Direct Attach Network support") private List securityGroupIdList; @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine") diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index 2fee99cf754..ac8a97f07b9 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -326,7 +326,7 @@ public class ApiDBUtils { } public static DomainVO findDomainById(Long domainId) { - return _domainDao.findById(domainId); + return _domainDao.findByIdIncludingRemoved(domainId); } public static DomainVO findDomainByIdIncludingRemoved(Long domainId) { @@ -334,15 +334,15 @@ public class ApiDBUtils { } public static DomainRouterVO findDomainRouterById(Long routerId) { - return _domainRouterDao.findById(routerId); + return _domainRouterDao.findByIdIncludingRemoved(routerId); } public static GuestOS findGuestOSById(Long id) { - return _guestOSDao.findById(id); + return _guestOSDao.findByIdIncludingRemoved(id); } public static HostVO findHostById(Long hostId) { - return _hostDao.findById(hostId); + return _hostDao.findByIdIncludingRemoved(hostId); } public static IPAddressVO findIpAddressById(long addressId) {