DaanHoogland commented on code in PR #13910:
URL: https://github.com/apache/cloudstack/pull/13910#discussion_r3879508178


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java:
##########
@@ -658,10 +658,16 @@ public Answer copyVolumeFromPrimaryToSecondary(final 
CopyCommand cmd) {
         final String secondaryStorageUrl = nfsStore.getUrl();
         KVMStoragePool secondaryStoragePool = null;
 
+        boolean srcConnected = false;
         try {
             final String volumeName = UUID.randomUUID().toString();
 
             final String destVolumeName = volumeName + "." + 
ImageFormat.QCOW2.getFileExtension();
+            // the source volume may not be attached anywhere (e.g. a detached 
volume being
+            // migrated between pools); connect it so storage drivers that 
expose devices on
+            // demand (e.g. Linstor shared storage pools) provide the device 
for the copy
+            srcConnected = storagePoolMgr.connectPhysicalDisk(
+                    primaryStore.getPoolType(), primaryStore.getUuid(), 
srcVolumePath, null);

Review Comment:
   ```suggestion
               srcConnected = storagePoolMgr.connectPhysicalDisk(
                       primaryStore.getPoolType(), primaryStore.getUuid(), 
srcVolumePath, null);
   ```
   
   @rp- , this comment is a bit over the top, i think (ai aided?) 3 lines for 1 
statement. If the statement really needs explanation it should be renamed I 
think. or extracted to a method with a clarifying name. 



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