Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect rbd_clone4 support by using dlsym() #1013

Merged
merged 3 commits into from
Jul 25, 2024

Commits on Jul 24, 2024

  1. internal: add dlsym package for working with dynamically loaded symbols

    The dlsym package provides LookupSymbol() which resolves a named symbol
    (like "rbd_clone4") and returns a unsafe.Pointer to it. The caller is
    expected to cast the symbol to function that can be called.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    d98c799 View commit details
    Browse the repository at this point in the history
  2. rbd: fix cleanup of CloneFromGroupSnap test case

    When there is a failure during the CloneFromGroupSnap test case, the
    rbd-group snapshot was not removed, preventing images from being deleted
    as well.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    55eff17 View commit details
    Browse the repository at this point in the history
  3. rbd: let CloneImageByID check for rbd_clone4 at runtime

    Some versions of librbd provide the rbd_clone4 function, and others do
    not. Squid will have the function backported in the 1st update, the
    initial release of Squid does not have it. This makes checking for the
    function based on the named Ceph version impractical.
    
    With the new dlsym.LookupSymbol() function, it is now possible to check
    the availability of rbd_clone4 during runtime. If the symbol is not
    found ErrNotImplemented is returned, which can be used to detect the
    unavailability of the function.
    
    Signed-off-by: Niels de Vos <[email protected]>
    nixpanic committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    cafbdc2 View commit details
    Browse the repository at this point in the history