From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8usM-00086S-6r for qemu-devel@nongnu.org; Tue, 15 Dec 2015 14:03:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8usG-0007gr-LI for qemu-devel@nongnu.org; Tue, 15 Dec 2015 14:03:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8usG-0007gm-G8 for qemu-devel@nongnu.org; Tue, 15 Dec 2015 14:03:00 -0500 From: "Dr. David Alan Gilbert (git)" Date: Tue, 15 Dec 2015 19:02:48 +0000 Message-Id: <1450206170-26901-5-git-send-email-dgilbert@redhat.com> In-Reply-To: <1450206170-26901-1-git-send-email-dgilbert@redhat.com> References: <1450206170-26901-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH 4/6] Migration: Emit event at start of pass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, quintela@redhat.com, amit.shah@redhat.com Cc: jdenemar@redhat.com, liang.z.li@intel.com, zhang.zhanghailiang@huawei.com From: "Dr. David Alan Gilbert" Emit an event each time we sync the dirty bitmap on the source; this helps libvirt use postcopy by giving it a kick when it might be a good idea to start the postcopy. Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 4 ++++ qapi/event.json | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/migration/ram.c b/migration/ram.c index 0490f00..102d1f2 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -27,6 +27,7 @@ */ #include #include +#include "qapi-event.h" #include "qemu/bitops.h" #include "qemu/bitmap.h" #include "qemu/timer.h" @@ -682,6 +683,9 @@ static void migration_bitmap_sync(void) num_dirty_pages_period = 0; } s->dirty_sync_count = bitmap_sync_count; + if (migrate_use_events()) { + qapi_event_send_migration_pass(bitmap_sync_count, NULL); + } } /** diff --git a/qapi/event.json b/qapi/event.json index f0cef01..2440dbc 100644 --- a/qapi/event.json +++ b/qapi/event.json @@ -255,6 +255,17 @@ 'data': {'status': 'MigrationStatus'}} ## +# @MIGRATION_PASS +# +# Emitted from the source side of a migration at the start of each pass +# (when it syncs the dirty bitmap) +# +# Since: 2.6 +## +{ 'event': 'MIGRATION_PASS', + 'data': { 'pass': 'int' } } + +## # @ACPI_DEVICE_OST # # Emitted when guest executes ACPI _OST method. -- 2.5.0