libublk-rs: v0.2 with async/await support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

libublk-rs v0.2 is released:

https://crates.io/crates/libublk
https://github.com/ming1/libublk-rs

Changes:

- support async/await for generic async fn(don't depend on runtime) and io_uring.
- unprivileged ublk
- queue idle handle
- almost all features in libublksrv are supported in libublk-rs now
- command line support for examples

Now each io command can be handled in dedicated io task as following,
and it looks like sync programming, but everything is handled in async
style:

         let mut cmd_op = libublk::sys::UBLK_IO_FETCH_REQ;
         let mut result = 0;
         let addr = std::ptr::null_mut();
         loop {
             if q.submit_io_cmd(tag, cmd_op, addr, result).await
                 == libublk::sys::UBLK_IO_RES_ABORT
             {
                 break;
             }

             // io_uring async is preferred
             result = handle_io_cmd(&q, tag).await;
             cmd_op = libublk::sys::UBLK_IO_COMMIT_AND_FETCH_REQ;
         }

Roadmap:
1) write more complicated targets with async/await

- re-write qcow2 with clean async/await implementation in rublk project which
depends on libublk

	https://crates.io/crates/rublk
	https://github.com/ming1/rublk

2) tens of thousands of ublk device support
- switch control command to async/await, and make ublk device in one
  thread with single blocking point

- shared task: one task can create multiple ublk devices

- shared uring: create multiple ublk device with single uring.

3) support tokio async, especially for non-io_uring target io handling


Thanks,
Ming





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux