diff mbox series

[v10,09/10] migration: add blocktime calculation into postcopy-test

Message ID 1505839684-10046-10-git-send-email-a.perevalov@samsung.com
State New
Headers show
Series calculate blocktime for postcopy live migration | expand

Commit Message

Alexey Perevalov Sept. 19, 2017, 4:48 p.m. UTC
This patch just requests blocktime calculation, but doesn't
add any facility to check or show it.

Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
---
 tests/postcopy-test.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Dr. David Alan Gilbert Sept. 21, 2017, 12:39 p.m. UTC | #1
* Alexey Perevalov (a.perevalov@samsung.com) wrote:
> This patch just requests blocktime calculation, but doesn't
> add any facility to check or show it.
> 
> Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
> ---
>  tests/postcopy-test.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c
> index 8142f2a..1db5359 100644
> --- a/tests/postcopy-test.c
> +++ b/tests/postcopy-test.c
> @@ -425,6 +425,17 @@ static void test_migrate(void)
>      g_assert(qdict_haskey(rsp, "return"));
>      QDECREF(rsp);
>  
> +#ifdef UFFD_FEATURE_THREAD_ID
> +    global_qtest = to;
> +    rsp = qmp("{ 'execute': 'migrate-set-capabilities',"
> +                  "'arguments': { "
> +                      "'capabilities': [ {"
> +                          "'capability': 'postcopy-blocktime',"
> +                          "'state': true } ] } }");
> +    g_assert(qdict_haskey(rsp, "return"));
> +    QDECREF(rsp);
> +#endif
> +

I think that'll break;  once you sync the kernel headers up,
we'll always get that defined even when we're building or running
on an older kernel.
So I think you need to try and enable it but fall back if it's not
available somehow.

Dave

>      /* We want to pick a speed slow enough that the test completes
>       * quickly, but that it doesn't complete precopy even on a slow
>       * machine, so also set the downtime.
> @@ -441,7 +452,6 @@ static void test_migrate(void)
>      g_assert(qdict_haskey(rsp, "return"));
>      QDECREF(rsp);
>  
> -
>      /* Wait for the first serial output from the source */
>      wait_for_serial("src_serial");
>  
> -- 
> 1.9.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox series

Patch

diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c
index 8142f2a..1db5359 100644
--- a/tests/postcopy-test.c
+++ b/tests/postcopy-test.c
@@ -425,6 +425,17 @@  static void test_migrate(void)
     g_assert(qdict_haskey(rsp, "return"));
     QDECREF(rsp);
 
+#ifdef UFFD_FEATURE_THREAD_ID
+    global_qtest = to;
+    rsp = qmp("{ 'execute': 'migrate-set-capabilities',"
+                  "'arguments': { "
+                      "'capabilities': [ {"
+                          "'capability': 'postcopy-blocktime',"
+                          "'state': true } ] } }");
+    g_assert(qdict_haskey(rsp, "return"));
+    QDECREF(rsp);
+#endif
+
     /* We want to pick a speed slow enough that the test completes
      * quickly, but that it doesn't complete precopy even on a slow
      * machine, so also set the downtime.
@@ -441,7 +452,6 @@  static void test_migrate(void)
     g_assert(qdict_haskey(rsp, "return"));
     QDECREF(rsp);
 
-
     /* Wait for the first serial output from the source */
     wait_for_serial("src_serial");