[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 57/64] slirp: remove remaining DEBUG blocks
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 57/64] slirp: remove remaining DEBUG blocks |
Date: |
Wed, 19 Dec 2018 00:04:35 +0100 |
From: Marc-André Lureau <address@hidden>
Instead, rely on slirp_debug flags, or compile unconditionally (the
substraction in cksum is unlikely to affect any benchmark result).
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
slirp/cksum.c | 4 ----
slirp/ip_icmp.c | 5 ++---
slirp/slirp.c | 5 +----
3 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/slirp/cksum.c b/slirp/cksum.c
index b9466485b5..0a988b845d 100644
--- a/slirp/cksum.c
+++ b/slirp/cksum.c
@@ -70,9 +70,7 @@ int cksum(struct mbuf *m, int len)
if (len < mlen)
mlen = len;
-#ifdef DEBUG
len -= mlen;
-#endif
/*
* Force to even boundary.
*/
@@ -122,12 +120,10 @@ int cksum(struct mbuf *m, int len)
s_util.c[0] = *(uint8_t *)w;
cont:
-#ifdef DEBUG
if (len) {
DEBUG_ERROR("cksum: out of data\n");
DEBUG_ERROR(" len = %d\n", len);
}
-#endif
if (mlen == -1) {
/* The last mbuf has odd # of bytes. Follow the
standard (the odd byte may be shifted left by 8 bits
diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index 6c7e375ff8..cd2faeacb6 100644
--- a/slirp/ip_icmp.c
+++ b/slirp/ip_icmp.c
@@ -257,13 +257,12 @@ icmp_send_error(struct mbuf *msrc, u_char type, u_char
code, int minsize,
/* check msrc */
if(!msrc) goto end_error;
ip = mtod(msrc, struct ip *);
-#ifdef DEBUG
- { char bufa[20], bufb[20];
+ if (slirp_debug & DBG_MISC) {
+ char bufa[20], bufb[20];
strcpy(bufa, inet_ntoa(ip->ip_src));
strcpy(bufb, inet_ntoa(ip->ip_dst));
DEBUG_MISC(" %.16s to %.16s\n", bufa, bufb);
}
-#endif
if(ip->ip_off & IP_OFFMASK) goto end_error; /* Only reply to fragment 0 */
/* Do not reply to source-only IPs */
diff --git a/slirp/slirp.c b/slirp/slirp.c
index abc573e6de..31af2efbd5 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -195,9 +195,7 @@ static int get_dns_addr_resolv_conf(int af, void
*pdns_addr, void *cached_addr,
if (++found > 3) {
DEBUG_MISC("(more)");
break;
- }
-#ifdef DEBUG
- else {
+ } else if (slirp_debug & DBG_MISC) {
char s[INET6_ADDRSTRLEN];
const char *res = inet_ntop(af, tmp_addr, s, sizeof(s));
if (!res) {
@@ -205,7 +203,6 @@ static int get_dns_addr_resolv_conf(int af, void
*pdns_addr, void *cached_addr,
}
DEBUG_MISC("%s", res);
}
-#endif
}
}
fclose(f);
--
2.19.2
- [Qemu-devel] [PULL 51/64] slirp: replace some fprintf() with DEBUG_MISC, (continued)
- [Qemu-devel] [PULL 51/64] slirp: replace some fprintf() with DEBUG_MISC, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 54/64] slirp: always build with debug statements, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 49/64] slirp: use virtual time for packet expiration, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 59/64] slirp: factor out guestfwd addition checks, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 47/64] slirp: drop <Vista compatibility, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 53/64] slirp: no need to make DPRINTF conditional on DEBUG, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 58/64] slirp: replace DEBUG_ARGS with DEBUG_ARG, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 52/64] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 62/64] slirp: set G_LOG_DOMAIN, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 56/64] slirp: use %p for pointers format, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 57/64] slirp: remove remaining DEBUG blocks,
Samuel Thibault <=
- [Qemu-devel] [PULL 61/64] build-sys: use a seperate slirp-obj-y && slirp.mo, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 64/64] slirp: Mark debugging calls as unlikely, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 55/64] slirp: introduce SLIRP_DEBUG environment variable, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 63/64] slirp: call into g_debug() for DEBUG macros, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 60/64] slirp: add clock_get_ns() callback, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 50/64] slirp: replace a fprintf with g_critical(), Samuel Thibault, 2018/12/18
- Re: [Qemu-devel] [PULL 00/64] slirp updates, Peter Maydell, 2018/12/19