[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] Python NBD client library
From: |
Richard W.M. Jones |
Subject: |
Re: [Qemu-block] Python NBD client library |
Date: |
Tue, 31 Jul 2018 16:16:52 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Jul 31, 2018 at 05:48:50PM +0300, Nir Soffer wrote:
> Thanks everyone for the good input on
> http://lists.nongnu.org/archive/html/qemu-block/2018-07/msg00168.html
>
> I'm convinced that the best direction for oVirt is having NBD client instead
> of using the kernel nbd client. I think a C library would be best, but a
> python
> version is faster to implement and may be good enough for oVirt, so I'm
> starting in this direction.
I think clients in all languages are welcome, though I agree that
eventually we're going to need a C client (and not the Curl track
which I was headed down, which was the wrong direction).
> If you like to check the prototype, see:
> https://gerrit.ovirt.org/c/93384/
>
> qemu's nbd/client.c was very helpful so far, since NBD doc
> https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
> is not very clear.
I agree the protocol spec has evolved by accretion so that it no
longer has a coherent narrative. Anyway some general comments on your
client in no particular order:
- Be nice if it was a separate Python library.
- It should support TCP sockets too. In fact those are probably more
important than Unix sockets in the bigger picture. Is there not a
Python "socket client" class you can subclass from which does all
the socket machinery?
- It looks as if you're only handling fixed new-style. Good! Don't
bother implementing anything else.
I would test against ‘qemu-nbd -x’ primarily, then secondarily against
nbd-server and nbdkit. Once it interoperates with all 3 then you're
good to go :-)
> Not sure that imageio is the best place for this. Do you have a better idea
> about a better home for this library?
A separate Python library in PyPi or wherever would be my preference.
I don't know what the policy is in imageio about dependencies though.
[...]
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org