Re: [Libguestfs] [libnbd PATCH 4/4] tests: Add language binding tests for stats reception

2022-09-03 Thread Eric Blake
On Sat, Sep 03, 2022 at 05:32:23PM +0100, Richard W.M. Jones wrote: > > So the patch series is OK, modulo my comments. I've made tweaks according to your requests. > > But I think it'd be better not to bind our future selves to > complicated guarantees about what are basically internal details

Re: [Libguestfs] [libnbd PATCH 1/4] internal: Track traffic stats

2022-09-03 Thread Eric Blake
On Sat, Sep 03, 2022 at 05:25:11PM +0100, Richard W.M. Jones wrote: > On Fri, Sep 02, 2022 at 05:14:22PM -0500, Eric Blake wrote: > > #ifdef DUMP_PACKETS > > - if (h->rbuf != NULL) > > -nbd_internal_hexdump (h->rbuf, r, stderr); > > + nbd_internal_hexdump (h->rbuf, r, stderr); > > Should

[Libguestfs] [libnbd PATCH 1/2] debug: Change trace of RStaticString returns

2022-09-03 Thread Eric Blake
We have very few APIs that return RStaticString. At present, only two can fail (get_protocol, connection_state); and when they succeed, their string is short enough to not need sanitization. Thus we can simplify them, which in turn will make it easier for the next patch to convert the remaining

[Libguestfs] [libnbd PATCH 2/2] debug: Trace even may_set_error=false functions

2022-09-03 Thread Eric Blake
When we introduced debug tracing, we stated that "because of limitations in the way debugging works it can only be done on functions which have may_set_error = true". This is because our trace statements depended on the current error context for part of its trace. But this is overly restrictive;

Re: [Libguestfs] [libnbd PATCH 4/4] tests: Add language binding tests for stats reception

2022-09-03 Thread Richard W.M. Jones
So the patch series is OK, modulo my comments. But I think it'd be better not to bind our future selves to complicated guarantees about what are basically internal details of the library and protocol. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read

Re: [Libguestfs] [libnbd PATCH 3/4] api: Add new nbd_stats_*() statistics counters

2022-09-03 Thread Richard W.M. Jones
On Fri, Sep 02, 2022 at 05:14:24PM -0500, Eric Blake wrote: > I was trying to write a test that determined whether a failure was due > to a short-circuit test on the client side or an actual failure > returned by the server. Such a test is a lot easier if we can watch > status counters increase

Re: [Libguestfs] [libnbd PATCH 1/4] internal: Track traffic stats

2022-09-03 Thread Richard W.M. Jones
On Fri, Sep 02, 2022 at 05:14:22PM -0500, Eric Blake wrote: > #ifdef DUMP_PACKETS > - if (h->rbuf != NULL) > -nbd_internal_hexdump (h->rbuf, r, stderr); > + nbd_internal_hexdump (h->rbuf, r, stderr); Should this be a separate patch? I guess the assertion here is that h->rbuf is set to an