From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVekQ-00029M-Iy for qemu-devel@nongnu.org; Wed, 11 Mar 2015 07:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVekN-0006St-D6 for qemu-devel@nongnu.org; Wed, 11 Mar 2015 07:24:22 -0400 Sender: Paolo Bonzini Message-ID: <550025DD.80502@redhat.com> Date: Wed, 11 Mar 2015 12:24:13 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1424887718-10800-1-git-send-email-mreitz@redhat.com> <1424887718-10800-8-git-send-email-mreitz@redhat.com> In-Reply-To: <1424887718-10800-8-git-send-email-mreitz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/25] nbd: Add "failed to open export" error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On 25/02/2015 19:08, Max Reitz wrote: > In case the connection is closed before the export length can be read, > and an export name had been specified, this generally indicates that for > some reason the export could not be opened (e.g. there is no export with > that name). Make the error message reflect this. > > Signed-off-by: Max Reitz Which patch introduces tests/qemu-iotests/096.out? Paolo > --- > nbd.c | 6 +++++- > tests/qemu-iotests/096.out | 2 +- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/nbd.c b/nbd.c > index 77d1158..ad0948b 100644 > --- a/nbd.c > +++ b/nbd.c > @@ -600,7 +600,11 @@ int nbd_receive_negotiate(int csock, const char *name, uint32_t *flags, > } > > if (read_sync(csock, &s, sizeof(s)) != sizeof(s)) { > - error_setg(errp, "Failed to read export length"); > + if (name) { > + error_setg(errp, "Failed to open export"); > + } else { > + error_setg(errp, "Failed to read export length"); > + } > goto fail; > } > *size = be64_to_cpu(s); > diff --git a/tests/qemu-iotests/096.out b/tests/qemu-iotests/096.out > index cc10e51..80d542a 100644 > --- a/tests/qemu-iotests/096.out > +++ b/tests/qemu-iotests/096.out > @@ -9,7 +9,7 @@ read 65536/65536 bytes at offset 0 > 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drv", "tray-open": true}} > {"return": {}} > -qemu-io: can't open device nbd://127.0.0.1:PORT/drv: Failed to read export length > +qemu-io: can't open device nbd://127.0.0.1:PORT/drv: Failed to open export > no file open, try 'help open' > {"return": {}} > {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} >