Commit 9499743f authored by Juan Quintela's avatar Juan Quintela
Browse files

migration: make migrate_fd_wait_for_unfreeze() return errors



Adjust all callers
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent d2dbc8e6
......@@ -150,8 +150,12 @@ static int buffered_close(void *opaque)
if (ret < 0) {
break;
}
if (s->freeze_output)
migrate_fd_wait_for_unfreeze(s->migration_state);
if (s->freeze_output) {
ret = migrate_fd_wait_for_unfreeze(s->migration_state);
if (ret < 0) {
break;
}
}
}
ret2 = migrate_fd_close(s->migration_state);
......
......@@ -370,13 +370,13 @@ static void migrate_fd_cancel(MigrationState *s)
migrate_fd_cleanup(s);
}
void migrate_fd_wait_for_unfreeze(MigrationState *s)
int migrate_fd_wait_for_unfreeze(MigrationState *s)
{
int ret;
DPRINTF("wait for unfreeze\n");
if (s->state != MIG_STATE_ACTIVE)
return;
return -EINVAL;
do {
fd_set wfds;
......@@ -388,8 +388,9 @@ void migrate_fd_wait_for_unfreeze(MigrationState *s)
} while (ret == -1 && (s->get_error(s)) == EINTR);
if (ret == -1) {
qemu_file_set_error(s->file, -s->get_error(s));
return -s->get_error(s);
}
return 0;
}
int migrate_fd_close(MigrationState *s)
......
......@@ -81,7 +81,7 @@ void migrate_fd_connect(MigrationState *s);
ssize_t migrate_fd_put_buffer(MigrationState *s, const void *data,
size_t size);
void migrate_fd_put_ready(MigrationState *s);
void migrate_fd_wait_for_unfreeze(MigrationState *s);
int migrate_fd_wait_for_unfreeze(MigrationState *s);
int migrate_fd_close(MigrationState *s);
void add_migration_state_change_notifier(Notifier *notify);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment