[pve-devel] [PATCH qemu-server] qmeventd: flush after verbose printing

Dominik Csapak d.csapak at proxmox.com
Tue Nov 24 15:04:06 CET 2020


if one would try to use -v in a systemd service, systemd would disable
line buffering for stdout and no output would happen (until the buffer
is full)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 qmeventd/qmeventd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qmeventd/qmeventd.h b/qmeventd/qmeventd.h
index 1921ef3..3dc539c 100644
--- a/qmeventd/qmeventd.h
+++ b/qmeventd/qmeventd.h
@@ -30,7 +30,7 @@
 #define __NR_pidfd_send_signal 424
 #endif
 
-#define VERBOSE_PRINT(...) do { if (verbose) { printf(__VA_ARGS__); } } while (0)
+#define VERBOSE_PRINT(...) do { if (verbose) { printf(__VA_ARGS__); fflush(stdout); } } while (0)
 
 static inline void log_neg(int errval, const char *msg)
 {
-- 
2.20.1






More information about the pve-devel mailing list