[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 5/5] QMP: Emit migration events on outgoing migra
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH v3 5/5] QMP: Emit migration events on outgoing migration |
Date: |
Wed, 9 Jun 2010 14:10:58 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
---
migration-exec.c | 3 ++-
migration-fd.c | 1 +
migration-tcp.c | 2 ++
migration-unix.c | 2 ++
migration.c | 5 +++++
5 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/migration-exec.c b/migration-exec.c
index 14718dd..9052cd2 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -22,6 +22,7 @@
#include "block.h"
#include <sys/types.h>
#include <sys/wait.h>
+#include "monitor.h"
//#define DEBUG_MIGRATION_EXEC
@@ -101,9 +102,9 @@ MigrationState *exec_start_outgoing_migration(Monitor *mon,
s->mig_state.shared = inc;
s->state = MIG_STATE_ACTIVE;
+ monitor_protocol_event(QEVENT_MIGRATION_STARTED, NULL);
s->mon = NULL;
s->bandwidth_limit = bandwidth_limit;
-
if (!detach) {
migrate_fd_monitor_suspend(s, mon);
}
diff --git a/migration-fd.c b/migration-fd.c
index 6d14505..9c4c7ae 100644
--- a/migration-fd.c
+++ b/migration-fd.c
@@ -83,6 +83,7 @@ MigrationState *fd_start_outgoing_migration(Monitor *mon,
s->mig_state.blk = blk;
s->mig_state.shared = inc;
+ monitor_protocol_event(QEVENT_MIGRATION_STARTED, NULL);
s->state = MIG_STATE_ACTIVE;
s->mon = NULL;
s->bandwidth_limit = bandwidth_limit;
diff --git a/migration-tcp.c b/migration-tcp.c
index 20f2e37..11a1203 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -18,6 +18,7 @@
#include "sysemu.h"
#include "buffered_file.h"
#include "block.h"
+#include "monitor.h"
//#define DEBUG_MIGRATION_TCP
@@ -102,6 +103,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon,
s->mig_state.blk = blk;
s->mig_state.shared = inc;
+ monitor_protocol_event(QEVENT_MIGRATION_STARTED, NULL);
s->state = MIG_STATE_ACTIVE;
s->mon = NULL;
s->bandwidth_limit = bandwidth_limit;
diff --git a/migration-unix.c b/migration-unix.c
index 57232c0..08f29a3 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -18,6 +18,7 @@
#include "sysemu.h"
#include "buffered_file.h"
#include "block.h"
+#include "monitor.h"
//#define DEBUG_MIGRATION_UNIX
@@ -101,6 +102,7 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
s->mig_state.blk = blk;
s->mig_state.shared = inc;
+ monitor_protocol_event(QEVENT_MIGRATION_STARTED, NULL);
s->state = MIG_STATE_ACTIVE;
s->mon = NULL;
s->bandwidth_limit = bandwidth_limit;
diff --git a/migration.c b/migration.c
index 2a44b46..256a679 100644
--- a/migration.c
+++ b/migration.c
@@ -268,6 +268,7 @@ void migrate_fd_monitor_suspend(FdMigrationState *s,
Monitor *mon)
void migrate_fd_error(FdMigrationState *s)
{
DPRINTF("setting error state\n");
+ monitor_protocol_event(QEVENT_MIGRATION_FAILED, NULL);
s->state = MIG_STATE_ERROR;
migrate_fd_cleanup(s);
}
@@ -371,8 +372,10 @@ void migrate_fd_put_ready(void *opaque)
if (old_vm_running) {
vm_start();
}
+ monitor_protocol_event(QEVENT_MIGRATION_FAILED, NULL);
state = MIG_STATE_ERROR;
} else {
+ monitor_protocol_event(QEVENT_MIGRATION_ENDED, NULL);
state = MIG_STATE_COMPLETED;
}
if (migrate_fd_cleanup(s) < 0) {
@@ -400,6 +403,7 @@ void migrate_fd_cancel(MigrationState *mig_state)
DPRINTF("cancelling migration\n");
+ monitor_protocol_event(QEVENT_MIGRATION_CANCELED, NULL);
s->state = MIG_STATE_CANCELLED;
qemu_savevm_state_cancel(s->mon, s->file);
@@ -413,6 +417,7 @@ void migrate_fd_release(MigrationState *mig_state)
DPRINTF("releasing state\n");
if (s->state == MIG_STATE_ACTIVE) {
+ monitor_protocol_event(QEVENT_MIGRATION_CANCELED, NULL);
s->state = MIG_STATE_CANCELLED;
migrate_fd_cleanup(s);
}
--
1.6.6.1
[Qemu-devel] [PATCH v3 2/5] Factorize common migration incoming code, Juan Quintela, 2010/06/09
[Qemu-devel] [PATCH v3 4/5] QMP: Emit migration events on incoming migration, Juan Quintela, 2010/06/09
[Qemu-devel] [PATCH v3 5/5] QMP: Emit migration events on outgoing migration,
Juan Quintela <=
Re: [Qemu-devel] [PATCH v3 0/5] Add QMP migration events, Yoshiaki Tamura, 2010/06/09
Re: [Qemu-devel] [PATCH v3 0/5] Add QMP migration events, Luiz Capitulino, 2010/06/09