Patchwork [v3,4/5] QMP: Emit migration events on incoming migration

login
register
mail settings
Submitter Juan Quintela
Date June 9, 2010, 12:10 p.m.
Message ID <3fdd2d6b2fbe31b2a69e77d9dcb722f42d1e318b.1276085283.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/55085/
State New
Headers show

Comments

Juan Quintela - June 9, 2010, 12:10 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/migration.c b/migration.c
index 4ce19ff..2a44b46 100644
--- a/migration.c
+++ b/migration.c
@@ -60,10 +60,13 @@  int qemu_start_incoming_migration(const char *uri)

 void process_incoming_migration(QEMUFile *f)
 {
+    monitor_protocol_event(QEVENT_MIGRATION_STARTED, NULL);
     if (qemu_loadvm_state(f) < 0) {
+        monitor_protocol_event(QEVENT_MIGRATION_FAILED, NULL);
         fprintf(stderr, "load of migration failed\n");
         exit(0);
     }
+    monitor_protocol_event(QEVENT_MIGRATION_ENDED, NULL);
     qemu_announce_self();
     DPRINTF("successfully loaded vm state\n");