From nobody Wed May 14 13:44:11 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523457794317628.2756623091075; Wed, 11 Apr 2018 07:43:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7F2A85A04; Wed, 11 Apr 2018 14:43:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73AE68779A; Wed, 11 Apr 2018 14:43:12 +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 143AF4ED20; Wed, 11 Apr 2018 14:43:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3BEgFv1008748 for ; Wed, 11 Apr 2018 10:42:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2CFCB10B0F3A; Wed, 11 Apr 2018 14:42:15 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D6F410B0F3B for ; Wed, 11 Apr 2018 14:42:15 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 80577100AE6; Wed, 11 Apr 2018 16:42:10 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 11 Apr 2018 16:41:24 +0200 Message-Id: <48a2a365a21f0b391d71b346cbbc97e5a5007c64.1523456480.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.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 34/73] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 11 Apr 2018 14:43:13 +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 Reviewed-by: J=EF=BF=BDn Tomko --- 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 a7b5ce385e..b55abc2e36 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 7ca667a507..d66fdb7cde 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