From nobody Mon Feb 9 01:20:22 2026 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 1500280260360549.6093830001133; Mon, 17 Jul 2017 01:31:00 -0700 (PDT) Received: from localhost ([::1]:48752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX1Qf-0001vi-De for importer@patchew.org; Mon, 17 Jul 2017 04:30:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX1Mv-0006uw-8F for qemu-devel@nongnu.org; Mon, 17 Jul 2017 04:27:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX1Mu-00026D-G0 for qemu-devel@nongnu.org; Mon, 17 Jul 2017 04:27:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45708) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dX1Mu-00025F-7r for qemu-devel@nongnu.org; Mon, 17 Jul 2017 04:27:04 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 173E97CE10 for ; Mon, 17 Jul 2017 08:27:03 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-53.pek2.redhat.com [10.72.12.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6153277EAD; Mon, 17 Jul 2017 08:26:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 173E97CE10 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 173E97CE10 From: Peter Xu To: qemu-devel@nongnu.org Date: Mon, 17 Jul 2017 16:26:06 +0800 Message-Id: <1500279971-13875-7-git-send-email-peterx@redhat.com> In-Reply-To: <1500279971-13875-1-git-send-email-peterx@redhat.com> References: <1500279971-13875-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 17 Jul 2017 08:27: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 v2 06/11] migration: provide migrate_params_apply() 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: Laurent Vivier , Eduardo Habkost , Juan Quintela , "Dr . David Alan Gilbert" , Peter Xu , Markus Armbruster 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" Abstracted from qmp_migrate_set_parameters(). Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- migration/migration.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 2821f8a..8c65054 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -716,38 +716,40 @@ static bool migrate_params_check(MigrationParameters = *params, Error **errp) return true; } =20 -void qmp_migrate_set_parameters(MigrationParameters *params, Error **errp) +static void migrate_params_apply(MigrationParameters *params) { MigrationState *s =3D migrate_get_current(); =20 - if (!migrate_params_check(params, errp)) { - /* Invalid parameter */ - return; - } - if (params->has_compress_level) { s->parameters.compress_level =3D params->compress_level; } + if (params->has_compress_threads) { s->parameters.compress_threads =3D params->compress_threads; } + if (params->has_decompress_threads) { s->parameters.decompress_threads =3D params->decompress_threads; } + if (params->has_cpu_throttle_initial) { s->parameters.cpu_throttle_initial =3D params->cpu_throttle_initia= l; } + if (params->has_cpu_throttle_increment) { s->parameters.cpu_throttle_increment =3D params->cpu_throttle_incr= ement; } + if (params->has_tls_creds) { g_free(s->parameters.tls_creds); s->parameters.tls_creds =3D g_strdup(params->tls_creds); } + if (params->has_tls_hostname) { g_free(s->parameters.tls_hostname); s->parameters.tls_hostname =3D g_strdup(params->tls_hostname); } + if (params->has_max_bandwidth) { s->parameters.max_bandwidth =3D params->max_bandwidth; if (s->to_dst_file) { @@ -755,6 +757,7 @@ void qmp_migrate_set_parameters(MigrationParameters *pa= rams, Error **errp) s->parameters.max_bandwidth / XFER_LIMIT_R= ATIO); } } + if (params->has_downtime_limit) { s->parameters.downtime_limit =3D params->downtime_limit; } @@ -765,11 +768,22 @@ void qmp_migrate_set_parameters(MigrationParameters *= params, Error **errp) colo_checkpoint_notify(s); } } + if (params->has_block_incremental) { s->parameters.block_incremental =3D params->block_incremental; } } =20 +void qmp_migrate_set_parameters(MigrationParameters *params, Error **errp) +{ + if (!migrate_params_check(params, errp)) { + /* Invalid parameter */ + return; + } + + migrate_params_apply(params); +} + =20 void qmp_migrate_start_postcopy(Error **errp) { --=20 2.7.4