diff mbox series

[v5,79/79] tests:numa-test: use explicit memdev to specify node RAM

Message ID 20200217173452.15243-80-imammedo@redhat.com
State New
Headers show
Series refactor main RAM allocation to use hostmem backend | expand

Commit Message

Igor Mammedov Feb. 17, 2020, 5:34 p.m. UTC
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 <imammedo@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
---
v3:
   * s/strcmp/g_str_equal/
   * put -object lines before -m
     (Thomas Huth <thuth@redhat.com>)
   * 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(-)

Comments

Philippe Mathieu-Daudé Feb. 18, 2020, 5:51 p.m. UTC | #1
On 2/17/20 6:34 PM, Igor Mammedov wrote:
> Follow up patches will remove automatic RAM distribution
> between nodes and will make default machine types require
> "memdev" option instead of legacy "mem" option.

Can we keep this patch for the follow up?

> 
> 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 <imammedo@redhat.com>
> Acked-by: Thomas Huth <thuth@redhat.com>
> ---
Igor Mammedov Feb. 19, 2020, 1 p.m. UTC | #2
On Tue, 18 Feb 2020 18:51:34 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> On 2/17/20 6:34 PM, Igor Mammedov wrote:
> > Follow up patches will remove automatic RAM distribution
> > between nodes and will make default machine types require
> > "memdev" option instead of legacy "mem" option.  
> 
> Can we keep this patch for the follow up?
memdev for numa was there for along time, just untested.
With this all numa tests switch to it instead of using
legacy option (+ a test for legacy option).
I don't think the patch should delayed along with numa
cleanups.

It of-cause could be posted as standalone patch as well,
I'll leave it upto Paolo whether to merge it or not.
 
> > 
> > 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 <imammedo@redhat.com>
> > Acked-by: Thomas Huth <thuth@redhat.com>
> > ---  
>
Philippe Mathieu-Daudé Feb. 19, 2020, 2:06 p.m. UTC | #3
On 2/19/20 2:00 PM, Igor Mammedov wrote:
> On Tue, 18 Feb 2020 18:51:34 +0100
> Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> 
>> On 2/17/20 6:34 PM, Igor Mammedov wrote:
>>> Follow up patches will remove automatic RAM distribution
>>> between nodes and will make default machine types require
>>> "memdev" option instead of legacy "mem" option.
>>
>> Can we keep this patch for the follow up?
> memdev for numa was there for along time, just untested.
> With this all numa tests switch to it instead of using
> legacy option (+ a test for legacy option).
> I don't think the patch should delayed along with numa
> cleanups.

I guess what confuses me is "Follow up patches *will* remove..."

> 
> It of-cause could be posted as standalone patch as well,
> I'll leave it upto Paolo whether to merge it or not.
>   
>>>
>>> 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 <imammedo@redhat.com>
>>> Acked-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>
>
Igor Mammedov Feb. 19, 2020, 2:30 p.m. UTC | #4
On Wed, 19 Feb 2020 15:06:24 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> On 2/19/20 2:00 PM, Igor Mammedov wrote:
> > On Tue, 18 Feb 2020 18:51:34 +0100
> > Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> >   
> >> On 2/17/20 6:34 PM, Igor Mammedov wrote:  
> >>> Follow up patches will remove automatic RAM distribution
> >>> between nodes and will make default machine types require
> >>> "memdev" option instead of legacy "mem" option.  
> >>
> >> Can we keep this patch for the follow up?  
> > memdev for numa was there for along time, just untested.
> > With this all numa tests switch to it instead of using
> > legacy option (+ a test for legacy option).
> > I don't think the patch should delayed along with numa
> > cleanups.  
> 
> I guess what confuses me is "Follow up patches *will* remove..."
I'll drop this frase since there aren't immediate "Follow up patches"
to avoid confusion

> > 
> > It of-cause could be posted as standalone patch as well,
> > I'll leave it upto Paolo whether to merge it or not.
> >     
> >>>
> >>> 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 <imammedo@redhat.com>
> >>> Acked-by: Thomas Huth <thuth@redhat.com>
> >>> ---  
> >>  
> >   
>
diff mbox series

Patch

diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c
index 35999ea28f..2f9b7f663a 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);