GithubHelp home page GithubHelp logo

Comments (5)

dotnwat avatar dotnwat commented on July 28, 2024

Adding this should not be a problem at all. The fastest approach is to submit a pull request. But I'll put this on the todo list.

from go-ceph.

ffledgling avatar ffledgling commented on July 28, 2024

@noahdesu Can do. I do have a question though, there are a few ways of doing this, would it be preferred if somehow the existing Create call on the go side understood how to call out to create4 based on the arguments passed and/or the function signature, or would it be preferred to introduce an entirely new Create4 call on the go side that calls out to rbd_create4 ?

I could try taking cues from how librbdpy does it and submit a PR, but it'd be nice to know if there's a convention/style being followed here.

from go-ceph.

dotnwat avatar dotnwat commented on July 28, 2024

I think that adding something like Create4 would be just fine (or using some other descriptive name). IIRC Go doesn't have default parameters, so trying to create some generic interface may be more trouble than it's worth.

from go-ceph.

dswarbrick avatar dswarbrick commented on July 28, 2024

If the goal is to maintain a go-ceph repo that can build against any installed librados, perhaps consider setting build tags via Makefile shell commands. For example, to handle the deprecation warnings mentioned in #42, a readelf could be executed to check for the newer, namespace-aware rados_nobjects_list_* functions (which were available in Jewel anyway):

$ readelf -s $(ldconfig -p | grep librados | awk '{print $NF}') | grep rados_nobjects_list_open
   699: 0000000000050160   614 FUNC    GLOBAL DEFAULT   12 rados_nobjects_list_open

Conditionally set go build tags, and split out the two variants of the rados_objects_list_* and rados_nobjects_list_* cgo wrappers into separate files containing build tags such as the following:

// +build HAVE_RADOS_NOBJECTS

and for older libraries:

// +build !HAVE_RADOS_NOBJECTS

This would work so long as something (i.e., the Makefile) would set the build tag. It may not be so convenient if the go-ceph library was simply being slurped in by go get; go build of a client app. Perhaps it would be better to assume that the latest and greatest library was present on the system, and rely on errors being thrown by the linker, forcing the user to explicitly set a build tag.

Alternatively, just git branch and maintain a different branch for older (LTS) releases of librados. Since the Ceph client libraries are generally backwards compatible, I don't see any harm in primarily / only supporting the latest Ceph client C library.

from go-ceph.

phlogistonjohn avatar phlogistonjohn commented on July 28, 2024

Hello, I'm automatically closing all issues filed prior to 2018 that have not been commented on recently. If this issue is still relevant to you please reopen the issue and restart the discussion. Thank you for your understanding.

from go-ceph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.