bug 12404: Fix NPE when delete host

But it's not enough. This happened because delete host logic is missing for Xen. Frank would add it.
This commit is contained in:
Sheng Yang 2011-12-07 13:27:45 -08:00
parent b3f861bf8f
commit dd7ff1d8db
1 changed files with 6 additions and 0 deletions

View File

@ -706,6 +706,12 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
List<StoragePoolHostVO> pools = _storagePoolHostDao.listByHostIdIncludingRemoved(hostId);
ResourceStateAdapter.DeleteHostAnswer answer = (ResourceStateAdapter.DeleteHostAnswer) dispatchToStateAdapters(ResourceStateAdapter.Event.DELETE_HOST, false, host, new Boolean(isForced), new Boolean(isForceDeleteStorage));
if (answer == null) {
s_logger.warn("Unable to delete host: " + hostId);
return false;
}
if (answer.getIsException()) {
return false;
}