[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 80/80] tests:numa-test: use explicit memdev to specify node RA
From: |
Igor Mammedov |
Subject: |
[PATCH v4 80/80] tests:numa-test: use explicit memdev to specify node RAM |
Date: |
Fri, 31 Jan 2020 16:09:50 +0100 |
Follow up patches will remove automatic RAM distribution
between nodes and will make default machine types require
"memdev" option instead of legacy "mem" option.
Make tests to follow new rules and add an additional test
for legacy "mem" option on old machine type, to make sure
it won't regress in the future.
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Thomas Huth <address@hidden>
---
v3:
* s/strcmp/g_str_equal/
* put -object lines before -m
(Thomas Huth <address@hidden>)
* drop new test_pc_legacy_mem(), due to dropping
"numa: forbid '-numa node,mem' for 5.0 and newer machine types"
it will be posted later, when libvirt side is prepared for
disabled '-numa node,mem' (hopefully 5.1)
---
tests/qtest/numa-test.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c
index 35999ea..2f9b7f6 100644
--- a/tests/qtest/numa-test.c
+++ b/tests/qtest/numa-test.c
@@ -25,9 +25,8 @@ static void test_mon_explicit(const void *data)
g_autofree char *s = NULL;
g_autofree char *cli = NULL;
- cli = make_cli(data, "-smp 8 "
- "-numa node,nodeid=0,cpus=0-3 "
- "-numa node,nodeid=1,cpus=4-7 ");
+ cli = make_cli(data, "-smp 8 -numa node,nodeid=0,memdev=ram,cpus=0-3 "
+ "-numa node,nodeid=1,cpus=4-7");
qts = qtest_init(cli);
s = qtest_hmp(qts, "info numa");
@@ -37,13 +36,13 @@ static void test_mon_explicit(const void *data)
qtest_quit(qts);
}
-static void test_mon_default(const void *data)
+static void test_def_cpu_split(const void *data)
{
QTestState *qts;
g_autofree char *s = NULL;
g_autofree char *cli = NULL;
- cli = make_cli(data, "-smp 8 -numa node -numa node");
+ cli = make_cli(data, "-smp 8 -numa node,memdev=ram -numa node");
qts = qtest_init(cli);
s = qtest_hmp(qts, "info numa");
@@ -60,7 +59,7 @@ static void test_mon_partial(const void *data)
g_autofree char *cli = NULL;
cli = make_cli(data, "-smp 8 "
- "-numa node,nodeid=0,cpus=0-1 "
+ "-numa node,nodeid=0,memdev=ram,cpus=0-1 "
"-numa node,nodeid=1,cpus=4-5 ");
qts = qtest_init(cli);
@@ -87,7 +86,8 @@ static void test_query_cpus(const void *data)
QTestState *qts;
g_autofree char *cli = NULL;
- cli = make_cli(data, "-smp 8 -numa node,cpus=0-3 -numa node,cpus=4-7");
+ cli = make_cli(data, "-smp 8 -numa node,memdev=ram,cpus=0-3 "
+ "-numa node,cpus=4-7");
qts = qtest_init(cli);
cpus = get_cpus(qts, &resp);
g_assert(cpus);
@@ -125,7 +125,7 @@ static void pc_numa_cpu(const void *data)
g_autofree char *cli = NULL;
cli = make_cli(data, "-cpu pentium -smp 8,sockets=2,cores=2,threads=2 "
- "-numa node,nodeid=0 -numa node,nodeid=1 "
+ "-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 "
"-numa cpu,node-id=1,socket-id=0 "
"-numa cpu,node-id=0,socket-id=1,core-id=0 "
"-numa cpu,node-id=0,socket-id=1,core-id=1,thread-id=0 "
@@ -178,7 +178,7 @@ static void spapr_numa_cpu(const void *data)
g_autofree char *cli = NULL;
cli = make_cli(data, "-smp 4,cores=4 "
- "-numa node,nodeid=0 -numa node,nodeid=1 "
+ "-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 "
"-numa cpu,node-id=0,core-id=0 "
"-numa cpu,node-id=0,core-id=1 "
"-numa cpu,node-id=0,core-id=2 "
@@ -223,7 +223,7 @@ static void aarch64_numa_cpu(const void *data)
g_autofree char *cli = NULL;
cli = make_cli(data, "-smp 2 "
- "-numa node,nodeid=0 -numa node,nodeid=1 "
+ "-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 "
"-numa cpu,node-id=1,thread-id=0 "
"-numa cpu,node-id=0,thread-id=1");
qts = qtest_init(cli);
@@ -270,7 +270,7 @@ static void pc_dynamic_cpu_cfg(const void *data)
/* create 2 numa nodes */
g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
- " 'arguments': { 'type': 'node', 'nodeid': 0 } }")));
+ " 'arguments': { 'type': 'node', 'nodeid': 0, 'memdev': 'ram' } }")));
g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
" 'arguments': { 'type': 'node', 'nodeid': 1 } }")));
@@ -542,13 +542,19 @@ int main(int argc, char **argv)
g_autoptr(GString) args = g_string_new(NULL);
const char *arch = qtest_get_arch();
+ if (g_str_equal(arch, "ppc64")) {
+ g_string_append(args, " -object memory-backend-ram,id=ram,size=512M");
+ } else {
+ g_string_append(args, " -object memory-backend-ram,id=ram,size=128M");
+ }
+
if (g_str_equal(arch, "aarch64")) {
g_string_append(args, " -machine virt");
}
g_test_init(&argc, &argv, NULL);
- qtest_add_data_func("/numa/mon/default", args, test_mon_default);
+ qtest_add_data_func("/numa/mon/cpus/default", args, test_def_cpu_split);
qtest_add_data_func("/numa/mon/cpus/explicit", args, test_mon_explicit);
qtest_add_data_func("/numa/mon/cpus/partial", args, test_mon_partial);
qtest_add_data_func("/numa/qmp/cpus/query-cpus", args, test_query_cpus);
--
2.7.4
- [PATCH v4 68/80] ppc/virtex_ml507: remove unused arguments, (continued)
- [PATCH v4 68/80] ppc/virtex_ml507: remove unused arguments, Igor Mammedov, 2020/01/31
- [PATCH v4 70/80] sparc/leon3: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 71/80] sparc/sun4m: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 73/80] remove no longer used memory_region_allocate_system_memory(), Igor Mammedov, 2020/01/31
- [PATCH v4 75/80] exec: drop bogus mem_path from qemu_ram_alloc_from_fd(), Igor Mammedov, 2020/01/31
- [PATCH v4 74/80] exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize(), Igor Mammedov, 2020/01/31
- [PATCH v4 76/80] make mem_path local variable, Igor Mammedov, 2020/01/31
- [PATCH v4 77/80] hostmem: introduce "prealloc-threads" property, Igor Mammedov, 2020/01/31
- [PATCH v4 79/80] tests/numa-test: make top level args dynamic and g_autofree(cli) cleanups, Igor Mammedov, 2020/01/31
- [PATCH v4 78/80] hostmem: fix strict bind policy, Igor Mammedov, 2020/01/31
- [PATCH v4 80/80] tests:numa-test: use explicit memdev to specify node RAM,
Igor Mammedov <=
- Re: [PATCH v4 00/80] refactor main RAM allocation to use hostmem backend, no-reply, 2020/01/31
- Re: [PATCH v4 00/80] refactor main RAM allocation to use hostmem backend, no-reply, 2020/01/31