From: Yanan Wang Date: Wed, 29 Sep 2021 02:58:10 +0000 (+0800) Subject: machine: Use ms instead of global current_machine in sanity-check X-Git-Tag: v6.2.0-rc0~75^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69fc28a78dbff2d3414bbafce38320b4433ed583;p=thirdparty%2Fqemu.git machine: Use ms instead of global current_machine in sanity-check In the sanity-check of smp_cpus and max_cpus against mc in function machine_set_smp(), we are now using ms->smp.max_cpus for the check but using current_machine->smp.max_cpus in the error message. Tweak this by uniformly using the local ms. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Pankaj Gupta Reviewed-by: Cornelia Huck Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210929025816.21076-11-wangyanan55@huawei.com> Signed-off-by: Paolo Bonzini --- diff --git a/hw/core/machine.c b/hw/core/machine.c index f2a34d98c06..12d74160538 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -881,7 +881,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name, } else if (ms->smp.max_cpus > mc->max_cpus) { error_setg(errp, "Invalid SMP CPUs %d. The max CPUs " "supported by machine '%s' is %d", - current_machine->smp.max_cpus, + ms->smp.max_cpus, mc->name, mc->max_cpus); }