From nobody Wed May 1 23:07:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512153519190570.6614005526167; Fri, 1 Dec 2017 10:38:39 -0800 (PST) Received: from localhost ([::1]:59563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKqCn-00081u-7o for importer@patchew.org; Fri, 01 Dec 2017 13:38:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoJi-0005UQ-Gr for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoJe-0003lj-4I for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54634) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKoJd-0003kw-TY for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:30 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CB822CE92F for ; Fri, 1 Dec 2017 12:58:20 +0000 (UTC) Received: from secure.mitica (ovpn-117-171.ams2.redhat.com [10.36.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14CC35C550; Fri, 1 Dec 2017 12:58:18 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 1 Dec 2017 13:58:08 +0100 Message-Id: <20171201125813.1437-2-quintela@redhat.com> In-Reply-To: <20171201125813.1437-1-quintela@redhat.com> References: <20171201125813.1437-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 01 Dec 2017 12:58:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/6] migration: free result string X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reported-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- tests/migration-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index be598d3257..799e24ebc6 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -358,13 +358,14 @@ static void migrate_check_parameter(QTestState *who, = const char *parameter, const char *value) { QDict *rsp, *rsp_return; - const char *result; + char *result; =20 rsp =3D wait_command(who, "{ 'execute': 'query-migrate-parameters' }"); rsp_return =3D qdict_get_qdict(rsp, "return"); result =3D g_strdup_printf("%" PRId64, qdict_get_try_int(rsp_return, parameter, -1)= ); g_assert_cmpstr(result, =3D=3D, value); + g_free(result); QDECREF(rsp); } =20 --=20 2.14.3 From nobody Wed May 1 23:07:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512152642558528.4386321790636; Fri, 1 Dec 2017 10:24:02 -0800 (PST) Received: from localhost ([::1]:59431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKpyX-00034L-9V for importer@patchew.org; Fri, 01 Dec 2017 13:23:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoIp-0004dN-1l for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:36:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoIn-0002rH-EC for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:36:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57100) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKoIn-0002qW-8I for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:36:37 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5172481DE5 for ; Fri, 1 Dec 2017 12:58:22 +0000 (UTC) Received: from secure.mitica (ovpn-117-171.ams2.redhat.com [10.36.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id F10505C893; Fri, 1 Dec 2017 12:58:20 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 1 Dec 2017 13:58:09 +0100 Message-Id: <20171201125813.1437-3-quintela@redhat.com> In-Reply-To: <20171201125813.1437-1-quintela@redhat.com> References: <20171201125813.1437-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 01 Dec 2017 12:58:22 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 2/6] tests: migration test deprecated commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We now test the deprecated commands everytime that we test the new commands. This makes unnecesary to add tests for deprecated commands. Signed-off-by: Juan Quintela --- tests/migration-test.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 799e24ebc6..51f49c74e9 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -369,7 +369,7 @@ static void migrate_check_parameter(QTestState *who, co= nst char *parameter, QDECREF(rsp); } =20 -static void migrate_set_downtime(QTestState *who, const double value) +static void deprecated_set_downtime(QTestState *who, const double value) { QDict *rsp; gchar *cmd; @@ -388,7 +388,7 @@ static void migrate_set_downtime(QTestState *who, const= double value) g_free(expected); } =20 -static void migrate_set_speed(QTestState *who, const char *value) +static void deprecated_set_speed(QTestState *who, const char *value) { QDict *rsp; gchar *cmd; @@ -402,6 +402,30 @@ static void migrate_set_speed(QTestState *who, const c= har *value) migrate_check_parameter(who, "max-bandwidth", value); } =20 +static void migrate_set_parameter(QTestState *who, const char *parameter, + const char *value) +{ + QDict *rsp; + gchar *cmd; + + if (strcmp(parameter, "downtime-limit") =3D=3D 0) { + deprecated_set_downtime(who, 0.12345); + } + + if (strcmp(parameter, "max-bandwidth") =3D=3D 0) { + deprecated_set_speed(who, "12345"); + } + + cmd =3D g_strdup_printf("{ 'execute': 'migrate-set-parameters'," + "'arguments': { '%s': %s } }", + parameter, value); + rsp =3D qtest_qmp(who, cmd); + g_free(cmd); + g_assert(qdict_haskey(rsp, "return")); + QDECREF(rsp); + migrate_check_parameter(who, parameter, value); +} + static void migrate_set_capability(QTestState *who, const char *capability, const char *value) { @@ -530,8 +554,8 @@ static void test_migrate(void) * quickly, but that it doesn't complete precopy even on a slow * machine, so also set the downtime. */ - migrate_set_speed(from, "100000000"); - migrate_set_downtime(from, 0.001); + migrate_set_parameter(from, "max-bandwidth", "100000000"); + migrate_set_parameter(from, "downtime-limit", "1"); =20 /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); --=20 2.14.3 From nobody Wed May 1 23:07:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512153333898937.2220918712518; Fri, 1 Dec 2017 10:35:33 -0800 (PST) Received: from localhost ([::1]:59537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKq9m-0005FB-1d for importer@patchew.org; Fri, 01 Dec 2017 13:35:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoJR-0005Bd-SA for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoJP-0003YG-2r for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35826) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKoJO-0003XO-Rq for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05FAC80F7A for ; Fri, 1 Dec 2017 12:58:24 +0000 (UTC) Received: from secure.mitica (ovpn-117-171.ams2.redhat.com [10.36.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4FB25C550; Fri, 1 Dec 2017 12:58:22 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 1 Dec 2017 13:58:10 +0100 Message-Id: <20171201125813.1437-4-quintela@redhat.com> In-Reply-To: <20171201125813.1437-1-quintela@redhat.com> References: <20171201125813.1437-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 01 Dec 2017 12:58:24 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 3/6] tests: Add migration precopy test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- tests/migration-test.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 51f49c74e9..3f3f056be6 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -539,7 +539,7 @@ static void test_migrate_end(QTestState *from, QTestSta= te *to) cleanup("dest_serial"); } =20 -static void test_migrate(void) +static void test_postcopy(void) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; @@ -582,6 +582,45 @@ static void test_migrate(void) test_migrate_end(from, to); } =20 +static void test_precopy_unix(void) +{ + char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); + QTestState *from, *to; + + test_migrate_start(&from, &to, uri); + + /* 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. + */ + /* 1 ms */ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1GB/s slow*/ + migrate_set_parameter(from, "max-bandwidth", "1000000000"); + + /* Wait for the first serial output from the source */ + wait_for_serial("src_serial"); + + migrate(from, uri); + + wait_for_migration_pass(from); + + /* 300 ms should converge */ + migrate_set_parameter(from, "downtime-limit", "300"); + + if (!got_stop) { + qtest_qmp_eventwait(from, "STOP"); + } + + qtest_qmp_eventwait(to, "RESUME"); + + wait_for_serial("dest_serial"); + wait_for_migration_complete(from); + + test_migrate_end(from, to); + g_free(uri); +} + int main(int argc, char **argv) { char template[] =3D "/tmp/migration-test-XXXXXX"; @@ -601,7 +640,8 @@ int main(int argc, char **argv) =20 module_call_init(MODULE_INIT_QOM); =20 - qtest_add_func("/migration/postcopy/unix", test_migrate); + qtest_add_func("/migration/precopy/unix", test_precopy_unix); + qtest_add_func("/migration/postcopy/unix", test_postcopy); =20 ret =3D g_test_run(); =20 --=20 2.14.3 From nobody Wed May 1 23:07:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512152822206172.93263865036226; Fri, 1 Dec 2017 10:27:02 -0800 (PST) Received: from localhost ([::1]:59463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKq1Y-0005Xy-CN for importer@patchew.org; Fri, 01 Dec 2017 13:26:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoIp-0004dU-3k for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:36:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoIk-0002oX-22 for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:36:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43754) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKoIj-0002np-Op for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:36:33 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB8B34E4C2 for ; Fri, 1 Dec 2017 12:58:25 +0000 (UTC) Received: from secure.mitica (ovpn-117-171.ams2.redhat.com [10.36.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 590565C881; Fri, 1 Dec 2017 12:58:24 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 1 Dec 2017 13:58:11 +0100 Message-Id: <20171201125813.1437-5-quintela@redhat.com> In-Reply-To: <20171201125813.1437-1-quintela@redhat.com> References: <20171201125813.1437-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 01 Dec 2017 12:58:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 4/6] tests: Add basic migration precopy tcp test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Not sharing code from precopy/unix because we have to read back the tcp parameter. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- tests/migration-test.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++= +--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 3f3f056be6..841c89e28a 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -354,8 +354,7 @@ static void cleanup(const char *filename) g_free(path); } =20 -static void migrate_check_parameter(QTestState *who, const char *parameter, - const char *value) +static char *migrate_get_parameter(QTestState *who, const char *parameter) { QDict *rsp, *rsp_return; char *result; @@ -364,9 +363,18 @@ static void migrate_check_parameter(QTestState *who, c= onst char *parameter, rsp_return =3D qdict_get_qdict(rsp, "return"); result =3D g_strdup_printf("%" PRId64, qdict_get_try_int(rsp_return, parameter, -1)= ); + QDECREF(rsp); + return result; +} + +static void migrate_check_parameter(QTestState *who, const char *parameter, + const char *value) +{ + char *result; + + result =3D migrate_get_parameter(who, parameter); g_assert_cmpstr(result, =3D=3D, value); g_free(result); - QDECREF(rsp); } =20 static void deprecated_set_downtime(QTestState *who, const double value) @@ -621,6 +629,50 @@ static void test_precopy_unix(void) g_free(uri); } =20 +static void test_precopy_tcp(void) +{ + char *uri; + char *port; + QTestState *from, *to; + + test_migrate_start(&from, &to, "tcp:127.0.0.1:0"); + + /* 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. + */ + /* 1 ms */ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1GB/s slow*/ + migrate_set_parameter(from, "max-bandwidth", "1000000000"); + + /* Wait for the first serial output from the source */ + wait_for_serial("src_serial"); + + port =3D migrate_get_parameter(to, "tcp-port"); + uri =3D g_strdup_printf("tcp:127.0.0.1:%s", port); + + migrate(from, uri); + + wait_for_migration_pass(from); + + /* 300 ms should converge */ + migrate_set_parameter(from, "downtime-limit", "300"); + + if (!got_stop) { + qtest_qmp_eventwait(from, "STOP"); + } + + qtest_qmp_eventwait(to, "RESUME"); + + wait_for_serial("dest_serial"); + wait_for_migration_complete(from); + + test_migrate_end(from, to); + g_free(uri); + g_free(port); +} + int main(int argc, char **argv) { char template[] =3D "/tmp/migration-test-XXXXXX"; @@ -641,6 +693,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); =20 qtest_add_func("/migration/precopy/unix", test_precopy_unix); + qtest_add_func("/migration/precopy/tcp", test_precopy_tcp); qtest_add_func("/migration/postcopy/unix", test_postcopy); =20 ret =3D g_test_run(); --=20 2.14.3 From nobody Wed May 1 23:07:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512151065003865.0367952541081; Fri, 1 Dec 2017 09:57:45 -0800 (PST) Received: from localhost ([::1]:59250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKpZE-0003dA-4U for importer@patchew.org; Fri, 01 Dec 2017 12:57:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoKM-000661-Vl for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:38:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoKI-0004Oi-5o for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:38:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36948) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKoKH-0004My-T6 for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:38:10 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E87F6C0050BB for ; Fri, 1 Dec 2017 12:58:27 +0000 (UTC) Received: from secure.mitica (ovpn-117-171.ams2.redhat.com [10.36.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CE105C881; Fri, 1 Dec 2017 12:58:26 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 1 Dec 2017 13:58:12 +0100 Message-Id: <20171201125813.1437-6-quintela@redhat.com> In-Reply-To: <20171201125813.1437-1-quintela@redhat.com> References: <20171201125813.1437-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 01 Dec 2017 12:58:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 5/6] tests: Add migration xbzrle test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- tests/migration-test.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 68 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index 841c89e28a..41dee78a9a 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -410,6 +410,20 @@ static void deprecated_set_speed(QTestState *who, cons= t char *value) migrate_check_parameter(who, "max-bandwidth", value); } =20 +static void deprecated_set_cache_size(QTestState *who, const char *value) +{ + QDict *rsp; + gchar *cmd; + + cmd =3D g_strdup_printf("{ 'execute': 'migrate-set-cache-size'," + "'arguments': { 'value': %s } }", value); + rsp =3D qtest_qmp(who, cmd); + g_free(cmd); + g_assert(qdict_haskey(rsp, "return")); + QDECREF(rsp); + migrate_check_parameter(who, "xbzrle-cache-size", value); +} + static void migrate_set_parameter(QTestState *who, const char *parameter, const char *value) { @@ -424,6 +438,10 @@ static void migrate_set_parameter(QTestState *who, con= st char *parameter, deprecated_set_speed(who, "12345"); } =20 + if (strcmp(parameter, "xbzrle-cache-size") =3D=3D 0) { + deprecated_set_cache_size(who, "4096"); + } + cmd =3D g_strdup_printf("{ 'execute': 'migrate-set-parameters'," "'arguments': { '%s': %s } }", parameter, value); @@ -673,6 +691,55 @@ static void test_precopy_tcp(void) g_free(port); } =20 +static void test_xbzrle(const char *uri) +{ + QTestState *from, *to; + + test_migrate_start(&from, &to, uri); + + /* 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. + */ + /* 100 ms */ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1MB/s slow*/ + migrate_set_parameter(from, "max-bandwidth", "1000000000"); + + migrate_set_parameter(from, "xbzrle-cache-size", "33554432"); + + migrate_set_capability(from, "xbzrle", "true"); + migrate_set_capability(to, "xbzrle", "true"); + /* Wait for the first serial output from the source */ + wait_for_serial("src_serial"); + + migrate(from, uri); + + wait_for_migration_pass(from); + + /* 300ms it should converge */ + migrate_set_parameter(from, "downtime-limit", "300"); + + if (!got_stop) { + qtest_qmp_eventwait(from, "STOP"); + } + qtest_qmp_eventwait(to, "RESUME"); + + wait_for_serial("dest_serial"); + wait_for_migration_complete(from); + + test_migrate_end(from, to); +} + +static void test_xbzrle_unix(void) +{ + char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); + + test_xbzrle(uri); + g_free(uri); +} + + int main(int argc, char **argv) { char template[] =3D "/tmp/migration-test-XXXXXX"; @@ -695,6 +762,7 @@ int main(int argc, char **argv) qtest_add_func("/migration/precopy/unix", test_precopy_unix); qtest_add_func("/migration/precopy/tcp", test_precopy_tcp); qtest_add_func("/migration/postcopy/unix", test_postcopy); + qtest_add_func("/migration/xbzrle/unix", test_xbzrle_unix); =20 ret =3D g_test_run(); =20 --=20 2.14.3 From nobody Wed May 1 23:07:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512153148956242.72304265220419; Fri, 1 Dec 2017 10:32:28 -0800 (PST) Received: from localhost ([::1]:59524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKq6o-0002Rn-Vd for importer@patchew.org; Fri, 01 Dec 2017 13:32:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoJR-0005Bf-T8 for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoJP-0003YL-3W for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35832) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKoJO-0003XN-RG for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:37:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED91D7E430 for ; Fri, 1 Dec 2017 12:58:29 +0000 (UTC) Received: from secure.mitica (ovpn-117-171.ams2.redhat.com [10.36.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4518F5C881; Fri, 1 Dec 2017 12:58:28 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 1 Dec 2017 13:58:13 +0100 Message-Id: <20171201125813.1437-7-quintela@redhat.com> In-Reply-To: <20171201125813.1437-1-quintela@redhat.com> References: <20171201125813.1437-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 01 Dec 2017 12:58:29 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 6/6] [RFH] tests: Add migration compress threads tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Yeap, it is still not working. trying to learn how to debug threads for guests running from the testt hardness. For some reason, compression is not working at the moment, test is disabled until I found why. Signed-off-by: Juan Quintela --- tests/migration-test.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 51 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index 41dee78a9a..eab3b146a4 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -739,6 +739,54 @@ static void test_xbzrle_unix(void) g_free(uri); } =20 +static void test_compress(const char *uri) +{ + QTestState *from, *to; + + test_migrate_start(&from, &to, uri); + + /* 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. + */ + /* 100 ms */ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1MB/s slow*/ + migrate_set_parameter(from, "max-bandwidth", "100000000"); + + migrate_set_parameter(from, "compress-threads", "4"); + migrate_set_parameter(to, "decompress-threads", "3"); + + migrate_set_capability(from, "compress", "true"); + migrate_set_capability(to, "compress", "true"); + /* Wait for the first serial output from the source */ + wait_for_serial("src_serial"); + + migrate(from, uri); + + wait_for_migration_pass(from); + + /* 300ms it should converge */ + migrate_set_parameter(from, "downtime-limit", "300"); + + if (!got_stop) { + qtest_qmp_eventwait(from, "STOP"); + } + qtest_qmp_eventwait(to, "RESUME"); + + wait_for_serial("dest_serial"); + wait_for_migration_complete(from); + + test_migrate_end(from, to); +} + +static void test_compress_unix(void) +{ + char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); + + test_compress(uri); + g_free(uri); +} =20 int main(int argc, char **argv) { @@ -763,6 +811,9 @@ int main(int argc, char **argv) qtest_add_func("/migration/precopy/tcp", test_precopy_tcp); qtest_add_func("/migration/postcopy/unix", test_postcopy); qtest_add_func("/migration/xbzrle/unix", test_xbzrle_unix); + if (0) { + qtest_add_func("/migration/compress/unix", test_compress_unix); + } =20 ret =3D g_test_run(); =20 --=20 2.14.3