Message ID | c85dcdeabcd873d3cec69321b34d8ed189550958.1316524908.git.quintela@redhat.com |
---|---|
State | New |
Headers | show |
δΊ 2011-9-20 21:24, Juan Quintela ει: > We were retrying when there was one error, entering a loop. > > Signed-off-by: Juan Quintela<quintela@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.
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");
We were retrying when there was one error, entering a loop. Signed-off-by: Juan Quintela <quintela@redhat.com> --- migration.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)