22 cpu_set_t *cpuset)
noexcept {
23 return detail::task_invoke(detail::control_get_queue_affinity_t{},
24 control_fd, dev_id, q_id, cpuset);
35 ublksrv_ctrl_dev_info *info)
noexcept {
36 return detail::task_invoke(detail::control_get_dev_info_t{}, control_fd,
47inline auto add_dev(
int control_fd, ublksrv_ctrl_dev_info *info)
noexcept {
49 detail::ex::then([](int32_t)
noexcept {});
58inline auto del_dev(
int control_fd, uint32_t dev_id)
noexcept {
59 return detail::task_invoke(detail::control_del_dev_t{}, control_fd, dev_id);
69inline auto start_dev(
int control_fd, uint32_t dev_id,
70 int32_t daemon_pid)
noexcept {
71 return detail::task_invoke(detail::control_start_dev_t{}, control_fd,
81inline auto stop_dev(
int control_fd, uint32_t dev_id)
noexcept {
82 return detail::task_invoke(detail::control_stop_dev_t{}, control_fd,
94 const ublk_params *params)
noexcept {
95 return detail::task_invoke(detail::control_set_params_t{}, control_fd,
107 ublk_params *params)
noexcept {
108 return detail::task_invoke(detail::control_get_params_t{}, control_fd,
119 return detail::task_invoke(detail::control_start_user_recovery_t{},
131 int32_t daemon_pid)
noexcept {
132 return detail::task_invoke(detail::control_end_user_recovery_t{},
133 control_fd, dev_id, daemon_pid);
144 detail::ex::then([](int32_t)
noexcept {});
154 return detail::task_invoke(detail::control_del_dev_async_t{}, control_fd,
166 uint64_t sectors)
noexcept {
167 return detail::task_invoke(detail::control_update_size_t{}, control_fd,
180 uint64_t timeout_ms)
noexcept {
181 return detail::task_invoke(detail::control_quiesce_dev_t{}, control_fd,
192 return detail::task_invoke(detail::control_try_stop_dev_t{}, control_fd,
207 const ublk_shmem_buf_reg *reg)
noexcept {
208 return detail::task_invoke(detail::control_register_shm_buf_t{}, control_fd,
221 uint64_t buf_index)
noexcept {
222 return detail::task_invoke(detail::control_unregister_shm_buf_t{},
223 control_fd, dev_id, buf_index);
Implementation of ublk control command interface.
auto get_features(Fd fd, uint64_t *features) noexcept
Get the feature flags supported by the ublk driver.
auto add_dev(Fd fd, ublksrv_ctrl_dev_info *info) noexcept
Add a new ublk device.
The main namespace of the ublk-cpp library.
auto stop_dev(int control_fd, uint32_t dev_id) noexcept
Stop a ublk device.
auto end_user_recovery(int control_fd, uint32_t dev_id, int32_t daemon_pid) noexcept
End user recovery for a ublk device.
auto get_features(int control_fd, uint64_t *features) noexcept
Get the feature flags supported by the ublk driver.
auto get_params(int control_fd, uint32_t dev_id, ublk_params *params) noexcept
Get the parameters of a ublk device.
auto register_shm_buf(int control_fd, uint32_t dev_id, const ublk_shmem_buf_reg *reg) noexcept
Register a shared memory buffer for zero-copy I/O on a ublk device (UBLK_F_SHMEM_ZC).
auto unregister_shm_buf(int control_fd, uint32_t dev_id, uint64_t buf_index) noexcept
Unregister a shared memory buffer from a ublk device.
auto quiesce_dev(int control_fd, uint32_t dev_id, uint64_t timeout_ms) noexcept
Quiesce a ublk device (UBLK_F_QUIESCE).
auto update_size(int control_fd, uint32_t dev_id, uint64_t sectors) noexcept
Update the size of a ublk device.
auto set_params(int control_fd, uint32_t dev_id, const ublk_params *params) noexcept
Set the parameters of a ublk device.
auto start_dev(int control_fd, uint32_t dev_id, int32_t daemon_pid) noexcept
Start a ublk device.
auto del_dev_async(int control_fd, uint32_t dev_id) noexcept
Delete a ublk device asynchronously.
auto get_dev_info(int control_fd, uint32_t dev_id, ublksrv_ctrl_dev_info *info) noexcept
Get the device information for a specific ublk device.
auto try_stop_dev(int control_fd, uint32_t dev_id) noexcept
Try to stop a ublk device if it has no openers (UBLK_F_SAFE_STOP_DEV).
auto start_user_recovery(int control_fd, uint32_t dev_id) noexcept
Start user recovery for a ublk device.
auto add_dev(int control_fd, ublksrv_ctrl_dev_info *info) noexcept
Add a new ublk device.
auto get_queue_affinity(int control_fd, uint32_t dev_id, uint16_t q_id, cpu_set_t *cpuset) noexcept
Get the queue affinity for a specific ublk queue.
auto del_dev(int control_fd, uint32_t dev_id) noexcept
Delete a ublk device.