[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment varia
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment variable |
Date: |
Mon, 14 Jan 2019 01:03:16 +0100 |
From: Marc-André Lureau <address@hidden>
Learn to read SLIRP_DEBUG=call,misc,error (all or help also handled)
to set the slirp_debug flags.
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
slirp/misc.c | 8 --------
slirp/slirp.c | 15 +++++++++++++++
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/slirp/misc.c b/slirp/misc.c
index e30d2ceb2a..a0f104be5e 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -11,14 +11,6 @@
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
-#ifdef DEBUG
-#define SLIRP_DEBUG (DBG_CALL | DBG_MISC | DBG_ERROR)
-#else
-#define SLIRP_DEBUG 0
-#endif
-
-int slirp_debug = SLIRP_DEBUG;
-
inline void
insque(void *a, void *b)
{
diff --git a/slirp/slirp.c b/slirp/slirp.c
index ce5f571d0f..0b70cb9fb6 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -35,6 +35,8 @@
#include <net/if.h>
#endif
+int slirp_debug;
+
/* Define to 1 if you want KEEPALIVE timers */
bool slirp_do_keepalive;
@@ -250,6 +252,7 @@ int get_dns6_addr(struct in6_addr *pdns6_addr, uint32_t
*scope_id)
static void slirp_init_once(void)
{
static int initialized;
+ const char *debug;
#ifdef _WIN32
WSADATA Data;
#endif
@@ -266,6 +269,18 @@ static void slirp_init_once(void)
loopback_addr.s_addr = htonl(INADDR_LOOPBACK);
loopback_mask = htonl(IN_CLASSA_NET);
+
+ debug = g_getenv("SLIRP_DEBUG");
+ if (debug) {
+ const GDebugKey keys[] = {
+ { "call", DBG_CALL },
+ { "misc", DBG_MISC },
+ { "error", DBG_ERROR },
+ };
+ slirp_debug = g_parse_debug_string(debug, keys, G_N_ELEMENTS(keys));
+ }
+
+
}
static void slirp_state_save(QEMUFile *f, void *opaque);
--
2.20.1
- [Qemu-devel] [PULL 44/65] slirp: simplify fork_exec(), (continued)
- [Qemu-devel] [PULL 44/65] slirp: simplify fork_exec(), Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 47/65] slirp: drop <Vista compatibility, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 59/65] slirp: factor out guestfwd addition checks, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 60/65] slirp: add clock_get_ns() callback, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 49/65] slirp: use virtual time for packet expiration, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 53/65] slirp: no need to make DPRINTF conditional on DEBUG, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 62/65] slirp: set G_LOG_DOMAIN, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 50/65] slirp: replace a fprintf with g_critical(), Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 58/65] slirp: replace DEBUG_ARGS with DEBUG_ARG, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 63/65] slirp: call into g_debug() for DEBUG macros, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment variable,
Samuel Thibault <=
- [Qemu-devel] [PULL 52/65] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 54/65] slirp: always build with debug statements, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 56/65] slirp: use %p for pointers format, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 48/65] slirp: rename exec_list, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 57/65] slirp: remove remaining DEBUG blocks, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 64/65] slirp: Mark debugging calls as unlikely, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 65/65] slirp: check data length while emulating ident function, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 61/65] build-sys: use a seperate slirp-obj-y && slirp.mo, Samuel Thibault, 2019/01/13
- Re: [Qemu-devel] [PULLv2 00/65] slirp updates, no-reply, 2019/01/13