Re: [PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-09-13 Thread Richard W.M. Jones
On Mon, Sep 13, 2021 at 05:07:12PM +0200, Kevin Wolf wrote: > > > if (ret < 0) { > > > -error_prepend(&local_err, "Failed to send reply: "); > > > +if (errno != EPIPE) { > > > +error_prepend(&local_err, "Failed to send reply: "); > > > +} else { > > > +

Re: [PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-09-13 Thread Kevin Wolf
Am 23.07.2021 um 17:49 hat Eric Blake geschrieben: > On Thu, Jul 22, 2021 at 11:45:52AM +0100, Richard W.M. Jones wrote: > > $ rm -f /tmp/sock /tmp/pid > > $ qemu-img create -f qcow2 /tmp/disk.qcow2 1M > > $ qemu-nbd -t --format=qcow2 --socket=/tmp/sock --pid-file=/tmp/pid > > /tmp/disk.qcow2 & >

Re: [PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-07-23 Thread Eric Blake
On Thu, Jul 22, 2021 at 11:45:52AM +0100, Richard W.M. Jones wrote: > $ rm -f /tmp/sock /tmp/pid > $ qemu-img create -f qcow2 /tmp/disk.qcow2 1M > $ qemu-nbd -t --format=qcow2 --socket=/tmp/sock --pid-file=/tmp/pid > /tmp/disk.qcow2 & > $ nbdsh -u 'nbd+unix:///?socket=/tmp/sock' -c 'h.get_size()'

[PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-07-22 Thread Richard W.M. Jones
$ rm -f /tmp/sock /tmp/pid $ qemu-img create -f qcow2 /tmp/disk.qcow2 1M $ qemu-nbd -t --format=qcow2 --socket=/tmp/sock --pid-file=/tmp/pid /tmp/disk.qcow2 & $ nbdsh -u 'nbd+unix:///?socket=/tmp/sock' -c 'h.get_size()' qemu-nbd: Disconnect client, due to: Failed to send reply: Unable to write to

[PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-07-22 Thread Richard W.M. Jones
This simple patch suppresses a warning message from qemu-nbd when a client abruptly disconnects. There is a way to work around this in the client (by shutting down the connection properly). Nevertheless the "Broken pipe" error seems unnecessary to me as it does not convey any useful information a