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

Yanan Wang posted 2 patches 2 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211010103954.20644-1-wangyanan55@huawei.com
Maintainers: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Eduardo Habkost <ehabkost@redhat.com>
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
[PATCH 0/2] hw/core/machine: An an unit test for smp_parse
Posted by Yanan Wang 2 years, 6 months ago
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

-- 
2.19.1