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

rbd: implement librbd.rbd_group_snap_get_info #1025

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nixpanic
Copy link
Member

@nixpanic nixpanic commented Sep 10, 2024

The new GroupSnapGetInfo function can be used to get a list of the RBD
image snapshots that were created as part of the RBD group snapshot.

This feature is implemented in 2 steps:

  1. direct librbd call (only in Ceph main branch)
  2. modification to use dlsym

I hope that makes it easier to understand, and might help others contributing such dynamically loaded functions too.

Depends-on: ceph/ceph#59883

Checklist

  • Added tests for features and functional changes
  • Public functions and types are documented
  • Standard formatting is applied to Go code
  • Is this a new API? Added a new file that begins with //go:build ceph_preview
  • Ran make api-update to record new APIs

@nixpanic nixpanic force-pushed the rbd/rbd_group_snap_get_info branch 2 times, most recently from a40229f to dee055a Compare September 11, 2024 08:34
@nixpanic nixpanic marked this pull request as ready for review September 11, 2024 08:54
@phlogistonjohn phlogistonjohn added the API This PR includes a change to the public API of a go-ceph package label Sep 11, 2024
anoopcs9
anoopcs9 previously approved these changes Sep 12, 2024
Copy link
Collaborator

@anoopcs9 anoopcs9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we could ignore the norm to have the corresponding tests for the newly introduced API in a separate source file, which I think may not hold good here due to its nature, changes look good to me.

@anoopcs9
Copy link
Collaborator

@Mergifyio rebase

Copy link

mergify bot commented Sep 12, 2024

rebase

✅ Branch has been successfully rebased

@nixpanic
Copy link
Member Author

Thanks @anoopcs9!

It seems that @ajarr is planning to send a PR for librbd.h to uncomment the namespace_type in the struct. Until that is done, this PR should not get merged yet.

@idryomov
Copy link

send a PR for librbd.h to uncomment the namespace_type in the struct

ceph/ceph#59883

Copy link

dpulls bot commented Sep 20, 2024

⚠️ Dpulls not installed on repository ceph/ceph. Checkout our quickstart for how to install.

The new GroupSnapGetInfo function can be used to get a list of the RBD
image snapshots that were created as part of the RBD group snapshot.

Signed-off-by: Niels de Vos <[email protected]>
@mergify mergify bot dismissed anoopcs9’s stale review September 20, 2024 08:48

Pull request has been modified.

#include <rbd/librbd.h>

// exact copy of librbd.h:rbd_group_snap_namespace_type_t as it is not included in all versions
#ifndef RBD_GROUP_SNAP_NAMESPACE_TYPE_USER

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of defining the underscored versions below, could ifndef block just be extended?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes, that probably works too. Would make it a little cleaner. I'll try that once the Ceph PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This PR includes a change to the public API of a go-ceph package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants