]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd: expose ContextWQ as pure interface for external implementations
authorAlexander Indenbaum <aindenba@redhat.com>
Wed, 10 Dec 2025 06:30:26 +0000 (08:30 +0200)
committerAlexander Indenbaum <aindenba@redhat.com>
Tue, 3 Feb 2026 12:51:29 +0000 (14:51 +0200)
commitc1ff4b6b2f0b216aac9fe828d1073195cdd8e047
treedd76187266be6c2bfc81fa2297bfe2c1f27fa900
parent98f9db9cd8315cc97ce0055c5a6f5a28fb85ddc2
librbd: expose ContextWQ as pure interface for external implementations

Make ContextWQ a pure interface in the public API to allow external modules
to provide custom ContextWQ implementations.

- Move ContextWQ to public header as pure interface (no Boost.ASIO dependencies)
- Extract ASIO implementation into separate AsioContextWQ class
- Add to set ContextWQ at open time
  - rbd_open_with_context_wq()
  - rbd_open_read_only_with_context_wq()
- Add rbd_get_ceph_context() C API to retrieve CephContext from RBD image
- Add rbd_context_complete() C API to complete contexts without full Context
  definition
- Change m_context_wq from unique_ptr to shared_ptr for external ownership
- Install public headers via CMake and include in librbd-devel package

Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
13 files changed:
ceph.spec.in
src/include/rbd/asio/ContextWQ.hpp [new file with mode: 0644]
src/include/rbd/librbd.h
src/librbd/AsioEngine.cc
src/librbd/AsioEngine.h
src/librbd/CMakeLists.txt
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/asio/AsioContextWQ.cc [new file with mode: 0644]
src/librbd/asio/AsioContextWQ.h [new file with mode: 0644]
src/librbd/asio/ContextWQ.cc [deleted file]
src/librbd/asio/ContextWQ.h
src/librbd/librbd.cc