set nosubdir for NFS SR

This commit is contained in:
Anthony Xu 2014-03-26 14:56:58 -07:00
parent 6de28bb1a4
commit c9edb7ecfe
2 changed files with 17 additions and 9 deletions

View File

@ -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) {

View File

@ -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) {