|
ublk-cpp v0.0
|
High-level API for running a ublk daemon. More...
Classes | |
| struct | Options |
| Extra options for daemon::run(). More... | |
Functions | |
| auto | setup (int control_fd, ublksrv_ctrl_dev_info *info) noexcept |
| Ensure the device described by info has been created and return its current information. | |
| auto | configure (int control_fd, uint32_t dev_id, ublk_params *params) noexcept |
| Ensure the device has been configured and return its current configuration in params. | |
| auto | start (int control_fd, uint32_t dev_id, int32_t daemon_pid) noexcept |
| Start the device, served by this daemon, if possible. | |
| template<IoHandler Handler> | |
| auto | run (int control_fd, uint32_t dev_id, Handler &handler, Options options) noexcept |
| Run the daemon serving a device until it stops. | |
| template<ShmHandler Handler> | |
| auto | run_shm_server (int control_fd, uint32_t dev_id, std::string_view path, Handler &handler, uint32_t flags) noexcept |
| Run the shared memory buffer registration service over a Unix domain socket (UBLK_F_SHMEM_ZC). | |
High-level API for running a ublk daemon.
|
inlinenoexcept |
Ensure the device has been configured and return its current configuration in params.
| control_fd | The control file descriptor for the ublk device. |
| dev_id | The device ID of the ublk device. |
| params | Configuration to apply when the device is not yet configured; on success it is written back with the device's effective parameters. |
Definition at line 42 of file daemon.hpp.
|
inlinenoexcept |
Run the daemon serving a device until it stops.
| control_fd | The control file descriptor for the ublk device. |
| dev_id | The device ID of the ublk device. |
| handler | The IoHandler used to process requests of all queues. |
| options | Runtime options of the per-queue io_uring loops. |
Definition at line 82 of file daemon.hpp.
|
inlinenoexcept |
Run the shared memory buffer registration service over a Unix domain socket (UBLK_F_SHMEM_ZC).
| control_fd | The control file descriptor for the ublk device. |
| dev_id | The device ID of the ublk device. |
| path | The Unix domain socket path to listen on. |
| handler | The ShmHandler notified of buffer registration and unregistration. |
| flags | Flags of the registered buffers (UBLK_SHMEM_BUF_*), e.g. UBLK_SHMEM_BUF_READ_ONLY. |
Definition at line 102 of file daemon.hpp.
|
inlinenoexcept |
Ensure the device described by info has been created and return its current information.
| control_fd | The control file descriptor for the ublk device. |
| info | Device info of the device to ensure exists. If the device already exists, it is updated with the current information. |
Definition at line 27 of file daemon.hpp.
|
inlinenoexcept |
Start the device, served by this daemon, if possible.
| control_fd | The control file descriptor for the ublk device. |
| dev_id | The device ID of the ublk device. |
| daemon_pid | The PID of the daemon process serving the device. |
Definition at line 55 of file daemon.hpp.