Skip to content

Commit

Permalink
savevm: make qemu_file_put_notify() return errors
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Juan Quintela committed Oct 17, 2012
1 parent 6f121ff commit a2b4135
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions migration.c
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion qemu-file.h
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions savevm.c
Expand Up @@ -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)
Expand Down

0 comments on commit a2b4135

Please sign in to comment.