On 10/12/2017 04:53 AM, Vladimir Sementsov-Ogievskiy wrote:
> Use packed structure instead of pointer arithmetics.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
> ---
>  include/block/nbd.h |  6 ++++++
>  nbd/server.c        | 36 ++++++++++++++----------------------
>  2 files changed, 20 insertions(+), 22 deletions(-)
> 

>      if (!len) {
> -        ret = nbd_send_reply(client->ioc, reply, errp);
> +        ret = nbd_write(client->ioc, &simple_reply, sizeof(simple_reply), 
> NULL);
>      } else {
>          qio_channel_set_cork(client->ioc, true);
> -        ret = nbd_send_reply(client->ioc, reply, errp);
> +        ret = nbd_write(client->ioc, &simple_reply, sizeof(simple_reply), 
> NULL);

One more thing: this should be errp, not NULL - we don't want to lose
the error, even if the next patch changes things yet again.

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