[Libguestfs] nbd_aio_p{read,write} responsibilities

Richard W.M. Jones
Fri, 18 Jun 2021 12:44:27 -0000

Another way to proceed here could be to write a from-scratch version
of nbdcopy using io_uring, to get a feel for the "shape" of what that
would look like.  Then translate back from that into an NBD API
proposal.

For simplicity in implementation:

 - Only implement NBD oldstyle protocol, which is very simple.  You
   can find it documented here:

https://gitlab.com/nbdkit/nbdkit/-/blob/dd894ae009c16810605252ee6996d329c4a13327/common/protocol/nbd-protocol.h#L51
   nbdkit supports oldstyle if you add the -o option.

 - Only do NBD server -> NBD server copies, forget about local files,
   pipes, etc.

 - Don't implement any of the options, synchronous mode, etc.  Just
   hard-code all the settings.

I'm interested in seeing what this would look like.  Also it might
answer a few questions I have:

 - Do we need to use threads in nbdcopy if we have io_uring?

 - How many io_urings should we use?

 - Can we avoid kernel-userspace copies?

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.