[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 04/13] nbd/server: structurize simple reply h
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 04/13] nbd/server: structurize simple reply header sending |
Date: |
Thu, 12 Oct 2017 16:42:31 -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.
English is fun! In the subject line, I'm fairly certain that
"structurize" is not likely to be in any dictionary, yet it is a perfect
word describing the patch, so I'm not touching it ;)
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> include/block/nbd.h | 6 ++++++
> nbd/server.c | 36 ++++++++++++++----------------------
> 2 files changed, 20 insertions(+), 22 deletions(-)
>
> +++ b/nbd/server.c
> @@ -902,26 +902,6 @@ static int nbd_receive_request(QIOChannel *ioc,
> NBDRequest *request,
> return 0;
> }
>
> -static int nbd_send_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)
> -{
> - uint8_t buf[NBD_REPLY_SIZE];
> -
> - reply->error = system_errno_to_nbd_errno(reply->error);
> -
> - trace_nbd_send_reply(reply->error, reply->handle);
We lose a trace here...
> static int nbd_co_send_simple_reply(NBDRequestData *req, NBDReply *reply,
> int len, Error **errp)
> {
> NBDClient *client = req->client;
> + NBDSimpleReply simple_reply;
> int ret;
>
> g_assert(qemu_in_coroutine());
>
> trace_nbd_co_send_simple_reply(reply->handle, reply->error, len);
>
> + set_be_simple_reply(&simple_reply,
> system_errno_to_nbd_errno(reply->error),
> + reply->handle);
> +
...but it always occurred immediately after another trace that has
redundant information (well, the trace you kept shows pre- rather than
post-translation of errno value to NBD wire value, and the trace you
drop didn't show length). I'm fine with the reduction, but it needs a
tweak to trace-events to reap the dead trace.
With that change,
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v3 03/13] nbd: rename some simple-request related objects to be _simple_, (continued)
- [Qemu-devel] [PATCH v3 10/13] nbd/client: refactor nbd_receive_starttls, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 12/13] nbd/client: prepare nbd_receive_reply for structured reply, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 02/13] block/nbd-client: refactor nbd_co_receive_reply, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 13/13] nbd: Minimal structured read for client, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 09/13] nbd: Minimal structured read for server, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 11/13] nbd: share some nbd entities to be reused in block/nbd-client.c, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 07/13] nbd-server: simplify reply transmission, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 04/13] nbd/server: structurize simple reply header sending, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 01/13] block/nbd-client: assert qiov len once in nbd_co_request, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 06/13] nbd/server: refactor nbd_co_send_simple_reply parameters, Vladimir Sementsov-Ogievskiy, 2017/10/12
- [Qemu-devel] [PATCH v3 08/13] nbd: header constants indenting, Vladimir Sementsov-Ogievskiy, 2017/10/12
- Re: [Qemu-devel] [PATCH v3 00/13] nbd minimal structured read, no-reply, 2017/10/12