From nobody Tue Feb 10 05:17:32 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 1507749359924598.4912428647899; Wed, 11 Oct 2017 12:15:59 -0700 (PDT) Received: from localhost ([::1]:42322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2MTu-0006QH-Ap for importer@patchew.org; Wed, 11 Oct 2017 15:15:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2MRy-0005Fq-GB for qemu-devel@nongnu.org; Wed, 11 Oct 2017 15:13:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2MRt-0004ox-IK for qemu-devel@nongnu.org; Wed, 11 Oct 2017 15:13:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36798) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2MRt-0004oX-Bq for qemu-devel@nongnu.org; Wed, 11 Oct 2017 15:13:45 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 677485F7A6; Wed, 11 Oct 2017 19:13:44 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-166.ams2.redhat.com [10.36.117.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBCBE6C407; Wed, 11 Oct 2017 19:13:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 677485F7A6 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dgilbert@redhat.com From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kwolf@redhat.com, jdenemar@redhat.com, wangjie88@huawei.com, quintela@redhat.com, peterx@redhat.com, mreitz@redhat.com Date: Wed, 11 Oct 2017 20:13:11 +0100 Message-Id: <20171011191317.24157-2-dgilbert@redhat.com> In-Reply-To: <20171011191317.24157-1-dgilbert@redhat.com> References: <20171011191317.24157-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 11 Oct 2017 19:13:44 +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 1/7] migration: Add 'pause-before-device' capability 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: fuweiwei2@huawei.com 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" From: "Dr. David Alan Gilbert" When 'pause-before-device' is enabled, the outgoing migration will pause after completing any outstanding IOs but before serialising the device state. At this point the management layer gets the chance to clean up any device jobs or other device users before the migration completes. Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 9 +++++++++ migration/migration.h | 1 + qapi/migration.json | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 98429dc843..df8f8c9f14 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1521,6 +1521,15 @@ bool migrate_use_multifd(void) return s->enabled_capabilities[MIGRATION_CAPABILITY_X_MULTIFD]; } =20 +bool migrate_pause_before_device(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_DEVIC= E]; +} + int migrate_multifd_channels(void) { MigrationState *s; diff --git a/migration/migration.h b/migration/migration.h index b83cceadc4..37feea5453 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -177,6 +177,7 @@ bool migrate_zero_blocks(void); =20 bool migrate_auto_converge(void); bool migrate_use_multifd(void); +bool migrate_pause_before_device(void); int migrate_multifd_channels(void); int migrate_multifd_page_count(void); =20 diff --git a/qapi/migration.json b/qapi/migration.json index f8b365e3f5..420b56f194 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -341,6 +341,9 @@ # @return-path: If enabled, migration will use the return path even # for precopy. (since 2.10) # +# @pause-before-device: Pause outgoing migration before serialising device +# state but after finalising any IO. (since 2.11) +# # @x-multifd: Use more than one fd for migration (since 2.11) # # Since: 1.2 @@ -348,7 +351,7 @@ { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram', - 'block', 'return-path', 'x-multifd' ] } + 'block', 'return-path', 'pause-before-device', 'x-multifd' ] } =20 ## # @MigrationCapabilityStatus: --=20 2.13.6