slirp: Remove default_mon usage

These errors don't seem user initiated, so forcibly printing to the
monitor doesn't seem right. Just use error_report.

Drop lprint since it's now unused.

Cc: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Cole Robinson 2014-03-21 19:42:20 -04:00 committed by Luiz Capitulino
parent 7931b05987
commit 02d1608980
3 changed files with 6 additions and 17 deletions

View file

@ -136,7 +136,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty)
if ((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0 || if ((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0 ||
bind(s, (struct sockaddr *)&addr, addrlen) < 0 || bind(s, (struct sockaddr *)&addr, addrlen) < 0 ||
listen(s, 1) < 0) { listen(s, 1) < 0) {
lprint("Error: inet socket: %s\n", strerror(errno)); error_report("Error: inet socket: %s", strerror(errno));
closesocket(s); closesocket(s);
return 0; return 0;
@ -146,7 +146,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty)
pid = fork(); pid = fork();
switch(pid) { switch(pid) {
case -1: case -1:
lprint("Error: fork failed: %s\n", strerror(errno)); error_report("Error: fork failed: %s", strerror(errno));
close(s); close(s);
return 0; return 0;
@ -242,15 +242,6 @@ strdup(str)
} }
#endif #endif
void lprint(const char *format, ...)
{
va_list args;
va_start(args, format);
monitor_vprintf(default_mon, format, args);
va_end(args);
}
void slirp_connection_info(Slirp *slirp, Monitor *mon) void slirp_connection_info(Slirp *slirp, Monitor *mon)
{ {
const char * const tcpstates[] = { const char * const tcpstates[] = {

View file

@ -139,7 +139,7 @@ int get_dns_addr(struct in_addr *pdns_addr)
return -1; return -1;
#ifdef DEBUG #ifdef DEBUG
lprint("IP address of your DNS(s): "); fprintf(stderr, "IP address of your DNS(s): ");
#endif #endif
while (fgets(buff, 512, f) != NULL) { while (fgets(buff, 512, f) != NULL) {
if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) { if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
@ -153,17 +153,17 @@ int get_dns_addr(struct in_addr *pdns_addr)
} }
#ifdef DEBUG #ifdef DEBUG
else else
lprint(", "); fprintf(stderr, ", ");
#endif #endif
if (++found > 3) { if (++found > 3) {
#ifdef DEBUG #ifdef DEBUG
lprint("(more)"); fprintf(stderr, "(more)");
#endif #endif
break; break;
} }
#ifdef DEBUG #ifdef DEBUG
else else
lprint("%s", inet_ntoa(tmp_addr)); fprintf(stderr, "%s", inet_ntoa(tmp_addr));
#endif #endif
} }
} }

View file

@ -287,8 +287,6 @@ void if_start(struct ttys *);
long gethostid(void); long gethostid(void);
#endif #endif
void lprint(const char *, ...) GCC_FMT_ATTR(1, 2);
#ifndef _WIN32 #ifndef _WIN32
#include <netdb.h> #include <netdb.h>
#endif #endif