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

Eric Blake
Sat, 03 Sep 2022 18:26:01 -0000

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 this be a separate patch?  I guess the assertion here is that
> h->rbuf is set to an address earlier in the function so it can never
> be NULL.

Correct on both counts: I noticed it while touching the function; the
'if' is dead code becaues of earlier in the function, but a separate
patch is worthwhile.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org