[Libguestfs] nbdcpy: from scratch nbdcopy using io_uring

Richard W.M. Jones rjones at redhat.com
Fri Jun 25 08:59:04 UTC 2021


On Fri, Jun 25, 2021 at 02:16:51PM +0530, Abhay Raj Singh wrote:
> > However 6 is probably too low - in nbdcopy we use 64.
> I kept it low just to verify the system works in the way I intended it to.
> 
> > So you can
> > open multiple TCP connections on each side and issue multiple
> > commands in flight on each of those connections.
> I will look into this, so we open multiple sockets hence get multiple
> socket_fds which we can read from and write to?

Yes.

> > The code looks very minimal at the moment.  I'm not very familiar with
> > the fmt:: class.
> It's just for formatting and output like printf.
> 
> >Does it successfully make a handshake to ‘nbdkit -o’
> > yet?
> I read in the protocol document https://github.com/NetworkBlockDevice/nbd/blob/
> master/doc/proto.md#oldstyle-negotiation
> that handshake is just about the server sending data to the client on accept,
> I open a socket and connect then read the handshake, and with the data,
> then populate NbdConnection variables. All this is done currently in the
> constructor of NbdConnection synchronously. So I guess the answer
> is yes.
[...]
> command to run nbkit server
> nbdkit data ' ( 0x55 0xAA )*2048 '  -o -f -p 1234

Yes this is good.

Another way to test it might be something like this:

  nbdkit -v -o random 1G --run './src/nbdcpy --source \$port --destination \$port'

(You could use other plugins instead of random, such as data,
sparse-random, memory, etc.)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list