qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cole Robinson <crobinso@redhat.com>
To: qemu-devel@nongnu.org
Cc: Jan Kiszka <jan.kiszka@siemens.com>, Cole Robinson <crobinso@redhat.com>
Subject: [Qemu-devel] [PATCH v2 1/9] slirp: Remove default_mon usage
Date: Fri, 21 Mar 2014 19:42:20 -0400	[thread overview]
Message-ID: <94600c146dee4db2b86ff0c32448e1467527d86f.1395445063.git.crobinso@redhat.com> (raw)
In-Reply-To: <cover.1395445063.git.crobinso@redhat.com>
In-Reply-To: <cover.1395445063.git.crobinso@redhat.com>

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>
---

v2:
    Use error_report instead of fprintf

 slirp/misc.c  | 13 ++-----------
 slirp/slirp.c |  8 ++++----
 slirp/slirp.h |  2 --
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/slirp/misc.c b/slirp/misc.c
index 6c1636f..b8eb74c 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -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[] = {
diff --git a/slirp/slirp.c b/slirp/slirp.c
index bad8dad..3fb48a4 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -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
         }
     }
diff --git a/slirp/slirp.h b/slirp/slirp.h
index e4a1bd4..6589d7e 100644
--- a/slirp/slirp.h
+++ b/slirp/slirp.h
@@ -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
-- 
1.8.5.3

  reply	other threads:[~2014-03-21 23:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 23:42 [Qemu-devel] [PATCH v2 0/9] error: Misc cleanups and improvements Cole Robinson
2014-03-21 23:42 ` Cole Robinson [this message]
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 2/9] vnc: Remove default_mon usage Cole Robinson
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 3/9] error: Privatize error_print_loc Cole Robinson
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 4/9] monitor: Remove unused monitor_print_filename Cole Robinson
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 5/9] error: Print error_report() to stderr if using qmp Cole Robinson
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 6/9] qerror.h: Remove unused error classes Cole Robinson
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 7/9] qerror.h: Remove QERR defines that are only used once Cole Robinson
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 8/9] qerror.h: Replace QERR_NOT_SUPPORTED with QERR_UNSUPPORTED Cole Robinson
2014-03-21 23:42 ` [Qemu-devel] [PATCH v2 9/9] error: Remove some unused headers Cole Robinson
2014-03-22  9:06 ` [Qemu-devel] [PATCH v2 0/9] error: Misc cleanups and improvements Paolo Bonzini
2014-03-27 20:57 ` Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94600c146dee4db2b86ff0c32448e1467527d86f.1395445063.git.crobinso@redhat.com \
    --to=crobinso@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).