diff mbox

[3/4] osdep: convert fprintf to error_report

Message ID 1411638384-5844-4-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) Sept. 25, 2014, 9:46 a.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 util/osdep.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Eric Blake Sept. 25, 2014, 12:35 p.m. UTC | #1
On 09/25/2014 03:46 AM, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>
> 
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  util/osdep.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/util/osdep.c b/util/osdep.c
> index b2bd154..7f6e483 100644
> --- a/util/osdep.c
> +++ b/util/osdep.c
> @@ -401,9 +401,9 @@ void fips_set_state(bool requested)
>  #endif /* __linux__ */
>  
>  #ifdef _FIPS_DEBUG
> -    fprintf(stderr, "FIPS mode %s (requested %s)\n",
> -	    (fips_enabled ? "enabled" : "disabled"),
> -	    (requested ? "enabled" : "disabled"));
> +    error_report("FIPS mode %s (requested %s)",
> +                 (fips_enabled ? "enabled" : "disabled"),
> +                 (requested ? "enabled" : "disabled"));

Do we really want debugging messages going through error_report()?  This
may be one hunk we don't want.
Gonglei (Arei) Sept. 25, 2014, 12:54 p.m. UTC | #2
> Subject: Re: [Qemu-devel] [PATCH 3/4] osdep: convert fprintf to error_report

> 

> On 09/25/2014 03:46 AM, arei.gonglei@huawei.com wrote:

> > From: Gonglei <arei.gonglei@huawei.com>

> >

> > Signed-off-by: Gonglei <arei.gonglei@huawei.com>

> > ---

> >  util/osdep.c | 8 ++++----

> >  1 file changed, 4 insertions(+), 4 deletions(-)

> >

> > diff --git a/util/osdep.c b/util/osdep.c

> > index b2bd154..7f6e483 100644

> > --- a/util/osdep.c

> > +++ b/util/osdep.c

> > @@ -401,9 +401,9 @@ void fips_set_state(bool requested)

> >  #endif /* __linux__ */

> >

> >  #ifdef _FIPS_DEBUG

> > -    fprintf(stderr, "FIPS mode %s (requested %s)\n",

> > -	    (fips_enabled ? "enabled" : "disabled"),

> > -	    (requested ? "enabled" : "disabled"));

> > +    error_report("FIPS mode %s (requested %s)",

> > +                 (fips_enabled ? "enabled" : "disabled"),

> > +                 (requested ? "enabled" : "disabled"));

> 

> Do we really want debugging messages going through error_report()?  This

> may be one hunk we don't want.

> 

Yep, agree.

Best regards,
-Gonglei

> --

> Eric Blake   eblake redhat com    +1-919-301-3266

> Libvirt virtualization library http://libvirt.org
diff mbox

Patch

diff --git a/util/osdep.c b/util/osdep.c
index b2bd154..7f6e483 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -401,9 +401,9 @@  void fips_set_state(bool requested)
 #endif /* __linux__ */
 
 #ifdef _FIPS_DEBUG
-    fprintf(stderr, "FIPS mode %s (requested %s)\n",
-	    (fips_enabled ? "enabled" : "disabled"),
-	    (requested ? "enabled" : "disabled"));
+    error_report("FIPS mode %s (requested %s)",
+                 (fips_enabled ? "enabled" : "disabled"),
+                 (requested ? "enabled" : "disabled"));
 #endif
 }
 
@@ -428,7 +428,7 @@  int socket_init(void)
     ret = WSAStartup(MAKEWORD(2, 2), &Data);
     if (ret != 0) {
         err = WSAGetLastError();
-        fprintf(stderr, "WSAStartup: %d\n", err);
+        error_report("WSAStartup: %d", err);
         return -1;
     }
     atexit(socket_cleanup);