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


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java:
##########
@@ -917,18 +917,25 @@ private KVMPhysicalDisk 
createPhysicalDiskByLibVirt(String name, KVMStoragePool
     }
 
 
-    private KVMPhysicalDisk createPhysicalDiskByQemuImg(String name, 
KVMStoragePool pool,
-            PhysicalDiskFormat format, Storage.ProvisioningType 
provisioningType, long size, byte[] passphrase) {
-        String volPath = pool.getLocalPath() + "/" + name;
+    private KVMPhysicalDisk createPhysicalDiskByQemuImg(String name, 
KVMStoragePool pool, PhysicalDiskFormat format, Storage.ProvisioningType 
provisioningType, long size,
+                                                        byte[] passphrase) {
+        String volPath;
         String volName = name;
         long virtualSize = 0;
         long actualSize = 0;
         QemuObject.EncryptFormat encryptFormat = null;
         List<QemuObject> passphraseObjects = new ArrayList<>();
-
         final int timeout = 0;
+        QemuImgFile destFile;
+
+        if (StoragePoolType.RBD.equals(pool.getType())) {
+            volPath = pool.getSourceDir() + "/" + name;
+            destFile = new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(pool, 
volPath));
+        } else {
+            volPath = pool.getLocalPath() + "/" + name;

Review Comment:
   Use file.separator instead of "/"



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to