JoaoJandre commented on code in PR #8947:
URL: https://github.com/apache/cloudstack/pull/8947#discussion_r1572658067


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDef.java:
##########
@@ -187,6 +208,13 @@ public String toString() {
             storagePoolBuilder.append("<path>" + _targetPath + "</path>\n");
             storagePoolBuilder.append("</target>\n");
         }
+        if (_poolType == PoolType.NETFS && _nfsopts != null) {
+            storagePoolBuilder.append("<fs:mount_opts>\n");
+            for (Map.Entry<String, String> options : _nfsopts.entrySet()) {
+                storagePoolBuilder.append("<fs:option name='" + 
options.getKey() + "'/>\n");
+            }
+            storagePoolBuilder.append("</fs:mount_opts>\n");

Review Comment:
   why not put this inside the if block at line 148?



##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java:
##########
@@ -654,20 +654,54 @@ public KVMStoragePool createStoragePool(String name, 
String host, int port, Stri
             } catch (LibvirtException e) {
                 s_logger.error("Failure in attempting to see if an existing 
storage pool might be using the path of the pool to be created:" + e);
             }
+        }
+
+        List<String> nfsopts = null;
+        if (type == StoragePoolType.NetworkFilesystem) {
+            if (details != null && details.containsKey("nfsopts")) {
+                nfsopts = 
Arrays.asList(details.get("nfsopts").replaceAll("\\s", "").split(","));
+            }
+
+            if (sp != null && nfsopts != null) {
+                try {
+                    LibvirtStoragePoolDef poolDef = getStoragePoolDef(conn, 
sp);
+                    Map poolNfsOptsMap = poolDef.getNfsOpts();
+                    boolean optionsDiffer = false;
+                    if (poolNfsOptsMap.size() != nfsopts.size()) {
+                        optionsDiffer = true;
+                    } else {
+                        for (String nfsopt : nfsopts) {
+                            if (!poolNfsOptsMap.containsKey(nfsopt)) {
+                                optionsDiffer = true;
+                                break;
+                            }
+                        }
+                    }
+                    if (optionsDiffer == true) {

Review Comment:
   ```suggestion
                       if (optionsDiffer) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to