summaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2010-05-11 23:28:53 +0200
committerJuan Quintela <quintela@redhat.com>2011-10-20 13:23:54 +0200
commitb167e9c775018460a2cabf51eeffb976c86ab2d6 (patch)
treec2a2b0fac6f3919f1b8ff288f0cd94f14fbdd3db /migration.c
parent4686295a3ee88bb64d56fe6baf5abdc63843d291 (diff)
downloadqemu-b167e9c775018460a2cabf51eeffb976c86ab2d6.tar.gz
qemu-b167e9c775018460a2cabf51eeffb976c86ab2d6.tar.bz2
qemu-b167e9c775018460a2cabf51eeffb976c86ab2d6.zip
migration: Remove get_status() accessor
It is only used inside migration.c, and fields on that struct are accessed all around the place on that file. Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/migration.c b/migration.c
index 400ffb7897..8dbe8df109 100644
--- a/migration.c
+++ b/migration.c
@@ -91,7 +91,7 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
int ret;
if (current_migration &&
- current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
+ current_migration->state == MIG_STATE_ACTIVE) {
monitor_printf(mon, "migration already in progress\n");
return -1;
}
@@ -136,7 +136,7 @@ int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
MigrationState *s = current_migration;
- if (s && s->get_status(s) == MIG_STATE_ACTIVE) {
+ if (s && s->state == MIG_STATE_ACTIVE) {
s->cancel(s);
}
return 0;
@@ -235,7 +235,7 @@ void do_info_migrate(Monitor *mon, QObject **ret_data)
if (current_migration) {
MigrationState *s = current_migration;
- switch (s->get_status(current_migration)) {
+ switch (s->state) {
case MIG_STATE_SETUP:
/* no migration has happened ever */
break;
@@ -386,7 +386,7 @@ static void migrate_fd_put_ready(void *opaque)
} else {
migrate_fd_completed(s);
}
- if (s->get_status(s) != MIG_STATE_COMPLETED) {
+ if (s->state != MIG_STATE_COMPLETED) {
if (old_vm_running) {
vm_start();
}
@@ -394,11 +394,6 @@ static void migrate_fd_put_ready(void *opaque)
}
}
-static int migrate_fd_get_status(MigrationState *s)
-{
- return s->state;
-}
-
static void migrate_fd_cancel(MigrationState *s)
{
if (s->state != MIG_STATE_ACTIVE)
@@ -460,7 +455,7 @@ void remove_migration_state_change_notifier(Notifier *notify)
int get_migration_state(void)
{
if (current_migration) {
- return migrate_fd_get_status(current_migration);
+ return current_migration->state;
} else {
return MIG_STATE_ERROR;
}
@@ -494,7 +489,6 @@ static MigrationState *migrate_new(Monitor *mon, int64_t bandwidth_limit,
MigrationState *s = g_malloc0(sizeof(*s));
s->cancel = migrate_fd_cancel;
- s->get_status = migrate_fd_get_status;
s->blk = blk;
s->shared = inc;
s->mon = NULL;