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

pybind/rados: add rados_service_*() #18812

Merged
merged 1 commit into from Dec 5, 2017

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Nov 8, 2017

Signed-off-by: Kefu Chai kchai@redhat.com

@jcsp
Copy link
Contributor

jcsp commented Nov 8, 2017

Just curious, do we have a consumer in mind for this?

Never mind, saw the link to the other PR.

"""
service = cstr(service, 'service')
daemon = cstr(daemon, 'daemon')
metadata_dict = '\0'.join(chain.from_iterable(metadata.items()))
Copy link
Member

Choose a reason for hiding this comment

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

do these dict inputs need a trailing '\0' added for the c call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i inspected the concat'ed string using gdb, it does have two trailing \0s.

(gdb) p/c (char[24])*metadata_dict
$12 = {118 'v', 101 'e', 114 'r', 115 's', 105 'i', 111 'o', 110 'n', 0 '\000', 51 '3', 46 '.', 49 '1', 52 '4', 0 '\000',
  109 'm', 101 'e', 109 'm', 111 'o', 114 'r', 121 'y', 0 '\000', 52 '4', 50 '2', 0 '\000', 0 '\000'}

but you are right. we can not rely on this.

Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor Author

@jdurgin fixed and repushed.

@tchaikov
Copy link
Contributor Author

tchaikov commented Dec 5, 2017

@tchaikov tchaikov merged commit 27c3b63 into ceph:master Dec 5, 2017
@tchaikov tchaikov deleted the wip-pybind-rados-service-api branch December 5, 2017 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants