libsnapshot: introduce snapuserd with ublk support
This substantial commit integrates ublk (userspace block device) support
into snapuserd, enabling a new mechanism for managing snapshot devices.
Key changes include:
* Initial Ublk Server Implementation: Adds the core ublk server
for snapuserd, including plumbing, async I/O handling, and
data copying within `snapshot_handle_io_async()`.
* Device Creation & Lifecycle Management: Introduces `CreateDevice()`
and `StopDevice()` interfaces for `UblkBlockServer` to manage
ublk device lifecycle, ensuring proper cleanup and stability.
* Dynamic Ublk Enablement: Implements logic to conditionally use
ublk based on board read-only properties.
* DM-Linear Device Handling: Creates and manages dm-linear devices
on top of ublk devices so dm-switch tables can work with ublk
devices.
* Uevent Helper Callback: Adds support for a uevent helper callback
to facilitate ublk device lifecycle in early boot stages via init
using socketpair().
* API Enhancements: Introduces `GetSnapshotDeviceName()` API to
retrieve ublk device names, and `UpdateUsesUblk()` (with and without
lock) for cached ublk status checks.
This integration allows for testing of snapshot updates and
daemon transitions with ublk.
Bug: 414812023
Test: th
Change-Id: I7fbfa5ccdbe4d688352283343da4ca9546a4fcb9
Signed-off-by:
Sandeep Dhavale <dhavale@google.com>
Loading
Please register or sign in to comment