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

xio: xio_init needs to be called before any other xio function #8227

Merged
merged 1 commit into from Mar 23, 2016
Merged

xio: xio_init needs to be called before any other xio function #8227

merged 1 commit into from Mar 23, 2016

Conversation

roidayan
Copy link
Contributor

Latest accelio code removes the attribute to call xio_init on load
and XioMessenger will first try to initialize portals and create xio context.
This commit will fix this behavior and call xio_init first.

Signed-off-by: Roi Dayan roid@mellanox.com

Latest accelio code removes the attribute to call xio_init on load
and XioMessenger will first try to initialize portals and create xio context.
This commit will fix this behavior and call xio_init first.

Signed-off-by: Roi Dayan <roid@mellanox.com>
@yuyuyu101
Copy link
Member

I think common/Initialize.h could meet your demand.

@cbodley
Copy link
Contributor

cbodley commented Mar 23, 2016

@roidayan looks good to me, if I understand right: the issue is that the XioMessenger ctor was initializing its portals member before the body called xio_init() - so moving xio_init() into a base class ctor fixes the order of initialization

@yuyuyu101 I don't think static initialization will work here, since the xio init depends on a CephContext

@roidayan
Copy link
Contributor Author

@cbodley yes that's correct.

I want also later to add a new commit to call xio_dtor from XioInit which we don't do today so I will need ~XioInit which I don't have in Initialize class.

@cbodley
Copy link
Contributor

cbodley commented Mar 23, 2016

@roidayan sounds good. there's already a nInstances counter that we should be able to use to tell when the last messenger destructs. it would also be nice to encapsulate that, intialized, and mtx as static members of XioInit while you're at it

@cbodley cbodley merged commit e1c0217 into ceph:master Mar 23, 2016
@roidayan roidayan deleted the xio-call_xio_init_first branch March 23, 2016 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants