From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005O3-Tl for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afd-000726-SU for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:56136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afd-000716-Nc for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:49 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00BRGDKX2U00@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:47 +0100 (BST) From: Alexey Perevalov Date: Fri, 12 May 2017 16:31:22 +0300 Message-id: <1494595886-30912-6-git-send-email-a.perevalov@samsung.com> In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> Subject: [Qemu-devel] [PATCH V5 5/9] migration: introduce postcopy-blocktime capability List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dgilbert@redhat.com, a.perevalov@samsung.com, i.maximets@samsung.com, peterx@redhat.com Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 1 + migration/migration.c | 9 +++++++++ qapi-schema.json | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index ba1a16c..82bbcd8 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -315,6 +315,7 @@ int migrate_compress_level(void); int migrate_compress_threads(void); int migrate_decompress_threads(void); bool migrate_use_events(void); +bool migrate_postcopy_blocktime(void); /* Sending on the return path - generic and then for each message type */ void migrate_send_rp_message(MigrationIncomingState *mis, diff --git a/migration/migration.c b/migration/migration.c index 569a7f6..c0443ce 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1371,6 +1371,15 @@ bool migrate_zero_blocks(void) return s->enabled_capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; } +bool migrate_postcopy_blocktime(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME]; +} + bool migrate_use_compression(void) { MigrationState *s; diff --git a/qapi-schema.json b/qapi-schema.json index 01b087f..fde6d63 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -894,11 +894,14 @@ # @release-ram: if enabled, qemu will free the migrated ram pages on the source # during postcopy-ram migration. (since 2.9) # +# @postcopy-blocktime: Calculate downtime for postcopy live migration (since 2.10) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', - 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] } + 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram', + 'postcopy-blocktime'] } ## # @MigrationCapabilityStatus: -- 1.9.1