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 <vsement...@virtuozzo.com> > --- > 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 <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature