[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 04/13] nbd/server: structurize simple reply h
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH v3 04/13] nbd/server: structurize simple reply header sending |
Date: |
Thu, 12 Oct 2017 16:52:53 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/12/2017 04:53 AM, Vladimir Sementsov-Ogievskiy wrote:
> Use packed structure instead of pointer arithmetics.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> 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
signature.asc
Description: OpenPGP digital signature