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

Missing rbd API components: function rbd_list #1008

Open
BadKid90s opened this issue Jul 5, 2024 · 1 comment
Open

Missing rbd API components: function rbd_list #1008

BadKid90s opened this issue Jul 5, 2024 · 1 comment

Comments

@BadKid90s
Copy link

image

I saw an API for querying the RBD image list in the Ceph source code, but go-ceph did not provide it.
Would you consider adding this method?
What method should be used to replace the outdated list method tag?

@phlogistonjohn
Copy link
Collaborator

phlogistonjohn commented Jul 5, 2024

func GetImageNames(ioctx *rados.IOContext) ([]string, error) {
var images []C.rbd_image_spec_t
size := C.size_t(4096)
for {
images = make([]C.rbd_image_spec_t, size)
ret := C.rbd_list2(

The function GetImageNames is based on the rbd_list2 api. It predates the convention of mentioning the C API name in the doc comment. Please try GetImageNames and see if that meets your needs.

What method should be used to replace the outdated list method tag?

I don't know what you mean by this. If you're referring to the CEPH_RB_DEPRECATED flag in the header. You don't need to worry about it as the api we use is rbd_list2. If you mean something else, please clarify the question.

PS. In the future please copy-paste plain text source code (the ceph header snippet) instead of using a screen shot. It makes it easier to view the message in the email notifications and is searchable by future users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants