[Qemu-devel] [PATCH v2 for-3.2 v2 15/30] slirp: replace error_report() and a fprintf with g_critical()

Marc-André Lureau posted 30 patches 6 years, 11 months ago
[Qemu-devel] [PATCH v2 for-3.2 v2 15/30] slirp: replace error_report() and a fprintf with g_critical()
Posted by Marc-André Lureau 6 years, 11 months ago
Reduce dependency on QEMU. QEMU could use a custom glib log handler if
it wants to redirect/filter it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 slirp/misc.c   | 2 +-
 slirp/socket.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/slirp/misc.c b/slirp/misc.c
index 7c2ed8c67f..6ee0ff0231 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -164,7 +164,7 @@ fork_exec(struct socket *so, const char *ex)
     g_strfreev(argv);
 
     if (err) {
-        error_report("%s", err->message);
+        g_critical("fork_exec: %s", err->message);
         g_error_free(err);
         closesocket(sp[0]);
         closesocket(sp[1]);
diff --git a/slirp/socket.c b/slirp/socket.c
index 677fd20c9d..08a065f6a7 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -285,7 +285,7 @@ err:
 
     sofcantrcvmore(so);
     tcp_sockclosed(sototcpcb(so));
-    fprintf(stderr, "soreadbuf buffer to small");
+    g_critical("soreadbuf buffer too small");
     return -1;
 }
 
-- 
2.20.0.rc1


Re: [Qemu-devel] [PATCH v2 for-3.2 v2 15/30] slirp: replace error_report() and a fprintf with g_critical()
Posted by Samuel Thibault 6 years, 11 months ago
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:32 +0400, a ecrit:
> Reduce dependency on QEMU. QEMU could use a custom glib log handler if
> it wants to redirect/filter it.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Applied, thanks!