This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 5bf81cf00233efe4478552e7bb13f3e96dc58ed1
Merge: 2ba64f2521a 3d8d4875fe3
Author: Daan Hoogland <[email protected]>
AuthorDate: Tue Aug 20 11:20:39 2024 +0200

    Merge release branch 4.19 to main
    
    * 4.19:
      linstor: Improve copyPhysicalDisk performance (#9417)

 .../kvm/storage/LinstorStorageAdaptor.java         | 39 +++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --cc 
plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
index 97b813669a6,64626788999..971c2e8c9fd
--- 
a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
+++ 
b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
@@@ -50,10 -49,12 +50,11 @@@ import com.linbit.linstor.api.model.Res
  import com.linbit.linstor.api.model.ResourceMakeAvailable;
  import com.linbit.linstor.api.model.ResourceWithVolumes;
  import com.linbit.linstor.api.model.StoragePool;
+ import com.linbit.linstor.api.model.Volume;
  import com.linbit.linstor.api.model.VolumeDefinition;
  
 -@StorageAdaptorInfo(storagePoolType=Storage.StoragePoolType.Linstor)
  public class LinstorStorageAdaptor implements StorageAdaptor {
 -    private static final Logger s_logger = 
Logger.getLogger(LinstorStorageAdaptor.class);
 +    protected Logger logger = LogManager.getLogger(getClass());
      private static final Map<String, KVMStoragePool> 
MapStorageUuidToStoragePool = new HashMap<>();
      private final String localNodeName;
  
@@@ -470,11 -500,13 +505,13 @@@
          destFile.setFormat(dstDisk.getFormat());
          destFile.setSize(disk.getVirtualSize());
  
+         boolean zeroedDevice = resourceSupportZeroBlocks(destPools, 
LinstorUtil.RSC_PREFIX + name);
+ 
          try {
-             final QemuImg qemu = new QemuImg(timeout);
+             final QemuImg qemu = new QemuImg(timeout, zeroedDevice, true);
              qemu.convert(srcFile, destFile);
          } catch (QemuImgException | LibvirtException e) {
 -            s_logger.error(e);
 +            logger.error(e);
              destPools.deletePhysicalDisk(name, Storage.ImageFormat.RAW);
              throw new CloudRuntimeException("Failed to copy " + 
disk.getPath() + " to " + name);
          }

Reply via email to