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

refactor command funcs arguments set up #226

Merged

Commits on May 8, 2020

  1. cutil: add a new internal package for c+go utility functions

    Now we have sufficient boilerplate in our code for interacting with
    various types and ceph calls with similar needs we establish a new
    internal package, "cutil" (C utilities).
    
    Note that many of the return types are wrapped. This is due to the
    limits placed on us by cgo.  Despite the irritating limitations Go
    places on "exporting" C types it still ought to help in the long run for
    patterns that are very common or patterns that are subtle and we want to
    write specific tests for.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed May 8, 2020
    Configuration menu
    Copy the full SHA
    ac6b6cc View commit details
    Browse the repository at this point in the history
  2. entrypoint: enable building and testing of internal/cutil package

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed May 8, 2020
    Configuration menu
    Copy the full SHA
    4664a41 View commit details
    Browse the repository at this point in the history
  3. rados: replace copy-n-paste *_command functions argument handling

    Replace the argument handling (wrangling?) around *_command functions,
    such as MonCommand, with the new command input and output helper types
    from the internal/cutil package.
    No external change should be visible.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed May 8, 2020
    Configuration menu
    Copy the full SHA
    9edde60 View commit details
    Browse the repository at this point in the history
  4. cephfs: replace copy-n-paste *_command functions argument handling

    Similar to the functions in the rados pkg, cephfs package has a function
    MdsCommand that is mostly boilerplate that to set up the C function's
    arguments. Replace it with the types from the new cutil internal
    package.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed May 8, 2020
    Configuration menu
    Copy the full SHA
    3d7c5fc View commit details
    Browse the repository at this point in the history
  5. cutil: allow passing free functions to command output type

    The *_command functions in librados and libcephfs document the use
    of specific free functions for data allocated. These functions are
    currently just wrappers around C's free() function. However, to be
    more strictly compliant this change adds a free-function callback
    to the CommandOutput type and the specific free functions are now
    used outside the unit tests.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed May 8, 2020
    Configuration menu
    Copy the full SHA
    2b54175 View commit details
    Browse the repository at this point in the history