machine: Introduce helper is_cpu_type_supported()
commitacbadc5a29b957d525dd89d668bfc939ac1f8bb8
authorGavin Shan <gshan@redhat.com>
Mon, 4 Dec 2023 00:47:19 +0000 (4 10:47 +1000)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 5 Jan 2024 15:20:14 +0000 (5 16:20 +0100)
treef511fa66e848811524acba58974236ec82e195c5
parentb9f452142cf4d47d97f6e6e2b727c9237443eb0f
machine: Introduce helper is_cpu_type_supported()

The logic, to check if the specified CPU type is supported in
machine_run_board_init(), is independent enough. Factor it out into
helper is_cpu_type_supported(). machine_run_board_init() looks a bit
clean with this. Since we're here, @machine_class is renamed to @mc to
avoid multiple line spanning of code. The comments are tweaked a bit
either.

No functional change intended.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231204004726.483558-3-gshan@redhat.com>
[PMD: Only call new helper if machine->cpu_type is not NULL]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/core/machine.c