qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] virtiofsd: replace warn(3) and warnx(3) wit


From: piaojun
Subject: Re: [Qemu-devel] [PATCH 1/2] virtiofsd: replace warn(3) and warnx(3) with fuse_warning()
Date: Fri, 23 Aug 2019 23:09:52 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0


On 2019/8/23 17:24, Stefan Hajnoczi wrote:
> Do not use warn(3) and warnx(3) since they print to stderr.  When
> --syslog is used these messages must go to syslog(3) instead.
> 
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  contrib/virtiofsd/passthrough_ll.c | 36 +++++++++++++++---------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/contrib/virtiofsd/passthrough_ll.c 
> b/contrib/virtiofsd/passthrough_ll.c
> index ca11764feb..873e0938a7 100644
> --- a/contrib/virtiofsd/passthrough_ll.c
> +++ b/contrib/virtiofsd/passthrough_ll.c
> @@ -628,12 +628,12 @@ retry:
>  
>       res = readlinkat(lo->proc_self_fd, procname, path, PATH_MAX);
>       if (res < 0) {
> -             warn("lo_parent_and_name: readlink failed");
> +             fuse_warning("lo_parent_and_name: readlink failed: %m\n");
>               goto fail_noretry;
>       }
>  
>       if (res >= PATH_MAX) {
> -             warnx("lo_parent_and_name: readlink overflowed");
> +             fuse_warning("lo_parent_and_name: readlink overflowed\n");
>               goto fail_noretry;
>       }
>       path[res] = '\0';
> @@ -641,7 +641,7 @@ retry:
>       last = strrchr(path, '/');
>       if (last == NULL) {
>               /* Shouldn't happen */
> -             warnx("lo_parent_and_name: INTERNAL ERROR: bad path read from 
> proc");
> +             fuse_warning("lo_parent_and_name: INTERNAL ERROR: bad path read 
> from proc\n");
>               goto fail_noretry;
>       }
>       if (last == path) {
> @@ -655,13 +655,13 @@ retry:
>               res = fstatat(AT_FDCWD, last == path ? "/" : path, &stat, 0);
>               if (res == -1) {
>                       if (!retries)
> -                             warn("lo_parent_and_name: failed to stat 
> parent");
> +                             fuse_warning("lo_parent_and_name: failed to 
> stat parent: %m\n");
>                       goto fail;
>               }
>               p = lo_find(lo, &stat);
>               if (p == NULL) {
>                       if (!retries)
> -                             warnx("lo_parent_and_name: failed to find 
> parent");
> +                             fuse_warning("lo_parent_and_name: failed to 
> find parent\n");
>                       goto fail;
>               }
>       }
> @@ -669,12 +669,12 @@ retry:
>       res = fstatat(p->fd, last, &stat, AT_SYMLINK_NOFOLLOW);
>       if (res == -1) {
>               if (!retries)
> -                     warn("lo_parent_and_name: failed to stat last");
> +                     fuse_warning("lo_parent_and_name: failed to stat last: 
> %m\n");
>               goto fail_unref;
>       }
>       if (stat.st_dev != inode->key.dev || stat.st_ino != inode->key.ino) {
>               if (!retries)
> -                     warnx("lo_parent_and_name: filed to match last");
> +                     fuse_warning("lo_parent_and_name: filed to match 
> last\n");

Typo *filed* -> *failed*, and others looks good to me. Feel free to add:

Reviewed-by: Jun Piao <address@hidden>

Jun



reply via email to

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