aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-09-04 12:45:42 +0200
committerJuan Quintela <quintela@redhat.com>2012-10-17 18:35:00 +0200
commita2b413512443e67cd58285b8d98b84792a66c710 (patch)
tree1e15091a6d7056d4f4d6db3db195b19576e72ef1
parent6f121ff575e1601d652f3eecf4f9ab1205c12df1 (diff)
savevm: make qemu_file_put_notify() return errors
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--migration.c5
-rw-r--r--qemu-file.h2
-rw-r--r--savevm.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/migration.c b/migration.c
index 2c93951423..62e030487d 100644
--- a/migration.c
+++ b/migration.c
@@ -287,10 +287,11 @@ static void migrate_fd_completed(MigrationState *s)
static void migrate_fd_put_notify(void *opaque)
{
MigrationState *s = opaque;
+ int ret;
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
- qemu_file_put_notify(s->file);
- if (s->file && qemu_file_get_error(s->file)) {
+ ret = qemu_file_put_notify(s->file);
+ if (ret) {
migrate_fd_error(s);
}
}
diff --git a/qemu-file.h b/qemu-file.h
index 8dd920790c..9c8985b610 100644
--- a/qemu-file.h
+++ b/qemu-file.h
@@ -107,7 +107,7 @@ int qemu_file_get_error(QEMUFile *f);
/* Try to send any outstanding data. This function is useful when output is
* halted due to rate limiting or EAGAIN errors occur as it can be used to
* resume output. */
-void qemu_file_put_notify(QEMUFile *f);
+int qemu_file_put_notify(QEMUFile *f);
static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv)
{
diff --git a/savevm.c b/savevm.c
index dee689998b..b080d37258 100644
--- a/savevm.c
+++ b/savevm.c
@@ -523,9 +523,9 @@ int qemu_fclose(QEMUFile *f)
return ret;
}
-void qemu_file_put_notify(QEMUFile *f)
+int qemu_file_put_notify(QEMUFile *f)
{
- f->put_buffer(f->opaque, NULL, 0, 0);
+ return f->put_buffer(f->opaque, NULL, 0, 0);
}
void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)