From cae19d0b5a271171dc574779c136c247a27d6e42 Mon Sep 17 00:00:00 2001 From: Anthony Xu Date: Tue, 21 Jan 2014 19:34:32 -0800 Subject: [PATCH] fix build --- .../xen/resource/CitrixResourceBase.java | 2 +- .../xen/resource/XenServerConnectionPool.java | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 9abfee345e7..ed9eec1dda3 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -6009,7 +6009,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } private void CheckXenHostInfo() throws ConfigurationException { - Connection conn = _connPool.getConnect(_host.ip, _username, _password); + Connection conn = ConnPool.getConnect(_host.ip, _username, _password); if( conn == null ) { throw new ConfigurationException("Can not create connection to " + _host.ip); } diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java index 572d08e2f5b..b779085f93c 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java @@ -207,7 +207,7 @@ public class XenServerConnectionPool { return false; } - + public Connection getConnect(String ip, String username, Queue password) { Connection conn = new Connection(getURL(ip), 10); try { @@ -220,12 +220,12 @@ public class XenServerConnectionPool { } catch (Exception e1) { String msg = "Unable to create master connection to host(" + maddress +") , due to " + e1.toString(); s_logger.debug(msg); - throw new CloudRuntimeException(msg, e1); + throw new CloudRuntimeException(msg, e1); } } catch (Exception e) { String msg = "Unable to create master connection to host(" + ip +") , due to " + e.toString(); s_logger.debug(msg); - throw new CloudRuntimeException(msg, e); + throw new CloudRuntimeException(msg, e); } return conn; } @@ -255,15 +255,15 @@ public class XenServerConnectionPool { if (mConn != null){ try{ Host.getByUuid(mConn, hostUuid); - } catch (Exception e) { + } catch (Exception e) { if (s_logger.isDebugEnabled()) { s_logger.debug("connect through IP(" + mConn.getIp() + " for pool(" + poolUuid + ") is broken due to " + e.toString()); } removeConnect(poolUuid); mConn = null; } - } - + } + if ( mConn == null ) { mConn = new XenServerConnection(getURL(ipAddress), ipAddress, username, password, _retries, _interval, wait); try { @@ -277,12 +277,12 @@ public class XenServerConnectionPool { String msg = "Unable to create master connection to host(" + maddress +") , due to " + e1.toString(); s_logger.debug(msg); throw new CloudRuntimeException(msg, e1); - - } + + } } catch (Exception e) { String msg = "Unable to create master connection to host(" + ipAddress +") , due to " + e.toString(); s_logger.debug(msg); - throw new CloudRuntimeException(msg, e); + throw new CloudRuntimeException(msg, e); } addConnect(poolUuid, mConn); }