[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 29/41] slirp: Clean up timeout handling around slirp
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 29/41] slirp: Clean up timeout handling around slirp_select_fill/poll |
Date: |
Wed, 24 Jun 2009 14:42:30 +0200 |
User-agent: |
StGIT/0.14.3 |
Again lot of dead code. Remove it.
Signed-off-by: Jan Kiszka <address@hidden>
---
slirp/misc.c | 2 --
slirp/misc.h | 1 -
slirp/slirp.c | 40 ++++------------------------------------
3 files changed, 4 insertions(+), 39 deletions(-)
diff --git a/slirp/misc.c b/slirp/misc.c
index cffb3a0..ee14db5 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -14,8 +14,6 @@
int slirp_debug = DBG_CALL|DBG_MISC|DBG_ERROR;
#endif
-u_int curtime, time_fasttimo, last_slowtimo;
-
struct quehead {
struct quehead *qh_link;
struct quehead *qh_rlink;
diff --git a/slirp/misc.h b/slirp/misc.h
index c21f69b..2f47888 100644
--- a/slirp/misc.h
+++ b/slirp/misc.h
@@ -17,7 +17,6 @@ struct ex_list {
};
extern struct ex_list *exec_list;
-extern u_int time_fasttimo, last_slowtimo;
#ifndef HAVE_STRDUP
char *strdup _P((const char *));
diff --git a/slirp/slirp.c b/slirp/slirp.c
index cf52d36..9b51c0b 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -52,13 +52,16 @@ static struct in_addr client_ipaddr;
static const uint8_t zero_ethaddr[6] = { 0, 0, 0, 0, 0, 0 };
int slirp_restrict;
-static int do_slowtimo;
int link_up;
struct ex_list *exec_list;
/* XXX: suppress those select globals */
fd_set *global_readfds, *global_writefds, *global_xfds;
+u_int curtime;
+static u_int time_fasttimo, last_slowtimo;
+static int do_slowtimo;
+
char slirp_hostname[33];
#ifdef _WIN32
@@ -267,9 +270,7 @@ void slirp_select_fill(int *pnfds,
fd_set *readfds, fd_set *writefds, fd_set *xfds)
{
struct socket *so, *so_next;
- struct timeval timeout;
int nfds;
- int tmp_time;
if (!link_up) {
return;
@@ -380,39 +381,6 @@ void slirp_select_fill(int *pnfds,
}
}
- /*
- * Setup timeout to use minimum CPU usage, especially when idle
- */
-
- /*
- * First, see the timeout needed by *timo
- */
- timeout.tv_sec = 0;
- timeout.tv_usec = -1;
- /*
- * If a slowtimo is needed, set timeout to 500ms from the last
- * slow timeout. If a fast timeout is needed, set timeout within
- * 200ms of when it was requested.
- */
- if (do_slowtimo) {
- /* XXX + 10000 because some select()'s aren't that accurate */
- timeout.tv_usec = ((500 - (curtime - last_slowtimo)) * 1000) +
10000;
- if (timeout.tv_usec < 0)
- timeout.tv_usec = 0;
- else if (timeout.tv_usec > 510000)
- timeout.tv_usec = 510000;
-
- /* Can only fasttimo if we also slowtimo */
- if (time_fasttimo) {
- tmp_time = (200 - (curtime - time_fasttimo)) * 1000;
- if (tmp_time < 0)
- tmp_time = 0;
-
- /* Choose the smallest of the 2 */
- if (tmp_time < timeout.tv_usec)
- timeout.tv_usec = (u_int)tmp_time;
- }
- }
*pnfds = nfds;
}
- [Qemu-devel] [PATCH 10/41] slirp: Bind support for host forwarding rules, (continued)
- [Qemu-devel] [PATCH 10/41] slirp: Bind support for host forwarding rules, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 12/41] slirp: Explicitely mark host-forwarding sockets, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 13/41] slirp: Do not allow to remove non-hostfwd sockets, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 15/41] slirp: Add info usernet for dumping connection states, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 17/41] slirp: Drop statistic code, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 23/41] slirp: tftp: Rework filename handling, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 24/41] slirp: Factor out one-time initialization, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 19/41] slirp: Drop unused icmp_var.h, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 20/41] slirp: tftp: Cleanup tftp_prefix check, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 21/41] slirp: tftp: Clean up tftp_send_error, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 29/41] slirp: Clean up timeout handling around slirp_select_fill/poll,
Jan Kiszka <=
- [Qemu-devel] [PATCH 26/41] slirp: Clean up updtime, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 25/41] slirp: Make IP packet ID consistent, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 27/41] slirp: Kill slirp_is_inited, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 28/41] slirp: Drop redundant checks from slirp_output, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 36/41] slirp: Use shell to erase smb directory, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 35/41] slirp: Save/restore bootp client states, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 32/41] slirp: Use internal state in interface, Jan Kiszka, 2009/06/24