Fix corner case in chardev udp: parameter
PATCH 1/1 Fix corner case in chardev udp: parameter
The missing '@' broke 'udp::<port>@:<port>' parsing.
---
qemu-char.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-char.c +1 -1
@@ -2314,7 +2314,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)qemu_opt_set (opts,"backend" ,"udp" );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 ) {fprintf (stderr,"udp #1\n" ); goto fail; }
Review
Quoted 6 lines · Jan Kiszka
The missing '@' broke 'udp::<port>@:<port>' parsing.
if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port,&pos)< 2) { host[0] = 0;(quoted diff) +1
-1- if (sscanf(p, ":%32[^,]%n", port,&pos)< 1) { + if (sscanf(p, ":%32[^@,]%n", port,&pos)< 1) {
Indeed.
Quoted 1 line
fprintf(stderr, "udp #1\n");
While you are at it, can you also zap this debug leftover?
thanks,
Gerd
Quoted 8 lines · Gerd Hoffmann
Review
Quoted 6 lines · Jan Kiszka
The missing '@' broke 'udp::<port>@:<port>' parsing.
if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port,&pos)< 2) { host[0] = 0;(quoted diff) +1
-1- if (sscanf(p, ":%32[^,]%n", port,&pos)< 1) { + if (sscanf(p, ":%32[^@,]%n", port,&pos)< 1) {
Quoted 5 lines
Indeed.
Quoted 1 line
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?
Jan
Quoted 9 lines · Jan Kiszka
Quoted 8 lines · Gerd Hoffmann
Quoted 6 lines · Jan Kiszka
The missing '@' broke 'udp::<port>@:<port>' parsing.
if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port,&pos)< 2) { host[0] = 0;(quoted diff) +1
-1- if (sscanf(p, ":%32[^,]%n", port,&pos)< 1) { + if (sscanf(p, ":%32[^@,]%n", port,&pos)< 1) {
Quoted 7 lines
Quoted 5 lines
Indeed.
Quoted 1 line
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
PATCH 1/1 Drop debug printfs from qemu_chr_parse_compat
Quoted 16 lines · Gerd Hoffmann
Quoted 15 lines · Jan Kiszka
Quoted 13 lines · Gerd Hoffmann
Review
Quoted 6 lines · Jan Kiszka
The missing '@' broke 'udp::<port>@:<port>' parsing.
if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port,&pos)< 2) { host[0] = 0;(quoted diff) +1
-1- if (sscanf(p, ":%32[^,]%n", port,&pos)< 1) { + if (sscanf(p, ":%32[^@,]%n", port,&pos)< 1) {Indeed.
Quoted 1 line
fprintf(stderr, "udp #1\n");While you are at it, can you also zap this debug leftover?
Quoted 8 lines
Quoted 2 lines
Looks like there are three of them in
qemu_chr_parse_compat- kill them all?Yes.
thanks,
Gerd
---
qemu-char.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
qemu-char.c +0 -3
@@ -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 ; }
[Qemu-devel] Re: [PATCH][STABLE] Drop debug printfs from qemu_chr_parse_compat
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
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?
Quoted 7 lines
Quoted 5 lines
Yes.
thanks,
GerdSigned-off-by Jan Kiszka<[email protected]>
Review
Quoted 3 lines
(quoted diff) +0
-3- fprintf(stderr, "udp #1\n"); - fprintf(stderr, "udp #2\n"); - fprintf(stderr, "%s: fail on \"%s\"\n", __FUNCTION__, filename);
cheers,
Gerd
Re: [Qemu-devel] [PATCH][STABLE] Drop debug printfs from qemu_chr_parse_compat
In reply to Jan KiszkaQuoted 17 lines · Jan Kiszka
Quoted 16 lines · Gerd Hoffmann
Quoted 15 lines · Jan Kiszka
Quoted 13 lines · Gerd Hoffmann
Review
Quoted 6 lines · Jan Kiszka
The missing '@' broke 'udp::<port>@:<port>' parsing.
if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port,&pos)< 2) { host[0] = 0;(quoted diff) +1
-1- if (sscanf(p, ":%32[^,]%n", port,&pos)< 1) { + if (sscanf(p, ":%32[^@,]%n", port,&pos)< 1) {Indeed.
Quoted 1 line
fprintf(stderr, "udp #1\n");While you are at it, can you also zap this debug leftover?
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
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.
Quoted 35 lines
Signed-off-by Jan Kiszka <[email protected]>---
qemu-char.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)qemu-char.c +0
-3@@ -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 ; }
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net