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 cb61d35
Date Wed, 26 Mar 2014 22:01:49 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 296dc861b -> cb61d35ad


set nosubdir for NFS SR


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

Branch: refs/heads/4.4
Commit: cb61d35ad05b2007b68feb4337308f0e1e910df1
Parents: 296dc86
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Wed Mar 26 14:56:58 2014 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Wed Mar 26 14:57:39 2014 -0700

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java        | 20 ++++++++++++++------
 .../xen/resource/XenServerStorageProcessor.java |  6 +++---
 2 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb61d35a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
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 a57b606..3115cbe 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
@@ -5091,6 +5091,14 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 s_logger.debug("Checking " + srr.nameLabel + " or SR " + srr.uuid + " on
" + _host);
             }
             if (srr.shared) {
+                if (SRType.NFS.equals(srr.type) ){
+                       Map<String, String> smConfig = srr.smConfig;
+                       if( !smConfig.containsKey("nosubdir")) {
+                           smConfig.put("nosubdir", "true");
+                           sr.setSmConfig(conn,smConfig);
+                       }
+                }
+
                 Host host = Host.getByUuid(conn, _host.uuid);
                 boolean found = false;
                 for (PBD pbd : pbds) {
@@ -5910,10 +5918,10 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
             }
 
             Host host = Host.getByUuid(conn, _host.uuid);
+            Map<String, String> smConfig = new HashMap<String, String>();
+            smConfig.put("nosubdir", "true");
+            SR sr = SR.create(conn, host, deviceConfig, new Long(0), name, uri.getHost()
+ uri.getPath(), SRType.NFS.toString(), "user", shared, smConfig);
 
-            SR sr =
-                    SR.create(conn, host, deviceConfig, new Long(0), name, uri.getHost()
+ uri.getPath(), SRType.NFS.toString(), "user", shared,
-                            new HashMap<String, String>());
             if (!checkSR(conn, sr)) {
                 throw new Exception("no attached PBD");
             }
@@ -6183,9 +6191,9 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
             deviceConfig.put("server", server);
             deviceConfig.put("serverpath", serverpath);
             Host host = Host.getByUuid(conn, _host.uuid);
-            SR sr =
-                    SR.create(conn, host, deviceConfig, new Long(0), pool.getUuid(), Long.toString(pool.getId()),
SRType.NFS.toString(), "user", true,
-                            new HashMap<String, String>());
+            Map<String, String> smConfig = new HashMap<String, String>();
+            smConfig.put("nosubdir", "true");
+            SR sr = SR.create(conn, host, deviceConfig, new Long(0), pool.getUuid(), Long.toString(pool.getId()),
SRType.NFS.toString(), "user", true, smConfig);
             sr.scan(conn);
             return sr;
         } catch (XenAPIException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb61d35a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
index e512046..a762f86 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
@@ -560,9 +560,9 @@ public class XenServerStorageProcessor implements StorageProcessor {
             deviceConfig.put("server", server);
             deviceConfig.put("serverpath", serverpath);
             Host host = Host.getByUuid(conn, hypervisorResource.getHost().uuid);
-            SR sr =
-                SR.create(conn, host, deviceConfig, new Long(0), pool.getUuid(), Long.toString(pool.getId()),
SRType.NFS.toString(), "user", true,
-                    new HashMap<String, String>());
+            Map<String, String> smConfig = new HashMap<String, String>();
+            smConfig.put("nosubdir", "true");
+            SR sr = SR.create(conn, host, deviceConfig, new Long(0), pool.getUuid(), Long.toString(pool.getId()),
SRType.NFS.toString(), "user", true, smConfig);
             sr.scan(conn);
             return sr;
         } catch (XenAPIException e) {


Mime
View raw message