mirror of https://github.com/xemu-project/xemu.git
ACPI/unit-test: Add a testcase for RAM allocation in numa node
As QEMU supports the memory-less node, it is possible that there is no RAM in the first numa node(also be called as node0). eg: ... \ -m 128,slots=3,maxmem=1G \ -numa node -numa node,mem=128M \ But, this makes it hard for QEMU to build a known-to-work ACPI SRAT table. Only fixing it is not enough. Add a testcase for this situation to make sure the ACPI table is correct for guest. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
fced4d00e6
commit
d82c4f82e0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -810,6 +810,28 @@ static void test_acpi_piix4_tcg_memhp(void)
|
|||
free_test_data(&data);
|
||||
}
|
||||
|
||||
static void test_acpi_q35_tcg_numamem(void)
|
||||
{
|
||||
test_data data;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
data.machine = MACHINE_Q35;
|
||||
data.variant = ".numamem";
|
||||
test_acpi_one(" -numa node -numa node,mem=128", &data);
|
||||
free_test_data(&data);
|
||||
}
|
||||
|
||||
static void test_acpi_piix4_tcg_numamem(void)
|
||||
{
|
||||
test_data data;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
data.machine = MACHINE_PC;
|
||||
data.variant = ".numamem";
|
||||
test_acpi_one(" -numa node -numa node,mem=128", &data);
|
||||
free_test_data(&data);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *arch = qtest_get_arch();
|
||||
|
@ -832,6 +854,8 @@ int main(int argc, char *argv[])
|
|||
qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp);
|
||||
qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp);
|
||||
qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp);
|
||||
qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem);
|
||||
qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem);
|
||||
}
|
||||
ret = g_test_run();
|
||||
boot_sector_cleanup(disk);
|
||||
|
|
Loading…
Reference in New Issue