于 2011-9-20 21:24, Juan Quintela 写道:
> We were retrying when there was one error, entering a loop.
> 
> Signed-off-by: Juan Quintela<quint...@redhat.com>
> ---
>   migration.c |    6 +++++-
>   1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/migration.c b/migration.c
> index 7f8928a..0baed23 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -362,6 +362,7 @@ void migrate_fd_connect(FdMigrationState *s)
>   void migrate_fd_put_ready(void *opaque)
>   {
>       FdMigrationState *s = opaque;
> +    int ret;
> 
>       if (s->state != MIG_STATE_ACTIVE) {
>           DPRINTF("put_ready returning because of non-active state\n");
> @@ -369,7 +370,10 @@ void migrate_fd_put_ready(void *opaque)
>       }
> 
>       DPRINTF("iterate\n");
> -    if (qemu_savevm_state_iterate(s->mon, s->file) == 1) {
> +    ret = qemu_savevm_state_iterate(s->mon, s->file);
> +    if (ret == -1) {
> +        migrate_fd_error(s);
> +    } else if (ret == 1) {
>           int old_vm_running = vm_running;
> 
>           DPRINTF("done iterating\n");
Maybe macro could be used in the situation that more than 2 possible
types of value may return.


-- 
Best Regards

Wayne Xia
mail:xiaw...@linux.vnet.ibm.com
tel:86-010-82450803


Reply via email to