From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
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
Subject: [Qemu-devel] [PATCH v2 4/6] Migration: Emit event at start of pass
Date: Wed, 16 Dec 2015 11:47:36 +0000 [thread overview]
Message-ID: <1450266458-3178-5-git-send-email-dgilbert@redhat.com> (raw)
In-Reply-To: <1450266458-3178-1-git-send-email-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
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 <dgilbert@redhat.com>
---
docs/qmp-events.txt | 14 ++++++++++++++
migration/ram.c | 4 ++++
qapi/event.json | 13 +++++++++++++
3 files changed, 31 insertions(+)
diff --git a/docs/qmp-events.txt b/docs/qmp-events.txt
index d2f1ce4..52eb7e2 100644
--- a/docs/qmp-events.txt
+++ b/docs/qmp-events.txt
@@ -496,6 +496,20 @@ Example:
{"timestamp": {"seconds": 1432121972, "microseconds": 744001},
"event": "MIGRATION", "data": {"status": "completed"}}
+MIGRATION_PASS
+--------------
+
+Emitted from the source side of a migration at the start of each pass
+(when it syncs the dirty bitmap)
+
+Data: None.
+
+ - "pass": An incrementing count (starting at 1 on the first pass)
+
+Example:
+{"timestamp": {"seconds": 1449669631, "microseconds": 239225},
+ "event": "MIGRATION_PASS", "data": {"pass": 2}}
+
STOP
----
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 <stdint.h>
#include <zlib.h>
+#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..390fd45 100644
--- a/qapi/event.json
+++ b/qapi/event.json
@@ -255,6 +255,19 @@
'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)
+#
+# @pass: An incrementing count (starting at 1 on the first pass)
+#
+# Since: 2.6
+##
+{ 'event': 'MIGRATION_PASS',
+ 'data': { 'pass': 'int' } }
+
+##
# @ACPI_DEVICE_OST
#
# Emitted when guest executes ACPI _OST method.
--
2.5.0
next prev parent reply other threads:[~2015-12-16 11:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 11:47 [Qemu-devel] [PATCH v2 0/6] Migration: Small fixes and improvements Dr. David Alan Gilbert (git)
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 1/6] migration: Export migrate_set_state() Dr. David Alan Gilbert (git)
2015-12-16 12:40 ` Juan Quintela
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 2/6] migration: Add state records for migration incoming Dr. David Alan Gilbert (git)
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 3/6] Postcopy: Send events/change state on incoming side Dr. David Alan Gilbert (git)
2015-12-16 11:47 ` Dr. David Alan Gilbert (git) [this message]
2015-12-16 12:41 ` [Qemu-devel] [PATCH v2 4/6] Migration: Emit event at start of pass Juan Quintela
2015-12-16 16:47 ` Eric Blake
2015-12-16 16:52 ` Dr. David Alan Gilbert
2016-01-13 10:27 ` Amit Shah
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 5/6] Use qemu_get_buffer_in_place for xbzrle data Dr. David Alan Gilbert (git)
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 6/6] multithread decompression: Avoid one copy Dr. David Alan Gilbert (git)
2016-01-13 10:29 ` [Qemu-devel] [PATCH v2 0/6] Migration: Small fixes and improvements Amit Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450266458-3178-5-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=jdenemar@redhat.com \
--cc=liang.z.li@intel.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).