Patchwork [STABLE] Drop debug printfs from qemu_chr_parse_compat

login
register
mail settings
Submitter Jan Kiszka
Date Jan. 18, 2010, 11:15 a.m.
Message ID <4B5442B5.5070409@web.de>
Download mbox | patch
Permalink /patch/43059/
State New
Headers show

Comments

Jan Kiszka - Jan. 18, 2010, 11:15 a.m.
Gerd Hoffmann wrote:
> On 01/18/10 11:21, Jan Kiszka wrote:
>> Gerd Hoffmann wrote:
>>> On 01/15/10 21:07, Jan Kiszka wrote:
>>>> The missing '@' broke 'udp::<port>@:<port>' parsing.
>>>
>>>>            if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port,&pos)<   2) {
>>>>                host[0] = 0;
>>>> -            if (sscanf(p, ":%32[^,]%n", port,&pos)<   1) {
>>>> +            if (sscanf(p, ":%32[^@,]%n", port,&pos)<   1) {
>>>
>>> Indeed.
>>>
>>>>                    fprintf(stderr, "udp #1\n");
>>>
>>> While you are at it, can you also zap this debug leftover?
>>
>> Looks like there are three of them in qemu_chr_parse_compat - kill
>> them all?
> 
> Yes.
> 
> thanks,
>   Gerd
> 

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 qemu-char.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
Gerd Hoffmann - Jan. 18, 2010, 11:25 a.m.
>>>> While you are at it, can you also zap this debug leftover?
>>>
>>> Looks like there are three of them in qemu_chr_parse_compat - kill
>>> them all?
>>
>> Yes.
>>
>> thanks,
>>    Gerd
>>
>
> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

> -                fprintf(stderr, "udp #1\n");
> -                    fprintf(stderr, "udp #2\n");
> -    fprintf(stderr, "%s: fail on \"%s\"\n", __FUNCTION__, filename);

cheers,
   Gerd
Aurelien Jarno - Feb. 28, 2010, 1:19 p.m.
On Mon, Jan 18, 2010 at 12:15:01PM +0100, Jan Kiszka wrote:
> Gerd Hoffmann wrote:
> > On 01/18/10 11:21, Jan Kiszka wrote:
> >> Gerd Hoffmann wrote:
> >>> On 01/15/10 21:07, Jan Kiszka wrote:
> >>>> The missing '@' broke 'udp::<port>@:<port>' parsing.
> >>>
> >>>>            if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port,&pos)<   2) {
> >>>>                host[0] = 0;
> >>>> -            if (sscanf(p, ":%32[^,]%n", port,&pos)<   1) {
> >>>> +            if (sscanf(p, ":%32[^@,]%n", port,&pos)<   1) {
> >>>
> >>> Indeed.
> >>>
> >>>>                    fprintf(stderr, "udp #1\n");
> >>>
> >>> While you are at it, can you also zap this debug leftover?
> >>
> >> Looks like there are three of them in qemu_chr_parse_compat - kill
> >> them all?
> > 
> > Yes.
> > 
> > thanks,
> >   Gerd
> > 

Thanks, committed to HEAD and cherry-picked in stable-0.12.

> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
>  qemu-char.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/qemu-char.c b/qemu-char.c
> index a8a92f5..ef7823f 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -2315,7 +2315,6 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
>          if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port, &pos) < 2) {
>              host[0] = 0;
>              if (sscanf(p, ":%32[^@,]%n", port, &pos) < 1) {
> -                fprintf(stderr, "udp #1\n");
>                  goto fail;
>              }
>          }
> @@ -2326,7 +2325,6 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
>              if (sscanf(p, "%64[^:]:%32[^,]%n", host, port, &pos) < 2) {
>                  host[0] = 0;
>                  if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) {
> -                    fprintf(stderr, "udp #2\n");
>                      goto fail;
>                  }
>              }
> @@ -2354,7 +2352,6 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
>      }
>  
>  fail:
> -    fprintf(stderr, "%s: fail on \"%s\"\n", __FUNCTION__, filename);
>      qemu_opts_del(opts);
>      return NULL;
>  }
>

Patch

diff --git a/qemu-char.c b/qemu-char.c
index a8a92f5..ef7823f 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2315,7 +2315,6 @@  QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
         if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port, &pos) < 2) {
             host[0] = 0;
             if (sscanf(p, ":%32[^@,]%n", port, &pos) < 1) {
-                fprintf(stderr, "udp #1\n");
                 goto fail;
             }
         }
@@ -2326,7 +2325,6 @@  QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
             if (sscanf(p, "%64[^:]:%32[^,]%n", host, port, &pos) < 2) {
                 host[0] = 0;
                 if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) {
-                    fprintf(stderr, "udp #2\n");
                     goto fail;
                 }
             }
@@ -2354,7 +2352,6 @@  QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
     }
 
 fail:
-    fprintf(stderr, "%s: fail on \"%s\"\n", __FUNCTION__, filename);
     qemu_opts_del(opts);
     return NULL;
 }