qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 07/25] nbd: Add "failed to open export" error me


From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH 07/25] nbd: Add "failed to open export" error message
Date: Wed, 11 Mar 2015 12:24:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


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 <address@hidden>

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"}
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]