[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 095/108] virtiofsd: convert more fprintf and perror to use fuse lo
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 095/108] virtiofsd: convert more fprintf and perror to use fuse log infra |
Date: |
Thu, 23 Jan 2020 16:46:17 +0000 |
From: Eryu Guan <address@hidden>
Signed-off-by: Eryu Guan <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Reviewed-by: Misono Tomohiro <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
tools/virtiofsd/fuse_signals.c | 7 +++++--
tools/virtiofsd/helper.c | 9 ++++++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/tools/virtiofsd/fuse_signals.c b/tools/virtiofsd/fuse_signals.c
index dc7c8ac025..f18625b6e2 100644
--- a/tools/virtiofsd/fuse_signals.c
+++ b/tools/virtiofsd/fuse_signals.c
@@ -12,6 +12,7 @@
#include "fuse_i.h"
#include "fuse_lowlevel.h"
+#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -47,13 +48,15 @@ static int set_one_signal_handler(int sig, void
(*handler)(int), int remove)
sa.sa_flags = 0;
if (sigaction(sig, NULL, &old_sa) == -1) {
- perror("fuse: cannot get old signal handler");
+ fuse_log(FUSE_LOG_ERR, "fuse: cannot get old signal handler: %s\n",
+ strerror(errno));
return -1;
}
if (old_sa.sa_handler == (remove ? handler : SIG_DFL) &&
sigaction(sig, &sa, NULL) == -1) {
- perror("fuse: cannot set signal handler");
+ fuse_log(FUSE_LOG_ERR, "fuse: cannot set signal handler: %s\n",
+ strerror(errno));
return -1;
}
return 0;
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 33749bfcb7..f98d8f2eb2 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -208,7 +208,8 @@ int fuse_daemonize(int foreground)
char completed;
if (pipe(waiter)) {
- perror("fuse_daemonize: pipe");
+ fuse_log(FUSE_LOG_ERR, "fuse_daemonize: pipe: %s\n",
+ strerror(errno));
return -1;
}
@@ -218,7 +219,8 @@ int fuse_daemonize(int foreground)
*/
switch (fork()) {
case -1:
- perror("fuse_daemonize: fork");
+ fuse_log(FUSE_LOG_ERR, "fuse_daemonize: fork: %s\n",
+ strerror(errno));
return -1;
case 0:
break;
@@ -228,7 +230,8 @@ int fuse_daemonize(int foreground)
}
if (setsid() == -1) {
- perror("fuse_daemonize: setsid");
+ fuse_log(FUSE_LOG_ERR, "fuse_daemonize: setsid: %s\n",
+ strerror(errno));
return -1;
}
--
2.24.1
- [PULL 086/108] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy(), (continued)
- [PULL 086/108] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 085/108] virtiofsd: Support remote posix locks, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 088/108] virtiofsd: make lo_release() atomic, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 087/108] virtiofsd: prevent fv_queue_thread() vs virtio_loop() races, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 090/108] virtiofsd: rename inode->refcount to inode->nlookup, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 089/108] virtiofsd: prevent races with lo_dirp_put(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 091/108] libvhost-user: Fix some memtable remap cases, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 092/108] virtiofsd: passthrough_ll: fix refcounting on remove/rename, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 097/108] virtiofsd: Fix data corruption with O_APPEND write in writeback mode, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 096/108] virtiofsd: Reset O_DIRECT flag during file open, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 095/108] virtiofsd: convert more fprintf and perror to use fuse log infra,
Dr. David Alan Gilbert (git) <=
- [PULL 094/108] virtiofsd: do not always set FUSE_FLOCK_LOCKS, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 093/108] virtiofsd: introduce inode refcount to prevent use-after-free, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 098/108] virtiofsd: passthrough_ll: Use cache_readdir for directory open, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 099/108] virtiofsd: add definition of fuse_buf_writev(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 100/108] virtiofsd: use fuse_buf_writev to replace fuse_buf_write for better performance, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 105/108] virtiofsd: Convert lo_destroy to take the lo->mutex lock itself, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 102/108] virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 101/108] virtiofsd: process requests in a thread pool, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 106/108] virtiofsd/passthrough_ll: Pass errno to fuse_reply_err(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 104/108] virtiofsd: add --thread-pool-size=NUM option, Dr. David Alan Gilbert (git), 2020/01/23