Commit a2b41351 authored by Juan Quintela's avatar Juan Quintela
Browse files

savevm: make qemu_file_put_notify() return errors


Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 6f121ff5
...@@ -287,10 +287,11 @@ static void migrate_fd_completed(MigrationState *s) ...@@ -287,10 +287,11 @@ static void migrate_fd_completed(MigrationState *s)
static void migrate_fd_put_notify(void *opaque) static void migrate_fd_put_notify(void *opaque)
{ {
MigrationState *s = opaque; MigrationState *s = opaque;
int ret;
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL); qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
qemu_file_put_notify(s->file); ret = qemu_file_put_notify(s->file);
if (s->file && qemu_file_get_error(s->file)) { if (ret) {
migrate_fd_error(s); migrate_fd_error(s);
} }
} }
......
...@@ -107,7 +107,7 @@ int qemu_file_get_error(QEMUFile *f); ...@@ -107,7 +107,7 @@ int qemu_file_get_error(QEMUFile *f);
/* Try to send any outstanding data. This function is useful when output is /* 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 * halted due to rate limiting or EAGAIN errors occur as it can be used to
* resume output. */ * 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) static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv)
{ {
......
...@@ -523,9 +523,9 @@ int qemu_fclose(QEMUFile *f) ...@@ -523,9 +523,9 @@ int qemu_fclose(QEMUFile *f)
return ret; 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) void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment