提交 2350e13c 编写于 作者: Y Yoshiaki Tamura 提交者: Juan Quintela

migration: add error handling to migrate_fd_put_notify().

Although migrate_fd_put_buffer() sets MIG_STATE_ERROR if it failed,
since migrate_fd_put_notify() isn't checking error of underlying
QEMUFile, those resources are kept open.  This patch checks it and
calls migrate_fd_error() in case of error.
Signed-off-by: NYoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Signed-off-by: NJuan Quintela <quintela@redhat.com>
Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 e6494061
......@@ -313,6 +313,9 @@ void migrate_fd_put_notify(void *opaque)
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
qemu_file_put_notify(s->file);
if (qemu_file_has_error(s->file)) {
migrate_fd_error(s);
}
}
ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size)
......@@ -329,9 +332,6 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size)
if (ret == -EAGAIN) {
qemu_set_fd_handler2(s->fd, NULL, NULL, migrate_fd_put_notify, s);
} else if (ret < 0) {
s->state = MIG_STATE_ERROR;
notifier_list_notify(&migration_state_notifiers, NULL);
}
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册