cpus: Fix botched configure_icount() error API violation fix
PATCH 1/1 cpus: Fix botched configure_icount() error API violation fix
--- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cpus.c +1 -1
@@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp)return ; } -if (strcmp (option,"auto" ) !=0 ) { +if (option && !strcmp (option,"auto" )) {if (qemu_strtol (option,NULL ,0 , &time_shift) <0 || time_shift <0 || time_shift >MAX_ICOUNT_SHIFT ) {error_setg (errp,"icount: Invalid shift value" );
Signature · 1 line
2.21.1
Quoted 6 lines · Markus Armbruster
Fixes abc9bf69a66a11499a801ff545b8fe7adbb3a04cFixes Coverity CID 1428754Signed-off-by Markus Armbruster <[email protected]>--- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cpus.c void configure_icount(QemuOpts *opts, Error **errp) · line 816
Quoted 11 lines
cpus.c +1
-1@@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp)return ; } -if (strcmp (option,"auto" ) !=0 ) { +if (option && !strcmp (option,"auto" )) {
Another alternative would be using g_strcmp0, but this form is fine.
Quoted 4 lines
cpus.c +0
-0if (qemu_strtol (option,NULL ,0 , &time_shift) <0 || time_shift <0 || time_shift >MAX_ICOUNT_SHIFT ) {error_setg (errp,"icount: Invalid shift value" );
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Philippe Mathieu-Daudé
Reviewed-byQuoted 11 lines · Eric Blake
Quoted 6 lines · Markus Armbruster
Fixes abc9bf69a66a11499a801ff545b8fe7adbb3a04cFixes Coverity CID 1428754Signed-off-by Markus Armbruster <[email protected]>---
cpus.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Eric Blake <[email protected]>Quoted 1 line
Quoted 11 lines
cpus.c void configure_icount(QemuOpts *opts, Error **errp) · line 815
Quoted 9 lines
cpus.c +1
-1@@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp) return; } - if (strcmp(option, "auto") != 0) { + if (option && !strcmp(option, "auto")) {Another alternative would be using
g_strcmp0, but this form is fine.
"Leading by example is the fastest way to train a team." ;)
Quoted 6 lines
Quoted 5 lines
if (
qemu_strtol(option, NULL, 0, &time_shift)< 0 ||time_shift< 0 ||time_shift>MAX_ICOUNT_SHIFT) {error_setg(errp, "icount: Invalid shift value");
Quoted 12 lines · Markus Armbruster
Fixes abc9bf69a66a11499a801ff545b8fe7adbb3a04cFixes Coverity CID 1428754Signed-off-by Markus Armbruster <[email protected]>--- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cpus.c +0
-0
cpus.c void configure_icount(QemuOpts *opts, Error **errp) · line 819
Quoted 8 lines
cpus.c +1
-1@@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp)return ; } -if (strcmp (option,"auto" ) !=0 ) { +if (option && !strcmp (option,"auto" )) {if (qemu_strtol (option,NULL ,0 , &time_shift) <0 || time_shift <0 || time_shift >MAX_ICOUNT_SHIFT ) {error_setg (errp,"icount: Invalid shift value" );
Nonsense. I shouldn't multi-task.
Paolo Bonzini
AppliedQuoted 13 lines · Markus Armbruster
Fixes abc9bf69a66a11499a801ff545b8fe7adbb3a04cFixes Coverity CID 1428754Signed-off-by Markus Armbruster <[email protected]>--- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cpus.c +0
-0
cpus.c void configure_icount(QemuOpts *opts, Error **errp) · line 819
Quoted 8 lines
cpus.c +1
-1@@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp)return ; } -if (strcmp (option,"auto" ) !=0 ) { +if (option && !strcmp (option,"auto" )) {if (qemu_strtol (option,NULL ,0 , &time_shift) <0 || time_shift <0 || time_shift >MAX_ICOUNT_SHIFT ) {error_setg (errp,"icount: Invalid shift value" );
Queued, thanks.
Paolo
Quoted 16 lines · Paolo Bonzini
Quoted 15 lines · Markus Armbruster
Fixes abc9bf69a66a11499a801ff545b8fe7adbb3a04cFixes Coverity CID 1428754Signed-off-by Markus Armbruster <[email protected]>--- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cpus.c +0
-0@@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp)return ; }
Quoted 8 lines
cpus.c void configure_icount(QemuOpts *opts, Error **errp) · line 819
Quoted 6 lines
cpus.c +1
-1-if (strcmp (option,"auto" ) !=0 ) { +if (option && !strcmp (option,"auto" )) {if (qemu_strtol (option,NULL ,0 , &time_shift) <0 || time_shift <0 || time_shift >MAX_ICOUNT_SHIFT ) {error_setg (errp,"icount: Invalid shift value" );Queued, thanks.
This one's wrong, please queue v2 instead.
Quoted 27 lines · Markus Armbruster
Quoted 16 lines · Paolo Bonzini
Quoted 15 lines · Markus Armbruster
Fixes abc9bf69a66a11499a801ff545b8fe7adbb3a04cFixes Coverity CID 1428754Signed-off-by Markus Armbruster <[email protected]>--- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cpus.c +0
-0@@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp)return ; }Quoted 8 lines
cpus.c void configure_icount(QemuOpts *opts, Error **errp) · line 819
Quoted 6 lines
cpus.c +1
-1-if (strcmp (option,"auto" ) !=0 ) { +if (option && !strcmp (option,"auto" )) {if (qemu_strtol (option,NULL ,0 , &time_shift) <0 || time_shift <0 || time_shift >MAX_ICOUNT_SHIFT ) {error_setg (errp,"icount: Invalid shift value" );Queued, thanks.
Quoted 2 lines
This one's wrong, please queue v2 instead.
Yep, got there already. Thanks!
Paolo