From nobody Wed May 14 13:27:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1522853079580687.7199360635238; Wed, 4 Apr 2018 07:44:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE3B94AEBE; Wed, 4 Apr 2018 14:44:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1D8282202; Wed, 4 Apr 2018 14:44:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A23F4180BAEE; Wed, 4 Apr 2018 14:44:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w34Eg6QQ020280 for ; Wed, 4 Apr 2018 10:42:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id AB7DE215CDCC; Wed, 4 Apr 2018 14:42:06 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B3322166BAE for ; Wed, 4 Apr 2018 14:42:06 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id C3D0D1044F6; Wed, 4 Apr 2018 16:42:01 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 4 Apr 2018 16:41:22 +0200 Message-Id: <617bab432daaf6e111a048beb2fd163e4a0e4ec1.1522852107.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 33/68] qemu: Introduce qemuMigrationParty enum X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 04 Apr 2018 14:44:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Some migration parameters and capabilities are supposed to be set on both sides of migration while others should only be set on one side. For example, CPU throttling parameters make no sense on the destination and they can be used even if the destination is too old to support them. To make qemuMigrationParamsFromFlags more general and usable on both sides of migration, we need to tell it what side it's been called on. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 3 ++- src/qemu/qemu_migration_params.c | 9 ++++++--- src/qemu/qemu_migration_params.h | 8 +++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6e6fc130c5..d8a641f77d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12765,7 +12765,8 @@ qemuDomainMigratePerform3Params(virDomainPtr dom, if (nmigrate_disks < 0) goto cleanup; =20 - if (!(migParams =3D qemuMigrationParamsFromFlags(params, nparams, flag= s))) + if (!(migParams =3D qemuMigrationParamsFromFlags(params, nparams, flag= s, + QEMU_MIGRATION_SOURCE))) goto cleanup; =20 if (!(compression =3D qemuMigrationAnyCompressionParse(params, nparams= , flags))) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 862bab1af9..72e4e660b7 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -80,7 +80,8 @@ qemuMigrationParamsFree(qemuMigrationParamsPtr migParams) qemuMigrationParamsPtr qemuMigrationParamsFromFlags(virTypedParameterPtr params, int nparams, - unsigned long flags) + unsigned long flags, + qemuMigrationParty party) { qemuMigrationParamsPtr migParams; =20 @@ -102,8 +103,10 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr para= ms, migParams->params.VAR ## _set =3D true; \ } while (0) =20 - GET(AUTO_CONVERGE_INITIAL, cpuThrottleInitial); - GET(AUTO_CONVERGE_INCREMENT, cpuThrottleIncrement); + if (party =3D=3D QEMU_MIGRATION_SOURCE) { + GET(AUTO_CONVERGE_INITIAL, cpuThrottleInitial); + GET(AUTO_CONVERGE_INCREMENT, cpuThrottleIncrement); + } =20 #undef GET =20 diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index 292b30b8e7..062e6f37a9 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -50,6 +50,11 @@ struct _qemuMigrationCompression { typedef struct _qemuMigrationParams qemuMigrationParams; typedef qemuMigrationParams *qemuMigrationParamsPtr; =20 +typedef enum { + QEMU_MIGRATION_SOURCE =3D (1 << 0), + QEMU_MIGRATION_DESTINATION =3D (1 << 1), +} qemuMigrationParty; + =20 qemuMigrationParamsPtr qemuMigrationParamsNew(void); @@ -57,7 +62,8 @@ qemuMigrationParamsNew(void); qemuMigrationParamsPtr qemuMigrationParamsFromFlags(virTypedParameterPtr params, int nparams, - unsigned long flags); + unsigned long flags, + qemuMigrationParty party); =20 void qemuMigrationParamsFree(qemuMigrationParamsPtr migParams); --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list