You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "akoskuczi-bw (via GitHub)" <gi...@apache.org> on 2026/10/01 20:45:07 UTC

Re: [I] KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 [cloudstack]

akoskuczi-bw commented on issue #13989:
URL: https://github.com/apache/cloudstack/issues/13989#issuecomment-5940205575

   Workaround until the libvirtd fix is available
   
   **Save this code as rados_compat.c**
   ```
   #define _GNU_SOURCE
   
   #include <stdio.h>
   #include <string.h>
   #include <dlfcn.h>
   #include <errno.h>
   
   typedef int (*rados_conf_set_fn)(
       void *cluster,
       const char *option,
       const char *value
   );
   
   int rados_conf_set(void *cluster, const char *option, const char *value)
   {
       static rados_conf_set_fn real_rados_conf_set = NULL;
   
       if (option && strcmp(option, "auth_supported") == 0) {
           fprintf(stderr,
                   "[rados-compat] ignoring deprecated option: "
                   "auth_supported=%s\n",
                   value ? value : "(null)");
   
           return 0;
       }
   
       if (!real_rados_conf_set) {
           dlerror();
   
           real_rados_conf_set =
               (rados_conf_set_fn)dlsym(RTLD_NEXT, "rados_conf_set");
   
           const char *err = dlerror();
   
           if (err || !real_rados_conf_set) {
               fprintf(stderr,
                       "[rados-compat] dlsym(rados_conf_set) failed: %s\n",
                       err ? err : "unknown error");
   
               return -EIO;
           }
       }
   
       return real_rados_conf_set(cluster, option, value);
   } 
   ```
   **Then compile and install it:**
   _gcc -shared -fPIC -O2 -Wall -Wextra -o librados_compat.so rados_compat.c -ldl
   install -o root -g root -m 0755 librados_compat.so /usr/local/lib/librados_compat.so_
   
   **Preload it into libvirtd:**
   _systemctl edit libvirtd_
   
   ```
   [Service]
   Environment="LD_PRELOAD=/usr/local/lib/librados_compat.so"
   ```
   _systemctl daemon-reload
   systemctl restart libvirtd
   systemctl restart cloudstack-agent_
   


-- 
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-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org