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

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


The following commit(s) were added to refs/heads/4.22 by this push:
     new 3e050553dc8 Restrict VDDK check on filesystem only when the agent 
property for VDDK is set (#14688)
3e050553dc8 is described below

commit 3e050553dc8f95ee17ffb862516c9df626f955b5
Author: Nicolas Vazquez <[email protected]>
AuthorDate: Fri Nov 27 06:21:11 2026 -0300

    Restrict VDDK check on filesystem only when the agent property for VDDK is 
set (#14688)
---
 .../kvm/resource/LibvirtComputingResource.java     | 24 ++++------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 1f90a625755..f42a4fae2ff 100644
--- 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -368,7 +368,6 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
     public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = 
"rpm -qa | grep -i virtio-win";
     public static final String 
UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "dpkg -l virtio-win";
     public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "dpkg -l nbdkit";
-    public static final String VDDK_AUTODETECT_PATH_CMD = "find / -type d 
-name 'vmware-vix-disklib-distrib' 2>/dev/null | head -n 1";
 
     public static final int LIBVIRT_CGROUP_CPU_SHARES_MIN = 2;
     public static final int LIBVIRT_CGROUP_CPU_SHARES_MAX = 262144;
@@ -1188,20 +1187,16 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
             LOGGER.warn("Configured VDDK library dir [{}] is invalid (missing 
lib64/libvixDiskLib.so), attempting auto-detection", vddkLibDir);
             vddkLibDir = null;
         }
-        if (StringUtils.isBlank(vddkLibDir)) {
-            vddkLibDir = detectVddkLibDir();
-        }
         if (StringUtils.isNotBlank(vddkLibDir)) {
             LOGGER.info("Detected VDDK library dir: {}", vddkLibDir);
+            vddkVersion = detectVddkVersion();
+            if (StringUtils.isNotBlank(vddkVersion)) {
+                LOGGER.info("Detected nbdkit VDDK plugin version: {}", 
vddkVersion);
+            }
         } else {
             LOGGER.warn("Could not detect a valid VDDK library dir; VDDK 
conversion will be unavailable");
         }
 
-        vddkVersion = detectVddkVersion();
-        if (StringUtils.isNotBlank(vddkVersion)) {
-            LOGGER.info("Detected nbdkit VDDK plugin version: {}", 
vddkVersion);
-        }
-
         vddkTransports = StringUtils.trimToNull(
                 
AgentPropertiesFileHandler.getPropertyValue(AgentProperties.VDDK_TRANSPORTS));
         vddkThumbprint = StringUtils.trimToNull(
@@ -6013,9 +6008,6 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
         if (StringUtils.isBlank(effectiveVddkLibDir)) {
             effectiveVddkLibDir = StringUtils.trimToNull(vddkLibDir);
         }
-        if (StringUtils.isBlank(effectiveVddkLibDir) || 
!isVddkLibDirValid(effectiveVddkLibDir)) {
-            effectiveVddkLibDir = detectVddkLibDir();
-        }
         return hostSupportsInstanceConversion() && 
isVddkLibDirValid(effectiveVddkLibDir) && 
StringUtils.isNotBlank(detectVddkVersion());
     }
 
@@ -6031,14 +6023,6 @@ public class LibvirtComputingResource extends 
ServerResourceBase implements Serv
         return libs != null && libs.length > 0;
     }
 
-    protected String detectVddkLibDir() {
-        String detectedPath = 
StringUtils.trimToNull(Script.runSimpleBashScript(VDDK_AUTODETECT_PATH_CMD));
-        if (StringUtils.isNotBlank(detectedPath) && 
isVddkLibDirValid(detectedPath)) {
-            return detectedPath;
-        }
-        return null;
-    }
-
     protected String detectVddkVersion() {
         try {
             ProcessBuilder pb = new ProcessBuilder("nbdkit", "vddk", 
"--version");

Reply via email to