qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 03/10] nbd/server: use errp instead of LOG


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 03/10] nbd/server: use errp instead of LOG
Date: Fri, 7 Jul 2017 10:48:18 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/07/2017 10:29 AM, Vladimir Sementsov-Ogievskiy wrote:
> Move to modern errp scheme from just LOGging errors.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  nbd/server.c | 266 
> +++++++++++++++++++++++++++++++++++------------------------
>  1 file changed, 160 insertions(+), 106 deletions(-)
> 

> @@ -142,23 +142,26 @@ static int nbd_negotiate_send_rep_len(QIOChannel *ioc, 
> uint32_t type,
>            type, opt, len);
>  
>      magic = cpu_to_be64(NBD_REP_MAGIC);
> -    if (nbd_write(ioc, &magic, sizeof(magic), NULL) < 0) {
> -        LOG("write failed (rep magic)");
> +    if (nbd_write(ioc, &magic, sizeof(magic), errp) < 0) {
> +        error_prepend(errp, "write failed (rep magic): ");
>          return -EINVAL;

I wonder if we should try harder to preserve the errno returned by
nbd_write() instead of blindly slamming -EINVAL/-EIO everywhere.  But
I'm not going to let it hold up my review of this patch.

Reviewed-by: Eric Blake <address@hidden>

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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