* [PATCH] cpus: Fix botched configure_icount() error API violation fix
@ 2020-05-08 10:49 Markus Armbruster
2020-05-08 13:45 ` Eric Blake
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Markus Armbruster @ 2020-05-08 10:49 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, peter.maydell
Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
Fixes: Coverity CID 1428754
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
cpus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index 5670c96bcf..b9275c672d 100644
--- a/cpus.c
+++ b/cpus.c
@@ -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");
--
2.21.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
2020-05-08 10:49 [PATCH] cpus: Fix botched configure_icount() error API violation fix Markus Armbruster
@ 2020-05-08 13:45 ` Eric Blake
2020-05-08 16:12 ` Philippe Mathieu-Daudé
2020-05-08 17:43 ` Markus Armbruster
2020-05-21 14:43 ` Paolo Bonzini
2 siblings, 1 reply; 7+ messages in thread
From: Eric Blake @ 2020-05-08 13:45 UTC (permalink / raw)
To: Markus Armbruster, qemu-devel; +Cc: pbonzini, peter.maydell
On 5/8/20 5:49 AM, Markus Armbruster wrote:
> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
> Fixes: Coverity CID 1428754
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> cpus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/cpus.c b/cpus.c
> index 5670c96bcf..b9275c672d 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -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.
> if (qemu_strtol(option, NULL, 0, &time_shift) < 0
> || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
> error_setg(errp, "icount: Invalid shift value");
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
2020-05-08 13:45 ` Eric Blake
@ 2020-05-08 16:12 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-08 16:12 UTC (permalink / raw)
To: Eric Blake, Markus Armbruster, qemu-devel; +Cc: pbonzini, peter.maydell
On 5/8/20 3:45 PM, Eric Blake wrote:
> On 5/8/20 5:49 AM, Markus Armbruster wrote:
>> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
>> Fixes: Coverity CID 1428754
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>> cpus.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
>>
>> diff --git a/cpus.c b/cpus.c
>> index 5670c96bcf..b9275c672d 100644
>> --- a/cpus.c
>> +++ b/cpus.c
>> @@ -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." ;)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
>> if (qemu_strtol(option, NULL, 0, &time_shift) < 0
>> || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
>> error_setg(errp, "icount: Invalid shift value");
>>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
2020-05-08 10:49 [PATCH] cpus: Fix botched configure_icount() error API violation fix Markus Armbruster
2020-05-08 13:45 ` Eric Blake
@ 2020-05-08 17:43 ` Markus Armbruster
2020-05-21 14:43 ` Paolo Bonzini
2 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2020-05-08 17:43 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, peter.maydell
Markus Armbruster <armbru@redhat.com> writes:
> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
> Fixes: Coverity CID 1428754
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> cpus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpus.c b/cpus.c
> index 5670c96bcf..b9275c672d 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
2020-05-08 10:49 [PATCH] cpus: Fix botched configure_icount() error API violation fix Markus Armbruster
2020-05-08 13:45 ` Eric Blake
2020-05-08 17:43 ` Markus Armbruster
@ 2020-05-21 14:43 ` Paolo Bonzini
2020-05-25 5:44 ` Markus Armbruster
2 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2020-05-21 14:43 UTC (permalink / raw)
To: Markus Armbruster, qemu-devel; +Cc: peter.maydell
On 08/05/20 12:49, Markus Armbruster wrote:
> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
> Fixes: Coverity CID 1428754
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> cpus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpus.c b/cpus.c
> index 5670c96bcf..b9275c672d 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
2020-05-21 14:43 ` Paolo Bonzini
@ 2020-05-25 5:44 ` Markus Armbruster
2020-05-25 10:21 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2020-05-25 5:44 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: peter.maydell, qemu-devel
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 08/05/20 12:49, Markus Armbruster wrote:
>> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
>> Fixes: Coverity CID 1428754
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>> cpus.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/cpus.c b/cpus.c
>> index 5670c96bcf..b9275c672d 100644
>> --- a/cpus.c
>> +++ b/cpus.c
>> @@ -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.
This one's wrong, please queue v2 instead.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
2020-05-25 5:44 ` Markus Armbruster
@ 2020-05-25 10:21 ` Paolo Bonzini
0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2020-05-25 10:21 UTC (permalink / raw)
To: Markus Armbruster; +Cc: peter.maydell, qemu-devel
On 25/05/20 07:44, Markus Armbruster wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
>> On 08/05/20 12:49, Markus Armbruster wrote:
>>> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
>>> Fixes: Coverity CID 1428754
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>>> cpus.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/cpus.c b/cpus.c
>>> index 5670c96bcf..b9275c672d 100644
>>> --- a/cpus.c
>>> +++ b/cpus.c
>>> @@ -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.
>
> This one's wrong, please queue v2 instead.
>
Yep, got there already. Thanks!
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-05-25 10:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 10:49 [PATCH] cpus: Fix botched configure_icount() error API violation fix Markus Armbruster
2020-05-08 13:45 ` Eric Blake
2020-05-08 16:12 ` Philippe Mathieu-Daudé
2020-05-08 17:43 ` Markus Armbruster
2020-05-21 14:43 ` Paolo Bonzini
2020-05-25 5:44 ` Markus Armbruster
2020-05-25 10:21 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).