qemu/slirp
Markus Armbruster 8631b6084a monitor: Separate "default monitor" and "current monitor" cleanly
Commits 376253ec..731b0364 introduced global variable cur_mon, which
points to the "default monitor" (if any), except during execution of
monitor_read() or monitor_control_read() it points to the monitor from
which we're reading instead (the "current monitor").  Monitor command
handlers run within monitor_read() or monitor_control_read().

Default monitor and current monitor are really separate things, and
squashing them together is confusing and error-prone.

For instance, usb_host_scan() can run both in "info usbhost" and
periodically via usb_host_auto_check().  It prints to cur_mon, which
is what we want in the former case: the monitor executing "info
usbhost".  But since that's the default monitor in the latter case, it
periodically spams the default monitor there.

A few places use cur_mon to log stuff to the default monitor.  If we
ever log something while cur_mon points to current monitor instead of
default monitor, the log temporarily "jumps" to another monitor.
Whether that can or cannot happen isn't always obvious.

Maybe logging to the default monitor (which may not even exist) is a
bad idea, and we should log to stderr or a logfile instead.  But
that's outside the scope of this commit.

Change cur_mon to point to the current monitor.  Create new
default_mon to point to the default monitor.  Update users of cur_mon
accordingly.

This fixes the periodical spamming of the default monitor by
usb_host_scan().  It also stops "log jumping", should that problem
exist.
2010-03-16 16:55:05 +01:00
..
bootp.c slirp: remove dead increments, spotted by clang 2010-03-07 13:45:37 +00:00
bootp.h slirp: Factor out internal state structure 2009-06-29 08:52:49 -05:00
cksum.c slirp: remove dead increments, spotted by clang 2010-03-07 13:45:37 +00:00
COPYRIGHT Remove the advertising clause from the slirp license 2009-01-26 19:37:41 +00:00
debug.h slirp: Cleanup and basic reanimation of debug code 2009-06-29 08:52:46 -05:00
if.c slirp: Use internal state in interface 2009-06-29 08:52:49 -05:00
if.h slirp: Factor out internal state structure 2009-06-29 08:52:49 -05:00
ip.h fix networking on win32 host 2009-12-18 23:23:56 +01:00
ip_icmp.c slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
ip_icmp.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
ip_input.c slirp: fix unmatched bracket in if 0 2009-09-30 18:56:44 +00:00
ip_output.c slirp: Factor out internal state structure 2009-06-29 08:52:49 -05:00
libslirp.h slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
main.h slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
mbuf.c slirp: fix use-after-free 2009-11-21 00:34:04 +01:00
mbuf.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
misc.c monitor: Separate "default monitor" and "current monitor" cleanly 2010-03-16 16:55:05 +01:00
misc.h slirp: Remove UDP protocol emulation (talk, cuseeme) 2009-07-27 14:09:15 -05:00
sbuf.c slirp: Drop dead code 2009-06-29 08:52:46 -05:00
sbuf.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
slirp.c slirp: remove dead nested assignment, spotted by clang 2010-03-07 13:45:38 +00:00
slirp.h Don't leak file descriptors 2009-12-03 11:45:50 -06:00
slirp_config.h rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN 2009-07-27 14:09:21 -05:00
socket.c slirp: remove dead initialization, spotted by clang 2010-03-07 13:45:38 +00:00
socket.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
tcp.h rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN 2009-07-27 14:09:21 -05:00
tcp_input.c slirp: remove dead assignments, spotted by clang 2010-03-07 13:13:05 +00:00
tcp_output.c slirp: Factor out internal state structure 2009-06-29 08:52:49 -05:00
tcp_subr.c slirp: remove dead increments, spotted by clang 2010-03-07 13:45:37 +00:00
tcp_timer.c More NULL pointer fixes 2009-08-01 10:13:20 +00:00
tcp_timer.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
tcp_var.h slirp: Factor out internal state structure 2009-06-29 08:52:49 -05:00
tcpip.h Remove the advertising clause from the slirp license 2009-01-26 19:37:41 +00:00
tftp.c slirp: remove dead assignments, spotted by clang 2010-03-07 13:13:05 +00:00
tftp.h slirp: Factor out internal state structure 2009-06-29 08:52:49 -05:00
udp.c Don't leak file descriptors 2009-12-03 11:45:50 -06:00
udp.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00