]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd, tools: migrate from boost::variant to std::variant 64101/head
authorKefu Chai <tchaikov@gmail.com>
Wed, 7 May 2025 00:42:52 +0000 (08:42 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 23 Jun 2025 07:47:43 +0000 (09:47 +0200)
commit32ca692abd8d1036c3ff923b78de2cfce5983646
tree5a71450f208f29c0dfdb0d087cbcd14a005aa517
parente01243e99c03d93e9e1597bce8d11d806a4cdfab
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>
(cherry picked from commit 786ea203a28374d8d9bf0b8cc9c3c43dcf686328)
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