cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject git commit: updated refs/heads/4.4 to 1c10d00
Date Fri, 11 Apr 2014 00:48:08 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 fc8e79c17 -> 1c10d00ec


avoid to create same FileSR on host more than once


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1c10d00e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1c10d00e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1c10d00e

Branch: refs/heads/4.4
Commit: 1c10d00ec9268c75c919bf4d873dc0e51eb9e1d2
Parents: fc8e79c
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Thu Apr 10 17:47:27 2014 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Thu Apr 10 17:47:27 2014 -0700

----------------------------------------------------------------------
 .../hypervisor/xen/resource/XenServer620Resource.java     |  9 ++++++---
 .../xen/resource/Xenserver625StorageProcessor.java        | 10 +++++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c10d00e/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620Resource.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620Resource.java
index 0ec45ae..0c8bc71 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620Resource.java
@@ -127,7 +127,7 @@ public class XenServer620Resource extends XenServer610Resource {
             @SuppressWarnings("unchecked")
             Set<Event.Record> events = (Set<Event.Record>)map.get("events");
             if (events.size() == 0) {
-                String msg = "Async " + timeout / 1000 + " seconds timeout for task " + task.toString();
+                String msg = "No event for task " + task.toString();
                 s_logger.warn(msg);
                 task.cancel(c);
                 throw new TimeoutException(msg);
@@ -144,11 +144,14 @@ public class XenServer620Resource extends XenServer610Resource {
 
                 if (taskRecord.status != Types.TaskStatusType.PENDING) {
                     if (s_logger.isDebugEnabled()) {
-                        s_logger.debug("Task is done " + taskRecord.status);
+                        s_logger.debug("Task: " + taskRecord.uuid + " is done " + taskRecord.status);
                     }
                     return;
                 } else {
-                    s_logger.debug("Task is not done " + taskRecord);
+                    if (s_logger.isDebugEnabled()) {
+                        s_logger.debug("Task: " + taskRecord.uuid +  " progress: " + taskRecord.progress);
+                    }
+
                 }
             }
             if (System.currentTimeMillis() - beginTime > timeout) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c10d00e/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
index dad3d14..6e29037 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625StorageProcessor.java
@@ -86,11 +86,19 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor
{
         SR sr = null;
         PBD pbd = null;
         try {
+            String srname = hypervisorResource.getHost().uuid + path.trim();
+            try {
+                Set<SR> srs = SR.getByNameLabel(conn, srname);
+                if ( srs != null && !srs.isEmpty()) {
+                    return srs.iterator().next();
+                }
+            } catch (Exception e) {
+            }
             Map<String, String> smConfig = new HashMap<String, String>();
             Host host = Host.getByUuid(conn, hypervisorResource.getHost().uuid);
             String uuid = UUID.randomUUID().toString();
 
-            sr = SR.introduce(conn,uuid, uuid, uuid, "file", "file", false, smConfig);
+            sr = SR.introduce(conn,uuid, srname, srname, "file", "file", false, smConfig);
             PBD.Record record = new PBD.Record();
             record.host = host;
             record.SR = sr;


Mime
View raw message