]> git.proxmox.com Git - mirror_qemu.git/commitdiff
slirp: Remove default_mon usage
authorCole Robinson <crobinso@redhat.com>
Fri, 21 Mar 2014 23:42:20 +0000 (19:42 -0400)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 25 Apr 2014 13:19:58 +0000 (09:19 -0400)
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>
slirp/misc.c
slirp/slirp.c
slirp/slirp.h

index 6c1636f7b6d6acf424cd3e6070f00499c42d408a..b8eb74cab03d86ded061e42daee30cf0405c9cf7 100644 (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 ||
                    bind(s, (struct sockaddr *)&addr, addrlen) < 0 ||
                    listen(s, 1) < 0) {
-                       lprint("Error: inet socket: %s\n", strerror(errno));
+                       error_report("Error: inet socket: %s", strerror(errno));
                        closesocket(s);
 
                        return 0;
@@ -146,7 +146,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty)
        pid = fork();
        switch(pid) {
         case -1:
-               lprint("Error: fork failed: %s\n", strerror(errno));
+               error_report("Error: fork failed: %s", strerror(errno));
                close(s);
                return 0;
 
@@ -242,15 +242,6 @@ strdup(str)
 }
 #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)
 {
     const char * const tcpstates[] = {
index bad8dad02e97e5350bf966dfa627ccd862d3edd2..3fb48a49212f69ff5385d354164eaf5162ac4c96 100644 (file)
@@ -139,7 +139,7 @@ int get_dns_addr(struct in_addr *pdns_addr)
         return -1;
 
 #ifdef DEBUG
-    lprint("IP address of your DNS(s): ");
+    fprintf(stderr, "IP address of your DNS(s): ");
 #endif
     while (fgets(buff, 512, f) != NULL) {
         if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
@@ -153,17 +153,17 @@ int get_dns_addr(struct in_addr *pdns_addr)
             }
 #ifdef DEBUG
             else
-                lprint(", ");
+                fprintf(stderr, ", ");
 #endif
             if (++found > 3) {
 #ifdef DEBUG
-                lprint("(more)");
+                fprintf(stderr, "(more)");
 #endif
                 break;
             }
 #ifdef DEBUG
             else
-                lprint("%s", inet_ntoa(tmp_addr));
+                fprintf(stderr, "%s", inet_ntoa(tmp_addr));
 #endif
         }
     }
index e4a1bd4abb19e9e24759edd633d1db119a8313b3..6589d7eef0bbc6bd6bde1b066948b1c0ecc8fa37 100644 (file)
@@ -287,8 +287,6 @@ void if_start(struct ttys *);
  long gethostid(void);
 #endif
 
-void lprint(const char *, ...) GCC_FMT_ATTR(1, 2);
-
 #ifndef _WIN32
 #include <netdb.h>
 #endif