[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 23/28] migration: add error handling to migrate_fd_p
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 23/28] migration: add error handling to migrate_fd_put_notify(). |
Date: |
Wed, 23 Feb 2011 22:47:32 +0100 |
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 | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/migration.c b/migration.c
index 697c74f..a02100b 100644
--- a/migration.c
+++ b/migration.c
@@ -241,6 +241,9 @@ static 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);
+ }
}
static ssize_t migrate_fd_put_buffer(void *opaque, const void *data,
@@ -258,12 +261,6 @@ static ssize_t migrate_fd_put_buffer(void *opaque, const
void *data,
if (ret == -EAGAIN) {
qemu_set_fd_handler2(s->fd, NULL, NULL, migrate_fd_put_notify, s);
- } else if (ret < 0) {
- if (s->mon) {
- monitor_resume(s->mon);
- }
- s->state = MIG_STATE_ERROR;
- notifier_list_notify(&migration_state_notifiers);
}
return ret;
--
1.7.4
- Re: [Qemu-devel] [PATCH 18/28] migration: convert current_migration from pointer to struct, (continued)
- [Qemu-devel] [PATCH 05/28] migration: Refactor MigrationState creation, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 23/28] migration: add error handling to migrate_fd_put_notify().,
Juan Quintela <=
- [Qemu-devel] [PATCH 22/28] savevm: avoid qemu_savevm_state_iteate() to return 1 when qemu file has error., Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 24/28] migration: Don't use callback on file defining it, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 25/28] migration: propagate error correctly, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 26/28] migration: qemu_savevm_iterate has three return values, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 27/28] migration: If there is one error, it makes no sense to continue, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 28/28] migration: make migration-{tcp, unix} consistent, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 11/28] migration: Introduce migrate_fd_completed() for consistenncy, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 15/28] migration: Move exported functions to the end of the file, Juan Quintela, 2011/02/23