From nobody Wed May 14 13:07:28 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 152285335773077.20304088692114; Wed, 4 Apr 2018 07:49:17 -0700 (PDT) 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 BF94712E379; Wed, 4 Apr 2018 14:49:15 +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 6E99F7F356; Wed, 4 Apr 2018 14:49:15 +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 0E6D3183287B; Wed, 4 Apr 2018 14:49:15 +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 w34Eg8jA020442 for ; Wed, 4 Apr 2018 10:42:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7ACD9215CDCD; Wed, 4 Apr 2018 14:42:08 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A58C2166BAE for ; Wed, 4 Apr 2018 14:42:08 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 55255104656; Wed, 4 Apr 2018 16:42:02 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 4 Apr 2018 16:41:54 +0200 Message-Id: <77a2ec41cf25cc709eb26b4896f733677aa38b4f.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 65/68] qemu: Drop priv->job.postcopyEnabled bool 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.16 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:49:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We store the flags passed to the API which started the migration. Let's use them instead of a separate bool to check if post-copy migration was requested. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 1 - src/qemu/qemu_domain.h | 1 - src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_migration.c | 4 ---- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d82c9aad23..2a15eb273b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -332,7 +332,6 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv) job->abortJob =3D false; job->spiceMigration =3D false; job->spiceMigrated =3D false; - job->postcopyEnabled =3D false; job->dumpCompleted =3D false; VIR_FREE(job->error); VIR_FREE(job->current); diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 8d608da121..91385da2a9 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -176,7 +176,6 @@ struct _qemuDomainJobObj { bool spiceMigration; /* we asked for spice migration an= d we * should wait for it to finish */ bool spiceMigrated; /* spice migration completed */ - bool postcopyEnabled; /* post-copy migration was enabled= */ char *error; /* job event completion error */ bool dumpCompleted; /* dump completed */ =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 04eb0b6929..b871dab581 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13840,7 +13840,7 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom, goto endjob; } =20 - if (!priv->job.postcopyEnabled) { + if (!(priv->job.apiFlags & VIR_MIGRATE_POSTCOPY)) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("switching to post-copy requires migration to be " "started with VIR_MIGRATE_POSTCOPY flag")); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 3ce180dd39..808a6c147e 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2403,8 +2403,6 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, migParams) < 0) goto stopjob; =20 - priv->job.postcopyEnabled =3D flags & VIR_MIGRATE_POSTCOPY; - if (mig->nbd && flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC)= && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) { @@ -3340,8 +3338,6 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, migParams) < 0) goto error; =20 - priv->job.postcopyEnabled =3D flags & VIR_MIGRATE_POSTCOPY; - if (migrate_flags & (QEMU_MONITOR_MIGRATE_NON_SHARED_DISK | QEMU_MONITOR_MIGRATE_NON_SHARED_INC)) { if (mig->nbd) { --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list