diff options
author | Gavin Shan <gshan@redhat.com> | 2023-12-04 10:47:20 +1000 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-05 16:20:15 +0100 |
commit | e702cbc19e6bc04685a48f9e07cbf74bf4d53042 (patch) | |
tree | ab8c42ff294a887d07f4a5984a1b3b494c56756d /qom | |
parent | acbadc5a29b957d525dd89d668bfc939ac1f8bb8 (diff) |
machine: Improve is_cpu_type_supported()
It's no sense to check the CPU type when mc->valid_cpu_types[0] is
NULL, which is a program error. Raise an assert on this.
A precise hint for the error message is given when mc->valid_cpu_types[0]
is the only valid entry. Besides, enumeration on mc->valid_cpu_types[0]
when we have mutiple valid entries there is avoided to increase the code
readability, as suggested by Philippe Mathieu-Daudé.
Besides, @cc comes from machine->cpu_type or mc->default_cpu_type. For
the later case, it can be NULL and it's also a program error. We should
use assert() in this case.
Signed-off-by: Gavin Shan <gshan@redhat.com>
Message-ID: <20231204004726.483558-4-gshan@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'qom')
0 files changed, 0 insertions, 0 deletions