* [PATCH for-6.1 ?] hw/core: fix error checkig in smp_parse
@ 2021-08-12 17:53 Daniel P. Berrangé
2021-08-12 18:57 ` Eduardo Habkost
2021-08-13 12:44 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2021-08-12 17:53 UTC (permalink / raw)
To: qemu-devel; +Cc: Daniel P. Berrangé, Eduardo Habkost
The machine_set_smp() mistakenly checks 'errp' not '*errp',
and so thinks there is an error every single time it runs.
This causes it to jump to the end of the method, skipping
the max CPUs checks. The caller meanwhile sees no error
and so carries on execution. The result of all this is:
$ qemu-system-x86_64 -smp -1
qemu-system-x86_64: GLib: ../glib/gmem.c:142: failed to allocate 481036337048 bytes
instead of
$ qemu-system-x86_64 -smp -1
qemu-system-x86_64: Invalid SMP CPUs -1. The max CPUs supported by machine 'pc-i440fx-6.1' is 255
This is a regression from
commit fe68090e8fbd6e831aaf3fc3bb0459c5cccf14cf
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: Thu May 13 09:03:48 2021 -0400
machine: add smp compound property
Closes: https://gitlab.com/qemu-project/qemu/-/issues/524
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
hw/core/machine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 943974d411..ab4fca6546 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -832,7 +832,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name,
}
mc->smp_parse(ms, config, errp);
- if (errp) {
+ if (*errp) {
goto out_free;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH for-6.1 ?] hw/core: fix error checkig in smp_parse
2021-08-12 17:53 [PATCH for-6.1 ?] hw/core: fix error checkig in smp_parse Daniel P. Berrangé
@ 2021-08-12 18:57 ` Eduardo Habkost
2021-08-13 12:44 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Eduardo Habkost @ 2021-08-12 18:57 UTC (permalink / raw)
To: Daniel P. Berrangé; +Cc: Peter Maydell, qemu-devel
On Thu, Aug 12, 2021 at 06:53:53PM +0100, Daniel P. Berrangé wrote:
> The machine_set_smp() mistakenly checks 'errp' not '*errp',
> and so thinks there is an error every single time it runs.
> This causes it to jump to the end of the method, skipping
> the max CPUs checks. The caller meanwhile sees no error
> and so carries on execution. The result of all this is:
>
> $ qemu-system-x86_64 -smp -1
> qemu-system-x86_64: GLib: ../glib/gmem.c:142: failed to allocate 481036337048 bytes
>
> instead of
>
> $ qemu-system-x86_64 -smp -1
> qemu-system-x86_64: Invalid SMP CPUs -1. The max CPUs supported by machine 'pc-i440fx-6.1' is 255
>
> This is a regression from
>
> commit fe68090e8fbd6e831aaf3fc3bb0459c5cccf14cf
> Author: Paolo Bonzini <pbonzini@redhat.com>
> Date: Thu May 13 09:03:48 2021 -0400
>
> machine: add smp compound property
>
> Closes: https://gitlab.com/qemu-project/qemu/-/issues/524
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
I will prepare a pull request with this, just in case we are
already going to have a -rc4. I don't think this bug alone
should delay release of 6.1, though.
> ---
> hw/core/machine.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 943974d411..ab4fca6546 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -832,7 +832,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name,
> }
>
> mc->smp_parse(ms, config, errp);
> - if (errp) {
> + if (*errp) {
> goto out_free;
> }
>
> --
> 2.31.1
>
--
Eduardo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-6.1 ?] hw/core: fix error checkig in smp_parse
2021-08-12 17:53 [PATCH for-6.1 ?] hw/core: fix error checkig in smp_parse Daniel P. Berrangé
2021-08-12 18:57 ` Eduardo Habkost
@ 2021-08-13 12:44 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-08-13 12:44 UTC (permalink / raw)
To: Daniel P. Berrangé, qemu-devel; +Cc: Eduardo Habkost
On 12/08/21 19:53, Daniel P. Berrangé wrote:
> The machine_set_smp() mistakenly checks 'errp' not '*errp',
> and so thinks there is an error every single time it runs.
> This causes it to jump to the end of the method, skipping
> the max CPUs checks. The caller meanwhile sees no error
> and so carries on execution. The result of all this is:
>
> $ qemu-system-x86_64 -smp -1
> qemu-system-x86_64: GLib: ../glib/gmem.c:142: failed to allocate 481036337048 bytes
>
> instead of
>
> $ qemu-system-x86_64 -smp -1
> qemu-system-x86_64: Invalid SMP CPUs -1. The max CPUs supported by machine 'pc-i440fx-6.1' is 255
>
> This is a regression from
>
> commit fe68090e8fbd6e831aaf3fc3bb0459c5cccf14cf
> Author: Paolo Bonzini <pbonzini@redhat.com>
> Date: Thu May 13 09:03:48 2021 -0400
>
> machine: add smp compound property
>
> Closes: https://gitlab.com/qemu-project/qemu/-/issues/524
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> hw/core/machine.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 943974d411..ab4fca6546 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -832,7 +832,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name,
> }
>
> mc->smp_parse(ms, config, errp);
> - if (errp) {
> + if (*errp) {
> goto out_free;
> }
>
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-13 12:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-12 17:53 [PATCH for-6.1 ?] hw/core: fix error checkig in smp_parse Daniel P. Berrangé
2021-08-12 18:57 ` Eduardo Habkost
2021-08-13 12:44 ` 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).