mbox series

[0/2] hw/core/machine: An an unit test for smp_parse

Message ID 20211010103954.20644-1-wangyanan55@huawei.com
Headers show
Series hw/core/machine: An an unit test for smp_parse | expand

Message

wangyanan (Y) Oct. 10, 2021, 10:39 a.m. UTC
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+sxzUSJdbY+j@redhat.com/

The originally posted test is here [2]:
[2] https://lore.kernel.org/qemu-devel/20210910073025.16480-17-wangyanan55@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