From patchwork Mon Jan 29 12:09:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 867076 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zVT554jFMz9s7F for ; Mon, 29 Jan 2018 23:16:25 +1100 (AEDT) Received: from localhost ([::1]:33274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg8MJ-0002Wh-NT for incoming@patchwork.ozlabs.org; Mon, 29 Jan 2018 07:16:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg8GD-0005hy-76 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 07:10:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eg8G7-0001QE-8f for qemu-devel@nongnu.org; Mon, 29 Jan 2018 07:10:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eg8G7-0001Pd-3T for qemu-devel@nongnu.org; Mon, 29 Jan 2018 07:09:59 -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 76F0F4E05D for ; Mon, 29 Jan 2018 12:09: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 6871D5C8A7; Mon, 29 Jan 2018 12:09:54 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 13:09:25 +0100 Message-Id: <20180129120932.12874-7-quintela@redhat.com> In-Reply-To: <20180129120932.12874-1-quintela@redhat.com> References: <20180129120932.12874-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]); Mon, 29 Jan 2018 12:09: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] [PULL 06/13] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We move to use migration_set_parameter() for everything. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- 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 799e24ebc6..0428d450df 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -369,37 +369,20 @@ static void migrate_check_parameter(QTestState *who, const char *parameter, QDECREF(rsp); } -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; - cmd = g_strdup_printf("{ 'execute': 'migrate_set_downtime'," - "'arguments': { 'value': %g } }", value); + cmd = g_strdup_printf("{ 'execute': 'migrate-set-parameters'," + "'arguments': { '%s': %s } }", + parameter, value); rsp = qtest_qmp(who, cmd); g_free(cmd); g_assert(qdict_haskey(rsp, "return")); QDECREF(rsp); - result_int = value * 1000L; - expected = 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 = g_strdup_printf("{ 'execute': 'migrate_set_speed'," - "'arguments': { 'value': %s } }", value); - rsp = 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); } static void migrate_set_capability(QTestState *who, const char *capability, @@ -530,8 +513,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"); /* Wait for the first serial output from the source */ wait_for_serial("src_serial");