qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 24/25] nbd: Fix error_append_hint usage


From: Eric Blake
Subject: Re: [PATCH v3 24/25] nbd: Fix error_append_hint usage
Date: Tue, 24 Sep 2019 16:12:34 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 9/24/19 3:09 PM, Vladimir Sementsov-Ogievskiy wrote:
> If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro.
> Otherwise hint will not be appended in case of errp == &fatal_err
> (program will exit before error_append_hint() call). Fix such cases.
> 

Copy-and-pasted, but if you want to tweak the grammar to all of the
patches with identical bodies:

If we want to append a hint to errp, we must use the ERRP_FUNCTION_BEGIN
macro.  Otherwise, the hint will not be appended when errp == &fatal_err
(the program will exit prior to the error_append_hint() call).  Fix such
cases.

> This commit (together with its neighbors) was generated by
> 
> git grep -l 'error_append_hint(errp' | while read f; do \
> spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \
> --in-place $f; done
> 
> and then
> 
> ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"
> 
> (auto-msg was a file with this commit message)
> 
> Still, for backporting it may be more comfortable to use only the first
> command and then do one huge commit.
> 
> Reported-by: Greg Kurz <address@hidden>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---

Should the commit-per-subsystem.py script append a distinct CC: line as
long as it is already grouping files by maintainer?

>  nbd/client.c | 1 +
>  nbd/server.c | 1 +
>  2 files changed, 2 insertions(+)

Reviewed-by: Eric Blake <address@hidden>

It's probably easier to take this entire series through one maintainer
(Markus, since it is error-related), than to have me pick up this patch
by itself through the NBD tree.

> 
> diff --git a/nbd/client.c b/nbd/client.c
> index b9dc829175..4d90a26c00 100644
> --- a/nbd/client.c
> +++ b/nbd/client.c
> @@ -153,6 +153,7 @@ static int nbd_receive_option_reply(QIOChannel *ioc, 
> uint32_t opt,
>  static int nbd_handle_reply_err(QIOChannel *ioc, NBDOptionReply *reply,
>                                  bool strict, Error **errp)
>  {
> +    ERRP_FUNCTION_BEGIN();
>      g_autofree char *msg = NULL;
>  
>      if (!(reply->type & (1 << 31))) {
> diff --git a/nbd/server.c b/nbd/server.c
> index 28c3c8be85..09565ad8dc 100644
> --- a/nbd/server.c
> +++ b/nbd/server.c
> @@ -1616,6 +1616,7 @@ void nbd_export_close(NBDExport *exp)
>  
>  void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error 
> **errp)
>  {
> +    ERRP_FUNCTION_BEGIN();
>      if (mode == NBD_SERVER_REMOVE_MODE_HARD || QTAILQ_EMPTY(&exp->clients)) {
>          nbd_export_close(exp);
>          return;
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]