Re: [Libguestfs] [nbdkit PATCH 4/4] blocksize-policy: Add blocksize-write-disconnect=N parameter

2022-10-27 Thread Richard W.M. Jones
On Wed, Oct 26, 2022 at 05:18:02PM -0500, Eric Blake wrote: > Allow this filter to emulate qemu's behavior of a hard disconnect on > write attempts larger than 32M. > --- > .../nbdkit-blocksize-policy-filter.pod| 21 > tests/Makefile.am | 12 +- >

Re: [Libguestfs] [nbdkit PATCH 3/4] api: Add nbdkit_disconnect(int)

2022-10-27 Thread Richard W.M. Jones
On Wed, Oct 26, 2022 at 05:18:01PM -0500, Eric Blake wrote: > We have already exposed nbdkit_shutdown() as a way for a plugin to > request that nbdkit itself shuts down when convenient (taking away the > current and all other client connections). But we lacked a way for a > plugin (or filter) to

Re: [Libguestfs] [nbdkit PATCH 2/4] server: Give client EOF when we are done writing

2022-10-27 Thread Richard W.M. Jones
On Wed, Oct 26, 2022 at 05:18:00PM -0500, Eric Blake wrote: > - if (conn->sockin >= 0) > -closesocket (conn->sockin); > - if (conn->sockout >= 0 && conn->sockin != conn->sockout) > -closesocket (conn->sockout); > + if (conn->sockout >= 0 && how == SHUT_WR) { > +if (conn->sockin ==

Re: [Libguestfs] [nbdkit PATCH 1/4] server: Switch connection status to enum

2022-10-27 Thread Richard W.M. Jones
On Wed, Oct 26, 2022 at 05:17:59PM -0500, Eric Blake wrote: > Instead of using magic numbers, track connection status via an enum. > While at it, convert functions whose return value is not used to > instead be void. No semantic change. > --- > server/internal.h| 16 +-- >

Re: [Libguestfs] [libnbd PATCH 3/3] nbdsh: Allow -u interleaved with -c

2022-10-27 Thread Richard W.M. Jones
It's confusing having patches 1 & 3 separate. I can't help thinking this whole series would be easier to understand if instead of building a list of Python commands as strings, we built a list of "instructions", where an instruction is a qualified union which (in OCaml) would be: type

Re: [Libguestfs] [libnbd PATCH 1/3] nbdsh: Refactor handling of -u and friends

2022-10-27 Thread Richard W.M. Jones
On Wed, Oct 26, 2022 at 04:15:59PM -0500, Eric Blake wrote: > Slightly rearrange the code so that we can reuse the -c framework for > executing the code snippets for -u, --opt-mode, and --base-allocation. > Slightly changes the error message when a URI is invalid (which > requires revamping