Actually no, I had to revert this.
https://gitlab.com/nbdkit/libnbd/-/commit/fb42056929e9177e0de2603e2f430a8...
I added a test:
https://gitlab.com/nbdkit/libnbd/-/commit/23b41ad0a2a6d6582a8e643e42960d2...
However the test deadlocks when we try to open multiple connections to
qemu-nbd (with your patch). As best I can tell this is because of
qemu's file locking. qemu-nbd doesn't seem to support the -U option
found in qemu-img, but even if it did I don't think it would be a good
idea to tell users that they have to use it.
I think this needs to be fixed in qemu-nbd itself.
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