FYI here is the asynch version:
https://gitlab.com/rwmjones/libnbd/-/commits/nbdublk/
I kept it as two commits so you can see the differences but obviously
it would be folded into one commit upstream.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit