diff options
author | Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> | 2011-02-23 00:01:24 +0900 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2011-10-20 13:23:51 +0200 |
commit | 2350e13c93c28f717e2ba1b31560b49ac6f81d4d (patch) | |
tree | 4b2862a3fdf4467d126e05e5056215677c129659 /migration.c | |
parent | e6494061690df2af7368752f35f5c22b5856e83c (diff) | |
download | qemu-2350e13c93c28f717e2ba1b31560b49ac6f81d4d.zip qemu-2350e13c93c28f717e2ba1b31560b49ac6f81d4d.tar.gz qemu-2350e13c93c28f717e2ba1b31560b49ac6f81d4d.tar.bz2 |
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: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/migration.c b/migration.c index 71b8aad..f41a40b 100644 --- a/migration.c +++ b/migration.c @@ -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; |