aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2010-05-11 23:01:53 +0200
committerJuan Quintela <quintela@redhat.com>2011-10-20 13:23:53 +0200
commitd5934dde1cc47306800558a8c8619dc6a976c11c (patch)
tree4f359fdb50354e1ba2c0dd103339c7fd5ef2e024 /migration.c
parent07af4452919fddc6dca6462828b457aad62f6387 (diff)
downloadqemu-d5934dde1cc47306800558a8c8619dc6a976c11c.zip
qemu-d5934dde1cc47306800558a8c8619dc6a976c11c.tar.gz
qemu-d5934dde1cc47306800558a8c8619dc6a976c11c.tar.bz2
migration: Introduce MIG_STATE_SETUP
Use MIG_STATE_ACTIVE only when migration has really started. Use this new state to setup migration parameters. Change defines for an anonymous struct. Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/migration.c b/migration.c
index ca038ec..281fbae 100644
--- a/migration.c
+++ b/migration.c
@@ -239,6 +239,9 @@ void do_info_migrate(Monitor *mon, QObject **ret_data)
MigrationState *s = current_migration;
switch (s->get_status(current_migration)) {
+ case MIG_STATE_SETUP:
+ /* no migration has happened ever */
+ break;
case MIG_STATE_ACTIVE:
qdict = qdict_new();
qdict_put(qdict, "status", qstring_from_str("active"));
@@ -478,6 +481,7 @@ void migrate_fd_connect(MigrationState *s)
{
int ret;
+ s->state = MIG_STATE_ACTIVE;
s->file = qemu_fopen_ops_buffered(s,
s->bandwidth_limit,
migrate_fd_put_buffer,
@@ -507,7 +511,7 @@ static MigrationState *migrate_new(Monitor *mon, int64_t bandwidth_limit,
s->shared = inc;
s->mon = NULL;
s->bandwidth_limit = bandwidth_limit;
- s->state = MIG_STATE_ACTIVE;
+ s->state = MIG_STATE_SETUP;
if (!detach) {
migrate_fd_monitor_suspend(s, mon);