[Libguestfs] [PATCH libnbd] api: Get rid of nbd_connection.

Richard W.M. Jones rjones at redhat.com
Thu May 23 15:03:28 UTC 2019


This isn't quite finished because not all of the tests or examples
have been updated, but it demonstrates an idea: Should we forget about
the concept of having multiple connections managed under a single
handle?

In this patch there is a single ‘struct nbd_handle *’ which manages a
single state machine and connection (and therefore no nbd_connection).
To connect to a multi-conn server you must do something like:

 - Connect once, check if the server supports multi-conn.

 - If it does, either disconnect and connect mulitple times "for
   real", or else open further handles as required.

An example of use of the new API can be found in
examples/threaded-reads-and-writes.c after this patch is applied.

Rich.





More information about the Libguestfs mailing list