From nobody Tue Oct 28 01:50:38 2025 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 1515189306296472.07204732757987; Fri, 5 Jan 2018 13:55:06 -0800 (PST) Received: from localhost ([::1]:60433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZx3-0003S3-TR for importer@patchew.org; Fri, 05 Jan 2018 16:54:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZv5-0002H3-N7 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:52:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZv4-00032Y-0F for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:52:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33052) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZv3-00031j-NQ for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:52:53 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0E48C049E39 for ; Fri, 5 Jan 2018 21:52:52 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47BE9605DE; Fri, 5 Jan 2018 21:52:51 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:36 +0100 Message-Id: <20180105215246.908-2-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 Jan 2018 21:52:52 +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 v4 01/11] tests: Remove deprecated migration tests 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 move to use migration_set_parameter() for everything. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- tests/migration-test.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 9fd5dadc0d..0448bc77dc 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -381,37 +381,20 @@ static void migrate_check_parameter(QTestState *who, = const char *parameter, QDECREF(rsp); } =20 -static void migrate_set_downtime(QTestState *who, const double value) +static void migrate_set_parameter(QTestState *who, const char *parameter, + const char *value) { QDict *rsp; gchar *cmd; - char *expected; - int64_t result_int; =20 - cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_downtime'," - "'arguments': { 'value': %g } }", value); + 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); - result_int =3D value * 1000L; - expected =3D g_strdup_printf("%" PRId64, result_int); - migrate_check_parameter(who, "downtime-limit", expected); - g_free(expected); -} - -static void migrate_set_speed(QTestState *who, const char *value) -{ - QDict *rsp; - gchar *cmd; - - cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_speed'," - "'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, "max-bandwidth", value); + migrate_check_parameter(who, parameter, value); } =20 static void migrate_set_capability(QTestState *who, const char *capability, @@ -543,8 +526,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 Tue Oct 28 01:50:38 2025 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 1515189307273192.43808826902705; Fri, 5 Jan 2018 13:55:07 -0800 (PST) Received: from localhost ([::1]:60434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZx6-0003U7-EX for importer@patchew.org; Fri, 05 Jan 2018 16:55:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZv6-0002H5-DO for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:52:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZv5-00034s-ID for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:52:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42444) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZv5-00033W-9A for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:52:55 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A95D3DFCD for ; Fri, 5 Jan 2018 21:52:54 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05155601B3; Fri, 5 Jan 2018 21:52:52 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:37 +0100 Message-Id: <20180105215246.908-3-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 Jan 2018 21:52:54 +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 v4 02/11] tests: Migration ppc test was missing arguments 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" Argument file is also needed there. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- 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 0448bc77dc..32f3bb86a8 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -464,8 +464,9 @@ static void test_migrate_start(QTestState **from, QTest= State **to, cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 256M" " -name pcdest,debug-threads=3Don" " -serial file:%s/dest_serial" + " -drive file=3D%s,if=3Dpflash,format=3D= raw" " -incoming %s", - accel, tmpfs, uri); + accel, tmpfs, bootpath, uri); } else { g_assert_not_reached(); } --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 151518931613750.92646359494847; Fri, 5 Jan 2018 13:55:16 -0800 (PST) Received: from localhost ([::1]:60436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZxL-0003cD-87 for importer@patchew.org; Fri, 05 Jan 2018 16:55:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvA-0002M1-Q1 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZv9-0003BX-Ev for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59632) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZv9-00039z-0F for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:52:59 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15C0861D0D for ; Fri, 5 Jan 2018 21:52:58 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B09E2605DE; Fri, 5 Jan 2018 21:52:54 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:38 +0100 Message-Id: <20180105215246.908-4-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 05 Jan 2018 21:52:58 +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 v4 03/11] tests: Consolidate accelerators declaration 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 Reviewed-by: Peter Xu --- tests/migration-test.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 32f3bb86a8..d81f22118b 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -434,27 +434,29 @@ static void test_migrate_start(QTestState **from, QTe= stState **to, gchar *cmd_src, *cmd_dst; char *bootpath =3D g_strdup_printf("%s/bootsect", tmpfs); const char *arch =3D qtest_get_arch(); + const char *accel =3D "kvm:tcg"; =20 got_stop =3D false; =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { init_bootfile_x86(bootpath); - cmd_src =3D g_strdup_printf("-machine accel=3Dkvm:tcg -m 150M" + cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 150M" " -name pcsource,debug-threads=3Don" " -serial file:%s/src_serial" " -drive file=3D%s,format=3Draw", - tmpfs, bootpath); - cmd_dst =3D g_strdup_printf("-machine accel=3Dkvm:tcg -m 150M" + accel, tmpfs, bootpath); + cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 150M" " -name pcdest,debug-threads=3Don" " -serial file:%s/dest_serial" " -drive file=3D%s,format=3Draw" " -incoming %s", - tmpfs, bootpath, uri); + accel, tmpfs, bootpath, uri); } else if (strcmp(arch, "ppc64") =3D=3D 0) { - const char *accel; =20 /* On ppc64, the test only works with kvm-hv, but not with kvm-pr = */ - accel =3D access("/sys/module/kvm_hv", F_OK) ? "tcg" : "kvm:tcg"; + if (access("/sys/module/kvm_hv", F_OK)) { + accel =3D "tcg"; + } init_bootfile_ppc(bootpath); cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 256M" " -name pcsource,debug-threads=3Don" --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 1515189477723587.4764368690403; Fri, 5 Jan 2018 13:57:57 -0800 (PST) Received: from localhost ([::1]:60458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZzw-0005t8-Td for importer@patchew.org; Fri, 05 Jan 2018 16:57:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvE-0002P2-6z for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvB-0003ER-1o for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvA-0003D7-NE for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:00 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7CC74E906 for ; Fri, 5 Jan 2018 21:52:59 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C109605DE; Fri, 5 Jan 2018 21:52:58 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:39 +0100 Message-Id: <20180105215246.908-5-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Jan 2018 21:52:59 +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 v4 04/11] tests: Use consistent names and sizes for migration 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 Reviewed-by: Peter Xu --- tests/migration-test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index d81f22118b..f469235d0b 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -440,13 +440,13 @@ static void test_migrate_start(QTestState **from, QTe= stState **to, =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { init_bootfile_x86(bootpath); - cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 150M" - " -name pcsource,debug-threads=3Don" + cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 256M" + " -name source,debug-threads=3Don" " -serial file:%s/src_serial" " -drive file=3D%s,format=3Draw", accel, tmpfs, bootpath); - cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 150M" - " -name pcdest,debug-threads=3Don" + cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 256M" + " -name target,debug-threads=3Don" " -serial file:%s/dest_serial" " -drive file=3D%s,format=3Draw" " -incoming %s", @@ -459,12 +459,12 @@ static void test_migrate_start(QTestState **from, QTe= stState **to, } init_bootfile_ppc(bootpath); cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 256M" - " -name pcsource,debug-threads=3Don" + " -name source,debug-threads=3Don" " -serial file:%s/src_serial" " -drive file=3D%s,if=3Dpflash,format=3D= raw", accel, tmpfs, bootpath); cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 256M" - " -name pcdest,debug-threads=3Don" + " -name target,debug-threads=3Don" " -serial file:%s/dest_serial" " -drive file=3D%s,if=3Dpflash,format=3D= raw" " -incoming %s", --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 1515189480301375.54210674930346; Fri, 5 Jan 2018 13:58:00 -0800 (PST) Received: from localhost ([::1]:60459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZzz-0005vw-Er for importer@patchew.org; Fri, 05 Jan 2018 16:57:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvE-0002P1-6x for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvC-0003H9-Qj for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42804) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvC-0003Fp-EQ for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:02 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E1CD4E906 for ; Fri, 5 Jan 2018 21:53:01 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29F5960473; Fri, 5 Jan 2018 21:52:59 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:40 +0100 Message-Id: <20180105215246.908-6-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Jan 2018 21:53:01 +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 v4 05/11] tests: Add deprecated commands migration 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" We add deprecated commands on a new test, so we don't have to add it on normal tests. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- tests/migration-test.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 59 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index f469235d0b..bcb0a82d42 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -513,6 +513,64 @@ static void test_migrate_end(QTestState *from, QTestSt= ate *to) cleanup("dest_serial"); } =20 +static void deprecated_set_downtime(QTestState *who, const double value) +{ + QDict *rsp; + gchar *cmd; + char *expected; + int64_t result_int; + + cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_downtime'," + "'arguments': { 'value': %g } }", value); + rsp =3D qtest_qmp(who, cmd); + g_free(cmd); + g_assert(qdict_haskey(rsp, "return")); + QDECREF(rsp); + result_int =3D value * 1000L; + expected =3D g_strdup_printf("%" PRId64, result_int); + migrate_check_parameter(who, "downtime-limit", expected); + g_free(expected); +} + +static void deprecated_set_speed(QTestState *who, const char *value) +{ + QDict *rsp; + gchar *cmd; + + cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_speed'," + "'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, "max-bandwidth", value); +} + +static void test_deprecated(void) +{ + char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); + QTestState *from, *to; + + /* Create source and destination guests. This way we can reuse + * test_migrate_start */ + test_migrate_start(&from, &to, uri); + + deprecated_set_downtime(from, 0.12345); + deprecated_set_downtime(to, 0.12345); + deprecated_set_speed(from, "12345"); + deprecated_set_speed(to, "12345"); + + g_free(uri); + + qtest_quit(from); + qtest_quit(to); + + cleanup("bootsect"); + cleanup("migsocket"); + cleanup("src_serial"); + cleanup("dest_serial"); +} + static void test_migrate(void) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); @@ -580,6 +638,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); =20 qtest_add_func("/migration/postcopy/unix", test_migrate); + qtest_add_func("/migration/deprecated", test_deprecated); =20 ret =3D g_test_run(); =20 --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 1515189646585860.0725755031476; Fri, 5 Jan 2018 14:00:46 -0800 (PST) Received: from localhost ([::1]:60567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXa2b-0000F4-GF for importer@patchew.org; Fri, 05 Jan 2018 17:00:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvF-0002QD-FY for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvE-0003KD-Eg for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33104) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvE-0003Ig-66 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:04 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 425D2C001F0C for ; Fri, 5 Jan 2018 21:53:03 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4E706058D; Fri, 5 Jan 2018 21:53:01 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:41 +0100 Message-Id: <20180105215246.908-7-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 Jan 2018 21:53:03 +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 v4 06/11] 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 Reviewed-by: Peter Xu --- 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 bcb0a82d42..88653ad767 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -571,7 +571,7 @@ static void test_deprecated(void) 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; @@ -618,6 +618,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 should make it not converge*/ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1GB/s */ + 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"; @@ -637,8 +676,9 @@ 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/deprecated", test_deprecated); + qtest_add_func("/migration/postcopy/unix", test_postcopy); =20 ret =3D g_test_run(); =20 --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 1515189482465956.19902477613; Fri, 5 Jan 2018 13:58:02 -0800 (PST) Received: from localhost ([::1]:60460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXa01-0005xp-Ld for importer@patchew.org; Fri, 05 Jan 2018 16:58:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvH-0002QH-Pg for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvG-0003M5-92 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52554) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvF-0003L6-Td for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF752C0587D2 for ; Fri, 5 Jan 2018 21:53:04 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A97D60626; Fri, 5 Jan 2018 21:53:03 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:42 +0100 Message-Id: <20180105215246.908-8-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 05 Jan 2018 21:53:04 +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 v4 07/11] 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 Reviewed-by: Peter Xu --- 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 88653ad767..024b6675fb 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -366,8 +366,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; @@ -376,9 +375,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 migrate_set_parameter(QTestState *who, const char *parameter, @@ -657,6 +665,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 should make it not converge*/ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1GB/s */ + 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"; @@ -677,6 +729,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/deprecated", test_deprecated); qtest_add_func("/migration/postcopy/unix", test_postcopy); =20 --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 1515189648678298.67188508673985; Fri, 5 Jan 2018 14:00:48 -0800 (PST) Received: from localhost ([::1]:60568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXa2a-0000FM-RF for importer@patchew.org; Fri, 05 Jan 2018 17:00:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvJ-0002RH-F5 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvH-0003NY-U9 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42820) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvH-0003Mj-Ip for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:07 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A6A024ACBB for ; Fri, 5 Jan 2018 21:53:06 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52121605DE; Fri, 5 Jan 2018 21:53:05 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:43 +0100 Message-Id: <20180105215246.908-9-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Jan 2018 21:53:06 +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 v4 08/11] 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 Reviewed-by: Peter Xu --- tests/migration-test.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 024b6675fb..c25c9dd7b1 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -554,6 +554,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 test_deprecated(void) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); @@ -567,7 +581,8 @@ static void test_deprecated(void) deprecated_set_downtime(to, 0.12345); deprecated_set_speed(from, "12345"); deprecated_set_speed(to, "12345"); - + deprecated_set_cache_size(from, "4096"); + deprecated_set_cache_size(to, "4096"); g_free(uri); =20 qtest_quit(from); @@ -709,6 +724,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. + */ + /* 1 ms should make it not converge*/ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1GB/s */ + 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 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"; @@ -732,6 +796,7 @@ int main(int argc, char **argv) qtest_add_func("/migration/precopy/tcp", test_precopy_tcp); qtest_add_func("/migration/deprecated", test_deprecated); 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 Tue Oct 28 01:50:38 2025 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 151518949053346.88770553807035; Fri, 5 Jan 2018 13:58:10 -0800 (PST) Received: from localhost ([::1]:60461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXa09-00063x-NO for importer@patchew.org; Fri, 05 Jan 2018 16:58:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvP-0002X9-0v for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvL-0003R2-Qv for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42844) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvL-0003QB-Eq for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:11 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8634A861A for ; Fri, 5 Jan 2018 21:53:10 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07F716058D; Fri, 5 Jan 2018 21:53:06 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:44 +0100 Message-Id: <20180105215246.908-10-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Jan 2018 21:53:10 +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 v4 09/11] tests: Create migrate-start-postcopy command 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" This way, it is like the rest of commands Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- tests/migration-test.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index c25c9dd7b1..70b3c0870b 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -436,6 +436,15 @@ static void migrate(QTestState *who, const char *uri) QDECREF(rsp); } =20 +static void migrate_start_postcopy(QTestState *who) +{ + QDict *rsp; + + rsp =3D wait_command(who, "{ 'execute': 'migrate-start-postcopy' }"); + g_assert(qdict_haskey(rsp, "return")); + QDECREF(rsp); +} + static void test_migrate_start(QTestState **from, QTestState **to, const char *uri) { @@ -598,7 +607,6 @@ static void test_postcopy(void) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; - QDict *rsp; =20 test_migrate_start(&from, &to, uri); =20 @@ -620,9 +628,7 @@ static void test_postcopy(void) =20 wait_for_migration_pass(from); =20 - rsp =3D wait_command(from, "{ 'execute': 'migrate-start-postcopy' }"); - g_assert(qdict_haskey(rsp, "return")); - QDECREF(rsp); + migrate_start_postcopy(from); =20 if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 151518978937823.396835507027845; Fri, 5 Jan 2018 14:03:09 -0800 (PST) Received: from localhost ([::1]:60664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXa4y-00023X-K7 for importer@patchew.org; Fri, 05 Jan 2018 17:03:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvP-0002XE-1I for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvN-0003Sc-QL for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36014) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvN-0003Rd-90 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:13 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5594A83F46 for ; Fri, 5 Jan 2018 21:53:12 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD8A0601B3; Fri, 5 Jan 2018 21:53:10 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:45 +0100 Message-Id: <20180105215246.908-11-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 05 Jan 2018 21:53:12 +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 v4 10/11] tests: Adjust sleeps for migration 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" Also reorder code to not sleep when event already happened. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- tests/migration-test.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 70b3c0870b..8914829006 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -280,10 +280,9 @@ static void read_blocktime(QTestState *who) =20 static void wait_for_migration_complete(QTestState *who) { - QDict *rsp, *rsp_return; - bool completed; - - do { + while (true) { + QDict *rsp, *rsp_return; + bool completed; const char *status; =20 rsp =3D wait_command(who, "{ 'execute': 'query-migrate' }"); @@ -292,8 +291,11 @@ static void wait_for_migration_complete(QTestState *wh= o) completed =3D strcmp(status, "completed") =3D=3D 0; g_assert_cmpstr(status, !=3D, "failed"); QDECREF(rsp); - usleep(1000 * 100); - } while (!completed); + if (completed) { + return; + } + usleep(1000); + } } =20 static void wait_for_migration_pass(QTestState *who) @@ -302,16 +304,13 @@ static void wait_for_migration_pass(QTestState *who) uint64_t pass; =20 /* Wait for the 1st sync */ - do { + while (!got_stop && !initial_pass) { + usleep(1000); initial_pass =3D get_migration_pass(who); - if (got_stop || initial_pass) { - break; - } - usleep(1000 * 100); - } while (true); + } =20 do { - usleep(1000 * 100); + usleep(1000); pass =3D get_migration_pass(who); } while (pass =3D=3D initial_pass && !got_stop); } @@ -510,13 +509,13 @@ static void test_migrate_end(QTestState *from, QTestS= tate *to) /* Destination still running, wait for a byte to change */ do { qtest_memread(to, start_address, &dest_byte_b, 1); - usleep(10 * 1000); + usleep(1000 * 10); } while (dest_byte_a =3D=3D dest_byte_b); =20 qtest_qmp_discard_response(to, "{ 'execute' : 'stop'}"); /* With it stopped, check nothing changes */ qtest_memread(to, start_address, &dest_byte_c, 1); - sleep(1); + usleep(1000 * 200); qtest_memread(to, start_address, &dest_byte_d, 1); g_assert_cmpint(dest_byte_c, =3D=3D, dest_byte_d); =20 --=20 2.14.3 From nobody Tue Oct 28 01:50:38 2025 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 1515189790293413.6555476998676; Fri, 5 Jan 2018 14:03:10 -0800 (PST) Received: from localhost ([::1]:60665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXa4z-00023q-J2 for importer@patchew.org; Fri, 05 Jan 2018 17:03:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXZvR-0002Zo-D8 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXZvQ-0003WK-FJ for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42440) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXZvQ-0003V6-8C for qemu-devel@nongnu.org; Fri, 05 Jan 2018 16:53:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F0CA81DE9 for ; Fri, 5 Jan 2018 21:53:15 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB2A5605DE; Fri, 5 Jan 2018 21:53:12 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 22:52:46 +0100 Message-Id: <20180105215246.908-12-quintela@redhat.com> In-Reply-To: <20180105215246.908-1-quintela@redhat.com> References: <20180105215246.908-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 Jan 2018 21:53:15 +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 v4 11/11] [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 Reviewed-by: Peter Xu --- tests/migration-test.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 51 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index 8914829006..eb44a95aa9 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -777,6 +777,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. + */ + /* 1 ms should make it not converge*/ + migrate_set_parameter(from, "downtime-limit", "1"); + /* 1GB/s */ + 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 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) { @@ -802,6 +850,9 @@ int main(int argc, char **argv) qtest_add_func("/migration/deprecated", test_deprecated); 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