From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, armbru@redhat.com, mreitz@redhat.com,
kwolf@redhat.com, pbonzini@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH 2/3] nbd: publish _lookup functions
Date: Tue, 18 Dec 2018 14:53:07 -0600 [thread overview]
Message-ID: <cbdeb57e-145c-e10f-084a-7273e73c17e0@redhat.com> (raw)
In-Reply-To: <20181102151152.288399-3-vsementsov@virtuozzo.com>
On 11/2/18 10:11 AM, Vladimir Sementsov-Ogievskiy wrote:
> These functions are used for formatting pretty trace points. We are
> going to add some in block/nbd-client, so, let's publish all these
> functions at once. Note, that nbd_reply_type_lookup is already
> published, and constants, "named" by these functions live in
> include/block/nbd.h too.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> include/block/nbd.h | 5 +++++
> nbd/nbd-internal.h | 5 -----
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/block/nbd.h b/include/block/nbd.h
> index 6a5bfe5d55..65402d3396 100644
> --- a/include/block/nbd.h
> +++ b/include/block/nbd.h
> @@ -343,5 +343,10 @@ static inline bool nbd_reply_is_structured(NBDReply *reply)
> }
>
> const char *nbd_reply_type_lookup(uint16_t type);
> +const char *nbd_opt_lookup(uint32_t opt);
> +const char *nbd_rep_lookup(uint32_t rep);
> +const char *nbd_info_lookup(uint16_t info);
> +const char *nbd_cmd_lookup(uint16_t info);
> +const char *nbd_err_lookup(int err);
Reviewed-by: Eric Blake <eblake@redhat.com>
Side note: We could even go further, and have code to auto-generate the
tables; see how nbdkit did it:
https://github.com/libguestfs/nbdkit/commit/d198cf9c
But for now, the protocol doesn't grow all that frequently, so keeping
the lists up to date by hand doesn't bother me.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2018-12-18 20:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 15:11 [Qemu-devel] [PATCH 0/3] nbd-client: drop extra error noise Vladimir Sementsov-Ogievskiy
2018-11-02 15:11 ` [Qemu-devel] [PATCH 1/3] error: add error_get_hint Vladimir Sementsov-Ogievskiy
2018-12-18 20:50 ` Eric Blake
2018-11-02 15:11 ` [Qemu-devel] [PATCH 2/3] nbd: publish _lookup functions Vladimir Sementsov-Ogievskiy
2018-12-18 20:53 ` Eric Blake [this message]
2018-11-02 15:11 ` [Qemu-devel] [PATCH 3/3] block/nbd-client: use traces instead of noisy error_report_err Vladimir Sementsov-Ogievskiy
2018-12-18 21:23 ` Eric Blake
2018-12-18 22:14 ` Eric Blake
2018-12-12 8:56 ` [Qemu-devel] ping Re: [PATCH 0/3] nbd-client: drop extra error noise Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cbdeb57e-145c-e10f-084a-7273e73c17e0@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).