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

Remove lib/ublksrv_aio.c #47

Open
old-memories opened this issue Feb 28, 2023 · 3 comments
Open

Remove lib/ublksrv_aio.c #47

old-memories opened this issue Feb 28, 2023 · 3 comments

Comments

@old-memories
Copy link
Contributor

old-memories commented Feb 28, 2023

Hi Ming,

There is no user of lib/ublksrv_aio.c now except demo_event.c. What about removing it from lib/ so that the library is simpler? I think related code can be moved into demo_event.c.

BTW, lib/ublksrv_aio.c uses pthread_spin_lock(), eventfd()... which should not be included in a library.

@ming1
Copy link
Collaborator

ming1 commented Mar 1, 2023

Hi Ming,

There is no user of lib/ublksrv_aio.c now except demo_event.c. What about removing it from lib/ so that the library is simpler? I think related code can be moved into demo_event.c.

libnbd uses it:

https://github.com/libguestfs/libnbd/tree/master/ublk

Also the following project uses it too:

https://gitlab.com/amarjargal.gundjalam/qemu/-/blob/ublk_test1/block/export/ublk.c

BTW, lib/ublksrv_aio.c uses pthread_spin_lock(), eventfd()... which should not be included in a library.

Can you explain a bit why libublksrv can't use pthread_spin_lock(), eventfd()? The former is from libpthread, and the latter is one syscall.
I think it is pretty fine to include it.

But if you needn't it, I think it is fine to add config option to not
build ublksrv_aio.c into libublksrv.

thanks,
Ming

@ming1
Copy link
Collaborator

ming1 commented Mar 1, 2023

Such as, it can be done in the following way:

./configure --disable-io-offload

@old-memories
Copy link
Contributor Author

That's a good idea. Thanks Ming.

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