[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] migration: add error handling to migrate_fd_put
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 5/7] migration: add error handling to migrate_fd_put_notify(). |
Date: |
Tue, 20 Sep 2011 15:24:44 +0200 |
From: Yoshiaki Tamura <address@hidden>
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 <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/migration.c b/migration.c
index c56d29c..7f8928a 100644
--- a/migration.c
+++ b/migration.c
@@ -312,6 +312,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)
@@ -328,9 +331,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;
--
1.7.6.2
- [Qemu-devel] [PATCH 0/7] Handle errors during migration, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 3/7] migration: Check that migration is active before cancel it, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 2/7] migration: only flush when there are no errors, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 1/7] migration: simplify state assignmente, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 7/7] migration: qemu_savevm_iterate has three return values, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 6/7] migration: If there is one error, it makes no sense to continue, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 5/7] migration: add error handling to migrate_fd_put_notify().,
Juan Quintela <=
- [Qemu-devel] [PATCH 4/7] savevm: avoid qemu_savevm_state_iterate() to return 1 when qemu file has error., Juan Quintela, 2011/09/20