[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/22] migration: Introduce MIG_STATE_NONE
From: |
Yoshiaki Tamura |
Subject: |
Re: [Qemu-devel] [PATCH 09/22] migration: Introduce MIG_STATE_NONE |
Date: |
Wed, 23 Feb 2011 18:36:43 +0900 |
2011/2/23 Juan Quintela <address@hidden>:
> Use MIG_STATE_ACTIVE only when migration has really started
>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> migration.c | 6 +++++-
> migration.h | 3 ++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/migration.c b/migration.c
> index 55f58c8..f015e02 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -238,6 +238,9 @@ void do_info_migrate(Monitor *mon, QObject **ret_data)
> MigrationState *s = current_migration;
>
> switch (s->get_status(current_migration)) {
> + case MIG_STATE_NONE:
> + /* no migration has happened ever */
> + break;
> case MIG_STATE_ACTIVE:
> qdict = qdict_new();
> qdict_put(qdict, "status", qstring_from_str("active"));
> @@ -465,6 +468,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,
> @@ -495,7 +499,7 @@ static MigrationState *migrate_create_state(Monitor *mon,
> int64_t bandwidth_limi
> s->shared = inc;
> s->mon = NULL;
> s->bandwidth_limit = bandwidth_limit;
> - s->state = MIG_STATE_ACTIVE;
> + s->state = MIG_STATE_NONE;
>
> if (!detach) {
> migrate_fd_monitor_suspend(s, mon);
> diff --git a/migration.h b/migration.h
> index 7d28dd3..3df2293 100644
> --- a/migration.h
> +++ b/migration.h
> @@ -19,9 +19,10 @@
> #include "notify.h"
>
> #define MIG_STATE_ERROR -1
> -#define MIG_STATE_COMPLETED 0
> +#define MIG_STATE_NONE 0
> #define MIG_STATE_CANCELLED 1
> #define MIG_STATE_ACTIVE 2
> +#define MIG_STATE_COMPLETED 3
It may be a good chance to make them enum?
Yoshi
>
> typedef struct MigrationState MigrationState;
>
> --
> 1.7.4
>
>
>
- Re: [Qemu-devel] [PATCH 03/22] migration: Fold MigrationState into FdMigrationState, (continued)
- [Qemu-devel] [PATCH 04/22] migration: Rename FdMigrationState MigrationState, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 05/22] migration: Refactor MigrationState creation, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 06/22] migration: Make all posible migration functions static, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 08/22] migration: Check that migration is active before cancel it, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 09/22] migration: Introduce MIG_STATE_NONE, Juan Quintela, 2011/02/22
- Re: [Qemu-devel] [PATCH 09/22] migration: Introduce MIG_STATE_NONE,
Yoshiaki Tamura <=
- [Qemu-devel] [PATCH 07/22] migration: move migrate_create_state to do_migrate, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 10/22] migration: Refactor and simplify error checking in migrate_fd_put_ready, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 11/22] migration: Introduce migrate_fd_completed() for consistenncy, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 12/22] migration: Use migrate_fd_error() in last place that set status to ERROR, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 13/22] migration: Our release callback was just free, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 15/22] migration: Remove migration cancel() callback, Juan Quintela, 2011/02/22