From 7fce71723bb2c182d17e1f4815feaf823bade5cb Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Thu, 17 Jan 2019 15:43:38 +0400 Subject: slirp: replace trace functions with DEBUG calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove a dependency on QEMU. Use the existing logging facilities. Set SLIRP_DEBUG=tftp to get tftp log. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/debug.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'slirp/debug.h') diff --git a/slirp/debug.h b/slirp/debug.h index 269d97d807..44d922df37 100644 --- a/slirp/debug.h +++ b/slirp/debug.h @@ -8,9 +8,10 @@ #ifndef DEBUG_H_ #define DEBUG_H_ -#define DBG_CALL 0x1 -#define DBG_MISC 0x2 -#define DBG_ERROR 0x4 +#define DBG_CALL (1 << 0) +#define DBG_MISC (1 << 1) +#define DBG_ERROR (1 << 2) +#define DBG_TFTP (1 << 3) extern int slirp_debug; @@ -38,4 +39,10 @@ extern int slirp_debug; } \ } while (0) +#define DEBUG_TFTP(fmt, ...) do { \ + if (G_UNLIKELY(slirp_debug & DBG_TFTP)) { \ + g_debug(fmt, ##__VA_ARGS__); \ + } \ +} while (0) + #endif /* DEBUG_H_ */ -- cgit 1.4.1