]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd, tools: migrate from boost::variant to std::variant
authorKefu Chai <tchaikov@gmail.com>
Wed, 7 May 2025 00:42:52 +0000 (08:42 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 7 May 2025 08:05:37 +0000 (16:05 +0800)
commit786ea203a28374d8d9bf0b8cc9c3c43dcf686328
treea4e9eac8749ed24daedc75bb92106dc427b0b6ec
parent52e6f6aa3cac48efe72578eac25646ea36db2ca9
librbd, tools: migrate from boost::variant to std::variant

Complete migration started in commit 017f333, replacing boost::variant with
std::variant throughout the librbd codebase. This change is part of our ongoing
effort to reduce third-party dependencies by leveraging C++ standard library
alternatives where possible.

Benefits include:
- Improved code readability and maintainability
- Reduced external dependency surface
- More consistent API usage with other components

Implementation note: Unlike Boost.variant, std::variant lacks built-in
operator<< support. This commit implements the necessary operator<< for
AttributeValue, our specific std::variant instantiation, to preserve the
existing behavior.

Also, despite that `apply_visit()` calls can be replaced with `visit()`
without being qualified with `std::` because of ADL, we are taking this
opportunity to adding the `std::` prefix for better readability.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
33 files changed:
src/librbd/MirroringWatcher.cc
src/librbd/TrashWatcher.cc
src/librbd/WatchNotifyTypes.h
src/librbd/api/Snapshot.cc
src/librbd/io/ImageDispatchSpec.cc
src/librbd/io/ObjectDispatchSpec.cc
src/librbd/io/ObjectDispatchSpec.h
src/librbd/io/ObjectDispatcher.cc
src/librbd/io/ReadResult.cc
src/librbd/io/ReadResult.h
src/librbd/journal/Replay.h
src/librbd/mirroring_watcher/Types.cc
src/librbd/mirroring_watcher/Types.h
src/librbd/trash_watcher/Types.cc
src/librbd/trash_watcher/Types.h
src/rbd_replay/ActionTypes.cc
src/rbd_replay/ActionTypes.h
src/rbd_replay/BoundedBuffer.hpp
src/rbd_replay/actions.cc
src/test/librbd/crypto/test_mock_CryptoObjectDispatch.cc
src/test/librbd/io/test_mock_ImageRequest.cc
src/test/librbd/operation/test_mock_TrimRequest.cc
src/tools/rbd_mirror/InstanceWatcher.cc
src/tools/rbd_mirror/LeaderWatcher.cc
src/tools/rbd_mirror/ServiceDaemon.cc
src/tools/rbd_mirror/image_map/Types.cc
src/tools/rbd_mirror/image_map/Types.h
src/tools/rbd_mirror/image_replayer/journal/EventPreprocessor.h
src/tools/rbd_mirror/instance_watcher/Types.cc
src/tools/rbd_mirror/instance_watcher/Types.h
src/tools/rbd_mirror/leader_watcher/Types.cc
src/tools/rbd_mirror/leader_watcher/Types.h
src/tools/rbd_mirror/service_daemon/Types.h