of using the kernel nbd client. I think a C library would be best, but a python
starting in this direction.
If you like to check the prototype, see:
qemu's nbd/client.c was very helpful so far, since NBD doc
is not very clear.
Not sure that imageio is the best place for this. Do you have a better idea
about a better home for this library?
Here is what we can do now:
$ qemu-img create -f qcow2 test.qcow2 1g
Formatting 'test.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16
$ qemu-nbd --fork -k /tmp/nbd.sock -t -f qcow2 test.qcow2 -x export -n
$ python3
...
>>> from ovirt_imageio_common import nbd
>>> c = nbd.Client("/tmp/nbd.sock", "export")
>>> c.export_size
1073741824
>>> c.minimum_block_size
1
>>> c.preferred_bloc_ksize
4096
>>> c.maximum_bloc_ksize
33554432