sureshanaparti commented on code in PR #8544:
URL: https://github.com/apache/cloudstack/pull/8544#discussion_r1464583628


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java:
##########
@@ -775,23 +781,22 @@ public KVMPhysicalDisk createPhysicalDisk(String name, 
KVMStoragePool pool,
         s_logger.info("Attempting to create volume " + name + " (" + 
pool.getType().toString() + ") in pool "
                 + pool.getUuid() + " with size " + toHumanReadableSize(size));
 
-        switch (pool.getType()) {
-            case RBD:
-                return createPhysicalDiskByLibVirt(name, pool, 
PhysicalDiskFormat.RAW, provisioningType, size);
-            case NetworkFilesystem:
-            case Filesystem:
-                switch (format) {
-                    case QCOW2:
-                    case RAW:
-                        return createPhysicalDiskByQemuImg(name, pool, format, 
provisioningType, size, passphrase);
-                    case DIR:
-                    case TAR:
-                        return createPhysicalDiskByLibVirt(name, pool, format, 
provisioningType, size);
-                    default:
-                        throw new CloudRuntimeException("Unexpected disk 
format is specified.");
-                }
-            default:
-                return createPhysicalDiskByLibVirt(name, pool, format, 
provisioningType, size);
+        StoragePoolType poolType = pool.getType();

Review Comment:
   tried switch/case on poolType (string), noticed some errors with it. keeping 
the new/refactored changes.



-- 
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