Hi, This series introduces an unit test for generic smp_parse().
We have had enough discussions about what kind of SMP configurations by the user should be considered valid and what should be invalid. Since we have finished optimizing the SMP parsing code, then this test normatively listed all the possible valid/invalid configurations that the user can provide. This can be a testing tool when we introduce new topology members and need to touch the parsing code. For your reference, Some related discussion is here [1]: [1] https://lore.kernel.org/qemu-devel/yoxf+sxzusjdb...@redhat.com/ The originally posted test is here [2]: [2] https://lore.kernel.org/qemu-devel/20210910073025.16480-17-wangyana...@huawei.com/ Compared to [2], the test in this series is reworked and more brief. Yanan Wang (2): hw/core/machine: Split out smp_parse as an inline API tests/unit: Add an unit test for smp parsing MAINTAINERS | 2 + hw/core/machine.c | 160 +--------- include/hw/core/smp.h | 185 +++++++++++ tests/unit/meson.build | 1 + tests/unit/test-smp-parse.c | 613 ++++++++++++++++++++++++++++++++++++ 5 files changed, 802 insertions(+), 159 deletions(-) create mode 100644 include/hw/core/smp.h create mode 100644 tests/unit/test-smp-parse.c -- 2.19.1